Page 1 of 1
check_mysql question
Posted: Thu Jul 31, 2014 5:06 am
by rajasegar
XI 2014R1.2
Can you please advice what is the best setting to use for alerting for check_mysql?
I dont quite understand how to set the warning and critical for this plugin.
Code: Select all
-S, --check-slave
Check if the slave thread is running properly.
-w, --warning
Exit with WARNING status if slave server is more than INTEGER seconds
behind master
-c, --critical
Exit with CRITICAL status if slave server is more then INTEGER seconds
behind master
When I use -S, i get
No slaves defined
Code: Select all
./check_mysql -d br1m -H 10.17.86.85 -P 3306 -u root -p password
Uptime: 57315 Threads: 47 Questions: 974501 Slow queries: 56 Opens: 14294 Flush tables: 1 Open tables: 436 Queries per second avg: 17.002|Connections=2237c;;; Open_files=78;;; Open_tables=436;;; Qcache_free_memory=361204800;;; Qcache_hits=102501c;;; Qcache_inserts=56377c;;; Qcache_lowmem_prunes=0c;;; Qcache_not_cached=100122c;;; Qcache_queries_in_cache=3696;;; Queries=974501c;;; Questions=531287c;;; Table_locks_waited=3c;;; Threads_connected=47;;; Threads_running=2;;; Uptime=57315c;;;
Re: check_mysql question
Posted: Thu Jul 31, 2014 2:04 pm
by lmiltchev
When I use -S, i get No slaves defined
Do you have master/slave (database replication) set up?
Re: check_mysql question
Posted: Thu Jul 31, 2014 5:49 pm
by rajasegar
lmiltchev wrote:When I use -S, i get No slaves defined
Do you have master/slave (database replication) set up?
Some got, but most of them don't.
Re: check_mysql question
Posted: Fri Aug 01, 2014 11:22 am
by sreinhardt
Well from the options you provided, the only warning\crit checks seem to be related to master\slave setup. In those cases, it will probably work great and let you know of a failover scenario. Now it does also look like it has a whole lot of other useful metrics, but that there may not be a warn\crit threshold for those. Could you provide the full help output from the plugin instead of a section of it?
Re: check_mysql question
Posted: Mon Aug 04, 2014 5:47 am
by rajasegar
sreinhardt wrote:Well from the options you provided, the only warning\crit checks seem to be related to master\slave setup. In those cases, it will probably work great and let you know of a failover scenario. Now it does also look like it has a whole lot of other useful metrics, but that there may not be a warn\crit threshold for those. Could you provide the full help output from the plugin instead of a section of it?
This is the standard mysql that came with xi. Anyway here is the info requested
Code: Select all
[nagios@nagiosprodxi1 libexec]$ ./check_mysql --help
check_mysql v2.0.2 (nagios-plugins 2.0.2)
Copyright (c) 1999-2014 Nagios Plugin Development Team
<[email protected]>
This program tests connections to a MySQL server
Usage:
check_mysql [-d database] [-H host] [-P port] [-s socket]
[-u user] [-p password] [-S] [-l] [-a cert] [-k key]
[-C ca-cert] [-D ca-dir] [-L ciphers] [-f optfile] [-g group]
Options:
-h, --help
Print detailed help screen
-V, --version
Print version information
--extra-opts=[section][@file]
Read options from an ini file. See
https://www.nagios-plugins.org/doc/extra-opts.html
for usage and examples.
-H, --hostname=ADDRESS
Host name, IP Address, or unix socket (must be an absolute path)
-P, --port=INTEGER
Port number (default: 3306)
-n, --ignore-auth
Ignore authentication failure and check for mysql connectivity only
-s, --socket=STRING
Use the specified socket (has no effect if -H is used)
-d, --database=STRING
Check database with indicated name
-f, --file=STRING
Read from the specified client options file
-g, --group=STRING
Use a client options group
-u, --username=STRING
Connect using the indicated username
-p, --password=STRING
Use the indicated password to authenticate the connection
==> IMPORTANT: THIS FORM OF AUTHENTICATION IS NOT SECURE!!! <==
Your clear-text password could be visible as a process table entry
-S, --check-slave
Check if the slave thread is running properly.
-w, --warning
Exit with WARNING status if slave server is more than INTEGER seconds
behind master
-c, --critical
Exit with CRITICAL status if slave server is more then INTEGER seconds
behind master
-l, --ssl
Use ssl encryptation
-C, --ca-cert=STRING
Path to CA signing the cert
-a, --cert=STRING
Path to SSL certificate
-k, --key=STRING
Path to private SSL key
-D, --ca-dir=STRING
Path to CA directory
-L, --ciphers=STRING
List of valid SSL ciphers
There are no required arguments. By default, the local database is checked
using the default unix socket. You can force TCP on localhost by using an
IP address or FQDN ('localhost' will use the socket as well).
Notes:
You must specify -p with an empty string to force an empty password,
overriding any my.cnf settings.
Send email to [email protected] if you have questions regarding use
of this software. To submit patches or suggest improvements, send email to
[email protected]
[nagios@nagiosprodxi1 libexec]$
Re: check_mysql question
Posted: Mon Aug 04, 2014 4:01 pm
by tmcdonald
You might actually try using this check_mysql plugin instead:
http://exchange.nagios.org/directory/Pl ... ld/details
The warning/crit options are a bit more configurable than our standard plugin. StackOverflow post here:
http://serverfault.com/questions/162484 ... ring-mysql