Multiple services with the same service_description directive s

Furnish, Trever G TGFurnish at herff-jones.com
Fri Jan 30 00:31:48 CET 2004


Yes, Noah, it's safe to duplicate your descriptions.  I've always done that.

Did you cc me on your message because you thought your response was an
answer to what I was asking about?  If so then I wasn't clear enough in my
own question. :-)  I was asking about an exception clause for service
definitions - ie without such a clause the only way to apply the same
service description to all members of a hostgroup except one would be to
apply the service to each host in that group separately.

In the case of your example below, imagine if "wan-us" included a host named
"router-chicago" which needed a different check_command.  The only options
you have for applying a ping command to everything in the "wan-us" group
EXCEPT "router-chicago" is to create one "Ping Test" service description per
host or to create a new group that includes everything in "wan-us" except
"router-chicago".

Now imagine that "wan-us" is 200 devices, only one of which needs a
different check_command.  Having to expand that group and apply the services
to hosts instead of hostgroups just made your config file about 100 times
the size it would have been if there had only been an "except" clause. :-(

--
Trever


> -----Original Message-----
> From: Noah Leaman [mailto:noah at mac.com]
> Sent: Thursday, January 29, 2004 12:08 AM
> To: nagios-users at lists.sourceforge.net
> Cc: Furnish, Trever G
> Subject: Multiple services with the same service_description 
> directives
> 
> 
> Is this a safe? It seems to work. I don't see anything 
> mentioned in the 
> Object Inheritance or the Time-Saving Tricks For 
> Template-Based Object 
> Definitions sections of the docs 
> (http://nagios.sourceforge.net/docs/1_0/templatetricks.html and 
> http://nagios.sourceforge.net/docs/1_0/templatetricks.html). It seems 
> though it's a result of template object inheritance.
> 
> define service {
>   use					generic-service-template
>   service_description		Ping Test
>   hostgroup_name		wan-us,lan-us
>   check_command		check_ping!200.0,50%!1000.0,90%
> }
> define service {
>   use					generic-service-template
>   service_description		Ping Test
>   hostgroup_name		lan-euro,wan-euro
>   check_command		check_ping!3000.0,80%!5000.0,100%
> }
> 
> < From the nagios docs >
> This directive is used to define the description of the 
> service, which 
> may contain spaces, dashes, and colons (semicolons, apostrophes, and 
> quotation marks should be avoided). No two services 
> associated with the 
> same host can have the same description. Services are uniquely 
> identified with their host_name and service_description directives.
> </From the nagios docs >
> 
> So it works as long as one host is assigned to both services of the 
> same description... which does makes sense. But knowing that "No two 
> services associated with the same host can have the same 
> description," 
> I find it useful to "reuse" service descriptions across multiple 
> definitions.
> 
> For example, I can set up an SNMP based service for routers that have 
> different read community strings:
> 
> define service {
>   use					generic-service-template
>   service_description          Uptime
>   hostgroup_name              wan-us,lan-us
>   check_command              check_snmp_uptime!ReadCommunity1
> }
> define service {
>   use					generic-service-template
>   service_description          Uptime
>   hostgroup_name              wan-us,lan-us
>   check_command              check_snmp_uptime!ReadCommunity2
> }
> define service {
>   use					generic-service-template
>   service_description          Uptime
>   hostgroup_name              wan-asia,lan-asia
>   check_command              check_dummy
>   active_checks_enabled  0
> }
> 
> The cool thing here is that I don't have to change the service 
> description for what is essentially the same service check (even for 
> the passive checks I have being done on a distribution 
> server). So they 
> all show up with the same sevice desc even though they are configured 
> slightly differently.
> 
> Is this a safe or am I going to run into problems?
> 
> -- 
> Noah
> 


-------------------------------------------------------
The SF.Net email is sponsored by EclipseCon 2004
Premiere Conference on Open Tools Development and Integration
See the breadth of Eclipse activity. February 3-5 in Anaheim, CA.
http://www.eclipsecon.org/osdn
_______________________________________________
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