Random Project

check_ifspeed

Hi, I’m using this plugin to monitor HP ProCurve Switches’ interface speed on the most important interfaces. The command I use on the terminal is:
[root@nagiux plugins]# ./check_ifspeed -H -C public -o .1.3.6.1.2.1
.2.2.1.10. -w 500000 -c 1000000

This plugin works properly, but only under certain conditions.

On the command line when I first run it on an interface I get:
UNKNOWN – New file created (/tmp/snmp–.1.3.6.1.2.1.2.2.1.10..dat)

Only on a seccond call to check_ifspeed under the same args I get a good output:
SNMP OK – IfSpeed: 5.93 kbps | IfSpeed=6067.54bps;500000;1000000;0;

Secondly, for some reason (which I haven’t yet figured if it relates to the first bug)::
1) some service checks bring a good result on the web intergace:
– SNMP OK – IfSpeed: 2.18 kbps
2)and some others bring a bad one:
– **ePN /usr/lib/nagios/plugins/check_ifspeed: “print() on closed filehandle DAT at (eval 1) line 136,”.

If someone knows how to fix this bug, please respond.

Thank you for reading this review and furthermore for contributing.