Server!/Horror! I have a magnet and I don't mind using it!

Relation and Database size for munin

Since we are running into some minor scaling problems at work and Munin doesn't provide the necessary information out of the box I created a small script that let's you see the relation size total relation size and also the database size of a PostgreSQL database.

The necessary information is quite easy to find in the PostgreSQL documentation. And with Python at hand you have a tool that let's you easily create the necessary script, available at my github repository.

The usage is simple just copy the script to a suitable place - personally I'd suggest either a directory under /opt oder /usr/local/bin - as my understanding of the Linux FHS is that this is just the right place.

When you're done make the script executable and symlink it to:

The latter two require to configure munin with at least a PG_DB environment variable so that the relation name is qualified and the functions used in the script will find the relation. The first form should just work.

Get the script here:

Generated: 2017-11-02 10:20:47 +0100