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 'README.md' 2 months ago
.gitignore first commit 4 months ago
README.md Actualizar 'README.md' 2 months ago
config-sample.txt first commit 4 months ago
server-stats.png modificar readme, y cambios en la tabla de la BD 4 months ago
stats.py modificar readme, y cambios en la tabla de la BD 4 months ago

README.md

Graphical serve’s stats with Python + Postgresql + Grafana

Grafana Stats

Python script that gets realtime stats data from server.

Dependencies

  • Grafana
  • Postgresql server
  • Everything else at the top of stats.py!

Usage:

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