MYSQL Monitor - no data

Couple of questions. First I have both the SNMP & Unix agent installed and running, SNMP has the extend, and can test successfully from the host OS (Oracle v8). On LibreNMS both Mysql app and Unix-agent are enabled. Firewall port is opened for agent, agent & snmpd are set to start at load and current status is active. Problem though is no data is going into the database. Counters are all 0.

So my first question is where should I look next to find the answer. I do not know of any means to test from the Librenms server the poll for either SNMP or agent. I did look at running ./poller.php -v -h db with no success or information to lead me to resolution.

Next and last question, the purpose of adding the app was to monitor and set an alarm for the connection count. I think (not sure) that from agent side it is the “bi:” field, though have not looked into it further. From the Librenms db side what table would this go into?

Is your mysql script currently setup as an snmp extend or in the agent on the MySQL server?

If agent, I would first trying telnet-ing to the unix-agent port on the MySQL server from your LibreNMS server. Should be port 6556. Hopefully you see <<<mysql>>> followed by all the keys in the agent output.

If so, trying running the poller against it.
./poller.php -h [DEVICE ID] -v -d -r -f -p -m unix-agent,applications

Similarly if it’s currently using the snmp extend. Try to snmpget . on the MySQL server from the LibreNMS server. Hopefully you see the stats.

If so, trying running the poller against it.
./poller.php -h [DEVICE ID] -v -d -r -f -p -m applications

In the LibreNMS DB, it should show up in the application_metrics table if working. Unfortunately, I don’t think it will maintain “bi” in the DB. I think it’s mapped to yet another value…

Thank you slashdoom for the reply, little bit closer now.

First the telnet worked, and output was everything I was looking for. Next I tried
./poller.php -h d1 -v -d -r -f -p -m unix-agent,applications
And that worked, it appears everything showed up.

Next I tried
./poller.php -h d1 -v -d -r -f -p -m applications
That worked but showed nothing for Mysql (I assume this skips agent and uses the SNMP extend)

Last I ran snmpget and got the following:

PHP Warning:  fopen(/var/cache/librenms/agent-local-mysql): failed to open stream: Permission denied in /etc/snmp/mysql on line 277
ERROR: Permission denied

This was for section # First, check the cache, removing that section ends up with “ERROR: Permission denied”

So, ultimately what I want to get is the poll from Mysql into the Librenms database so I can create an alarm event for when the connection counts exceeds certain value. Since I do not care how this gets polled, i.e. should I A.) disable SNMP polling with the Unix-Agent enabled or B.) remove db server and re-add without SNMP but enable applications & Unix-Agent?

Solved the problem, it was my old friend SELinux that had stopped by for a visit and decided to not allow SNMP to run the mysql script. DOH!

1 Like