# Last Updated: 2022/09/19 # NOTES: # - This script requires Fujitsu ServerView RAID Manager to be installed on the server as it uses the amcli.exe CLI tool. # - amcli64.exe can be located in different directories depending on the version, so update the directory path on line 16 if needed. # - The output from amcli.exe will show something like "Status logical drives: OK" for the RAID status, so the recommended Success rule in the CheckCentral check configuration would be: # - Body Text - Contains - Status logical drives: OK # - You can also add a Body Text - Contains - Status disks: OK for an extra sanity check. ################### # 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 path to ssacli.exe here Set-Location "C:\Program Files (x86)\Fujitsu\ServerView Suite\RAID Manager\bin" #################################################### # Script Processing (Don't modify below this line) # #################################################### # Setup the subject for the email $subject = "Fujitsu LSI MegaRAID Status: " + $env:COMPUTERNAME # Get the RAID status using OpenManage Server Administrator Write-Output "`n[INFO] Getting the RAID report...`n" try { $raidReport = .\amCLI.exe --list all | Out-String } catch { $raidReport = "Failed to get the RAID status" + $env:COMPUTERNAME } # Create the activity in CheckCentral Write-Output "`n[INFO] Creating the activity in CheckCentral...`n" $ccActivity = [PSCustomObject]@{ sendNotifications = $true sendTicketingSystems = $true 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)) 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" }