Page 1 of 1

NCPA windowscounters no results

Posted: Mon Feb 25, 2019 11:26 am
by yderiy
Hello everybody
Cannot get a result with NCPA from windowscounters.
I'm trying to Run as a Nagios check for windows counter like this from NCPA API page:

Code: Select all

/Process(7zG.exe)/% Processor Time
Im running "7zG.exe" to simulate proc load by process
it return me following result:

Code: Select all

{ "perfdata": "'\\Process(7zG.exe)\\% Processor Time'=0c;40.00;80.00;", "returncode": 0, "stdout": "OK: \\Process(7zG.exe)\\% Processor Time was 0 c | '\\Process(7zG.exe)\\% Processor Time'=0c;40.00;80.00;" }
But I was expecting a percentage answer, something like 80%.
On the Nagios web page I receive an infomation like this:
Performance Data: '\Process(7zG)\% Processor Time'=0c;40;60;

Does it work like this? Is there any error in my query?

Re: NCPA windowscounters no results

Posted: Tue Feb 26, 2019 12:13 pm
by yderiy
After some long internet search, just figured out that I need to use "sleep" parameter for such a per second counter. In Nagios Core for "check_ncpa.py" use parameter

Code: Select all

-q sleep=n
, where is n stand for n second. You can use your value in second.

Re: NCPA windowscounters no results

Posted: Tue Feb 26, 2019 3:46 pm
by scottwilkerson
Thanks for sharing the solution!