Troubleshoot Nagios MariaDB check - KeegMitch/Operations-Engineering-group-c GitHub Wiki
Carrying on from the last lab here
As the service appears to not be working, we need to check the config:
This command check below is the same command we put in our nagios service for MariaDB:
/usr/lib/nagios/plugins/check_mysql -H '$HOSTADDRESS$' -u '$ARG1$' -p '$ARG2$' '$ARG3$'
- To do this, log onto your database server and open a MariaDB shell, then run the following SQL statement:
sudo mysql -u root -p
Password is whatever your sudo password is
CREATE USER 'nagios'@'mgmt-c' IDENTIFIED BY 'mypasswd';
GRANT SELECT ON nagiosdb.* to 'nagios'@'mgmt-c' IDENTIFIED BY 'mypasswd';
- Command to see if changes let db-c connect, try restarting mariadb on the db server
/usr/lib/nagios/plugins/check_mysql -H db-c -u nagios -p mypasswd
- Replace the check command in the mariadb service from
config.ppfile to this:check_command => 'check_mysql_cmdlinecred!nagios!mypasswd',
Now the MariaDB critical error is resolved: