Ticket 236 ‐ Resolve MariaDB Service Check Failures in Nagios - SupaHotBall/OE2-Group-D GitHub Wiki
Task
- Diagnose Monitoring Failure:
- Review current Nagios MariaDB check configuration
- Examine service check logs and error messages
- Verify MariaDB server accessibility and credentials
- Implement Fixes per Lab 07.1:
- Update check_mysql command parameters.
- Adjust timeout and retry settings if needed.
- Validate proper database user permissions.cfg.
- Testing & Validation:
- Manually test the updated monitoring configuration.
- Verify successful checks in Nagios web interface.
- Confirm alerting works as expected.
Steps Taken
Check that MariaDB is running on the DB server
systemctl status mariadb
Test the check command manually
/usr/lib/nagios/plugins/check_mysql -H db-d
The output should match the error on the Nagios web interface
Log in to MariaDB shell with the default root user
sudo my sql -u root -p
Run the following command to perform a select query on a nonexistent database which is enough for Nagios check to pass
GRANT SELECT ON nagiosdb.* TO 'nagios'@'13.75.179.27' IDENTIFIED BY 'mypasswd';
Run the command below on the management server (use the same password as the password in the query in mariadb server)
/usr/lib/nagios/plugins/check_mysql -H db-d -u nagios -p rushhour
Edit this line in the puppet module config.pp file. It should pass in the values of the user and the password created earlier
check_mysql_cmdlinecred!nagios!rushhour
Ensure that puppet agent test is ran to apply the configuration everytime the config.pp file is updated
sudo puppet agent --test
Restart the nagios4 service
Verify that the Nagios check is passing
Challenges
The first time a user was created, the db server wouldn't connect still due to permission issues. In order to resolve this, the user was deleted and then recreated and had flush privileges applied to it. After this, connection was successful.
MariaDB server conf file was not configured correctly and this needs to be fixed before proceeding
External Resources
N/A
Ticket Reference
https://rt.dataraster.com/Ticket/Display.html?id=236