check_rrdtraf plugin

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
nms
Posts: 222
Joined: Wed Sep 28, 2016 9:35 am

check_rrdtraf plugin

Post by nms »

Hi,

When executing this plugin with a higher unit then bytes, the result is as follows (sample):

Code: Select all

/usr/local/nagios/libexec/check_rrdtraf -f /var/lib/mrtg/10.193.1.3_504.rrd -w 500.0,500.0 -c 800.0,800.0 -l M
OK - Current BW in: .64Mbps Out: .17Mbps|in=.643269Mb/s;500.0;800.0 out=.171962Mb/s;500.0;800.0
Is there a possibility to obtain the values that have 0 float showing as 0.xxMbps instead of a .xxMbps?

Also is there a possibility of taking into consideration low and high thresholds?

Thanks in advance
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: check_rrdtraf plugin

Post by scottwilkerson »

nms wrote: Is there a possibility to obtain the values that have 0 float showing as 0.xxMbps instead of a .xxMbps?
Yes, you would have to modify the plugin /usr/local/nagios/libexec/check_rrdtraf to add the leading zero if it was less than 1.
nms wrote:Also is there a possibility of taking into consideration low and high thresholds?
This plugin does not take into account ranges or the ability to alert on levels below a certain amount, and unfortunately I do not know of another rrd plugin that does.
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
User avatar
cdienger
Support Tech
Posts: 5045
Joined: Tue Feb 07, 2017 11:26 am

Re: check_rrdtraf plugin

Post by cdienger »

The plugin uses bc to do the math which drops the zero. You could pipe the output to awk to print it as a float with a leading zero:

Code: Select all

scale=$SCALE; ($VALUEIN/$SDIVIN)"| bc
becomes:

Code: Select all

scale=$SCALE; ($VALUEIN/$SDIVIN)"| bc | awk '{printf "%f", $0}'
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
nms
Posts: 222
Joined: Wed Sep 28, 2016 9:35 am

Re: check_rrdtraf plugin

Post by nms »

Thanks cdienger.
This thread can be closed
kyang

Re: check_rrdtraf plugin

Post by kyang »

Sounds good! I'll be closing this topic as resolved!

If you have any more questions, feel free to create another thread!

Thank you for using the Nagios Support Forum!
Locked