Monitoring HP ProLiant via PowerShell & WMI: Drive Health

This is the first in a series of posts about monitoring HP ProLiant system health via PowerShell and WMI.

I chose to implement this as an alternative to SNMP since SNMP support in Windows Server is being EOL’ed.

These scripts were written to be used in conjunction with PRTG Network Monitor, but they can just as easily be adapted to display the information in a table by un-commenting a single line.

This functionality depends on the HP Insight Management WBEM providers being installed on the monitored server. The account you’re running the script as will also need permission to do remote WMI queries against the server in question.

Running the script in standalone mode will result in the following output:
2014-04-09 11_07_24-Windows PowerShell ISE

Out of the box, the script will output the data in XML as needed by PRTG:

<prtg>
    <result>
        <channel>Port:1I Box:1 Bay:1 - SAS Disk P4W89D4A</channel>
        <value>2</value>
    </result>
    <result>
        <channel>Port:1I Box:1 Bay:2 - SAS Disk P4WA9UUA</channel>
        <value>2</value>
    </result>
    <result>
        <channel>Port:1I Box:1 Bay:3 - SAS Disk P4XWYJSA</channel>
        <value>2</value>
    </result>
    <result>
        <channel>Port:1I Box:1 Bay:4 - SAS Disk P4XX08ZA</channel>
        <value>2</value>
    </result>
    <result>
        <channel>Port:2I Box:1 Bay:5 - SAS Disk P4VX5AVA</channel>
        <value>2</value>
    </result>
    <result>
        <channel>Port:2I Box:1 Bay:6 - SAS Disk P4W9Y78A</channel>
        <value>2</value>
    </result>
</prtg>

Setting up the script for PRTG

  1. Copy the script to Custom SensorsEXEXML in your PRTG installation folder. Remember to do this on all probes if you have multiple.
  2. Add a new sensor of type EXE/Script Advanced Sensor to the device that represents the ProLiant server you wish to monitor.
  3. Make sure the following sensor settings are configured as per below:
    1. Parameters: %host
    2. Security Context: ‘Use Windows credentials of parent device’

The script is configured to put the entire sensor into an error state if there’s a problem with one of the channels. It will also set the sensor message to indicate which disk is experiencing the problem.

Here’s the script:

https://gist.github.com/dstreefkerk/10224178.js

One thought on “Monitoring HP ProLiant via PowerShell & WMI: Drive Health

  1. Pingback: Monitoring HP ProLiant via PowerShell & WMI: Temperature Sensors | User Error

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s