NCPA windowscounters no results

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
yderiy
Posts: 2
Joined: Mon Feb 25, 2019 9:16 am

NCPA windowscounters no results

Post 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?
yderiy
Posts: 2
Joined: Mon Feb 25, 2019 9:16 am

Re: NCPA windowscounters no results

Post 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.
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: NCPA windowscounters no results

Post by scottwilkerson »

Thanks for sharing the solution!
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
Locked