Powershell nagios external scripts monitoring hdd
Powershell nagios external scripts monitoring hdd Пример внешнего скрипта для Nagiosa на Powershell который мониторит статус диска.
1 2 3 4 5 6 7 8 9 10 11 12 13 |
gwmi win32_diskdrive|%{ $model = $_.model $status = $_.status if($_.ConfigManagerErrorCode -ne 0){ write-host "Problem on $model" exit 1 } if($_.status -notlike "OK"){ write-host "Status hdd does not match ok. Now status $status" exit 2 } } exit 0 |
Пример настройки конфига Nagios можно посмотреть тут: https://docs.nsclient.org/howto/external_scripts/#ps1-power-shell