NSClient++ Help (#1) - CheckCounter and 3.7 changes (#471) - Message List
First, I'm glad to see that development is still progressing on NSClient. I think it's a great tool for monitoring.
Now, my issue. I'm starting to use 0.3.7 as it installs on Windows 2008. I've currently standardized on 0.3.5, which works great.
I've notice the output from checkcounter is different with 3.7 vs 3.5. Is this an expected change? Can we expect any additional changes with future versions?
With 0.3.5, I get the following result: OK: \Memory\Commit Limit: 7.621e+009
With 0.3.7, I get the following result: Notice the additional text after the pipe. OK: \Memory\Commit Limit: 2.66076e+009|'\Memory\Commit Limit'=2660761600;0;0;
Now, this is not a HUGE deal, but I'm using perl scripts to parse the output so I can feed it into Cacti. It just means that I now have to add to my regular expressions to get the result correct. Cacti only needs the numbers. I did submit a ticket some time ago asking for just raw numbers from checkcounter command. This would make my life a lot easier. ;)
First off if it has changed it is a "bug" as I have not intentionally changed this. Since it is only the "text"part why not use the performance data for cati instead?
Michael Medinmickem10/13/09 07:02:08 (4 years ago)
Thanks for the reply. I'm not sure what you mean by use the performance data. Is there a way to get just the data? I didn't think there was a way. What I do now is use the ShowAll parameter inside a perl script to get just the raw numbers.
As I said, I can make the 3.7 output work with my scripts, I just have to tweak the perl regular expressions a little and make my script compatible with 3.5 and 3.7. The additional text using the 3.7 client makes my script fail. Again, not nsclient's fault.
Here is one of the scripts I use for Cacti.
$response = `/usr/lib64/nagios/plugins/check_nrpe -H $ARGV -c CheckCounter -a "\\Memory\\Pool Nonpaged Bytes"`; chomp $response; ($nonpaged) = ($response =~ /Pool Nonpaged Bytes: (\d+\.\d+\S*|\d*)/); print "nonpaged:$nonpaged\n";
Correct output which Cacti can input.
Output using the 3.7 which Cacti barfs on.
nonpaged:1.51101e+007|'\Memory\Pool paged:1.1894e+008|'\Memory\Poolmikef10/13/09 21:05:24 (4 years ago)
performance data is the "stuff at the end" after the "bar char and should be unformatted. If it is not then it is a bug.
Michael Medinmickem10/13/09 21:41:44 (4 years ago)
Just for the record, I rewrote my regular expression and now my scripts are working well with 3.7. As well as 3.5.
($paged) = ($response =~ /Pool Paged Bytes: (\d+\.\d+\S*|\d*)/);
($paged) = ($response =~ /Pool Paged Bytes: (\d+\.\d+e\+\d+|\d+\.\d+|\d+)/);mikef10/17/09 01:32:07 (4 years ago)