Monitor PostgreSQL database age with telegraf

PostgreSQL is amazing database but has one very problematic feature which can be disastrous. This problem is called transaction ID wraparound error. We already had one problem of this kind so we set monitoring for it. The easiest way is to monitor “age of...

Monitor PostgreSQL heartbeat with telegraf

The easiest way how to monitor if PostgreSQL is up and running without causing any necessary load on database is to connect and get just pid of the session using command select pg_backend_pid(); – this is very lightweight action. I set this monitoring using...

Monitor PostgreSQL queries in Grafana

To be able to monitor PostgreSQL queries under non superuser you need to create some objects as superuser and grant select permissions to your monitoring user. Solution based on “How to view the query of another session in pg_stat_activity without being super...

Grafana – redirect port 3000 to 80

If you need / want to redirect Grafana from port 3000 to 80 (for example when you use subdomain to call Grafana) the easiest way to do it is by rerouting on OS level: iptables -t nat -A PREROUTING -p tcp --dport 80 -j REDIRECT --to-port 3000   Links: Redirect...

Monitor ftp with telegraf

I use this simple monitoring of our ftp server. vsftpd service health monitoring: bash script: #!/bin/bash service vsftpd status > /dev/null 2>&1;echo "{ \"ftp_health_error\": $? }" configuration in telegraf: [[inputs.exec]]...