A basic prometheus exporter for HP servers with an ILO controller which uses SNMP (and optionally HTTPS) to attempt to strike a balance between frequency and detail of metrics.
## testing
I have tested this on a single server (my dl380p gen8) with ILO4, as I do not own any other servers with an ILO controller.
It works for me, but might not for you.
## Setting up the ILO
HP does not allow reading SNMP by default, so you need to enable it.
### SNMP
1. Log into your ILO dashboard.
2. Go to **Administration > Management**
3. Under **SNMP Settings** set the **Read community** to whatever you want (but remember it for later!)
4. Click **Apply**
### HTTPS (optional)
1. Log into your ILO dashboard.
2. Go to **Administration > User Administration**
3. Add a new user
- Set the username and password to whatever you want (also remember this)
- I recommend not selecting any permissions, as they are not necessary
## Setting up the exporter
These steps are copied from my notes and detail the general process I go through to install any exporter. They were written to run on Debian 12.
### download
Grab the latest release from the [releases tab](https://github.com/Benjamin-Wiegand/ilo_exporter/releases).
Replace `$DOWNLOAD_URL` with the appropriate download url.
```bash
cd ~
curl $DOWNLOAD_URL -Lo ilo_exporter.tar.gz
# extract
tar -xvf ilo_exporter.tar.gz
rm ilo_exporter.tar.gz
```
### install
create a daemon user and prepare the file structure
*asyncore, a dependency of pysnmp, was removed in python 3.12.*
```bash
sudo pip install pyasyncore
```
#### if also using HTTPS:
```bash
sudo touch /opt/ilo_exporter/ilo_credentials
sudo chmod 0750 /opt/ilo_exporter/ilo_credentials
# replace 'vim' with your editor of choice
sudo vim /opt/ilo_exporter/ilo_credentials
```
Add these contents, making sure to replace `$USERNAME` and `$PASSWORD` with the credentials you picked in step 3 of [HTTPS server setup](#https-optional)
```bash
ILO_USERNAME="$USERNAME"
ILO_PASSWORD="$PASSWORD"
# uncomment and point to an SSL certificate if you have one