Code Monkey home page Code Monkey logo

prometheus-smartctl's Introduction

Prometheus S.M.A.R.T ctl metrics exporter

build

This is a simple exporter for the Prometheus metrics using smartctl. The script smartprom.py also comes with smartprom.service so that you can run this script in the background on your Linux OS via systemctl. The script will use port 9902, you can change it by changing it directly in the script. This script exports all of the data available from the smartctl.

Docker image here: https://hub.docker.com/r/matusnovak/prometheus-smartctl

Running under Systemd services

  1. Install smartctl
yum install smartmontools -y
  1. Clone project
git clone https://github.com/uncelvel/prometheus-smartctl
cd prometheus-smartctl
  1. Copy the smartprom.service file into /etc/systemd/system folder.
cp smartprom.service /etc/systemd/system
  1. Copy the smartprom.py file anywhere into your system.
cp smartprom.py /usr/sbin/
chmod +x /usr/sbin/smartprom.py
  1. Install prometheus_client for the root user
yum install python3 -y 
sudo -H python3 -m pip install prometheus_client
  1. Run
systemctl enable smartprom
systemctl start smartprom
  1. Your metrics will now be available at
http://localhost:9902

Docker usage

No extra configuration needed, should work out of the box. The privileged: true is needed because then smartctl can't access drvies from the host.

version: '3'
services:
  smartctl-metrics:
    image: matusnovak/prometheus-smartctl:latest
    restart: unless-stopped
    privileged: true
    ports:
      - 9902:9902

Your metrics will be available at http://localhost:9902/metrics

prometheus-smartctl's People

Contributors

matusnovak avatar stemid avatar m1k1o avatar uncelvel avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.