LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (http://www.linuxquestions.org/questions/linux-server-73/)
-   -   monitoring EC2 RDS in nagios (http://www.linuxquestions.org/questions/linux-server-73/monitoring-ec2-rds-in-nagios-883010/)

call_krushna 05-27-2011 06:13 AM

monitoring EC2 RDS in nagios
 
Hi,

I want to monitor RDS (mysql database of EC2) using Nagios. In command line ( I am able to do it but I dont know how to feed it in nagios .

On nagios server if I execute the following command , I am able to fetch the information of database (RDS)

Nagios_server #/usr/local/nagios/libexec/check_mysqld.pl -p<password> -f -u <username> -A uptime,threads_connected,slow_queries,open_tables -H <hostname> -q 'SHOW STATUS'

output :- MYSQL 5.1.50 OK | uptime=344783 threads_connected=672 slow_queries=0 open_tables=64

Please let me know, to feed the same output in nagios .

Note :- Here the host name is public dns name (x.y.z.amazon.com) .We cant ping to this host.With mysql command , we can log in and work on databases.

Any help will be highly apreciated.

Krushna

acid_kewpie 05-28-2011 03:00 PM

so you just need to define that command as a nagios command in it's config, and then associate that command with a service, and that service with a node. standard docs are your friends... http://homepage.mac.com/duling/halfd...-Howto-p1.html

call_krushna 05-30-2011 10:52 AM

Thanks for reply.Adding as a command and as service , i have done already.How to add the service with a node or host ,since here we can not ping to the node(host). Only mysql command will work.In command.cfg, i have added following

define command{
command_name check_mysqld
command_line $USER1$/check_mysqld.pl -H $HOSTADDRESS$ -u $ARG1$ -p $ARG2$ -a uptime,threads_connected,questions,slow_queries,open_tables -w ",,,," -c ",,,,"
}
and in services , I have added

define host{
use rds ; Name of RDS
host_name <RDS name>
alias <RDS name>
address <rds_fqdn_name>
}
#################################################################################################### ##
define service{
use local-service ; Name of service template to use
host_name <RDS_name>
service_description Mysql_health_check
check_command check_mysqld!<username>!<password>

}


In nagios ,it is showing as down. Anything I need to change on this.

acid_kewpie 05-30-2011 11:08 AM

well run the check command manually yourself from a command line. What does it say? What does the service status page actually say other than the overall status? can you actually telnet to port 1433 on the box from the nagios server?

call_krushna 06-06-2011 05:50 AM

Quote:

Originally Posted by acid_kewpie (Post 4371117)
well run the check command manually yourself from a command line. What does it say? What does the service status page actually say other than the overall status? can you actually telnet to port 1433 on the box from the nagios server?

Hi Chris ,

Thanks for info . It worked for me in the same way . Only change I hade to made was adding hostname .Below is the details .

define service{
use local-service ; Name of service template to use
host_name <any hostname not the Rds name> ;
service_description Mysql_health_check
check_command check_mysqld!<username>!<password>

}


#The rds status will be shown in the defined host name.

Thanks a lot.

Krushna


All times are GMT -5. The time now is 07:41 AM.