Advertisement
surepointit

Monitor Dell OpenManage RAID Virtual Disk

Feb 13th, 2025
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Import-Module $SuperOpsModule
  2. $customerSubDomain = "surepointit"
  3. $apiKey = "api-eyJhbGciOiJSUzI1NiJ9.eyJqdGkiOiI2ODg0MzEyMzQzMTM3MTgxNjk2IiwicmFuZG9taXplciI6Iu-_ve-_ve-_vSzvv71A77-9XHUwMDE2UiJ9.NH7qEnz02CrhNh5vJUSo8XNGeJevl3i5STcxpqTiY7iAdb29_aTFKFkC08zFNgDm9YXX_srR3cZatf6p1v8iMlAK9pM4BAYwv1GxmuEdHg63RZoLbPQCbl-ROSVC2VEcxKWz3etdfsTufLNNDw3_666jCPsA0ZeUrQRskP7_6KkS5XIt2w2JTdSf4Nylc-aq5pmaT0sxWVI0ENEWixRNqMCdnPaLa4IyH3gvXJmvZXxSiPiJw1_Kl1HsodAqJkZr-kvmBQqz4dfheI9TmY7p95GvdP9lBLgrKDNHAJkdYb9OuWIHIeeLWUnZtwfZEW9Fty65XIHLKuE-fOc6LssXLg"
  4.  
  5.  
  6. # Check to see if this server is a physical host
  7. if ((Get-WmiObject -Namespace "root\cimv2" -Class Win32_ComputerSystem).Model -like '*Virtual*') {
  8.     Write-Host "Unsupported Server. This can only run on a physical host."
  9.     exit 0
  10. }
  11.  
  12. # Check to see if this server is a Dell.
  13. if ((Get-CimInstance -ClassName Win32_ComputerSystem).Manufacturer -notlike 'Dell*') {
  14.     Write-Host "System Manufacturer is not Dell, exiting..."
  15.     exit 0
  16. }
  17.  
  18. # Check to see if this server is a PowerEdge.
  19. if ((Get-CimInstance -ClassName Win32_ComputerSystem).Model -notlike 'PowerEdge*') {
  20.     Write-Host "System Manufacturer is not a PowerEdge, exiting..."
  21.     exit 0
  22. }
  23.  
  24. $version = (Get-ItemProperty "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion").CurrentVersion
  25. if ($Version -lt "6.3") {
  26.     Write-Host "Unsupported OS. This component requires at least Server 2012R2"
  27.     exit 0
  28. }
  29. try {
  30.     omconfig preferences cdvformat delimiter=comma
  31.     $OmReport = omreport storage vdisk -fmt cdv |  select-string -SimpleMatch "ID,Status," -Context 0, 5000
  32. }
  33. catch {
  34.     throw "Error: omreport Command has Failed: $($_.Exception.Message). Check if Dell OpenManage is installed and OMReport is in the PATH variable."
  35. }
  36. $VDarray = convertfrom-csv $OmReport -Delimiter ","
  37.  
  38. foreach ($VirtualDisk in $VDarray | where-object { $_.'> ID' -in 0..1000 }) {
  39.     if ($($virtualdisk.State) -eq "Ready" -or $($virtualdisk.Status) -eq "Ok") {
  40.     }
  41.     else {
  42.         write-host "$($VirtualDisk.Name) / $($VirtualDisk.'Device Name') Has Status $($VirtualDisk.Status) / $($VirtualDisk.State)"
  43.         $RAIDStatus = "failed"
  44.     }
  45.  
  46. }
  47.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement