#235: Resolve MariaDB Service Check Failures in Nagios - Rmhibbert/oe2-group-c GitHub Wiki

Step by step

Test the check command manually

Description: command /usr/lib/nagios/plugins/check mysql, passing a host address that is automatically interpolated by Nagios and an optional second argument.

Command: /usr/lib/nagios/plugins/check_mysql -H db-c {538E53F6-FCEF-482B-8F18-674ACA645755}


Connect to database

Description: connect to MariaDB server in the db server

Command: sudo mysql -u root -p


Run the command in MariaDB

Description: Run the command Nagios add user command into MariaDB

Command: GRANT SELECT ON nagiosdb.* TO 'nagios'@'10.2.0.4' IDENTIFIED BY 'mypasswd';

FLUSH PRIVILEGES;

EXIT;


Edit MariaDB configuration file: 50-server.cnf

Description: Find this line: bind-address = 127.0.0.1, change it to: bind-address = 0.0.0.0

Command: sudo nano /etc/mysql/mariadb.conf.d/50-server.cnf


Restart the MariaDB

Description: Restart the MariaDB server after applying the new bind-address

Command: sudo systemctl restart mariadb.service


Run command in management server

Description: run check_mysql to check if the nagios is connect to the MariaDB server

Command: /usr/lib/nagios/plugins/check_mysql -H 10.2.0.4 -u nagios -p mypasswd {B77BA54D-CFCA-4D47-9132-9532BC7AE3C4}


Update the server

Description: Update the code and the server

Command: sudo puppet agent --test


Challenges

Text