Вы находитесь на странице: 1из 17

SyedJahanzaibPersonalBlogtoShare

Knowledge!

October31,2013

MonitoringMikrotikwithLinuxbaseMRTG[References]
Filedunder:LinuxRelated,MikrotikRelatedTags:mikrotikgraph,mikrotikmrtg,queue
graph,queuemonitoring,queuemrtgSyedJahanzaib/Pinochio~:)@2:23PM

i
19Votes

FollowingpostisabouthowtomonitorMikrotikSsytem/Routerboardtocreatelivegraphswith
historyforeveryaspect,likeCPU,Memory,Voltage,Amps,Interfaceetc.Itcomesveryuseful
whenyouremotelyadministratingthesystemandyouneedtoknowwhathappensoverthe
periodoftimeandhaveanoverviewoneveryinternalinstanceofthesystem.

IwroteanotherarticlethatexplainswellonhowtoinstallMRTGinUbuntuandmonitoranything

IwroteanotherarticlethatexplainswellonhowtoinstallMRTGinUbuntuandmonitoranything
withit,butWORDPRESScodingruinsthecodebadly,butstillyoucangetideafromitfrom
followingURL.
https://aacable.wordpress.com/tag/mrtginstallationonubuntu/
SobasicallyyouhavetofirstinstallMRTGonlinux,thenyoucanusethatmrtginstallationtomonitor
anydevicesinyournetwork(whichsupportssnmpthatincludesmikrotikaswell)

1MIKROTIKSECTION

#EnablingSNMPonMikrotik
FirstEnableSNMPservice(withpublicascommunitystringorwhateveryoulikeonyour
mikrotik.MakesurenofirewallruleisblockingSNMPtrafficfrom/tothemonitoringserver.
OpenTerminalinmikrotikandpastethefollowingcommand.Oryoucanconfigureitviagoing
toIP>SNMP
1
2
3
4
5
6

/snmpcommunity
set[finddefault=yes]addresses=0.0.0.0/0authenticationpassword=""authen
security=nonewriteaccess=no

/snmp
setcontact=SyedJahanzaibenabled=yesengineid=""location=aacablewordpress

Nowproceedfurther

1.MonitoringMikrotikSimpleQueuewithLinuxbase
MRTG(formonitoringperformanceandtrackpurposes)


TomonitorsimpleQUEUEviaLinuxbaseMRTG,youcanusefollowingconfigasanexample
FirstyouhavetocheckyoursimplequeueOID(numericvaluewhichisusedbyMRTGtopoll
specificdatafromtheremoteserver)inmikrotik.forexampleyouhaveaqueuetoallow100Mfor
proxycachedmarkedpackets.

OpenTerminalandprintOIDforSimpleQueuenumber0(yourcanbechanged,butingeneral
Queueforproxyhitpacketsshouldbeon**TOP**)
1
2
3
4
5
6
7

[admin@MikroTik]/queuesimpleprint

Flags:Xdisabled,Iinvalid,Ddynamic

0;;;SimpleQueueforsquidProxyCACHEHITPacketAllowUnlimitedBandwid
name=SQforcachehitinterface=allparent=nonepacketmarks=Cachedirection=b
burstthreshold=0/0bursttime=0s/0stotalqueue=defaultsmall

NowcheckitsOIDvaluewhichwillbeusedinMRTGtographthevalues.Doremember,Ifyou
move/delete/addparticularQueue,theoidvaluewillchange,simplynotedownnewvalueand
recreategraphswiththenewvalues.AlsooneverysystemtheseOIDsaredifferent,simplytakea
printoidtousethem.
1
2
3
4
5
6
7

[admin@MikroTik]/queuesimpleprintoid

Flags:Xdisabled,Iinvalid,Ddynamic

0;;;SimpleQueueforsquidProxyCACHEHITPacketAllowUnlimitedBandwid
name=.1.3.6.1.4.1.14988.1.1.2.1.1.2.12534bytesin=.1.3.6.1.4.1.14988.1.1.2.1.
packetsout=.1.3.6.1.4.1.14988.1.1.2.1.1.11.12534queuesin=.1.3.6.1.4.1.14988

Asshowedintheimagebelow...


Nowwehavetotakebytesinandbytesoutvalueforgraphingpurposes.whichisinourcase
are
.1.3.6.1.4.1.14988.1.1.2.1.1.8.12534
.1.3.6.1.4.1.14988.1.1.2.1.1.9.12534
NowyoucansimplyusethebelowCFGfiletocreateGraphsforthemikrotiksimplequeue.
1
2
3
4
5
6

Target[mikrotiksimplequeueinout]:.1.3.6.1.4.1.14988.1.1.2.1.1.8.12534&amp
MaxBytes[mikrotiksimplequeueinout]:100000000
#Options[mikrotiksimplequeueinout]:bits
Title[mikrotiksimplequeueinout]:MikrotikQUEUEforCacheHIT
PageTop[mikrotiksimplequeueinout]:<H1>MikrotikQUEUEforCacheHIT</H1>
#Maintainer:SyedJahanzaib

SAMPLEGRAPHFORTHESIMPLEQUEUE
MONITORINGVIAMRTG(ASSHOWED
ABOVE)

SampleGraphsforccr_1036
FollowingaresamplegraphsshowingvariousaspectsofMikrotikCCR1036.

SAMPLECFGFILES(WORKINGGOODWITH
MIKROTIKCCR_1036ROUTERBOARDMODEL.

MikrotikCCRGeneralOIDs
1
2
3
4
5
6
7
8

activefan:.1.3.6.1.4.1.14988.1.1.3.9.0
voltage:.1.3.6.1.4.1.14988.1.1.3.8.0
temperature:.1.3.6.1.4.1.14988.1.1.3.10.0
processortemperature:.1.3.6.1.4.1.14988.1.1.3.11.0
current:.1.3.6.1.4.1.14988.1.1.3.13.0
powerconsumption:.1.3.6.1.4.1.14988.1.1.3.12.0
psu1state:.1.3.6.1.4.1.14988.1.1.3.15.0
psu2state:.1.3.6.1.4.1.14988.1.1.3.16.0

18.0isiguessfan2rpmoid,notmentionedinprintoid.</pre>

9
10
11
12
13
14

18.0isiguessfan2rpmoid,notmentionedinprintoid.</pre>
<pre>uptime:.1.3.6.1.2.1.1.3.0
totalmemory:.1.3.6.1.2.1.25.2.3.1.5.65536
usedmemory:.1.3.6.1.2.1.25.2.3.1.6.65536
cpufrequency:.1.3.6.1.4.1.14988.1.1.3.14.0
buildtime:.1.3.6.1.4.1.14988.1.1.7.6.0

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44

#192.168.100.2isMikrotikRBIPAddress
#MRTGsamplecfgfilesforMikrotikCCRRouterboardmonitoring
#SyedJahanzaib
#LastModifiedat14thJAN2016

###MIKROTIKCCR_1036192.168.100.2CPUload###
Target[192.168.100.2_cpu]:1.3.6.1.2.1.25.3.3.1.2.1&1.3.6.1.2.1.25.3.3.1.2.1
AbsMax[192.168.100.2_cpu]:100
MaxBytes[192.168.100.2_cpu]:100
Title[192.168.100.2_cpu]:MIKROTIKCCR_1036CPUload
PageTop[192.168.100.2_cpu]:<H1>MIKROTIKCCR_1036CPUload</H1>
Options[192.168.100.2_cpu]:gauge,growright,nopercent,noo
YLegend[192.168.100.2_cpu]:CPUload
ShortLegend[192.168.100.2_cpu]:%
LegendI[192.168.100.2_cpu]:CPUload(percentage)

#MIKROTIKCCR_1036PPPoEACTIVEUsers
Target[mtPPPoEusers]:1.3.6.1.4.1.9.9.150.1.1.1.0&1.3.6.1.4.1.9.9.150.1.1.1.
Title[mtPPPoEusers]:ActivePPPoEUsersonMIKROTIKCCR_1036
PageTop[mtPPPoEusers]:<H1>ActivePPPoEUsersonMIKROTIKCCR_1036</H1>
MaxBytes[mtPPPoEusers]:1000
Colours[mtPPPoEusers]:B#8888ff,B#8888ff,B#5398ff,B#5398ff
Options[mtPPPoEusers]:gauge,nopercent,noo,integer,growright
LegendI[mtPPPoEusers]:ActivePPPoEUsersonMT
LegendO[mtPPPoEusers]:
YLegend[mtPPPoEusers]:ActivePPPoEUsersonMT
Legend1[mtPPPoEusers]:ActivePPPoEUsersonMT
Legend2[mtPPPoEusers]:

###MONITORINGMIKROTIKCCR_1036CPUTEMP###
Target[mt.cpu.temp]:1.3.6.1.4.1.14988.1.1.3.11.0&1.3.6.1.4.1.14988.1.1.3.11
Options[mt.cpu.temp]:gauge,growright,nopercent,noinfo
MaxBytes[mt.cpu.temp]:100
Colours[mt.cpu.temp]:RED#ff4f27,Y#fffb15,RED#ff4f27,RED#fffb15
#Unscaled[mt.cpu.temp]:dwmy
YLegend[mt.cpu.temp]:CPUTemprature
Title[mt.cpu.temp]:MIKROTIKCCR_1036RBCPUTemprature
PageTop[mt.cpu.temp]:<H1>MIKROTIKCCR_1036RBCPUTemprature</H1>
ShortLegend[mt.cpu.temp]:c
LegendI[mt.cpu.temp]:
LegendO[mt.cpu.temp]:CPUTemp
Legend1[mt.cpu.temp]:CPUTemprature

45

Legend2[mt.cpu.temp]:CPUTemprature

45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99

Legend2[mt.cpu.temp]:CPUTemprature

###MONITORINGMIKROTIKCCR_1036RBTEMP###
Target[mt.rb.temp]:1.3.6.1.4.1.14988.1.1.3.10.0&1.3.6.1.4.1.14988.1.1.3.10.
Options[mt.rb.temp]:gauge,growright,nopercent,noinfo
MaxBytes[mt.rb.temp]:100
Colours[mt.rb.temp]:RED#ff4f27,Y#fffb15,RED#ff4f27,RED#fffb15
#Unscaled[mt.rb.temp]:dwmy
YLegend[mt.rb.temp]:RBTemprature
Title[mt.rb.temp]:MIKROTIKCCR_1036RouterBoardTemprature
PageTop[mt.rb.temp]:<H1>MIKROTIKCCR_1036RouterBoardTemprature</H1>
ShortLegend[mt.rb.temp]:c
LegendI[mt.rb.temp]:
LegendO[mt.rb.temp]:RBTemp
Legend1[mt.rb.temp]:RBTemprature
Legend2[mt.rb.temp]:RBTemprature

###MONITORINGMIKROTIKCCR_1036VOLTAGEMonitor###
Target[mtvoltage]:.1.3.6.1.4.1.14988.1.1.3.8.0&1.3.6.1.4.1.14988.1.1.3.8.0
Options[mtvoltage]:gauge,growright,nopercent,noinfo
MaxBytes[mtvoltage]:1000
Colours[mtvoltage]:RED#ff4f27,Y#fffb15,RED#ff4f27,RED#fffb15
#Unscaled[mtvoltage]:dwmy
YLegend[mtvoltage]:VoltaegMonitor
Title[mtvoltage]:MIKROTIKCCR_1036CloudcoreRBVOLTAGEMonitor
PageTop[mtvoltage]:<H1>MIKROTIKCCR_1036CloudcoreRBVOLTAGEMonitor</H1>
ShortLegend[mtvoltage]:c
LegendI[mtvoltage]:
LegendO[mtvoltage]:Voltage
Legend1[mtvoltage]:Voltage
Legend2[mtvoltage]:Voltage

###MONITORINGMIKROTIKCCR_1036power.consumptionWattUsageMonitor###
Target[mtpowerconsumption]:.1.3.6.1.4.1.14988.1.1.3.12.0&.1.3.6.1.4.1.1498
Options[mtpowerconsumption]:gauge,growright,nopercent,noinfo
MaxBytes[mtpowerconsumption]:1000
Colours[mtpowerconsumption]:RED#ff4f27,Y#fffb15,RED#ff4f27,RED#fffb15
#Unscaled[mtpowerconsumption]:dwmy
YLegend[mtpowerconsumption]:WattsUSAGEMonitor
Title[mtpowerconsumption]:MIKROTIKCCR_1036CloudcoreRBWattsUsageMonit
PageTop[mtpowerconsumption]:<H1>MIKROTIKCCR_1036CloudcoreRBWattsUsage
ShortLegend[mtpowerconsumption]:W
LegendI[mtpowerconsumption]:
LegendO[mtpowerconsumption]:power.consumption.wts
Legend1[mtpowerconsumption]:power.consumption.wts
Legend2[mtpowerconsumption]:power.consumption.wts

###MONITORINGMIKROTIKCCR_1036FAN2SpeedMonitor###
Target[mtFAN2speed]:1.3.6.1.4.1.14988.1.1.3.18.0&1.3.6.1.4.1.14988.1.1.3.
Options[mtFAN2speed]:gauge,growright,nopercent,noinfo
MaxBytes[mtFAN2speed]:10000
Colours[mtFAN2speed]:RED#ff4f27,Y#fffb15,RED#ff4f27,RED#fffb15
#Unscaled[mtFAN2speed]:dwmy

99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137

#Unscaled[mtFAN2speed]:dwmy
YLegend[mtFAN2speed]:WattsUSAGEMonitor
Title[mtFAN2speed]:MIKROTIKCCR_1036CloudcoreRBFAN2SpeedMonitor
PageTop[mtFAN2speed]:<H1>MIKROTIKCCR_1036CloudcoreRBFAN2SpeedMonit
ShortLegend[mtFAN2speed]:RPM
LegendI[mtFAN2speed]:
LegendO[mtFAN2speed]:fan2.rpm.speed
Legend1[mtFAN2speed]:fan2.rpm.speed
Legend2[mtFAN2speed]:fan2.rpm.speed

###MONITORINGMIKROTIKCCR_1036AMPMonitor###
Target[mtampmon]:1.3.6.1.4.1.14988.1.1.3.13.0&1.3.6.1.4.1.14988.1.1.3.13.
Options[mtampmon]:gauge,growright,nopercent,noinfo
MaxBytes[mtampmon]:10000
Colours[mtampmon]:RED#ff4f27,Y#fffb15,RED#ff4f27,RED#fffb15
#Unscaled[mtampmon]:dwmy
YLegend[mtampmon]:AMPUSAGEMonitor
Title[mtampmon]:MIKROTIKCCR_1036CloudcoreRBAMPMonitor
PageTop[mtampmon]:<H1>MIKROTIKCCR_1036CloudcoreRBAMPMonitor</H1>
ShortLegend[mtampmon]:amp
LegendI[mtampmon]:
LegendO[mtampmon]:amp.speed
Legend1[mtampmon]:amp.speed
Legend2[mtampmon]:amp.speed

#PercentofMIKROTIKCCR_1036memoryused
Target[ccr_server_mem_ram]:(1.3.6.1.2.1.25.2.3.1.6.65536&1.3.6.1.2.1.25.2.
Title[ccr_server_mem_ram]:MemoryusageforMIKROTIKCCR_1036CCRServer
PageTop[ccr_server_mem_ram]:<H1>MemoryusageforMIKROTIKCCR_1036CCRServ
MaxBytes[ccr_server_mem_ram]:100
ShortLegend[ccr_server_mem_ram]:%
YLegend[ccr_server_mem_ram]:%ofMemory
Legend1[ccr_server_mem_ram]:UsedMemory
LegendI[ccr_server_mem_ram]:Used:
LegendO[ccr_server_mem_ram]:
Options[ccr_server_mem_ram]:nopercent,gauge,integer,growright
Unscaled[ccr_server_mem_ram]:ymwd

Regards
SyedJahanzaib
Comments(6)

6Comments
1. GoodWork!
CommentbyFelipeRomeroOctober31,2013@6:41PM
Reply
2. JahanzaibapkaEmailidmilsakhtahai?
CommentbyshaniDecember23,2013@12:23AM
Reply
aacable[at]hotmail.com
CommentbySyedJahanzaib/Pinochio~:)December23,2013@8:14AM
Reply
3. thankyouSyed,itisreallyagreatjob.
canwehaveanadditionhowtoinstallMRTGformonitoringMikroTikdevices
CommentbyHatemSabreyNovember20,2014@5:17PM
Reply
Youcandomonitoringofyourmikrotikdevicesasshowedinthisguide.Whatspecifically
youwanttoask?describeindetails.
CommentbySyedJahanzaib/Pinochio~:)November21,2014@12:46PM
Reply
brocanwemakemrtggraphforpppoeusers
CommentbyMuhammadIsmailJanuary26,2015@12:47PM
RSS(ReallySimpleSyndication)feedforcommentsonthispost.TrackBackURI(Uniform
ResourceIdentifier)
TheSilveristheNewBlackTheme.BlogatWordPress.com.

Вам также может понравиться