Monitoring HP ProLiant via PowerShell & WMI: Drive Health
Note: This article was originally written in April 2014 and is now over 11 years old. Due to changes in PowerShell, Windows Server, and HP ProLiant hardware/software over time, the described solution may no longer work as written. Please consider this guide as a conceptual reference rather than a current implementation guide.
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 deprecated.
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: [Image removed during migration: Screenshot showing PowerShell ISE window with output from the script displaying disk health status for multiple drives with Port/Box/Bay information and SAS disk identifiers]
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
- Copy the script to Custom Sensors\EXE\XML in your PRTG installation folder. Remember to do this on all probes if you have multiple.
- Add a new sensor of type EXE/Script Advanced Sensor to the device that represents the ProLiant server you wish to monitor.
- Make sure the following sensor settings are configured as per below:
- Parameters: %host
- 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:
Modern Alternatives
Since this post was written in 2014, several better alternatives have emerged:
-
HPE iLO PowerShell Cmdlets: HPE now provides official PowerShell modules for ProLiant management that offer more comprehensive monitoring capabilities. The latest version supports Gen8 through Gen11 servers and uses the Redfish API standard.
-
iLOrest (HPE RESTful Interface Tool): An open-source Redfish client scripting tool available for Windows and Linux that provides advanced server management capabilities.
-
Redfish API: The industry-standard API for modern server management, which is fully implemented in HPE iLO 5 and 6. It’s recommended for new implementations over WMI.
-
OpenManage Essentials/Enterprise: Dell EMC’s management solution that also supports HP hardware in many cases.
-
PowerShell Universal Dashboard: Create interactive dashboards based on PowerShell scripts that can monitor server health.
-
Container-based monitoring solutions: Tools like Prometheus and Grafana can be used to create comprehensive monitoring dashboards with alerting capabilities.
Security Considerations
The original approach has several security aspects to consider:
-
WMI remote access: Requires authentication and firewall considerations that may create security risks if not properly configured. Modern environments often restrict these ports.
-
Credential storage: The original implementation relies on Windows authentication which may have security implications. Modern solutions support more secure credential management methods.
-
Outdated components: The HP WBEM providers mentioned may no longer be maintained or updated. HPE has shifted focus to Redfish API support.
-
Input validation: The script should validate host input to prevent potential command injection.
-
Limited encryption: WMI communications may not be adequately encrypted, potentially exposing sensitive server health information.
-
Access control: Consider implementing additional access controls to restrict who can run these monitoring scripts.
Consider implementing modern security practices when adapting this script for current environments, including secure credential management and validation of all inputs.
Additional Notes for 2025
- PRTG Network Monitor continues to be available with the latest version being 25.1.104.1961 (April 2025).
- SNMP is still technically available in Windows Server, but has remained a deprecated feature since Windows Server 2012.
- For Gen10 and newer servers, HPE no longer provides WBEM providers. The recommended approach is to use the Redfish API via HPE’s PowerShell cmdlets or iLOrest tool.
- WMI-based monitoring is considered legacy and HPE recommends migrating to Redfish API for all server management operations.
- The HPE iLO PowerShell cmdlets module is available from the PowerShell Gallery, making installation and updates much easier than the original approach.