Skip to content

Enumerate PERC RAID controller S.M.A.R.T. information remotely. Was made to help fetch information when the system is running ESXi, but can get information from any system running a PERC card.

Notifications You must be signed in to change notification settings

perfectra1n/esxi-perccli-exporter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

(Remote) ESXi PERCCLI Exporter

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.py

in 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 perccli on 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 .vib version of the perccli here, with the driver page (if the previous direct URL didn't work) for it here.
    • You can then use sftp to copy the .vib file over into something like the /tmp directory on the ESXi host.
    • Then install the .vib via esxcli 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 -v argument).
    • You can then validate that the installation worked as expected, by running the following command on the ESXi machine:
/opt/lsi/perccli/perccli /cALL show all J
  • Then you're good to go!

Configuration

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_password

You can change the following values using environment variables:

  • Modify the default port the application exposes by overriding the environment variable PORT. (default value of 10424)
  • Define the path where perccli is stored on the remote machine by overriding PERCCLI_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: 10424

Prometheus Scrape Job

You 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>

About

Enumerate PERC RAID controller S.M.A.R.T. information remotely. Was made to help fetch information when the system is running ESXi, but can get information from any system running a PERC card.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published