1 Setup HPE RAID Monitoring SSACLI for Zabbix Agent2 ( setup_zabbix-agnet2-hpe-raid-monitoring.yaml)
Tobias Pries edited this page 2026-03-09 07:28:28 +00:00

HPE RAID Monitoring Setup with Automatic Slot Detection

1. Overview

This Ansible playbook automates the deployment of the HPE Smart Storage Administrator CLI (ssacli) and integrates hardware RAID monitoring into Zabbix Agent 2.

A key feature of this playbook is Automatic Slot Detection: it identifies the hardware RAID controller's slot number dynamically, ensuring compatibility across different HPE ProLiant models (e.g., DL360, DL380, ML series) without manual configuration.


2. How to Use

You can download and execute this playbook directly from the Git repository.

Download the Playbook

Use either curl or wget to fetch the YAML file:

Using curl:

curl -O [https://git.netguide.io/t.pries/ansible-playbooks/raw/branch/main/setup_zabbix-agnet2-hpe-raid-monitoring.yaml](https://git.netguide.io/t.pries/ansible-playbooks/raw/branch/main/setup_zabbix-agnet2-hpe-raid-monitoring.yaml)

Using wget:

wget [https://git.netguide.io/t.pries/ansible-playbooks/raw/branch/main/setup_zabbix-agnet2-hpe-raid-monitoring.yaml](https://git.netguide.io/t.pries/ansible-playbooks/raw/branch/main/setup_zabbix-agnet2-hpe-raid-monitoring.yaml)

Run the Playbook

Execute the playbook against your inventory (replace your_inventory.ini and target_group accordingly):

ansible-playbook -i your_inventory.ini setup_zabbix-agnet2-hpe-raid-monitoring.yaml --become --ask-become-pass

3. Key Features

  • Dynamic Slot Detection: Automatically finds the RAID controller slot (e.g., Slot 0, 1, or 3).
  • Automatic Repo Management: Adds the HPE Management Component Pack (MCP) for the specific Ubuntu release (e.g., Focal, Jammy).
  • Security (Least Privilege): Grants the zabbix user passwordless sudo access only to the ssacli binary.
  • Safe Execution: The playbook will fail gracefully if no physical HPE controller is detected (e.g., when run on a VM).

4. Technical Breakdown

Step 1: Repository & Keys

The playbook imports the required HPE GPG keys and adds the official HPE SDR repository to /etc/apt/sources.list.d/hp-mcp.list.

Step 2: Slot Detection Logic

It runs ssacli ctrl all show and parses the output to find the active controller slot. This value is used to populate the Zabbix configuration file.

Step 3: Permissions

A sudoers snippet is created at /etc/sudoers.d/zabbix-ssacli:

Cmnd_Alias ZBX_SSACLI=/usr/sbin/ssacli
zabbix ALL=(root) NOPASSWD: ZBX_SSACLI

Step 4: Zabbix UserParameters

The file /etc/zabbix/zabbix_agent2.d/hpe-raid.conf is created with the following monitoring keys:

Key Description
hpe.raid.failed Counts physical drives that are NOT "OK".
hpe.raid.predictive Counts drives reporting a "Predictive Failure".
hpe.raid.ld_bad Counts logical drives that are NOT "OK".

5. Validation & Alarm Testing

Verify Configuration

Check the generated file to see which slot was detected:

cat /etc/zabbix/zabbix_agent2.d/hpe-raid.conf

Manual Permission Check

Test if the zabbix user can fetch RAID data:

sudo -u zabbix sudo /usr/sbin/ssacli ctrl all show status

Simulated Alarm Test

To ensure the Zabbix Frontend triggers correctly:

  1. Open /etc/zabbix/zabbix_agent2.d/hpe-raid.conf.
  2. Find the test section and uncomment: UserParameter=hpe.raid.failed,echo 1.
  3. Restart the agent: systemctl restart zabbix-agent2.
  4. Check Zabbix "Latest Data". If the value is 1, the monitoring chain is working.
  5. Revert the changes and restart the agent again after testing.

6. Requirements

  • OS: Ubuntu (Focal 20.04, Jammy 22.04, or newer).
  • Hardware: Physical HPE ProLiant server.
  • Service: Zabbix Agent 2 must be installed.