Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to use check_mysql to monitor mysql in nagios

2025-03-09 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)05/31 Report--

It is believed that many inexperienced people have no idea about how to use check_mysql to monitor mysql in nagios. Therefore, this paper summarizes the causes and solutions of the problem. Through this article, I hope you can solve this problem.

Nagios monitors the mysql server:

1. Set up a dedicated database:

[root@svr3] # / usr/local/webserver/mysql/bin/mysql-u root-p

Enter password:

Welcome to the MySQL monitor. Commands end with; or\ g.

Your MySQL connection id is 51910

Server version: 5.5.3-m3-log Source distribution

Type 'help;' or'\ h' for help. Type'\ c'to clear the current input statement.

Mysql > create database nagios

Query OK, 1 row affected (0.00 sec)

Mysql > grant select on nagios.* to identified by '123qweasd'

Query OK, 0 rows affected (0.00 sec)

> flush privileges

Query OK, 0 rows affected (0.00 sec)

Mysql > select User,Password,Host from user

+-+

| | User | Password | Host | |

+-+

| | root | * 84BB5DF4823DA319BBF86C99624479A198E6EEE9 | localhost | |

| | nagios | * A1F1CB851D62F002C09A0C9C4A76262473432F55 |% | |

+-+

14 rows in set (0.00 sec)

12 rows in set (0.00 sec)

[root@svr3] # / usr/local/nagios/libexec/check_mysql-H 10.1.1.30-u nagios-d nagios-p 123qweasd

Uptime: 970046 Threads: 1 Questions: 684583 Slow queries: 3 Opens: 672 Flush tables: 1 Open tables:

369 Queries per second avg: 0.705

[root@svr4 nrpe_install] # / usr/local/nagios/libexec/check_mysql-H 10.1.1.30-u nagios-d nagios-p 123qweasd

Uptime: 970348 Threads: 1 Questions: 684584 Slow queries: 3 Opens: 672 Flush tables: 1 Open tables: 369 Queries per second avg: 0.705

Start setting up decisively:

# define users

# define groups and belong to users

# increase in users

Add plug-in commands to command.cfg:

# check mysql

Define command {

Command_name check_mysql

Command_line $USER1 $/ check_mysql-H $HOSTADDRESS$-u nagios-d nagios-p 123qweasd

}

# define services:

Define service {

Host_name svr3.labexam.com

Service_description MysqlDB

Check_period 24x7

Max_check_attempts 2

Normal_check_interval 1

Retry_check_interval 1

Contact_groups sagroup,dbagroup

Notification_interval 5

Notification_period 24x7

Notification_options w,u,c,r

Check_command check_mysql

}

After reading the above, have you mastered how to use check_mysql to monitor mysql in nagios? If you want to learn more skills or want to know more about it, you are welcome to follow the industry information channel, thank you for reading!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report