Commit Graph

2 Commits

Author SHA1 Message Date
Mario Trangoni a40f7e78da StorCli text collector: fix pylint issues and handle StorCli not installed (#758)
* StorCli text collector: fix pylint issues and handle StorCli not installed

* StorCli text collector: Add HELP and TYPE strings.
2017-12-12 18:48:06 +01:00
Matt Bostock 2c02571040 Add StorCli text collector example script
Collect metrics from the StorCLI utility on the health of MegaRAID
hardware RAID controllers and write them to stdout so that they can be
used by the textfile collector.

We parse the JSON output that StorCLI provides.

Script must be run as root or with appropriate capabilities for storcli
to access the RAID card.

Designed to run under Python 2.7, using the system Python provided with
many Linux distributions.

The metrics look like this:

    mbostock@host:~$ sudo ./storcli.py
    megaraid_status_code 0
    megaraid_controllers_count 1
    megaraid_emergency_hot_spare{controller="0"} 1
    megaraid_scheduled_patrol_read{controller="0"} 1
    megaraid_virtual_drives{controller="0"} 1
    megaraid_drive_groups{controller="0"} 1
    megaraid_virtual_drives_optimal{controller="0"} 1
    megaraid_degraded{controller="0"} 0
    megaraid_battery_backup_healthy{controller="0"} 1
    megaraid_ports{controller="0"} 8
    megaraid_failed{controller="0"} 0
    megaraid_drive_groups_optimal{controller="0"} 1
    megaraid_healthy{controller="0"} 1
    megaraid_physical_drives{controller="0"} 24
    megaraid_controller_info{controller="0", model="AVAGOMegaRAIDSASPCIExpressROMB"} 1
    mbostock@host:~$
2016-12-22 22:55:58 +00:00