Page 2 of 5

Re: SNMP charts show MBits not Mbps

Posted: Tue Mar 08, 2016 3:56 pm
by rbuckle
I am so sorry for such a Noob at this but where do i import this script, i tried in the plugins but then it does not show up in the core check command options

Re: SNMP charts show MBits not Mbps

Posted: Tue Mar 08, 2016 4:09 pm
by ssax
Just put it in /usr/local/nagios/libexec, if you want it to be used as the default for the switch wizard then go to Configure > Core Config Manager > Commands, edit the check_xi_service_mrtgtraf and change it to:

Code: Select all

$USER1$/check_rrdtraf_custom -f /var/lib/mrtg/$ARG1$ -w $ARG2$ -c $ARG3$ -l $ARG4$
Then apply config.

NOTE: Again, you will mess up your current bandwidth checks if you do this and will need to delete the associated RRDs in /usr/local/nagios/share/perfdata/HOSTNAME/SERVICENAME.rrd

Re: SNMP charts show MBits not Mbps

Posted: Tue Mar 08, 2016 4:46 pm
by rbuckle
OK so i think that i have this problem sussed out,

It seems that when you probe a Mikrotik with SNMP it returns a number in bytes, Nagios doesn't know this and assumes it is bits.

So now it seems i am looking for a plugin to convert the plugin to convert bytes to bits, which means we shouldnt need to delete the rrd's?

Re: SNMP charts show MBits not Mbps

Posted: Wed Mar 09, 2016 10:29 am
by ssax
MRTG queries your router/switch which by default gets it thinking it's bytes.

The only way that I can see to resolve the issue would be for you to delete the RRDs (from /var/lib/mrtg and from /usr/local/nagios/share/perfdata) for these Mikrotik devices and add this option to your /etc/mrtg/conf.d/DEVICENAME.cfg

Code: Select all

Options[_]: growright, bits
We would then have to look at the script from there since the calculations would be different I believe, maybe not though.

Re: SNMP charts show MBits not Mbps

Posted: Wed Mar 09, 2016 12:09 pm
by rbuckle
ok so that broke mrtg LOL

Re: SNMP charts show MBits not Mbps

Posted: Wed Mar 09, 2016 3:06 pm
by rkennedy
Could you provide more information about how it broke MRTG? What are you seeing?

Re: SNMP charts show MBits not Mbps

Posted: Wed Mar 09, 2016 3:14 pm
by rbuckle
i am seeing no data in the nagios reports... all charts show 0Mbps after making that change.

I run a test on the command and it returns 0Mbps

Re: SNMP charts show MBits not Mbps

Posted: Wed Mar 09, 2016 4:36 pm
by ssax
Just to confirm.

You added it to the /etc/mrtg/conf.d/DEVICENAME.cfg file, right?

You removed the RRD files for the bandwidth checks from /usr/local/nagios/share/perfdata/HOSTNAME/ and from /var/lib/mrtg/, right?

Re: SNMP charts show MBits not Mbps

Posted: Wed Mar 09, 2016 5:52 pm
by rbuckle
That is correct

Re: SNMP charts show MBits not Mbps

Posted: Thu Mar 10, 2016 11:57 am
by ssax
Ok, follow this process, I've updated the plugin to use the proper logic now.

Edit /etc/mrtg/conf.d/DEVICENAME.cfg and uncomment this line:

Code: Select all

# Options[_]: growright, bits
Then delete all your MRTG RRDs for that device:

Code: Select all

rm -rf /var/lib/mrtg/DEVICENAME*
Then take this updated plugin, unzip it, and put it in /usr/local/nagios/libexec with a different name (like check_rrdtraf_bits).
check_rrdtraf_bits.zip
Then go into the web interface and go to Configure > Core Config Manager > Commands and edit the check_xi_service_mrtgtraf command to point to the new plugin (check_rrdtraf_bits) and apply configuration. Doing it this way will allow the wizard to still work properly and should be safe for upgrades.

Now delete all your bandwidth perfdata files for that device (XML and RRD files) in /usr/local/nagios/share/perfdata/DEVICENAME.

It needs to be done in that exact process. Once MRTG runs again and a few bandwidth checks run it should rebuild the performance data graphs and should show the proper data.