After you install MySQL, you need to monitor the MySQL service.
Nagios Open source Check_mysql is good for MySQL's slave machine monitoring. However, the database host monitoring is slightly inadequate. Use a monitoring plugin: Check_mysql_health download and use the method see:http://exchange.nagios.org/directory/MySQL/check_mysql_health/detailsSpecific monitoring: For slave machines, use Nagios's own check_mysql monitoringcommand[check_mysql_slave]=/usr/local/nagios/libexec/check_mysql-h localhost-s/tmp/mysql.sock-uRoot- PXXX-s-w 1-c 3 Where the user and password are subject to change. Delay 1 seconds warning, delay 3 seconds alarm. Check_mysql_health monitoring MySQL master server/usr/local/nagios/libexec/custom/check_mysql_health--hostname localhost--socket/tmp/mysql.sock--usernameRoot--passwordxxxxxx--modexxxxx--warningxxxxx--criticalxxxxxMode:
Connection-time (time to connect to the server)
Uptime (time the server is running)
threads-connected (number of currently open connections)
Threadcache-hitrate (thread cache hit rate)
Slave-lag (Seconds behind Master)
slave-io-running (slave io running:yes)
slave-sql-running (Slave sql Running:yes)
Qcache-hitrate (query hit rate, if this value is close to 100%, the better the server select is optimized)
Qcache-lowmem-prunes (because of small memory, the number of cache queries removed from memory, you can increase query_cache_size, reduce lowmem, increase hit rate optimization)
Keycache-hitrate (MyISAM key cache hit rate, if the hit rate is too low, increase key_buffer_size)
Bufferpool-hitrate (InnoDB buffer pool hit rate)
Bufferpool-wait-free (InnoDB buffer pool waiting for cleanup page)
Log-waits (InnoDB log waits for write time, if this wait time is too large, increase the log buffer pool size)
Tablecache-hitrate (Table cache Hit rate)
Table-lock-contention (lock rate of Table)
Index-usage (index usage, the larger the index, the better the indexes, the smaller the index optimization)
Tmp-disk-tables (number of temporary table creation)
Slow-queries (slow query is the ratio of all queries, this value is high if the MySQL database is not optimized)
Long-running-procs (long running process)
cluster-ndbd-running (MySQL cluster monitoring)
SQL (executes a SQL that returns a number to check if MySQL can link the query)
Example: nrpe.cfg:command[check_mysql_health]=/usr/local/nagios/libexec/custom/check_mysql_health--hostname localhost--socket /tmp/mysql.sock--usernamexxxxx--passwordxxxxx--mode $ARG 1$--warning $ARG 2$--critical $ARG 3$Xxx.cfg:define service{Use xxxxxxhost_name xxxxxxservice_description MySQL database connection numberCheck_command check_nrpe_args!check_mysql_health!threads-connected!80!120} define service{Use xxxxxhost_name xxxxxservice_description MySQL database innodb cache hitCheck_command check_nrpe_args!check_mysql_health!bufferpool-hitrate}define service{Use xxxxxhost_name xxxxxservice_description MySQL database innodb buffer pool waiting for cleanup pageCheck_command Check_nrpe_args!check_mysql_health!bufferpool-wait-free}define service{Use xxxxxhost_name xxxxxservice_description MySQL Database innodblog write wait timeCheck_command check_nrpe_args!check_mysql_health!log-waits}define service{Use xxxxxhost_name xxxxx service_description MySQL Database lock exampleCheck_command check_nrpe_args!check_mysql_health!table-lock-contention}define service{Use xxxxx host_name xxxxxservice_description MySQL Database open file numberCheck_command check_nrpe_args!check_mysql_health!open-files!80!90}define service{Use xxxxx host_name xxxxxservice_description MySQL Database slow query rateCheck_command check_nrpe_args!check_mysql_health!slow-queries!5!10}Get.PS: The value of warnging and critical: 10 is greater than 10% alarm, 10: is less than 10% alarm, not fill is the default value. mode A statement can only one, --mode xxx1 xxx2:xxx1 effective--mode xxx1--mode xxx2:xxx2 effective
Monitor MySQL various options