I have check witch monitoring directory size, via NCPA agent and powershell script.
Code: Select all
define service {
host_name TEST-Server
service_description OS Dir size c:test01:test
display_name test01
check_command check_ncpa_pfs_FolderSize!xxx!$USERxxx$!-Path 'c:\test01\test'!!!!!
max_check_attempts 2
check_interval 120
retry_interval 2
check_period 24x7
notification_period 24x7
notifications_enabled 0
register 1
}
define service {
host_name TEST-Server
service_description OS Dir size c:test02:test
display_name test02
check_command check_ncpa_pfs_FolderSize!xxx!$USERxxx$!-Path 'c:\test02\test'!!!!!
max_check_attempts 2
check_interval 120
retry_interval 2
check_period 24x7
notification_period 24x7
notifications_enabled 0
register 1
}Code: Select all
define command {
command_name check_ncpa_pfs_FolderSize
command_line $USER1$/check_ncpa.py -H $HOSTADDRESS$ -P $ARG1$ -t $ARG2$ -T 140 -M "agent/plugin/check_ms_FolderSize.ps1" -a "$ARG3$"
}Code: Select all
[root@nagiosserver libexec]# ./check_ncpa.py -H x.x.x.x -P xxxx -t xxxx -M agent/plugin/check_ms_FolderSize.ps1 -a "-Path 'c:\test01\test'" -T 180
OK: Velikost adresare c:\test01\test je 300.6399 Gb. | 'Size'=300.6399GB;;; 'Files'=203533;;; 'Dirs'=38225;;; 'Time'=79.8469s;;;
[root@nagiosserver libexec]# ./check_ncpa.py -H x.x.x.x -P xxxx -t xxxx -M agent/plugin/check_ms_FolderSize.ps1 -a "-Path 'c:\test02\test'" -T 180
OK: Velikost adresare c:\test02\test je 21.2187 Gb. | 'Size'=21.2187GB;;; 'Files'=179;;; 'Dirs'=8;;; 'Time'=0.2969s;;;Code: Select all
UNKNOWN: Execution exceeded timeout threshold of xxxsCode: Select all
Critical (Service check timed out after 30.01 seconds)./check_ncpa.py --help
-T TIMEOUT, --timeout=TIMEOUT
Enforced timeout, will terminate plugins after this
amount of seconds. [15]
btw. I tried this via "Tools by Box293" and command Test and there is the same result as trough the CLI.
Michal