https://github.com/ustclug/raid-telegraf
Parse megacli & storcli & ssacli outputs, and can be used in telegraf inputs.exec
https://github.com/ustclug/raid-telegraf
raid-monitoring telegraf
Last synced: 2 months ago
JSON representation
Parse megacli & storcli & ssacli outputs, and can be used in telegraf inputs.exec
- Host: GitHub
- URL: https://github.com/ustclug/raid-telegraf
- Owner: ustclug
- License: mit
- Created: 2021-07-25T07:06:56.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2024-04-11T12:34:08.000Z (over 1 year ago)
- Last Synced: 2025-04-08T02:21:27.819Z (6 months ago)
- Topics: raid-monitoring, telegraf
- Language: Python
- Homepage:
- Size: 26.4 KB
- Stars: 10
- Watchers: 2
- Forks: 4
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# raid-telegraf
Compatible with Python 3.7+ (Latest Python version in Debian 10). No third-party dependencies.
/etc/telegraf/telegraf.d/raid.conf:
```
[[inputs.exec]]
commands = ["sudo /opt/raid-telegraf/main.py --use megacli"]
# or sudo /opt/raid-telegraf/main.py --use storcli
timeout = "30s"
data_format = "influx"
interval = "5m"
```/etc/sudoer:
```
telegraf ALL=(root) NOPASSWD: /opt/raid-telegraf/main.py
```(Or modify `/etc/sudoers.d/telegraf`)
## Supported RAID controller software
- megacli
- storcli
- ssacli (HPE, currently supports single controller only, only physical disk status string)
- mdadm (with smartctl)
- For mdadm, also check [telegraf official mdstat plugin](https://github.com/influxdata/telegraf/tree/master/plugins/inputs/mdstat).## Output
It outputs in influxdb format like this:
```influxdb
raid_telegraf,device=Drive\ /c0/e32/s0 media_error=0,other_error=0,predictive_failure=0,firmware="Online, Spun up",smart_alert="No"
```For ssacli, only "device" and "firmware" are valid, other values will be 0 or "N/A".
## Limitation
- Heavily relies on parsing the output of the RAID controller software.
- More testcase is needed.
- Influxdb format serialization is naive.