check_mysql question

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
rajasegar
Posts: 1018
Joined: Sun Mar 30, 2014 10:49 pm

check_mysql question

Post 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;;;

5 x Nagios 5.6.9 Enterprise Edition
RHEL 6 & 7
rrdcached & ramdisk optimisation
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: check_mysql question

Post by lmiltchev »

When I use -S, i get No slaves defined
Do you have master/slave (database replication) set up?
Be sure to check out our Knowledgebase for helpful articles and solutions!
rajasegar
Posts: 1018
Joined: Sun Mar 30, 2014 10:49 pm

Re: check_mysql question

Post 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.
5 x Nagios 5.6.9 Enterprise Edition
RHEL 6 & 7
rrdcached & ramdisk optimisation
sreinhardt
-fno-stack-protector
Posts: 4366
Joined: Mon Nov 19, 2012 12:10 pm

Re: check_mysql question

Post 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?
Nagios-Plugins maintainer exclusively, unless you have other C language bugs with open-source nagios projects, then I am happy to help! Please pm or use other communication to alert me to issues as I no longer track the forum.
rajasegar
Posts: 1018
Joined: Sun Mar 30, 2014 10:49 pm

Re: check_mysql question

Post 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]$
5 x Nagios 5.6.9 Enterprise Edition
RHEL 6 & 7
rrdcached & ramdisk optimisation
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: check_mysql question

Post 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
Former Nagios employee
Locked