Build precise queries to find exactly what you need
Press ESC to close
I added on to the script felix has created above. This one will return OK with spare drives and return a more specific error to Nagios…
—
$array_config_util = ‘C:Program Files (x86)CompaqHpacucliBinhpacucli.exe’
try { $exec = & $array_config_util ‘ctrl all show config’ #Write-Output $exec } catch { Write-Host “Problem checking array status (hint: nagioscheck_smartarray.ps1)” exit 3 }
# filter results for lines that talk about drives (physicaldrive, logicaldrive) # and do not end with “OK”: $not_OK = $exec | Where-Object { $_ -like “*drive*” } | Where-Object { $_ -notlike “*OK)”} | Where-Object { $_ -notlike “*OK, spare)”} if ($not_OK.length -lt 2) { Write-Host “Array status appears OK” Write-Host $not_OK exit 0 }
Write-Host “Array status not OK;” $not_OK #write-Host $not_OK exit 2
We’ve completely redesigned the world’s largest repository of Nagios plugins and monitoring tools. Join thousands of users sharing monitoring solutions for servers, applications, and everything in between.
Due to our redesign, all existing accounts require a password reset to access your account again.
Ready to explore 6,100+ projects and contribute to the community?
Reset Password Create Account
Happy Monitoring!