Page 1 of 1

Alert low traffic on linux interface

Posted: Fri Dec 16, 2016 3:05 pm
by krak0v
Hi

We have a Linux server that sniff traffic on one of it interface. I need to know when the inbound traffic its too low in this interface, for example less than 100kbps. I'm very n00b in Nagios and the last days I was testing some plugins. It has to be through snmp, I found a plugin that work well in a normal monitor situation: monitor high traffic.

I want a warning alert when the traffic it below than 100kbps

./check_snmp_int.pl -H xx.xx.xx.xx -C community eth1 -k -w100:,10 -c0,0

prompt this:
Argument "100:" isn't numeric in numeric ne (!=) at ./check_snmp_int.pl line 701.
eth1:UP (78.9KBps/0.0KBps):1 UP: OK

Its there another plugin that do what I want or how can I set correctly this?

Thank any help

Nagios version: 3.2.3
Ubuntu 12.04

Re: Alert low traffic on linux interface

Posted: Mon Dec 19, 2016 11:09 am
by rkennedy
It sounds like the plugin doesn't suppot using the colon after, you could simply use check_snmp to do something like this -

Code: Select all

[root@localhost libexec]# ./check_snmp -H 192.168.5.41 -C nagiosprivate -v 2c -o IF-MIB::ifIndex.10 -w 11
/usr/bin/snmpget -Le -t 1 -r 5 -m ALL -v 1 [authpriv] 192.168.5.41:161 IF-MIB::ifIndex.10
IF-MIB::ifIndex.10 = INTEGER: 10
SNMP OK - 10 | IF-MIB::ifIndex.10=10;11;;

[root@localhost libexec]# ./check_snmp -H 192.168.5.41 -C nagiosprivate -v 2c -o IF-MIB::ifIndex.10 -w 11:
/usr/bin/snmpget -Le -t 1 -r 5 -m ALL -v 1 [authpriv] 192.168.5.41:161 IF-MIB::ifIndex.10
IF-MIB::ifIndex.10 = INTEGER: 10
SNMP WARNING - *10* | IF-MIB::ifIndex.10=10;0;;
You're right with using the colon though for less than, the second example I posted is what you're after I believe.

Re: Alert low traffic on linux interface

Posted: Mon Dec 19, 2016 11:37 am
by bwallace
In addition to rkennedy's post, I always refer people to this helpful guide on how to create less than or range thresholds:
http://www.techadre.com/content/nagios- ... lds-ranges