MariaDB/MySQL health plugin for Nagios Core?
MariaDB/MySQL health plugin for Nagios Core?
Perhaps this has been asked several times in the past but I can't find the right answer so if any could point me on the right direction for find a good and recommended MySQL/MariaDB health I will be very graceful. As an additional request and perhaps could be fine (if already doesn't exists) a index page or some place where sort this kind of information for newbies like me.
Thanks in advace
Thanks in advace
- Box293
- Too Basu
- Posts: 5126
- Joined: Sun Feb 07, 2010 10:55 pm
- Location: Deniliquin, Australia
- Contact:
Re: MariaDB/MySQL health plugin for Nagios Core?
This one is pretty popular:
https://exchange.nagios.org/directory/M ... th/details
https://exchange.nagios.org/directory/M ... th/details
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Re: MariaDB/MySQL health plugin for Nagios Core?
I have compiled the plugin by running the following commands:Box293 wrote:This one is pretty popular:
https://exchange.nagios.org/directory/M ... th/details
Code: Select all
./configure --with-nagios-group=nagcmd
make
make install
Code: Select all
chown nagios:nagios check_mysql_healthCode: Select all
check_mysql_health --hostname localhost --username nagios --password 'xxxxxxxx' --mode connection-time
bash: check_mysql_health: command not found
- Box293
- Too Basu
- Posts: 5126
- Joined: Sun Feb 07, 2010 10:55 pm
- Location: Deniliquin, Australia
- Contact:
Re: MariaDB/MySQL health plugin for Nagios Core?
Make sure you pre-pend the command with ./ (if you are in /usr/local/nagios/libexec) or /usr/local/nagios/libexec/
Code: Select all
./check_mysql_health --hostname localhost --username nagios --password 'xxxxxxxx' --mode connection-time
/usr/local/nagios/libexec/check_mysql_health --hostname localhost --username nagios --password 'xxxxxxxx' --mode connection-timeAs of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Re: MariaDB/MySQL health plugin for Nagios Core?
I got this almost done but something else is failing.
I've tried also to install the module by running:
But it fails (logs are huge for post here)
Can you help me?
Code: Select all
./check_mysql_health --hostname localhost --username nagios --password 'xxxxx' --mode connection-time
CRITICAL - cannot connect to information_schema. install_driver(mysql) failed: Can't locate DBD/mysql.pm in @INC (@INC contains: . /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5) at (eval 18) line 3.
Perhaps the DBD::mysql perl module hasn't been fully installed,
or perhaps the capitalisation of 'mysql' isn't right.
Available drivers: DBM, ExampleP, File, Gofer, Proxy, SQLite, Sponge.
at ./check_mysql_health line 1955
Code: Select all
cpan DBD::mysql
Can you help me?
- Box293
- Too Basu
- Posts: 5126
- Joined: Sun Feb 07, 2010 10:55 pm
- Location: Deniliquin, Australia
- Contact:
Re: MariaDB/MySQL health plugin for Nagios Core?
Code: Select all
yum -y install perl-DBD-MySQLAs of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Re: MariaDB/MySQL health plugin for Nagios Core?
I've compiled the plugin and get it working by running some tests as for example the command below:Box293 wrote:Code: Select all
yum -y install perl-DBD-MySQL
Code: Select all
check_mysql_health --hostname localhost --username nagios --password xxxxxxxxx --mode connection-timeCode: Select all
define service{
use local-service ; Name of service template to use
host_name localhost
service_description MariaDB
check_command check_mysql_health
notifications_enabled 1
}
Code: Select all
# 'check_mysql_health' command definition
define command{
command_name check_mysql_health
command_line $USER1$/check_mysql_health --hostname $HOSTNAME$ --username $USERNAME$ --password $PASSWORD$
}
But what is the right way to use this on the service|command definition? Can any give me some example of this and tell me also where I should write those values? Meaning current hostname, username and mysql user passwordThe environment variables are:
NAGIOS__SERVICEMYSQL_HOST (_mysql_host in the service definition)
NAGIOS__SERVICEMYSQL_USER (_mysql_user in the service definition)
NAGIOS__SERVICEMYSQL_PASS (_mysql_pass in the service definition)
NAGIOS__SERVICEMYSQL_PORT (_mysql_port in the service definition)
NAGIOS__SERVICEMYSQL_SOCK (_mysql_sock in the service definition)
- Box293
- Too Basu
- Posts: 5126
- Joined: Sun Feb 07, 2010 10:55 pm
- Location: Deniliquin, Australia
- Contact:
Re: MariaDB/MySQL health plugin for Nagios Core?
Define your command like this:
Define your service like this:
The ! in the check_command in the service separate $ARG1$, $ARG2$, $ARG3$
Does this make sense?
Code: Select all
# 'check_mysql_health' command definition
define command{
command_name check_mysql_health
command_line $USER1$/check_mysql_health --hostname $HOSTNAME$ --username $ARG1$ --password $ARG2$ $ARG3$
}Code: Select all
define service{
use local-service ; Name of service template to use
host_name localhost
service_description MariaDB
check_command check_mysql_health!the_username!the_password!--mode connection-time
notifications_enabled 1
}Does this make sense?
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Re: MariaDB/MySQL health plugin for Nagios Core?
Yes, many thanks I've figured out minutes ago and got this working but thanks for your time, this will act as help for others
- Box293
- Too Basu
- Posts: 5126
- Joined: Sun Feb 07, 2010 10:55 pm
- Location: Deniliquin, Australia
- Contact:
Re: MariaDB/MySQL health plugin for Nagios Core?
Great stuff, glad you're on the right track 
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.