Monitoring MySQL
-
- Former Nagios Staff
- Posts: 4583
- Joined: Wed Sep 21, 2016 10:29 am
- Location: NoLo, Minneapolis, MN
- Contact:
Re: Monitoring MySQL
You might be working on it, but you might have missed it. Can you post the full output of /usr/local/nagios/libexec/check_nrpe -H X.X.X.X where X.X.X.X is your IP address. Thanks!
-
- Posts: 62
- Joined: Thu Oct 27, 2016 2:43 pm
Re: Monitoring MySQL
avandemore wrote:Please show the full command and output as it relates to your error. Example:Code: Select all
[root@avandemore-centos7 etc]# /usr/local/nagios/libexec/check_nrpe -H 192.168.3.156 I (0.4.4.19 2015-12-08) seem to be doing fine...
Code: Select all
[ec2-user@ip-172-31-51-197 ~]$ /usr/local/nagios/libexec/check_mysql_counters_55 -H 54.196.226.111
UNKNOWN: usage: check_mysql_counters -H host -P port -u mysqluser -p mysqlpassword
[ec2-user@ip-172-31-51-197 ~]$ cd /usr/lcal/nagios/libexec
-bash: cd: /usr/lcal/nagios/libexec: No such file or directory
Code: Select all
[ec2-user@ip-172-31-51-197 libexec]$ /usr/local/nagios/libexec/check_mysql_counters_55 -H 54.196.226.111 -P 3066 -u x -p x
PHP Fatal error: Class 'PDO' not found in /usr/local/nagios/libexec/check_mysql_counters_55 on line 508
-
- Posts: 62
- Joined: Thu Oct 27, 2016 2:43 pm
Re: Monitoring MySQL
Ok, but it isn't working by NRPE.dwhitfield wrote:You might be working on it, but you might have missed it. Can you post the full output of /usr/local/nagios/libexec/check_nrpe -H X.X.X.X where X.X.X.X is your IP address. Thanks!
Code: Select all
[ec2-user@ip-172-31-51-197 libexec]$ /usr/local/nagios/libexec/check_nrpe -H 54.196.226.111
NRPE v2.15
-
- Posts: 4
- Joined: Wed Nov 30, 2016 3:14 pm
Re: Monitoring MySQL
Your nagios server needs the PHP PDO package installed. Which package you need depends on the OS, check for the php-mysql package.
-
- Posts: 62
- Joined: Thu Oct 27, 2016 2:43 pm
Re: Monitoring MySQL
Ok, I installed the package, now what?jasonholtzapple wrote:Your nagios server needs the PHP PDO package installed. Which package you need depends on the OS, check for the php-mysql package.
Code: Select all
[ec2-user@ip-172-31-51-197 libexec]$ /usr/local/nagios/libexec/check_mysql_counters_55 -H 54.196.226.111 -P 3066 -u x-p x
SQLSTATE[HY000] [2003] Can't connect to MySQL server on '54.196.226.111' (111)
-
- Posts: 4
- Joined: Wed Nov 30, 2016 3:14 pm
Re: Monitoring MySQL
That message is pretty clear. Your nagios server can't connect to the database. Check your firewalls. Also you are using a non-standard mysql port, that might be a typo.
-
- Posts: 62
- Joined: Thu Oct 27, 2016 2:43 pm
Re: Monitoring MySQL
Ok, I had a little mistake, but now what??? what does that message mean?jasonholtzapple wrote:That message is pretty clear. Your nagios server can't connect to the database. Check your firewalls. Also you are using a non-standard mysql port, that might be a typo.
Code: Select all
[ec2-user@ip-172-31-51-197 objects]$ /usr/local/nagios/libexec/check_mysql_counters_55 -H 54.196.226.111 -P 3306 -u x -p x
SQLSTATE[HY000] [1130] Host '54.166.49.89' is not allowed to connect to this MariaDB server[ec2-user@ip-172-31-51-197 objects]$
-
- Posts: 4
- Joined: Wed Nov 30, 2016 3:14 pm
Re: Monitoring MySQL
Unfortunately this plugin is probably not going to work well with MariaDB, unless the status variables returned by MariaDB are exactly the same as the Oracle MySQL version. If you do get it to work, report back and I'll add MariaDB to the list of supported flavors.
Re: Monitoring MySQL
Thank you for your contribution here.jasonholtzapple wrote:Unfortunately this plugin is probably not going to work well with MariaDB, unless the status variables returned by MariaDB are exactly the same as the Oracle MySQL version. If you do get it to work, report back and I'll add MariaDB to the list of supported flavors.
Based on this, I would look at talking to your database administrator to allow 54.166.49.89 to access the MariaDB. You can find instructions here - http://stackoverflow.com/questions/1559 ... sql-server - this may not work though as @jasonholtzapple mentioned.Cristhian_Plaza wrote:Ok, I had a little mistake, but now what??? what does that message mean?jasonholtzapple wrote:That message is pretty clear. Your nagios server can't connect to the database. Check your firewalls. Also you are using a non-standard mysql port, that might be a typo.
Code: Select all
[ec2-user@ip-172-31-51-197 objects]$ /usr/local/nagios/libexec/check_mysql_counters_55 -H 54.196.226.111 -P 3306 -u x -p x SQLSTATE[HY000] [1130] Host '54.166.49.89' is not allowed to connect to this MariaDB server[ec2-user@ip-172-31-51-197 objects]$
One more thing to note @Cristhian_Plaza - you had previously posted your root mysql username / password here, which I modified - in the future you may want to sanitize what you're posting to avoid posting sensitive credentials to a WAN facing server.
Former Nagios Employee
-
- Posts: 62
- Joined: Thu Oct 27, 2016 2:43 pm
Re: Monitoring MySQL
OK... It is working now¡ with the last post... I created an account and I can see, I think the check's definitions, I don't know how to use call this definition one by one on commands.cfgrkennedy wrote:Thank you for your contribution here.jasonholtzapple wrote:Unfortunately this plugin is probably not going to work well with MariaDB, unless the status variables returned by MariaDB are exactly the same as the Oracle MySQL version. If you do get it to work, report back and I'll add MariaDB to the list of supported flavors.
Based on this, I would look at talking to your database administrator to allow 54.166.49.89 to access the MariaDB. You can find instructions here - http://stackoverflow.com/questions/1559 ... sql-server - this may not work though as @jasonholtzapple mentioned.Cristhian_Plaza wrote:Ok, I had a little mistake, but now what??? what does that message mean?jasonholtzapple wrote:That message is pretty clear. Your nagios server can't connect to the database. Check your firewalls. Also you are using a non-standard mysql port, that might be a typo.
Code: Select all
[ec2-user@ip-172-31-51-197 objects]$ /usr/local/nagios/libexec/check_mysql_counters_55 -H 54.196.226.111 -P 3306 -u x -p x SQLSTATE[HY000] [1130] Host '54.166.49.89' is not allowed to connect to this MariaDB server[ec2-user@ip-172-31-51-197 objects]$
One more thing to note @Cristhian_Plaza - you had previously posted your root mysql username / password here, which I modified - in the future you may want to sanitize what you're posting to avoid posting sensitive credentials to a WAN facing server.
Code: Select all
MYSQL_COUNTERS OK | 'ABORTED_CLIENTS'=0c 'ABORTED_CONNECTS'=90c 'BINLOG_COMMITS'=0c 'BINLOG_GROUP_COMMITS'=0c 'BINLOG_CACHE_DISK_USE'=0c 'BINLOG_CACHE_USE'=0c 'BINLOG_STMT_CACHE_DISK_USE'=0c 'BINLOG_STMT_CACHE_USE'=0c 'BYTES_RECEIVED'=67900347B 'BYTES_SENT'=408555315B 'COM_ADMIN_COMMANDS'=0c 'COM_ALTER_DB'=0c 'COM_ALTER_DB_UPGRADE'=0c 'COM_ALTER_EVENT'=0c 'COM_ALTER_FUNCTION'=0c 'COM_ALTER_PROCEDURE'=0c 'COM_ALTER_SERVER'=0c 'COM_ALTER_TABLE'=4c 'COM_ALTER_TABLESPACE'=0c 'COM_ANALYZE'=0c 'COM_ASSIGN_TO_KEYCACHE'=0c 'COM_BEGIN'=0c 'COM_BINLOG'=0c 'COM_CALL_PROCEDURE'=0c 'COM_CHANGE_DB'=0c 'COM_CHANGE_MASTER'=0c 'COM_CHECK'=313c 'COM_CHECKSUM'=0c 'COM_COMMIT'=0c 'COM_CREATE_DB'=0c 'COM_CREATE_EVENT'=0c 'COM_CREATE_FUNCTION'=0c 'COM_CREATE_INDEX'=0c 'COM_CREATE_PROCEDURE'=0c 'COM_CREATE_SERVER'=0c