I have been trying to enable the MySQL application on my LibreNMS server but no data is being loaded into RRD. I have tried to run the /etc/snmp/mysql script manually, but got this error:
[email protected]:/etc/snmp# ./mysql
ERROR: No such file or directory
I really don’t know anything about PHP to debug this error, could anyone with more experience give me a hand with fixing this?
“”
Unlike most other scripts, the MySQL script requires a configuration file mysql.cnf in the same directory as the extend or agent script with following content:
is your snmpd running as root?
in my /var/cache/librenms/ all files have owner and group in which snmpd is running
also /var/cache/librenms directory is owned by snmpd user, which isn’t
i opened /var/cache/librenms up to 775 so snmpd user and root is able to do all stuff in it
you’ve got in /etc/snmp/ mysql script with 755 as mode and owned by root or snmpd user
also you’ve got there: mysql.conf with login credentials to mysql server in it and it has also mode 755 and is owned by snmpd user?
then you’ve got /var/cache/librenms directory which is owned by snmpd user
also you run yum install php-cli php-mysql
to verify needed packages are installed
what says syntax error check: php -l /etc/snmp/mysql
and php -l /etc/snmp/mysql.cnf
?
your root access to database is password secured, so those credentials are matching?
Package php-cli-7.2.33-1.el7.remi.x86_64 already installed and latest version
Package php-mysql-5.4.16-48.el7.x86_64 is obsoleted by php-mysqlnd-7.2.33-1.el7.remi.x86_64 which is already instaled
Syntax check:
[email protected]:/etc/snmp# php -l /etc/snmp/mysql
No syntax errors detected in /etc/snmp/mysql
[email protected]:/etc/snmp# php -l /etc/snmp/mysql.cnf
No syntax errors detected in /etc/snmp/mysql.cnf
[email protected]:/etc/snmp#
[email protected]:/etc/snmp# mysql -uroot -proot
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 94189
Server version: 5.5.65-MariaDB MariaDB Server
Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
MariaDB [(none)]>