Open SourceMonitoringWeaponNagios, Very powerful and easy to use, for example, for monitoringMysqlServer.
Monitoring mysql requires processing in the nagios and mysql servers: Installing nrpe on the mysql server, creating mysql monitoring users, configuring nagios, and creating browser verification accounts with htpasswd. The following is a step-by-step description.
1. Install nrpe on the mysql server.
This operation is basically the same as installing nrpe on the nagios server. The only difference is that the nrpe. cfg file server_address should be changed to the IP address of the mysql server. Start the nrpe service.
2. Create a mysql access user nagios. This account is only used by the nagios monitoring program to access the mysql database. It has nothing to do with other accounts. For the sake of security, the permissions of the account nagios should be very low, and only the select permission of the database should be available. Further, we create an empty database nagdb, and then let the nagios account access this empty database. Then we can test and monitor the mysql database through the check_mysql plug-in.
1. create an empty database (mysql root permission is required): mysql> create database nagdb;
2. Create a mysql account nagios: mysql> GRANT select ON nagdb. * TO 'nagdb @ '% ';
3. Use a plug-in to check the Configuration:
- [root@mysql /usr/local/nrpe/libexec]# ./check_mysql -H 192.168.0.102 -u nagios -d nagdb
-
- Uptime: 189145 Threads: 2 Questions: 3501834 Slow queries: 0 Opens: 67 Flush tables: 1 Open tables: 57 Queries per second avg: 18.514
-
4. Check again from the nagios Server:
- [root@nagios /usr/local/nagios/libexec]# ./check_mysql -H 192.168.0.102 -u nagios -d nagdb
-
- Uptime: 189664 Threads: 2 Questions: 3501836 Slow queries: 0 Opens: 67 Flush tables: 1 Open tables: 57 Queries per second avg: 18.463
-
After everything is normal, the configuration and test on the mysql server will be completed.