Collect SmartRAID disk state using ssacli utility
Default Path for storcli utility is /opt/smartstorageadmin/ssacli/bin/ssacli
To test the data extraction, the python script collector can be run.
It will output the metrics computed for collected and more detailled info about the disks
python -m collectd_megaraid.collectorTo use with collectd you need collectd-python plugins
LoadPlugin python
<Plugin python>
# Path where python module is located (if cloned, working copy path)
ModulePath "/opt/collectd/collectd-smartraid"
LogTraces true
Interactive false
Import "collectd_smartraid.collectd_plugin"
<Module "smartraid">
Verbose True
</Module>
</Plugin>
The plugin will output 2 metrics
logical_drive_statewith plugin instance = c{controller_slot_id}_d{logical_drive_id}physical_drive_statewith plugin instance = c{controller_slot}d{logical_drive}{disk_ref}
The value of the metric is the logical state (1=OK, 0=Anything else)
Prometheus export will look like this :
collectd_smartraid_gauge{smartraid="c0_d1",type="logical_drive_state",instance="hostname"} 1 1755854414815
collectd_smartraid_gauge{smartraid="c0_d1_1I_1_1",type="physical_drive_state",instance="hostname"} 1 1755854414815
collectd_smartraid_gauge{smartraid="c0_d1_1I_1_2",type="physical_drive_state",instance="hostname"} 1 1755854414815
collectd_smartraid_gauge{smartraid="c0_d1_1I_1_3",type="physical_drive_state",instance="hostname"} 1 1755854414815
collectd_smartraid_gauge{smartraid="c0_d1_1I_1_4",type="physical_drive_state",instance="hostname"} 1 1755854414815