NSClient++ Help (#1) - Performance Counter and values greater than 999999 (#342) - Message List

Performance Counter and values greater than 999999

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.

tia, Jim

  • Message #1026

    This sounds a lot like #151 which should have been fixed?

    (Which version of NSClient++ do you use)

    MickeM

    • Message #1060

      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.

      Cheers,

      Jim

      • Message #1061

        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 -c CheckCounter -a "
        PhysicalDisk?(_Total)
        Disk Read Bytes/sec" ShowAll OK: \PhysicalDisk?(_Total)\Disk Read Bytes/sec: 4.59211e+006

        [root@scope libexec]# ./check_nrpe -H myhostname CheckVersion? I (0.3.5.1 2008-09-24) seem to be doing fine...

        • Message #1067

          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.

          Script:

          #!/usr/bin/perl

          $response = /usr/local/nagios/libexec/check_nrpe -H $ARGV[0] -c CheckCounter -a "\\PhysicalDisk(_Total)\\Disk Read Bytes/sec" ShowAll; chomp $response;

          ($bytesrd) = ($response =~ /Read Bytes\/sec: (\d+\.\d+|\d*)/); print "$bytesrd\n";

          • Message #1068

            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*)/);

            • Message #1070

              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 Medin

              • Message #1072

                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.

Subscriptions