Hi All,
Good day!
I've been cracking my head on how to add MySQL_query service. When I test in putty it's okay but when I add in CCM, I get error "You don't have permission to access /nagiosxi/includes/components/ccm/index.php on this server"
I can add other services in CCM with no problem only this MySQL_query. I'm really not good in Nagios.
I already have added the id that is showing when I check error in Modsecurity, restarted apache but still the same thing.
I appreciate your help.
Thanks and have a great day!
Ann
Cannot Add service in CCM for mysql_query
Re: Cannot Add service in CCM for mysql_query
Can you show us the actual command run from the command line along with the output of it? Also, show us how "MySQL_query" is configured in XI.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Re: Cannot Add service in CCM for mysql_query
Hello,
Thanks for your response.
This is the command I used;
./check_mysql_query -u root -p nagiosxi -d information_schema -q "select variable_value from global_status where Variable_name='Threads_connected'" -w :140 -c :151
Output:
QUERY OK: 'select variable_value from global_status where Variable_name='Threads_connected'' returned 32.000000 | result=32.000000;140.000000;151.000000;
All of a sudden today, it was added in the UI with Unknown Error "Must specify a SQL query to run".
Please help. I cannot make it to work. Been trying for a month now.
Thanks and have a great day!
Ann
Thanks for your response.
This is the command I used;
./check_mysql_query -u root -p nagiosxi -d information_schema -q "select variable_value from global_status where Variable_name='Threads_connected'" -w :140 -c :151
Output:
QUERY OK: 'select variable_value from global_status where Variable_name='Threads_connected'' returned 32.000000 | result=32.000000;140.000000;151.000000;
All of a sudden today, it was added in the UI with Unknown Error "Must specify a SQL query to run".
Please help. I cannot make it to work. Been trying for a month now.
Thanks and have a great day!
Ann
Re: Cannot Add service in CCM for mysql_query
Can you show us a screenshot of how you have it entered into the CCM? I'm thinking there might be some escaping or possibly templating issues at play.
Former Nagios employee
Re: Cannot Add service in CCM for mysql_query
Most probably it is a misconfiguration issue. Here's what I tested (which worked fine from the command like and in the GUI):
my command:
my service:
Testing from the CLI:
In the GUI:
Hope this helps.
my command:
Code: Select all
define command {
command_name check_mysql_query
command_line $USER1$/check_mysql_query -H $HOSTADDRESS$ -u $ARG1$ -p $ARG2$ -d $ARG3$ -q $ARG4$ $ARG5$
}Code: Select all
define service {
host_name localhost
service_description MySQL Query
use local-service
check_command check_mysql_query!root!nagiosxi!information_schema!"select variable_value from global_status where Variable_name='Threads_connected'"!-w :140 -c :151!!!
notifications_enabled 1
contacts nagiosadmin
register 1
}Code: Select all
# ./check_mysql_query -u root -p nagiosxi -d information_schema -q "select variable_value from global_status where Variable_name='Threads_connected'" -w :140 -c :151
QUERY OK: 'select variable_value from global_status where Variable_name='Threads_connected'' returned 51.000000 | result=51.000000;140.000000;151.000000;You do not have the required permissions to view the files attached to this post.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Re: Cannot Add service in CCM for mysql_query
Hi lmiltchev,
Thank you soo much for your help I appreciate it and it worked!
You guys are the best.
Ann
Thank you soo much for your help I appreciate it and it worked!
You guys are the best.
Ann
Re: Cannot Add service in CCM for mysql_query
I am glad I could help! 
Be sure to check out our Knowledgebase for helpful articles and solutions!