NagiOS-Monitor MySQL/MariaDB Using check_mysql Plugin CentOS 7

Linuxtopic
3



NagiOS-Monitor MySQL/MariaDB Using check_mysql Plugin CentOS 7 nagios toturial, nagios monitoring tool, server monitoring, host & service monitor,  nagios installation, nagios core,nagios plugin , nagios configuration, nagios latest version



Configure Steps on Client Machine :





Step 1:





Install Dependency


yum install perl-DBI perl-DBD-MySQL perl-GD


Step 2:







Method 1:





Check Plugin "check_mysql”  in “/usr/lib/nagios/plugins/” if did’nt found





Install nagios-plugins*


yum install nagios-plugins*


OR




Method 2:


Download “check_mysql” from “https://exchange.nagios.org/directory/Plugins/Databases/MySQL

Or

https://exchange.nagios.org/components/com_mtree/attachment.php?link_id=174&cf_id=24


keep it on "/usr/lib/nagios/plugins/"


chmod +x /usr/lib/nagios/plugins/check_mysqld.pl






Step 3:





Create Database User of Monitor


mysql -u root –p


mysql> grant select on mysql.* to nagios@172.17.20.103 identified by 'password';


mysql> flush privileges;


Step 4:





Go to Nagios Server





## Add Service on webserver.linuxtopic.cfg


vi /usr/local/nagios/etc/servers/webserver.linuxtopic.cfg


define service{


       use                           generic-service         ; Inherit default values from a template


       host_name               webserver.linuxtopic.com


       service_description  MySQL


       check_command      check_mysqld


       check_interval          1


       retry_interval            1


       }





NagiOS-Monitor MySQL/MariaDB Using check_mysql Plugin CentOS 7 nagios toturial, nagios monitoring tool, server monitoring, host & service monitor,  nagios installation, nagios core,nagios plugin , nagios configuration, nagios latest version





Step 5:





### commands.cfg


vi /usr/local/nagios/etc/objects/commands.cfg


define command{


   command_name   check_mysqld


   command_line      $USER1$/check_mysql -H $HOSTADDRESS$ -u nagios -ppassword -f -T -a uptime,threads_connected,questions,slow_queries,open_tables -w ",,,," -c ",,,,"


}





mysql_check-command.png





Step 6:





Check plugin “check_mysql” if not found copy from “172.17.20.103” and keep on “/usr/local/nagios/libexec/”


rsync -ave 'ssh -p22' root@172.17.20.103:/usr/lib64/nagios/plugins/check_mysql /usr/local/nagios/libexec/


mysql_check-rsysnc.png





Step 7:





Test Mysql_check Plugin



cd /usr/local/nagios/libexec

./check_mysql -H 172.17.20.103 -u nagios -ppassword






mysql_check-test.png





Restart Nagios Service


   


systemctl restart nagios





Step 7:





Check on Nagios on Web Browser.





http://172.17.20.100/nagios







NagiOS-Monitor MySQL/MariaDB Using check_mysql Plugin CentOS 7 nagios toturial, nagios monitoring tool, server monitoring, host & service monitor,  nagios installation, nagios core,nagios plugin , nagios configuration, nagios latest version






Post a Comment

3Comments

  1. Great article. Thanks for updating this.

    ReplyDelete
  2. Ever wondered how a baby Best Monitor can help you look after your newborn baby in the early weeks and months? Our article will introduce one of the most useful baby monitors out there, the baby breathing monitor.

    ReplyDelete
Post a Comment

#buttons=(Ok, Go it!) #days=(20)

Our website uses cookies to enhance your experience. Check Now
Ok, Go it!