LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 04-02-2013, 08:52 AM   #1
sarah allali
LQ Newbie
 
Registered: Jan 2013
Location: Morocco
Distribution: Debian , ubunto
Posts: 15

Rep: Reputation: Disabled
error with check_mysql nagios


i have configured check_mysql on my server :

#'check_mysql'command definition
define command{
command_name check_mysql
command_line $USER$/check_mysql -H $HOSADDRESS$ -u $ARG1$ -p $ARG2$
}
service definition:
define service{
use generic-service
host_name hostname
service_description mysql
check_command check_mysql!root!password
( root is user of mysql and 'nagios' is the password )

on NRPE server :
command[check_mysql]=/usr/local/nagios/libexec/check_mysql -H $ARG1$ -u $ARG2$ -p password
and i also did this :
mysql>grant all privileges on *.* to root@localhost Identified by 'nagios';
mysql>flush priviliges;

when i :
/usr/local/nagios/libexec/check_mysql -H 192.168.1.10 -u root -p nagios
Uptime: 350 Threads: 1 Questions: 104 Slow queries: Opens:99 Flush tables: 1 Open tables: 11 Queries per second avg: 0.709

but when i check_mysql via check nrpe i get:

/usr/local/nagios/libexec/check_nrpe -H 192.168.1.10 -c check_mysql -u root -p nagios
i get this : Incorrect command line arguments supplied

so what did i do wrong because i tried everything and i tried changing arguments and everything but It won't work
thanx in advance
 
Old 04-02-2013, 10:44 AM   #2
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 17,921

Rep: Reputation: 3690Reputation: 3690Reputation: 3690Reputation: 3690Reputation: 3690Reputation: 3690Reputation: 3690Reputation: 3690Reputation: 3690Reputation: 3690Reputation: 3690
Quote:
Originally Posted by sarah allali View Post
i have configured check_mysql on my server :
#'check_mysql'command definition
define command{
command_name check_mysql
command_line $USER$/check_mysql -H $HOSADDRESS$ -u $ARG1$ -p $ARG2$
}
service definition:
define service{
use generic-service
host_name hostname
service_description mysql
check_command check_mysql!root!password
( root is user of mysql and 'nagios' is the password )

on NRPE server :
command[check_mysql]=/usr/local/nagios/libexec/check_mysql -H $ARG1$ -u $ARG2$ -p password
and i also did this :
mysql>grant all privileges on *.* to root@localhost Identified by 'nagios';
mysql>flush priviliges;

when i :
/usr/local/nagios/libexec/check_mysql -H 192.168.1.10 -u root -p nagios
Uptime: 350 Threads: 1 Questions: 104 Slow queries: Opens:99 Flush tables: 1 Open tables: 11 Queries per second avg: 0.709

but when i check_mysql via check nrpe i get:

/usr/local/nagios/libexec/check_nrpe -H 192.168.1.10 -c check_mysql -u root -p nagios
i get this : Incorrect command line arguments supplied

so what did i do wrong because i tried everything and i tried changing arguments and everything but It won't work
thanx in advance
Spell out your words. And if you referenced ANY of the NRPE documentation you've been given several times now, you'd see you're calling the command incorrectly.
Code:
define service{
        use                    generic-service 
        host_name              hostname
        service_description    mysql 
        check_command          check_nrpe!check_mysql
}
 
Old 04-04-2013, 09:35 AM   #3
sarah allali
LQ Newbie
 
Registered: Jan 2013
Location: Morocco
Distribution: Debian , ubunto
Posts: 15

Original Poster
Rep: Reputation: Disabled
Code:
Spell out your words. And if you referenced ANY of the NRPE documentation you've been given several times now, you'd see you're calling the command incorrectly.
Code:
define service{
        use                    generic-service 
        host_name              hostname
        service_description    mysql 
        check_command          check_nrpe!check_mysql
}
i don't think this is the problem because i did the same thing with other services like tomcat and ping and i did what you told me i would get this message "check_mysql is not defined",
and i already defined check_nrpe in my file :
define command{
command_name check_nrpe
command_line $USER1$/check_nrpe -H $HOTSADDRESS$ -c $ARG1$ -a $ARG2$ $ARG3$ $ARG4$
}

and check_mysql on web interface of nagios as you can see is working it gives me okey : (all other services as well )
Click image for larger version

Name:	webnag worked all.PNG
Views:	39
Size:	38.4 KB
ID:	12212
but when i launch the command line => /usr/local/nagios/libexec/check_nrpe -H 192.168.1.10 -c check_mysql -u root -p nagios
i get this : Incorrect command line arguments supplied

thank you for reply

Last edited by sarah allali; 04-04-2013 at 09:41 AM.
 
Old 04-04-2013, 09:56 AM   #4
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 17,921

Rep: Reputation: 3690Reputation: 3690Reputation: 3690Reputation: 3690Reputation: 3690Reputation: 3690Reputation: 3690Reputation: 3690Reputation: 3690Reputation: 3690Reputation: 3690
Quote:
Originally Posted by sarah allali View Post
Code:
Spell out your words. And if you referenced ANY of the NRPE documentation you've been given several times now, you'd see you're calling the command incorrectly.
Code:
define service{
        use                    generic-service 
        host_name              hostname
        service_description    mysql 
        check_command          check_nrpe!check_mysql
}
i don't think this is the problem because i did the same thing with other services like tomcat and ping and i did what you told me i would get this message "check_mysql is not defined", and i already defined check_nrpe in my file:
Code:
define command{
command_name check_nrpe 
command_line $USER1$/check_nrpe -H $HOTSADDRESS$ -c $ARG1$ -a $ARG2$ $ARG3$ $ARG4$
}
Great...check_nrpe is defined. However, your problem is with check_mysql. THAT is what you need to define correctly, which you haven't.
Quote:
and check_mysql on web interface of nagios as you can see is working it gives me okey : (all other services as well )
Attachment 12212
but when i launch the command line => /usr/local/nagios/libexec/check_nrpe -H 192.168.1.10 -c check_mysql -u root -p nagios
i get this : Incorrect command line arguments supplied
Right, because you need to define the host and other parameters for check_mysql in the service definition, and since you're passing them TWICE, that would give you the INCORRECT COMMAND LINE ARGUMENTS.

Again, you need to read/understand the check_nrpe documentation, and perhaps try researching this plugin, because there are MANY examples on how to configure it, such as this one, pulled from the Nagios forums:
Code:
nrpe.conf file info
command[check_mysql]=/usr/lib64/nagios/plugins/check_mysql -H xxxx -u xxxx -p *****
--------------
Service template for Nagios box
define service{
use generic-service
host_name xxxxxxxxxxxx
service_description MySQL Check
check_command check_nrpe!check_mysql
}
Again, all of this is covered in the Nagios documentation, and the plugin documentation. If you read it and pay attention to the errors that you're getting (which are VERY clear), it will tell you how to fix it.

And when posting follow-ups about check_mysql, it is rather pointless to post the check_nrpe configuration, isn't it??

Last edited by TB0ne; 04-04-2013 at 10:11 AM.
 
1 members found this post helpful.
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
nagios not working (http://localhost/nagios or http://ip/nagios) 404 error connect2janu Linux - Server 1 11-18-2012 03:06 AM
Nagios Error. Shahnawaz Uqaili Linux - Newbie 22 05-25-2011 10:27 AM
Nagios Error!!! anishkumarv Linux - Server 3 04-19-2011 05:45 AM
nagios error Rahul Kolan Linux - Software 1 11-13-2009 04:08 AM
installing check_mysql and check_mem nagios plugins williebens Linux - Networking 15 07-31-2008 07:01 PM


All times are GMT -5. The time now is 10:36 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration