Quantcast
Channel: Syed Jahanzaib – Personal Blog to Share Knowledge !
Viewing all articles
Browse latest Browse all 408

Monitoring Mikrotik with Linux base MRTG [References]

$
0
0

I have another article that explains well about monitoring most of the mikrotik parts via nix base MRTG but it have lots of junk data too , curse upon WordPress who always messes with the coding and most of the time my hard work goes to TRASH :(

I will post updates

# Enabling SNMP on Mikrotik

First Enable SNMP service (with public as community string or whatever you like on your mikrotik. Make sure no firewall rule is blocking SNMP traffic from/to the monitoring server.

Open Terminal in mikrotik and paste the following command. Or you can configure it via going to IP > SNMP


/snmp community
set [ find default=yes ] addresses=0.0.0.0/0 authentication-password="" authentication-protocol=MD5 encryption-password="" encryption-protocol=DES name=public read-access=yes \
security=none write-access=no

/snmp
set contact=Syed-Jahanzaib enabled=yes engine-id="" location=aacable-wordpress-com trap-community=public trap-generators="" trap-target="" trap-version=1
[admin@MikroTik-2] /snmp>

Now proceed further :)

1. Monitoring Mikrotik Simple Queue with Linux base MRTG (for monitoring performance and track purposes)

To monitor simple QUEUE via Linux base MRTG, you can use following config as an example :D

First you have to check your simple queue OID (numeric value which is used by MRTG to poll specific data from the remote server) in mikrotik. for example you have a queue to allow 100M for proxy cached marked packets.

sq-ch

Open Terminal and print OID for Simple Queue number 0 (your can be changed, but in general Queue for proxy hit packets should be on ** TOP ** )


[admin@MikroTik] /queue simple print

Flags: X - disabled, I - invalid, D - dynamic

0    ;;; Simple Queue for squid Proxy CACHE HIT Packet Allow Unlimited Bandwidth
name=SQ-for-cache-hit interface=all parent=none packet-marks=Cache direction=both priority=8 queue=default-small/default-small limit-at=0/0 max-limit=100M/100M burst-limit=0/0
burst-threshold=0/0 burst-time=0s/0s total-queue=default-smal

Now check its OID value which will be used in MRTG to graph the values. Do remember, If you move/delete/add particular Queue , the oid value will change, simply note down new value and recreate graphs with the new values. Also on every system these OIDs are different, simply take a print oid to use them.


[admin@MikroTik] /queue simple print oid

Flags: X - disabled, I - invalid, D - dynamic

0    ;;; Simple Queue for squid Proxy CACHE HIT Packet Allow Unlimited Bandwidth
name=.1.3.6.1.4.1.14988.1.1.2.1.1.2.12534 bytes-in=.1.3.6.1.4.1.14988.1.1.2.1.1.8.12534 bytes-out=.1.3.6.1.4.1.14988.1.1.2.1.1.8.12534 packets-in=.1.3.6.1.4.1.14988.1.1.2.1.1.10.12534
packets-out=.1.3.6.1.4.1.14988.1.1.2.1.1.11.12534 queues-in=.1.3.6.1.4.1.14988.1.1.2.1.1.12.12534 queues-out=.1.3.6.1.4.1.14988.1.1.2.1.1.13.12534

As showed in the image below . . .

qu-oid

Now we have to take bytes-in and bytes-out value for graphing purposes. which is in our case 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

Now you can simply use the below CFG file to create Graphs for the mikrotik simple queue.


Target[mikrotik-simple-queue-in-out]: .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:public@10.0.0.1
MaxBytes[mikrotik-simple-queue-in-out]: 100000000
#Options[mikrotik-simple-queue-in-out]: bits
Title[mikrotik-simple-queue-in-out]: Mikrotik QUEUE for Cache HIT
PageTop[mikrotik-simple-queue-in-out]: <H1>Mikrotik QUEUE for Cache HIT</H1>
<TABLE>
<TR><TD>Port:</TD><TD>Connected on WAN router</TD></TR>
<TR><TD>Maintainer:</TD><TD>Syed Jahanzaib</TD></TR>
<TR><TD>Interface:</TD><TD>eth0</TD></TR>
<TR><TD>Max Speed:</TD><TD>10.mbps poor man</TD></TR>
</TABLE

SAMPLE GRAPH FOR THE SIMPLE QUEUE MONITORING VIA MRTG

QUEUE-SAMPLE.

.

2. Monitoring CPU Usage


### MIKROTIK 10.0.0.1 CPU load ###
Target[10.0.0.1_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:public@10.0.0.1
AbsMax[10.0.0.1_cpu]: 100
MaxBytes[10.0.0.1_cpu]: 100
Title[10.0.0.1_cpu]: MIKROTIK CPU load
PageTop[10.0.0.1_cpu]: <H1>MIKROTIK CPU load</H1>
Options[10.0.0.1_cpu]: gauge,growright,nopercent, noo
YLegend[10.0.0.1_cpu]: CPU load
ShortLegend[10.0.0.1_cpu]: %
LegendI[10.0.0.1_cpu]: CPU load (percentage)

As showed in the image below . . .
mt-cpu-load

3. Monitoring Active PPP Users

# Mikrotik PPP ACTIVE Users
Target[mtpppusers]: 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.0:public@10.0.0.1
Title[mtpppusers]: Active PPP Users on MT
PageTop[mtpppusers]: <H1>Active PPP Users on MT</H1>
MaxBytes[mtpppusers]: 300
Colours[mtpppusers]: B#8888ff,B#8888ff,B#5398ff,B#5398ff
Options[mtpppusers]: gauge,nopercent,noo,integer,growright
LegendI[mtpppusers]: Active PPP Users on MT
LegendO[mtpppusers]:
YLegend[mtpppusers]: Active PPP Users on MT
Legend1[mtpppusers]: Active PPP Users on MT
Legend2[mtpppusers]:

As showed in the image below . . .

ppp

4. Monitoring RB CPU Temperature

### MONITORING Mikrotik CPU TEMP ###
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.0:public@10.0.0.1
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]: CPU Temprature
Title[mt.cpu.temp]: Mikrotik RB  CPU Temprature
PageTop[mt.cpu.temp]: <H1>Mikrotik RB  CPU Temprature</H1>
ShortLegend[mt.cpu.temp]: c
LegendI[mt.cpu.temp]:
LegendO[mt.cpu.temp]: CPU Temp
Legend1[mt.cpu.temp]: CPU Temprature
Legend2[mt.cpu.temp]: CPU Temprature

5. Monitoring RB Temperature

### MONITORING Mikrotik RB TEMP ###
Target[mt.rb.temp]: 1.3.6.1.4.1.14988.1.1.3.10.0&amp;.1.3.6.1.4.1.14988.1.1.3.10.0:public@10.0.0.1
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]: Mikrotik Router Board Temprature
PageTop[mt.rb.temp]: <H1>Mikrotik Router Board Temprature</H1>
ShortLegend[mt.rb.temp]: c
LegendI[mt.rb.temp]:
LegendO[mt.rb.temp]: RB Temp
Legend1[mt.rb.temp]: RB Temprature
Legend2[mt.rb.temp]: RB Temprature

Regard’s
Syed Jahanzaib


Filed under: Linux Related, Mikrotik Related

Viewing all articles
Browse latest Browse all 408

Trending Articles