Nagios Exchange
  • Home
  • Directory
  • About

Advanced Search

Build precise queries to find exactly what you need

Search Logic

Select compatible versions

Press ESC to close

Sign In Sign Up
Plugins4387Themes and Skins11Add-ons732Documentation283Graphics and Logos36View All Categories
LinuxSecuritySNMPFile SystemCloud
New Listings Recently Updated Listings Most Favored Listings Most Popular Listings Most Rated Listings Most Reviewed Listings
Random Project
Nagios XI Documentation Using The Nagios XI Config Import Prep Tool
0.0 (0)
95.1K
RSS Feed
Newest Listings Updated Listings
Top Contributors
LAMY (7)Julien DESMAREST (6)deskwork_itunes142 (4)Davide Lemma (4)Joerg Hoerter (3)
See More
Newest Contributors
Guillaume8723 (1)Salvo (1)SOHA-IT (1)Tsvetomir Tsvetanov (1)Igor Ru (1)
See More
Home > Felix
F

Felix

@felix_h

User Stats

Favorites0

Views

Projects0

No Projects Found
Powershell NRPE NSClient script for HP SmartArray check

complex; made simpler version

I also had trouble with this script on our servers. In particular, it returned a false "OK" status when I pulled a drive out of the array. I tried debugging it for a bit, but ended up getting frustrated and just rewrote it much shorter: ---- #### # # NAME: check_smartarray.ps1 # # ABOUT: Checks the output of HP's Array Configuration Utility for Smart Array # RAID controllers, and tries to detect any problems with array status. # # This was inspired by Christophe Robert's "Powershell NRPE NSClient # script for HP SmartArray check", found here: # http://exchange.nagios.org/directory/Plugins/Hardware/Server-Hardware/HP-(Compaq)/Powershell-NRPE-NSClient-script-for-HP-SmartArray-check/details # That one seemed a bit complicated, so I shortened it. # # AUTHOR: Felix Howe # # DISCLAIMER: I don't warrant this code as being suitable for anything; # use at your own risk. In writing it I represent only myself, not my employer. # #### $array_config_util = 'C:Program FilesCompaqHpacucliBinhpacucli.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)" } if ($not_OK.length -lt 2) { Write-Host "Array status appears OK" exit 0 } Write-Host "Array status not OK; please check (hint: nagioscheck_smartarray.ps1)" exit 2 ----

Reviewed 12 years ago

No Favorites Found

Copyright © 2009-2025 Nagios Enterprises, LLC. All rights reserved.

Privacy PolicyTerms of UseTrademarks