HP iLO Metrics Exporter

532 詞

HP iLO Metrics Exporter

因為我自己的環境有HP ILO3ILO5,而ILO3沒有 AlertMail 的功能

所以我覺得如果可以透過 Grafana Alerting 來通知我是否異常,這樣更聰明些,所以我做了一點小調整。

原本的套件還是使用Python2.7,我的系統又因為其他套件使用了Python3

所以也一併調整成Python3的語法了。

同時,Grafana的dashboard我也調整過了,沒意外的話應該套用就可以使用了 d(`・∀・)b

我的Github連結:https://github.com/luca-yao/hpilo-exporter

Gauges

Here are the status code of gauge

1
2
3
0 - OK
1 - Degraded
2 - Dead (Other)

Output example

Example of status of your iLO

1
2
3
4
5
6
7
8
9
10
11
12
health_at_a_glance:
battery: {status: OK}
bios_hardware: {status: OK}
fans: {redundancy: Redundant, status: OK}
memory: {status: OK}
network: {status: Link Down},
power_supplies: {redundancy: Redundant, status: OK}
processor: {status: OK}
storage: {status: Degraded}
temperature: {status: OK}
vrm: {status: Ok}
drive: {status: Ok}

The returned output would be:

1
2
3
4
5
6
7
8
9
10
11
12
hpilo_battery{product_name="ProLiant DL360 Gen9",server_name="name.fqdn.domain"} 0.0
hpilo_storage{product_name="ProLiant DL360 Gen9",server_name="name.fqdn.domain"} 1.0
hpilo_fans{product_name="ProLiant DL360 Gen9",server_name="name.fqdn.domain"} 0.0
hpilo_bios_hardware{product_name="ProLiant DL360 Gen9",server_name="name.fqdn.domain"} 0.0
hpilo_memory{product_name="ProLiant DL360 Gen9",server_name="name.fqdn.domain"} 0.0
hpilo_power_supplies{product_name="ProLiant DL360 Gen9",server_name="name.fqdn.domain"} 0.0
hpilo_processor{product_name="ProLiant DL360 Gen9",server_name="name.fqdn.domain"} 0.0
hpilo_network{product_name="ProLiant DL360 Gen9",server_name="name.fqdn.domain"} 2.0
hpilo_temperature{product_name="ProLiant DL360 Gen9",server_name="name.fqdn.domain"} 0.0
hpilo_vrm{product_name="ProLiant DL380 Gen6",server_name="name.fqdn.domain"} 0.0
hpilo_drive{product_name="ProLiant DL380 Gen6",server_name="name.fqdn.domain"} 0.0
hpilo_firmware_version{product_name="ProLiant DL360 Gen9",server_name="name.fqdn.domain"} 2.5

Installing

You can install exporter on the server directly or on separate machine.
To run, you must have Python and pip installed.

To install with pip:

1
pip install -e $HPILO_EXPORTER_DIR

Then just:

1
hpilo-exporter [--address=0.0.0.0 --port=9416 --endpoint="/metrics"]

HPILO is also available on Pypi so it can be installed directly:

1
pip install hpilo-exporter

Docker

Prebuild images are available from the docker repository:

1
idnt/hpilo-exporter:latest

To build the image yourself

1
docker build --rm -t hpilo-exporter .

To run the container

1
docker run -p 9416:9416 hpilo-exporter:latest

You can then call the web server on the defined endpoint, /metrics by default.

1
curl 'http://127.0.0.1:9416/metrics?ilo_host=127.0.0.1&ilo_port=443&ilo_user=admin&ilo_password=admin'

Passing argument to the docker run command

1
docker run -p 9416:9416 hpilo-exporter:latest --port 9416 --ilo_user my_user --ilo_password my_secret_password

Docker compose

Here is an example of Docker Compose deployment:

1
2
3
4
5
6
7
8
9
10
hpilo:
image: my.registry/hpilo-exporter
ports:
- 9416:9416
command:
- '--port=9416'
deploy:
placement:
constraints:
- node.hostname == my_node.domain

Kubernetes

A helm chart is available at prometheus-helm-addons.

Prometheus config

Assuming:

  • the exporter is available on http://hpilo:9416
  • you use same the port,username and password for all your iLO
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
- job_name: 'hpilo'
scrape_interval: 1m
scrape_timeout: 30s
params:
ilo_port: ['443']
ilo_user: ['my_ilo_user']
ilo_password: ['my_ilo_password']
static_configs:
- targets:
- ilo_fqdn.domain

relabel_configs:
- source_labels: [__address__]
target_label: __param_ilo_host
- source_labels: [__param_ilo_host]
target_label: ilo_host
- target_label: __address__
replacement: hpilo:8082 # hpilo exporter.