NSClient++ Help (#1) - Performance Counter and values greater than 999999 (#342) - Message List
Using CheckCounter, there are some counters which return values greater than 999999. When this happens, the value is shown using exponential notation, for example running this: returns this WARNING: total: 1.04367e+006 > warning Which is great, but the same notation is also used in the performance data: Performance Data: 'total'=1.04502e+006;1e+006;1.5e+006; Is there any way to get the performace data without the exponential format?
I guess a workaround might be to revert to using check_nt with the source I mentioned earlier at http://www.shatterit.com/nc_net/files/check_nt.c , but if there's a low-pain solution to continue using check_nrpe I'd rather stick with that if possible.
This sounds a lot like #151 which should have been fixed?
(Which version of NSClient++ do you use)
MickeMmickem01/28/09 20:22:32 (4 years ago)
Good question! Errm, Oops .. currently we're using 0.2.7.
Many thanks, I'll start a moving to 0.3.5. It looks like there's a fair bit else I'll find useful in there too. I'll see if I can start doing a few more passive checks while I'm at it.
Please forgive me for not replying earlier, and for not checking the changelog properly beforehand.
Jimaveryjim02/09/09 16:38:55 (4 years ago)
I just ran across this issue as well. I'm using 0.3.5.1. In my case, it's with disk Byte Read and Write counters.
[root@scope libexec]# ./check_nrpe -H myhostname CheckVersion? I (0.3.5.1 2008-09-24) seem to be doing fine...Mike F02/10/09 03:05:34 (4 years ago)
Just an update from my previous post. The only reason I say this is an issue, is because I'm using a script for Cacti to read this output into a rrd file and ultimatly into a graph. The e+006 causes my script to output incorrect data.
I'm using a perl script to execute the check_nrpe command and when it returns a scientific notation, my script sends the wrong value. It basically strips off the e+006. I'm currently looking into a way that I can reformat the output to correct values. And I believe rrd will accept scientific notation.
$response = /usr/local/nagios/libexec/check_nrpe -H $ARGV -c CheckCounter -a "\\PhysicalDisk(_Total)\\Disk Read Bytes/sec" ShowAll; chomp $response;
($bytesrd) = ($response =~ /Read Bytes\/sec: (\d+\.\d+|\d*)/); print "$bytesrd\n";Mike F02/10/09 18:41:49 (4 years ago)
I think I got this working OK. I just had to change my perl script to outout scientific notation correctly. RRD seems ok with the format.
New output line: ($bytesrd) = ($response =~ /Read Bytes\/sec: (\d+\.\d+\S*|\d*)/);Mike F02/11/09 02:44:55 (4 years ago)
This is actually "by design", you can get the unfiltered data from the performance data. A "bug" though made the performance data go "Missing" when no bounds were specified. This have been fixed in the "Next" nightly build out in a bit. But you can also just add faked max/min bounds.
Michael Medinmickem02/11/09 08:50:32 (4 years ago)
Now that I think about it, a more helpful option would be to just output the actual data, without all the text. This would make it easier to import the output into Cacti because I wouldn't have to parse the output to make it Cacti friendly.
So instead of; OK: \PhysicalDisk?(_Total)\Disk Read Bytes/sec: 4.59211e+006
Just output: 4.59211e+006
I'll add this to the feature requests.
Thanks for the reply and for making a great tool. Just for your information, we're using nsclient++ on over 100 Windows servers and have 1,100+ service monitors running in Nagios without a hitch.Mike F02/11/09 16:18:03 (4 years ago)