As far as I remember LibreNMS determines the data it will record upon first successful check execution.
So if your check output changed after the first run that resulted in “OK…”, LibreNMS won’t pick up on additional data sources and will not store them in services.service_ds in the database.
If that might be the underlying cause in your case, delete the check (and all rrd’s, db entries etc.) and re-add it. Be aware that this means you will lose your historical data.
To be clear: LibreNMS will graph all “perfdata” output from Nagios checks it will find (but as said above, only checks for perfdata ds’es on first succesful run). So maybe you can add the correct output to your postgres check if it is not in the defined format.
I dedicated some time to this today and worked it all out (thanks to your guidance as a starting point).
I also have this problem which no one could answer:
but have been able to work out both issues from your response.
Firstly, the “Backends” was always showing up correctly, I just never realised it at the time.
Secondly, I de-selected the postgres App, then removed the RRD files. I couldn’t work out how to remove db entries etc, couldn’t find anything to remove even when installing phpMyAdmin on it. If you have a document/help on this anywhere, please advise (just for my interest).
I then checked the /etc/snmp/postgres script, which calls the Nagios check_postgres.pl script, and noticed that the Nagios script allows for multiple ports to be included on the ports line, so I changed the top of the postgres script to be:
#make sure the paths are right for your system
$cpg -u $DBuser -p 5598,5599 --action dbstats | awk -F ' ' '
Notice the important part there is “-p 5598,5599” which must be added to the script. This is nowhere to be found in any documentation but the Nagios script supports multiple ports to be defined there, therefore supplying access to all the DB’s. This should be added to the LibreNMS docs so it can help others.
Then I waited 5 minutes for the poll to finish, then I re-added the entry into /etc/snmp/snmpd.conf and re-enabled in LibreNMS, then waited.
The script was then able to see all databases, and pull the right metrics for each.
Very happy. I’ll update the other case with the same reference to this case for solved status.