Commit Graph

8 Commits

Author SHA1 Message Date
Nuno Tavares 0dc14762ef ADD Cachevault_Info.Temp, being a distinct phy component, I think it's worth monitoring (#1268)
Signed-off-by: Nuno Tavares <n.tavares@portavita.eu>
2019-02-21 14:12:45 +01:00
mpursley 7d150d5782 add physical disk "state" to megaraid_pd_info metric (#1226)
Signed-off-by: Matt Pursley <mpursley@gmail.com>
2019-01-31 12:40:37 +01:00
Andreas Wirooks 9c9e17aba7 Handle 'Unknown' as measurement value. (#1113)
We use the output-compatible perccli and storcli.py does not handle 'Unknown' as a result:
```
sg="Error parsing \"/var/lib/node_exporter/perccli.prom\": text format parsing error in line 222: expected float as value, got \"Unknown\"" source="textfile.go:212"
```
I know, the perccli should not return 'Unknown' but this error breaks all other useful measurements because the prom file is not parsable. My if condition fixes this.

Signed-off-by: Andreas Wirooks <andreas.wirooks@1und1.de>
2018-11-23 16:29:56 +01:00
Christopher Blum 1b98db9fa7 textfile example storcli enhancements (#1145)
* storcli.py: Remove IntEnum

This removes an external dependency.
Moved VD state to VD info labels

* storcli.py: Fix BBU health detection

BBU Status is 0 for a healthy cache vault and 32 for a healthy BBU.

* storcli.py: Strip all strings from PD

Strip all strings that we get from PDs.
They often contain whitespaces....

* storcli.py: Add formatting options

Add help text explaining how this documented was formatted

* storcli.py: Add DG to pd_info label

Add disk group to pd_info.
That way we can relate to PDs in the same DG.
For example to check if all disks in one RAID
use the same interface...

* storcli.py: Fix promtool issues

Fix linting issues reported by promtool check-metrics
* storcli.py: Exit if storcli reports issues

storcli reports if the command was a success.
We should not continue if there are issues.

* storcli.py: Try to parse metrics to float

This will sanitize the values we hand over to
node_exporter - eliminating any unforeseen values we read out...

* storcli.py: Refactor code to implement handle_sas_controller()

Move code into methods so that we can now also support HBA queries.
* storcli.py: Sort inputs

"...like a good python developer"
  - Daniel Swarbrick

* storcli.py: Replace external dateutil library with internal datetime

Removes external dependency...

* storcli.py: Also collect temperature on megaraid cards

We have already collected them on mpt3sas cards...

* storcli.py: Clean up old code

Removed dead code that is not used any more.

* storcli.py: strip() all information for labels

They often contain whitespaces...

* storcli.py: Try to catch KeyErrors generally

If some key we expect is not there, we will want to
still print whatever we have collected so far...

* storcli.py: Increment version number

We have made some changes here and there.
The general look of the data has not been changed.

* storcli.py: Fix CodeSpell issue

Split string to avoid issues with Codespell due to Celcius in JSON Key

Signed-off-by: Christopher Blum <zeichenanonym@web.de>
2018-11-07 17:12:23 +01:00
Christopher Blum 6aa5cfba6c textfile example script rework (#1074)
* textfile smartmon.sh

Added functions to also parse megaraid disks.
Added parsing to also detect the grown_defects counters.

* textfile storcli.py

Reworked the example file to export lots more information about
megaraid attached controllers, VDs and PDs.

Signed-off-by: Christopher Blum <christopher.blum@profitbricks.com>
2018-09-18 22:43:20 +02:00
Bruce Lee 8d3484d0ca Update storcli.py (#783) 2018-01-09 09:10:30 +01:00
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