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.conffile 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 the total. Set ignorePG to 0. The default is 1. You can also 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 are necessary. Give only the values to change):
DBuser=monitoring
ignorePG=0
DBhost=localhost
With netdata or a similar tool, set ignorePG to 1. Without this setting, the total is wrong on a system with light or moderate usage.
LibreNMS discovers the application automatically, as described at the top of the page. If the discovery fails, do the steps under the SNMP Extend heading at the top of the page.