S.M.A.R.T. and partition data exporter for the Prometheus monitoring system
Project description
prometheus-disk-exporter
A prometheus exporter for disk S.M.A.R.T. data and partition usage
information
For security reasons, this script is not supposed to be ran with root
privileges. Instead, the only command which requires these privileges
(smartctl
) is ran using sudo
within getter.sh
. For this reason
the installation step includes adding a sudoers configuration to run
this command without the need of a password for the specified user.
installation
- Install the pip package
python -m pip install prometheus-disk-exporter
- Add sudoers configuration to run
smartctl
without password. Make sure to changeprometheus
to whatever user is set to run the service with systemd, and that this does not create conflicts with other parts of your sudoers configuration.
echo 'prometheus ALL=(ALL:ALL) NOPASSWD: /usr/bin/smartctl' | sudo tee -a /etc/sudoers.d/99-prometheus-disk-exporter
- Create a systemd service
prometheus-disk-exporter.service
for this script. A sample can be found in thesystemd
folder of the repository. - Start and enable the systemd service.
sudo systemctl enable prometheus-disk-exporter.service
sudo systemctl start prometheus-disk-exporter.service
arguments
usage: prometheus_disk_exporter [-h] [--listen-address LISTEN_ADDRESS]
[--listen-port LISTEN_PORT]
options:
-h, --help show this help message and exit
--listen-address LISTEN_ADDRESS, -l LISTEN_ADDRESS
Address for HTTP server to listen on
--listen-port LISTEN_PORT, -p LISTEN_PORT
Port for HTTP server to listen on
- listen-address: Address for HTTP server to listen on (string) (Default: '0.0.0.0')
- listen-port: Port for HTTP server to listen on (int) (Default: 9313)
data structure
partition data (csv)
column | value | example |
---|---|---|
0 | block | /dev/sda1 , |
1 | mountpoint | / , |
2 | filesystem | ext4 , |
3 | used bytes | 1231231232 , |
4 | size bytes | 9999999999 , |
5 | disk serial | WD-W........... |
disk data (csv)
column | value | example |
---|---|---|
0 | block | /dev/sda , |
1 | serial number | WD-W................ , |
2 | model family | Western Digital Blue , |
3 | rotation rate | 7200rpm |
4 | power on hours | 11000 , |
5 | power cycles | 2000 , |
6 | raw read error rate | 0 , |
7 | temperature | 41 |
credits
- prometheus_smart_exporter. if all you are looking for is a SMART data exporter, i highly recommend their implementation
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
Close
Hashes for prometheus-disk-exporter-0.0.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | dabdae410cdcb5c1bec5cfd49ab31451ec2958c3f39f867bae43cc77d7863671 |
|
MD5 | 9174363e497ca29f890f05b15b9a4a43 |
|
BLAKE2b-256 | 376ce401a71423928eece6b22a51d2bbb9720a41a4368ca804b0d203df5fbb49 |
Close
Hashes for prometheus_disk_exporter-0.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ab6c681454e234f9507ce5b3d0268843d14a2e72c46c3c01cbc3d0c9d6057ba8 |
|
MD5 | 087935bbfb927884c90eb832cb276b1e |
|
BLAKE2b-256 | 9d8d7184a8e2337d371872505e85f02e0ca18cb253a7cea36be27024b7915c18 |