Page 1 of 1

NCPA CPU Thresholds on MultiProc Host

Posted: Mon Apr 13, 2015 2:02 pm
by dlausche
I am using NCPA v1.8.1 on a Windows 7 host and am trying to setup simple CPU % thresholds in Nagios. What I am experiencing is that on a multi-core host all it takes is one of the cores/CPUs to be over the threshold and then an alert is generated.

in ncpa.cfg:
...
[passive checks]
%HOSTNAME%|cpu usage = /cpu/percent --warning 80 --critical 90

and this output for - https://localhost:5693/api/cpu/percent
{
"value": {
"percent": [
[
5.2,
84.4,
8.7,
14.1,
],
"%"
]
}
}

With only the one CPU above the threshold the result is Warning yet the overall CPU use for the four CPUs is really < 30%. How do I configure it to use a combined percentage of all CPUs considered together? I am looking for the CPU metric shown on the NCPA dashboard that is labeled "Current" and is to the right of the CPU use graph.

Re: NCPA CPU Thresholds on MultiProc Host

Posted: Mon Apr 13, 2015 2:09 pm
by lmiltchev
Try this:

Code: Select all

https://localhost:5693/api/cpu/percent?aggregate=avg

Re: NCPA CPU Thresholds on MultiProc Host

Posted: Mon Apr 13, 2015 2:14 pm
by dlausche
Perfect. That is exactly what I am looking for. I've been reading the NCPA API docs for hours trying to figure out how to do this. I didn't find anything explaining how to aggregate or average like this.

Thanks much!

Re: NCPA CPU Thresholds on MultiProc Host

Posted: Mon Apr 13, 2015 2:19 pm
by cmerchant
Looks like we can go ahead and close this thread. Thanks.