# Last Updated: 2023/09/22 # NOTES: # - This script requires Dell OpenManage to be installed on the server as it uses the omreport.exe CLI tool. # - The output from omreport will show "Status : Ok" for each volume, so the recommended Success rule in the CheckCentral check configuration would be: # - Body Text - Complex Match ": Ok"{#} (where # is the number of volumes that omreport returns) ################### # Script Settings # ################### # Set the allowed TLS versions $TLSProtocol = [System.Net.SecurityProtocolType] 'Ssl3 , Tls, Tls11, Tls12, Tls13' [System.Net.ServicePointManager]::SecurityProtocol = $TLSProtocol # CheckCentral API key $apiToken = "" # Set the RAID controller ID to check here. If the system only has one RAID controller, it should be ID 0. # If you want to specify multiple controllers (e.g. if you have a BOSS controller and a PERC controller in the system, use 0,1) $raidControllerID = 0,1 #################################################### # Script Processing (Don't modify below this line) # #################################################### # Setup the subject for the email $subject = "Dell RAID Status: " + $env:COMPUTERNAME # Setup the $raidReport variable $raidReport = "" foreach ($raidController in $raidControllerID) { # Get the RAID status using OpenManage Server Administrator Write-Output "`n[INFO] Getting the RAID report from omreport...`n" try { $raidReport += omreport.exe storage vdisk controller=$raidController | Out-String } catch { $raidReport += "Failed to get the RAID status from omreport.exe for $($raidController): " + $env:COMPUTERNAME } } # Create the activity in CheckCentral Write-Output "`n[INFO] Creating the activity in CheckCentral...`n" $ccActivity = [PSCustomObject]@{ activities = @( [PSCustomObject]@{ subject = $subject body = $raidReport } ) } $ccCreateActivitiesRequest = Invoke-WebRequest -Uri "https://api.checkcentral.cc/createActivities/?apiToken=$apiToken" -Method "POST" -ContentType "text/json" -Body $(($ccActivity | ConvertTo-Json)) -UseBasicParsing if (($ccCreateActivitiesRequest.Content | ConvertFrom-Json).activities_saved -lt ($ccCreateActivitiesRequest.Content | ConvertFrom-Json).activities_received) { Write-Output "Failed to create $(($ccCreateActivitiesRequest.Content | ConvertFrom-Json).activities_received - ($ccCreateActivitiesRequest.Content | ConvertFrom-Json).activities_saved) activitie(s) in CheckCentral" }