check_mysql_query error [nagios plugin]

Saurabh kumar saurabh.85 at gmail.com
Mon Jun 24 07:52:32 CEST 2013


Hi all,

I am using check_mysql_query plugin and facing different errors with
different instance of usage. Following are the configurations and error
thrown by each one of them :

1.)

define command{
        command_name          check_slow_query
        command_line             $USER1$/check_mysql_query -H $HOSTADDRESS$
-P 3306 -d INFORMATION_SCHEMA -u username -p passwd -w 1 -c 3 -q 'SELECT
COUNT(*) FROM processlist WHERE COMMAND = "Query" AND time > 300'
}

define service{
        host_name                  host1
        service_description      Slow running queries
        contact_groups            alerts
        max_check_attempts   2
        check_period               24x7
        check_command         check_slow_query
}

[1372051002] INITIAL SERVICE STATE: slave-cia-db00;Slow running
queries;CRITICAL;HARD;2;QUERY CRITICAL: Error with query - *Unknown column
'300$' in 'where clause'*

2.)

define command{
        command_name          check_daily_revenue
        command_line             $USER1$/check_mysql_query -H $HOSTADDRESS$
-P 3306 -d db_name -u user -p passwd -c 10: -q "SELECT SUM(revenue) FROM
table1 WHERE date = (SELECT MAX(date) FROM table1)"
}

define service{
        host_name                   host1
        service_description       Todays total revenue from table1
        contact_groups             alerts
        max_check_attempts    2
        check_period                24x7
        check_command           check_daily_revenue
}

[1372051002] INITIAL SERVICE STATE: slave-cia-db00;Todays total revenue
from table1;CRITICAL;HARD;2;QUERY CRITICAL: Error with query - You have an
error in your SQL syntax: check the manual that corresponds to your MySQL
server version for the right syntax to use near '$' at line 1

3.)

define command{
        command_name         count_sources
        command_line            $USER1$/check_mysql_query -H $HOSTADDRESS$
-P 3306 -d db_name -u user -p passwd -q 'SELECT COUNT(*) FROM sources'
}

define service{
        host_name                  host1
        service_description      count sources
        contact_groups            alerts
        max_check_attempts   2
        check_period               24x7
        check_command         count_sources
}

[1372051002] INITIAL SERVICE STATE: slave-cia-db00;Slow running Crawl
Jobs;CRITICAL;HARD;2;QUERY CRITICAL: Error with query - Table '*
cmp_pricing.sources$*' *doesn't exist*

Note: The password above contains a $ at the end ex: 'passwd$'
Anyone knows what could be the problem ?

-Saurabh
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.monitoring-lists.org/archive/users/attachments/20130624/26a03866/attachment.html>
-------------- next part --------------
------------------------------------------------------------------------------
This SF.net email is sponsored by Windows:

Build for Windows Store.

http://p.sf.net/sfu/windows-dev2dev
-------------- next part --------------
_______________________________________________
Nagios-users mailing list
Nagios-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue. 
::: Messages without supporting info will risk being sent to /dev/null


More information about the Users mailing list