probkem with multiple check_command

Marc Powell marc at ena.com
Tue Sep 20 17:28:43 CEST 2005



> -----Original Message-----
> From: nagios-users-admin at lists.sourceforge.net [mailto:nagios-users-
> admin at lists.sourceforge.net] On Behalf Of Gabriele Di Giambelardini
> Sent: Tuesday, September 20, 2005 10:06 AM
> To: nagios-users at lists.sourceforge.net
> Subject: Re: [Nagios-users] probkem with multiple check_command
> 
> Hi think that I wasn't able to explain my problem...
> I need to create an group of check_commands for one host...
> It's possible? and if yes, how??

You must create one service{} definition for each check you wish to make
and associate them with the host using the host_name directive. Using
your example --


	# CONTROLLA ciccio
	define service {
	use                            generic-service 
	host_name                      ciccio
	service_description            ciccio-http
	is_volatile                    0
	check_period                   24x7
	max_check_attempts             3
	normal_check_interval          3
	retry_check_interval           1
	contact_groups                 mag-admin
	notification_interval          12
	notification_period            24x7
	notification_options           w,u,c,r
	check_command                  check_http 
	}

	# CONTROLLA ciccio
	define service {
	use                            generic-service 
	host_name                      ciccio
	service_description            ciccio-ftp
	is_volatile                    0
	check_period                   24x7
	max_check_attempts             3
	normal_check_interval          3
	retry_check_interval           1
	contact_groups                 mag-admin
	notification_interval          12
	notification_period            24x7
	notification_options           w,u,c,r
	check_command                  check_ftp
	}

	# CONTROLLA ciccio
	define service {
	use                            generic-service 
	host_name                      ciccio
	service_description            ciccio-8080
	is_volatile                    0
	check_period                   24x7
	max_check_attempts             3
	normal_check_interval          3
	retry_check_interval           1
	contact_groups                 mag-admin
	notification_interval          12
	notification_period            24x7
	notification_options           w,u,c,r
	check_command                  check_telnet!8080 
	}

	# CONTROLLA ciccio
	define service {
	use                            generic-service 
	host_name                      ciccio
	service_description            ciccio-8786
	is_volatile                    0
	check_period                   24x7
	max_check_attempts             3
	normal_check_interval          3
	retry_check_interval           1
	contact_groups                 mag-admin
	notification_interval          12
	notification_period            24x7
	notification_options           w,u,c,r
	check_command                  check_telnet!8786
	}

Note that you can greatly simplify these by moving the common elements
into your generic-service template

define service {
	name					generic-service
	other stuff already here....
	is_volatile                    0
	check_period                   24x7
	max_check_attempts             3
	normal_check_interval          3
	retry_check_interval           1
	contact_groups                 mag-admin
	notification_interval          12
	notification_period            24x7
	notification_options           w,u,c,r
	register				 0
	}

	# CONTROLLA ciccio
	define service {
	use                            generic-service 
	host_name                      ciccio
	service_description            ciccio-http
	check_command                  check_http 
	}

	# CONTROLLA ciccio
	define service {
	use                            generic-service 
	host_name                      ciccio
	service_description            ciccio-ftp
	check_command                  check_ftp
	}

	# CONTROLLA ciccio
	define service {
	use                            generic-service 
	host_name                      ciccio
	service_description            ciccio-8080
	check_command                  check_telnet!8080 
	}

	# CONTROLLA ciccio
	define service {
	use                            generic-service 
	host_name                      ciccio
	service_description            ciccio-8786
	check_command                  check_telnet!8786
	}

--
Marc


-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. 
Download it for free - -and be entered to win a 42" plasma tv or your very
own Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
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