<div dir="ltr"><div style>Hi all,</div><div style><br></div><div style>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 :</div>
<div style><br></div>1.) <br><div><br></div><div><div>define command{</div><div> command_name check_slow_query</div><div> 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'</div>
<div>}</div><div><br></div><div>define service{</div><div> host_name host1</div><div> service_description Slow running queries</div><div> contact_groups alerts</div><div>
max_check_attempts 2</div><div> check_period 24x7</div><div> check_command check_slow_query</div><div>}</div></div><div><br></div><div style>[1372051002] INITIAL SERVICE STATE: slave-cia-db00;Slow running queries;CRITICAL;HARD;2;QUERY CRITICAL: Error with query - <b>Unknown column '300$' in 'where clause'</b></div>
<div style><br></div><div style>2.)</div><div style><br></div><div style><div>define command{</div><div> command_name check_daily_revenue</div><div> 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)"</div>
<div>}</div><div><br></div><div>define service{</div><div> host_name host1</div><div> service_description Todays total revenue from table1</div><div> contact_groups alerts</div>
<div> max_check_attempts 2</div><div> check_period 24x7</div><div> check_command check_daily_revenue</div><div>}</div><div><br></div><div>[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<br>
</div><div><br></div><div>3.) </div><div><br></div><div>define command{</div><div> command_name count_sources</div><div> command_line $USER1$/check_mysql_query -H $HOSTADDRESS$ -P 3306 -d db_name -u user -p passwd -q 'SELECT COUNT(*) FROM sources'</div>
<div>}</div><div><br></div><div>define service{</div><div> host_name host1</div><div> service_description count sources</div><div> contact_groups alerts</div><div> max_check_attempts 2</div>
<div> check_period 24x7</div><div> check_command count_sources</div><div>}</div><div><br></div><div>[1372051002] INITIAL SERVICE STATE: slave-cia-db00;Slow running Crawl Jobs;CRITICAL;HARD;2;QUERY CRITICAL: Error with query - Table '<b>cmp_pricing.sources$</b>' <b>doesn't exist</b><br>
</div><div><br></div><div style>Note: The password above contains a $ at the end ex: 'passwd$'</div><div style>Anyone knows what could be the problem ?</div><div style><br></div><div style>-Saurabh</div></div></div>