Simple Powershell MegaRAID Logical Drive State Skript for cmk

Ein ganz einfaches Skript, um den State des Logical Drives mit MegaCLI und als local Check von CMK zu monitoren:

$OK = 0
#$Warning = 1
$Critical = 2
$RaidState = $(C:\Progra~2\MegaRAID\MegaCli.exe -LDInfo -l0 -aALL)
if ($RaidState[9] -eq „State               : Optimal“) {
  $status = $OK
  $statustext = „OK“
  $detail = „RAID Status des Logical Drives 0 OK“
else {
  $status = $Critical
  $statustext = „CRITICAL“
  $detail = „RAID Status des Logical Drives 0 CRITICAL“
}
Write-Host „$status RaidState0 – $($statustext): $detail“

Schreibe einen Kommentar