Python script that gets *realtime* stats data from server.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
tarteka 45327953ac Actualizar '' 2 years ago
.gitignore first commit 2 years ago Actualizar '' 2 years ago
config-sample.txt first commit 2 years ago
server-stats.png modificar readme, y cambios en la tabla de la BD 2 years ago modificar readme, y cambios en la tabla de la BD 2 years ago

Graphical serve's stats with Python + Postgresql + Grafana

Grafana Stats

Python script that gets realtime stats data from server.


  • Grafana
  • Postgresql server
  • Everything else at the top of!


  1. Create DB user: sudo -u postgres createuser -D -A -P username
  2. Create DB: sudo -u postgres createdb -O username statsdb
  3. Edit config-sample.txt (and rename to config.txt) to specify the hostname of the server you would like to get data from, its DB name and DB user.
  4. Run 'python stats-py' within Python Virtual Environment to test everything is OK. Install all needed packages with 'pip install package'
  5. Use your favourite scheduling method to set ./ to run regularly.
  6. Add the datasource PostgreSQL to your Grafana, configuring Host (usually localhost:5432), Database, User andPassword fields.

Then you could graph your server stats with Grafana's PostgreSQL datasource!

What values can you track in Grafana?

  • CPU % usage
  • Memory size
  • Memory used size
  • Memory % used
  • Disk size
  • Disk free size
  • Disk used size
  • Disk used %
  • Disk IO read bytes
  • Disk IO write bytes
  • Net IO sent bytes
  • Net IO receive bytes