This is another Prometheus exporter, but is meant to target machines running ESXi that have a PERC RAID controller. This essentially leverages the storcli.py textfile collector's functionality, but does so over sshpass. It's scuffed, I know, but it works. I couldn't find anything else that allowed me to fetch the RAID controller's metrics (even if it was just some SMART data).
This tool relies on installing perccli on the ESXi machine as a .vib, and then the exporter SSHs into the machine to run the command /opt/lsi/perccli/perccli /cALL show all J to gather the JSON the command outputs, and then exposes the information for Prometheus to scrape on /metrics.
You can also find a Dockerfile in this repository if you would like to create a container out of it for yourself. Or you can fetch it via:
docker pull perfectra1n/esxi-perccli-exporter:latest
Otherwise, you can run:
cd esxi-perccli-exporter/
pip install -r requirements.txt
python main.pyin order to just run the exporter on 10424. You'll probably need to set the CONFIG_FILE_PATH environment variable to the path where your config is stored, though.
You'll need the following:
- Enable remote SSH on the ESXi hosts
- Install
percclion the remote machine. You can download it here, or you can find the driver page (if the previous direct URL didn't work) for it here.- For ESXi, you can find the
.vibversion of thepercclihere, with the driver page (if the previous direct URL didn't work) for it here. - You can then use
sftpto copy the.vibfile over into something like the/tmpdirectory on the ESXi host. - Then install the
.vibviaesxcli software vib install -v=/tmp/vmware-perccli-007.1327.vib --force --maintenance-mode --no-sig-check(make sure you use the correct filename, and provide the full path to the file in the-vargument). - You can then validate that the installation worked as expected, by running the following command on the ESXi machine:
- For ESXi, you can find the
/opt/lsi/perccli/perccli /cALL show all J- Then you're good to go!
Here's an example of the config.yml you'll need to create.
targets:
server1:
username: root
password: esxi_root_password
server2:
username: root
password: esxi_root_passwordYou can change the following values using environment variables:
- Modify the default port the application exposes by overriding the environment variable
PORT. (default value of10424) - Define the path where
perccliis stored on the remote machine by overridingPERCCLI_FILE_PATH. (default value of/opt/lsi/perccli/perccli) - Modify the location of the configuration file via the variable
CONFIG_FILE_PATH. (default value/etc/prometheus/config.yml)
Below is a list of the environment variables that you can change, and their defaults:
CONFIG_FILE_PATH: "/etc/prometheus/config.yml"
PERCCLI_FILE_PATH: "/opt/lsi/perccli/perccli"
PORT: 10424You can use the following Prometheus scrape job entry as a basis for your own:
- job_name: "perccli-metrics"
static_configs:
- targets:
- server1
- server2
- server3
metrics_path: /metrics
relabel_configs:
- source_labels: [__address__]
target_label: __param_target
- source_labels: [__param_target]
target_label: instance
- target_label: __address__
replacement: <real_ip_of_exporter>:<real_port_of_exporter>