Multiple IP address SSH/HTTP check

Marc Powell marc at ena.com
Wed Feb 25 18:49:53 CET 2009


On Feb 25, 2009, at 10:13 AM, Satish Patel wrote:

>
> I have client which has multiple IP address and runing apache and ssh
> on it but i dont know how to check service on multiple ip address?
>
> i have define both interface IP address in hosts.cfg file
>
> like this.
>
> address 192.168.1.1,172.16.1.1

This will not work unless the check_plugins you are using understand  
and can work with multiple host addresses. Most (all?) of the standard  
plugins do not.

You can either create new host{} entries for each IP address or just  
use one address for the main host address and create special service/ 
command definitions for the others.

define host {
	host_name Foo
	host_address 192.168.1.1
	...
}

define service {
	host_name Foo
	service_description http on 172.16.1.1
	check_command	check_http_by_ip!172.16.1.1
	...
}

define service {
	host_name Foo
	service_description ssh on 172.16.1.1
	check_command	check_ssh_by_ip!172.16.1.1
	...
}

define command {
	command_name check_http_by_ip
	command_line	$USER1$/check_http -H $ARG1$  ... (other plugin specific  
arguments).
}

define command {
	command_name check_ssh_by_ip
	command_line	$USER1$/check_ssh -H $ARG1$  ... (other plugin specific  
arguments).
}

  The above was done completely from memory so there may be  
syntactical errors but the concept is there...

--
Marc


------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
_______________________________________________
Nagios-users mailing list
Nagios-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue. 
::: Messages without supporting info will risk being sent to /dev/null





More information about the Users mailing list