Monitoring mysql server using nagios as an open-source monitoring tool (1)

Source: Internet
Author: User

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:

 
 
  1. [root@mysql /usr/local/nrpe/libexec]# ./check_mysql -H 192.168.0.102 -u nagios -d nagdb  
  2.  
  3. Uptime: 189145 Threads: 2 Questions: 3501834 Slow queries: 0 Opens: 67 Flush tables: 1 Open tables: 57 Queries per second avg: 18.514  
  4.  

4. Check again from the nagios Server:

 
 
  1. [root@nagios /usr/local/nagios/libexec]# ./check_mysql -H 192.168.0.102 -u nagios -d nagdb  
  2.  
  3. Uptime: 189664 Threads: 2 Questions: 3501836 Slow queries: 0 Opens: 67 Flush tables: 1 Open tables: 57 Queries per second avg: 18.463  
  4.  

After everything is normal, the configuration and test on the mysql server will be completed.


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.