mickem / nscp

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

check_pdh - Arguments averages and time not working #702

Open riahc3 opened 3 years ago

riahc3 commented 3 years ago

Issue and Steps to Reproduce

Trying to get the average of a performance counter does not work

./check_nrpe -H AHOST -t 30 -c check_pdh -n -a 'counter=\PhysicalDisk(0 C:)\% Disk Time' 'warn=value>70' 'crit=value>90' 'averages' 'time=120s'

./check_nrpe -H AHOST -t 30 -c check_pdh -n -a 'counter=\PhysicalDisk(0 C:)\% Disk Time' 'warn=value>70' 'crit=value>90' 'averages' 'time=120'

./check_nrpe -H AHOST -t 30 -c check_pdh -n -a 'counter=\PhysicalDisk(0 C:)\% Disk Time' 'warn=value>70' 'crit=value>90' 'time=120'

./check_nrpe -H AHOST -t 30 -c check_pdh -n -a 'counter=\PhysicalDisk(0 C:)\% Disk Time' 'warn=value>70' 'crit=value>90' 'time=120s'

./check_nrpe -H AHOST -t 30 -c check_pdh -n -a 'counter=\PhysicalDisk(0 C:)\% Disk Time' 'warn=value>70' 'crit=value>90' 'averages' 

Expected Behavior

It should show me the average performance counter over a two minute period

Actual Behavior

It shows me the real time counter.

Details

mdollemore commented 3 years ago

Add the following to your NSClient++ .ini file;-

[/settings/system/windows/counters/DiskTime] collection strategy=rrd counter=\PhysicalDisk(0 C:)\% Disk Time

then use;-

./check_nrpe -H AHOST -t 30 -c check_pdh -n -a 'counter=DiskTime' 'warn=value>70' 'crit=value>90' 'time=120'

It should work, it does for me anyay