librenms / librenms-agent

LibreNMS Agent & Scripts
GNU General Public License v2.0
116 stars 187 forks source link

Adding optional configuration file support to postgres snmp script #437

Closed bnerickson closed 1 year ago

bnerickson commented 1 year ago

I've added configuration file support so that users can more easily update the postgres script on their local systems without worrying about whether doing so will overwrite any custom settings (such as the DBuser). The configuration file is completely optional for backwards-compatibility.

I've also added the ability to specify the hostname for check_postgres.pl to connect to, since connecting to the Unix socket in my case results in authentication failures (the .pgpass file is completely ignored). Specifying the hostname as "localhost" rectifies this issue. The default of connecting to the Unix socket is not changed, however.

Documentation update PR submitted here: https://github.com/librenms/librenms/pull/14627