This support forum board is for support questions relating to
Nagios XI , our flagship commercial network monitoring solution.
nms
Posts: 222 Joined: Wed Sep 28, 2016 9:35 am
Post
by nms » Tue Oct 10, 2017 4:21 am
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:
Post
by scottwilkerson » Tue Oct 10, 2017 9:03 am
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.
cdienger
Support Tech
Posts: 5045 Joined: Tue Feb 07, 2017 11:26 am
Post
by cdienger » Tue Oct 10, 2017 9:21 am
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
Post
by nms » Mon Oct 30, 2017 8:03 am
Thanks cdienger.
This thread can be closed
kyang
Post
by kyang » Mon Oct 30, 2017 9:39 am
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!