Page 1 of 1

monitoring of network interfaces shows 0Mbps

Posted: Mon Sep 07, 2020 9:35 am
by smoren
Hello,
I'm trying to monitor network devices for bandwidth, but all checks return status like 'OK - Current BW in: 0Mbps Out: 0Mbps'. I use Network Switch / Router Monitoring Wizard. I've consulted KB https://support.nagios.com/kb/article.php?id=29 and several topics in this forum without luck. I use snmp v3 to connect to device.

- simple 'snmpwalk -v3 ...' returns correct output ('HC' counters are used).
- following command returns no error (no output in console)

Code: Select all

LANG=C LC_ALL=C /usr/bin/mrtg /etc/mrtg/mrtg.cfg

- all noHC directives from mrtg config files are commented out
- versions used: Nagios XI 5.7.3, OS - RHEL 6.10.

Do you have any other ideas what to check?

Thanks.

Re: monitoring of network interfaces shows 0Mbps

Posted: Tue Sep 08, 2020 4:12 pm
by cdienger
Check the rrd files that mrtg writes the bandwidth information to. For example, data from /var/lib/mrtg/192.168.5.43_74.rrd (from the KB/your device's IP and interface number will likely differ) can be written to the screen with:

Code: Select all

rrdtool dump /var/lib/mrtg/192.168.5.43_74.rrd
This will likely show a lot of empty place holders. To show just lines with data:

Code: Select all

rrdtool dump /var/lib/mrtg/192.168.5.43_74.rrd | grep -v NaN
In a working situation this would show you values sorted by the time they were inserted into the rrd files. For example:

Code: Select all

<database>
                        <!-- 2020-09-01 16:56:00 CDT / 1598997360 --> <row><v> 1.0000000000e+00 </v></row>
                        <!-- 2020-09-01 16:57:00 CDT / 1598997420 --> <row><v> 3.0000000000e+00 </v></row>
                        <!-- 2020-09-01 16:58:00 CDT / 1598997480 --> <row><v> 2.0000000000e+00 </v></row>
                        <!-- 2020-09-01 16:59:00 CDT / 1598997540 --> <row><v> 7.0000000000e+00 </v></row>
                         ...
</database>
The bandwidth plugin that Nagios uses pulls data from the rrd files that the mrtg process writes so this can help narrow things down. If the data isn't in these rrd files then we'll need to focus on the mrtg side of things and if the data is in there then we'll need to focus on the Nagios command.