Prometheus exporter for Sun ALOM statistics
Project description
alom_exporter
This connects to an instance of Sun Advanced Lights-Out Management (ALOM) via SSH and exports metrics about the host system to Prometheus! It has been tested on Sun T1000 and T2000 systems so far- please try it with your system and file a bug if it's not compatible. It is currently focused on showenvironment
metrics: voltage/amperage/temperature, for safety and environmental monitoring. The system running this exporter requires the following:
- python3
- Network access to the management interface of your target server
- Credentials for logging into the target server in a configuration file, like the following:
alom_ssh_address: '192.168.1.231'
alom_ssh_username: admin
alom_ssh_password: changeme
This file is YAML-formatted and is passed to the alom_exporter
script with the -c
/--config
option.
Since the showenvironment
command doesn't require administrative privileges, I'd recommend setting up a dedicated user for alom_exporter to adhere to the principle of least privilege.
For example, here's how to add an unprivileged user to an ALOM console.
sc> useradd exporter
sc> userpassword exporter
New password: *********
Re-enter new password: *********
sc> usershow exporter
Username Permissions Password
exporter ---- Assigned
Make sure the username and password entered at the console match what you entered in the config.yaml
file.
Installation
Install via pip, pip install alom-exporter
- and note the package name uses a dash. The daemon can be invoked with alom_exporter
.
Example
This was generated from example output of a Sun T2000 server. Python metrics are omitted for brevity.
# HELP alom_system_temperature Current temperature of system sensors
# TYPE alom_system_temperature gauge
alom_system_temperature{sensor="PDB/T_AMB"} 24.0
alom_system_temperature{sensor="MB/T_AMB"} 28.0
alom_system_temperature{sensor="MB/CMP0/T_TCORE"} 44.0
alom_system_temperature{sensor="MB/CMP0/T_BCORE"} 44.0
alom_system_temperature{sensor="IOBD/IOB/TCORE"} 43.0
alom_system_temperature{sensor="IOBD/T_AMB"} 29.0
# HELP alom_fan_speed Current speed of cooling fans in RPM
# TYPE alom_fan_speed gauge
alom_fan_speed{sensor="FT0/FM0"} 3586.0
alom_fan_speed{sensor="FT0/FM1"} 3525.0
alom_fan_speed{sensor="FT0/FM2"} 3650.0
alom_fan_speed{sensor="FT2"} 2455.0
# HELP alom_voltage_status Current voltage at sensors across the machine
# TYPE alom_voltage_status gauge
alom_voltage_status{sensor="MB/V_+1V5"} 1.48
alom_voltage_status{sensor="MB/V_VMEML"} 1.79
alom_voltage_status{sensor="MB/V_VMEMR"} 1.78
alom_voltage_status{sensor="MB/V_VTTL"} 0.89
alom_voltage_status{sensor="MB/V_VTTR"} 0.89
alom_voltage_status{sensor="MB/V_+3V3STBY"} 3.39
alom_voltage_status{sensor="MB/V_VCORE"} 1.31
alom_voltage_status{sensor="IOBD/V_+1V5"} 1.48
alom_voltage_status{sensor="IOBD/V_+1V8"} 1.79
alom_voltage_status{sensor="IOBD/V_+3V3MAIN"} 3.36
alom_voltage_status{sensor="IOBD/V_+3V3STBY"} 3.41
alom_voltage_status{sensor="IOBD/V_+1V"} 1.11
alom_voltage_status{sensor="IOBD/V_+1V2"} 1.17
alom_voltage_status{sensor="IOBD/V_+5V"} 5.15
alom_voltage_status{sensor="IOBD/V_-12V"} -12.04
alom_voltage_status{sensor="IOBD/V_+12V"} 12.18
alom_voltage_status{sensor="SC/BAT/V_BAT"} 3.06
# HELP alom_system_load Current system load in amps
# TYPE alom_system_load gauge
alom_system_load{sensor="MB/I_VCORE"} 34.64
alom_system_load{sensor="MB/I_VMEML"} 7.56
alom_system_load{sensor="MB/I_VMEMR"} 6.42
# HELP alom_sensor_status Status of current sensors
# TYPE alom_sensor_status gauge
alom_sensor_status{sensor="IOBD/I_USB0"} 1.0
alom_sensor_status{sensor="IOBD/I_USB1"} 1.0
alom_sensor_status{sensor="FIOBD/I_USB"} 1.0
# HELP alom_power_supply_status Status of power supplies
# TYPE alom_power_supply_status gauge
alom_power_supply_status{supply="PS0"} 1.0
alom_power_supply_status{supply="PS1"} 1.0
# HELP alom_ok Scraping status from ALOM
# TYPE alom_ok gauge
alom_ok 1.0
# HELP alom_system_power System power status
# TYPE alom_system_power gauge
alom_system_power 1.0
Some examples in this repo's test suite are from this official Sun documentation.
License
GPLv3 - a copy is included with this software as LICENSE.txt
We need some type of file logging.
OSError: Socket is closed ^CTraceback (most recent call last): File "/usr/local/lib/python3.7/wsgiref/handlers.py", line 137, in run self.result = application(self.environ, self.start_response) File "/home/delucks/.local/lib/python3.7/site-packages/prometheus_client/exposition.py", line 52, in prometheus_app status, header, output = _bake_output(registry, accept_header, params) File "/home/delucks/.local/lib/python3.7/site-packages/prometheus_client/exposition.py", line 40, in _bake_output output = encoder(registry) File "/home/delucks/.local/lib/python3.7/site-packages/prometheus_client/openmetrics/exposition.py", line 14, in generate_latest for metric in registry.collect(): File "/home/delucks/.local/lib/python3.7/site-packages/prometheus_client/registry.py", line 82, in collect for metric in collector.collect(): File "/home/delucks/.local/lib/python3.7/site-packages/alom/metrics.py", line 57, in collect env = self.connection.showenvironment() File "/home/delucks/.local/lib/python3.7/site-packages/alom/ssh.py", line 89, in showenvironment sent = self.channel.send('showenvironment\n') File "/home/delucks/.local/lib/python3.7/site-packages/paramiko/channel.py", line 801, in send return self._send(s, m) File "/home/delucks/.local/lib/python3.7/site-packages/paramiko/channel.py", line 1198, in _send raise socket.error("Socket is closed") OSError: Socket is closed Traceback (most recent call last): File "/home/delucks/.local/bin/alom_exporter", line 10, in sys.exit(main()) File "/home/delucks/.local/lib/python3.7/site-packages/alom/metrics.py", line 93, in main time.sleep(10) KeyboardInterrupt
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file alom_exporter-0.0.7.tar.gz
.
File metadata
- Download URL: alom_exporter-0.0.7.tar.gz
- Upload date:
- Size: 13.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/3.7.3 pkginfo/1.5.0.1 requests/2.24.0 requests-toolbelt/0.9.1 tqdm/4.50.0 CPython/3.8.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3efeda802af85ebbf03c9c607321742c3b2ba83e5bf08da56321b8e8304a4f7b |
|
MD5 | fc2d49d9cdeaaaf6d3ded44dd07e1fb2 |
|
BLAKE2b-256 | 222eaab8ee77b04e6ad2ce4b6b44287edfaf98b938e3033e3fd9f04c7cf9adf6 |
File details
Details for the file alom_exporter-0.0.7-py3-none-any.whl
.
File metadata
- Download URL: alom_exporter-0.0.7-py3-none-any.whl
- Upload date:
- Size: 22.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/3.7.3 pkginfo/1.5.0.1 requests/2.24.0 requests-toolbelt/0.9.1 tqdm/4.50.0 CPython/3.8.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | fa530a8b3459271e0b6f9373acde1b212b84d4e85c1a8d66bc5bc8dbf4db2b8b |
|
MD5 | 9c10152a7a7c511d1429d7f7514d4e30 |
|
BLAKE2b-256 | 86f2de28dd0c04e077cdb6dba9e037a7089fbae18a9509cd6f8559cb7b6d410a |