Page 1 of 2

Nagios XI Alert for low or no bandwidth

Posted: Tue May 03, 2016 4:18 pm
by rbuckle
How can you configure a probe to alert when the bandwidth through a monitored drops below a certain level?

Re: Nagios XI Alert for low or no bandwidth

Posted: Tue May 03, 2016 4:41 pm
by rkennedy
You should be able to use a different parameter in your warning / critical thresholds, for you it would be appending a :, which represents <.

See this link for more info - https://nagios-plugins.org/doc/guidelin ... HOLDFORMAT

Re: Nagios XI Alert for low or no bandwidth

Posted: Tue May 03, 2016 4:56 pm
by ssax
I've modified the plugin to add a new option -L (see attached) that will change it from greater than to less than, please test it out and let me know if that works.
check_rrdtraf_less.zip

Code: Select all

/usr/local/nagios/libexec/check_rrdtraf2 -f /var/lib/mrtg/192.168.X.X_1.rrd -w 1 -c 25 -l M -L

Re: Nagios XI Alert for low or no bandwidth

Posted: Tue May 10, 2016 6:07 pm
by rbuckle
i tried using both methods but could not get it to not be a greater than alert

Re: Nagios XI Alert for low or no bandwidth

Posted: Wed May 11, 2016 9:04 am
by lmiltchev
What is not working for you? Can you elaborate?

I just tried the modified plugin provided by ssax, and it works just fine for me.
Example:

Code: Select all

[root@localhost libexec]# /usr/local/nagios/libexec/check_rrdtraf2 -f /var/lib/mrtg/192.168.x.x_7.rrd -w 1 -c 1 -l M
OK - Current BW in: .05Mbps Out: .08Mbps|in=.059158Mb/s;1;1 out=.080785Mb/s;1;1
[root@localhost libexec]# /usr/local/nagios/libexec/check_rrdtraf2 -f /var/lib/mrtg/192.168.x.x_7.rrd -w 1 -c 1 -l M -L
CRITICAL - Current BW in: .05Mbps Out: .08Mbps|in=.059158Mb/s;1;1 out=.080785Mb/s;1;1

Re: Nagios XI Alert for low or no bandwidth

Posted: Wed May 11, 2016 12:26 pm
by rbuckle
This is what i get

Code: Select all

COMMAND: /usr/local/nagios/libexec/check_rrdtraf_less -f /var/lib/mrtg/10.0.0.27_5.rrd -w 5 -c 5 -l M -L
OUTPUT: CRITICAL - Current BW in: 7.94Mbps Out: 46.88Mbps|in=7.944299Mb/s;5;5 out=46.888900Mb/s;5;5

Re: Nagios XI Alert for low or no bandwidth

Posted: Wed May 11, 2016 3:52 pm
by lmiltchev
Yeah, it seems like ssax's solution works only if the actual value is above the specified threshold but not when it is below it. Our developers will be looking this this.

For the time being, as a "workaround", you could try using the negate plugin with the original check_rrdtraf plugin (not ssax's version). Using the negate is pretty much straight forward. Here's our documentation on negate:
https://assets.nagios.com/downloads/nag ... ios-XI.pdf

Hope this helps. Let us know if you get stuck on something.

Re: Nagios XI Alert for low or no bandwidth

Posted: Wed May 11, 2016 5:02 pm
by rbuckle
so do i have to create the plugin for the command? then create the command? or is it

Code: Select all

$USER1$/negate $USER1$/check_rrdtraf_bits -f /var/lib/mrtg/$ARG1$ -w $ARG2$ -c $ARG3$ -l $ARG4$

Re: Nagios XI Alert for low or no bandwidth

Posted: Wed May 11, 2016 5:19 pm
by lmiltchev
You can also use:

Code: Select all

negate 	$USER1$/negate -s --ok=CRITICAL $USER1$/check_rrdtraf -f /var/lib/mrtg/$ARG1$ -w $ARG2$ -c $ARG3$ -l $ARG4$
This way, the output text will be also substituted (from OK to Critical).

Re: Nagios XI Alert for low or no bandwidth

Posted: Mon May 16, 2016 12:38 pm
by rbuckle
lmiltchev wrote:You can also use:

Code: Select all

negate 	$USER1$/negate -s --ok=CRITICAL $USER1$/check_rrdtraf -f /var/lib/mrtg/$ARG1$ -w $ARG2$ -c $ARG3$ -l $ARG4$
This way, the output text will be also substituted (from OK to Critical).
This gives me a blank reply