mickem / nscp

NSClient++
http://nsclient.org
GNU General Public License v2.0
244 stars 94 forks source link

check_cpu Question #649

Open andyb4u opened 4 years ago

andyb4u commented 4 years ago

Hi,

This may be the wrong place to ask this, the forums appear to be down.

It relates to the NSClient command check check_cpu:

There does not appear to be any documentation on the time argument, explaining how the NSClient can check at different time intervals.

Does the NSClient: Save the values of the CPU load every 5 seconds. Therefore, this enables you to report on an average figure over a time period How far in time can you go back – 15 minutes or since the nsclient agent was restarted? Where does the CPU load value comes from? - performance counters?: CounterName = "% Processor Time";CategoryName = "Processor";InstanceName = "_Total";

If anyone can shed any light about how check_cpu works it would be greatly appreciated.

Regards, Andy

mintsoft commented 4 years ago

src is here: https://github.com/mickem/nscp/blob/174c454a47b733fe0e8c5e78c558d719f1d797e7/modules/CheckSystem/CheckSystem.cpp#L556

But it looks like it basically comes from the performance counters judging by https://github.com/mickem/nscp/blob/174c454a47b733fe0e8c5e78c558d719f1d797e7/modules/CheckSystem/CheckSystem.cpp#L582