Random Project

quite good plugin, missing two features

Hi,

I tested this plugin and it did not work correctly out of the box on the command line because it did output nothing at all (but web ui said “OK”). Looking into the code the problem was on line 140 where it says
my $TRAFFIC_FILE = “/usr/local/nagios/libexec/traffic/”;

This directory did not exist on my system; this caused the plugin to output nothing. After adding this directory, it worked. Maybe add a test if directory exists and throw an error if not?

I miss two features though, whose availability would easily push this plugin to a five star plugin(!)
– error packet counter and corresponding warn/crit tresholds
– automatic port speed detection

These two are very important IMHO:
– error counter
If the error counters grows, you could be alarmed; thanks to performance data, you would even have some long time trending, being able to research when errors increased e.g.

– auto-detect port speed
If the network admin decides to change a port speed from 100M to 1G, the plugin settings for this specific port will become incorrect. Auto-detection could help here.

If you start the plugin with debug level 4 you can see that port speed detection _would_ already work. The command

/usr/lib/nagios/plugins/check_iftraffic64.pl -H 192.168.123.123 -C not-so-public -i 1 –debug 4

outputs (shortend):

OID’s:
IfOperStatus: 1.3.6.1.2.1.2.2.1.8.1
IfSpeed: 1.3.6.1.2.1.31.1.1.1.15.1
IfSpeed32: 1.3.6.1.2.1.2.2.1.5.1
RESULTS:
Operational Status: 1
Interface Speed (64bit): 100 Mbits
Interface Speed (32bit): 100000000 bits

So there is already a port speed detection, but not used in any way – maybe it is unreliable?

Since I cannot re-review a plugin here, I will mark it with 5 stars, hoping the author might add these two features in the future.