Activities

November 2009
M T W T F S S
« Oct   Dec »
 1
2345678
9101112131415
16171819202122
23242526272829
30  

Nagios – Custom command for checking the status of Port on the same server

Here I am checking the status of mysql running on the nagios Monitoring host

Go to nagios installation directory on nagios Monitoring host.

1. #

cd /usr/local/nagios/etc/objects/

2. Add the following line to ” command.cfg and save

 # vi commands.cfg

define command{
command_name check_tcp_mysql
command_line /usr/local/nagios/libexec/check_tcp -H localhost -p 3306 -w 100 -c 150
}

Note : we can see the proposed out put by executing this command from the console directly(“/usr/local/nagios/libexec/check_tcp -H localhost -p 3306 -w 100 -c 150”)

3. Edit localhost.cfg and append the line at the end of the file. Save and quit

define service{
use local-service ; Name of service template to use
host_name nagios-svr
service_description MySQL
check_command check_tcp_mysql
notifications_enabled 1
}

4. Verify the sample Nagios configuration files.

#/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg

5. Restart nagios service

Thats’ it

1 comment to Nagios – Custom command for checking the status of Port on the same server

Leave a Reply

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>