Postgres
SNMP Extend
-
Copy the shell script, postgres, to the desired host
wget https://github.com/librenms/librenms-agent/raw/master/snmp/postgres -O /etc/snmp/postgres -
Make the script executable
chmod +x /etc/snmp/postgres -
Edit your snmpd.conf file and add:
extend postgres /etc/snmp/postgres -
Restart snmpd on your host
-
Install the Nagios check
check_postgres.plon your system: https://github.com/bucardo/check_postgres -
Verify the path to
check_postgres.plin/etc/snmp/postgresis correct. -
(Optional) If you wish to change the DB username (default:
pgsql), enable the postgres DB in totalling (e.g. set ignorePG to 0, default: 1), or set a hostname forcheck_postgres.plto connect to (default: the Unix Socketpostgresqlis running on), then create the file/etc/snmp/postgres.configwith the following contents (note that not all of them need be defined, just whichever you'd like to change):
DBuser=monitoring
ignorePG=0
DBhost=localhost
Note that if you are using netdata or the like, you may wish to set ignorePG to 1 or otherwise that total will be very skewed on systems with light or moderate usage.
The application should be auto-discovered as described at the top of the page. If it is not, please follow the steps set out under SNMP Extend heading top of page.