service escalation on all services of all hosts

Paul M. Dubuc work at paul.dubuc.org
Tue Jun 7 20:11:44 CEST 2011


Michael Barrett wrote:
> Ahh, ok, that would explain it.  That's a bummer.   Thanks.

One way around this is to create a host group where you put hosts that have 
services assigned:

define hostgroup{
     hostgroup_name      ServiceHosts
     alias               Hosts with Services Assigned
     register            0   ; hide this hostgroup unless you want it displayed.
}

Then use a template that assigns hosts to this group:

define host{
     name            service-host
     register        0   ; this is a template

     hostgroups      +ServiceHosts    ; add host to this hostgroup
}

Make sure every host definition that has services assigned has the
	use service-host
directive in it (or uses a template that does).  Alternatively you can just 
assign the services to the ServiceHosts group in the service definitions 
instead of using this host template.

Then you can define your escalation this way:

define serviceescalation {
       use                     email-all
       hostgroup_name          ServiceHosts
       service_description     *
}

Hope this helps.

Paul Dubuc

>
> On Jun 7, 2011, at 10:29 AM, Paul M. Dubuc wrote:
>
>>
>> Michael Barrett wrote:
>>> Hi, I'm having a problem with an example given in the Tips&   Tricks documentation page. Currently I'm running: Nagios Core 3.2.0
>>>
>>> Anyway, the tip I'm trying is from here http://nagios.sourceforge.net/docs/nagioscore/3/en/objecttricks.html#serviceescalation
>>>
>>> The particular tip reads:
>>>
>>> All Services On Same Host:
>>> If you want to create service escalations for all services assigned to a particular host, you can use a wildcard in the service_description directive. The definition below would create a service escalation for all services on host HOST1. All the instances of the service escalation would be identical (i.e. have the same contact groups, notification interval, etc.).
>>>
>>> If you feel like being particularly adventurous, you can specify a wildcard in both the host_name and service_description directives. Doing so would create a service escalation for all services that you've defined in your configuration files.
>>>
>>> ##########
>>>
>>> So I tried the following:
>>>
>>> define serviceescalation {
>>>      name                    email-all
>>>      first_notification      1
>>>      last_notification       0
>>>      notification_interval   120
>>>      contact_groups          ops-group
>>>
>>>      register 0
>>> }
>>>
>>> define serviceescalation {
>>>      use                     email-all
>>>      host_name               *
>>>      service_description     *
>>> }
>>>
>>> And when I go to restart nagios I get the following:
>>>
>>> Error: Could not expand hostgroups and/or hosts specified in service (config file '/etc/nagios3/conf.d/services.cfg', starting on line 34)
>>>     Error processing object config files!
>>>
>>>
>>> Anyone know why this is a problem?  Am I missing something in the documentation, or is it just incorrect?
>>>
>>
>> You probably have some hosts that have no services assigned.  Using the wildcard for both host_name and service_description will not work in that case, unfortunately.  All hosts specified MUST have a service that matches the given service_description or you will get this error.
>>
>> Paul Dubuc
>
> --
> Michael Barrett
> loki77 at gmail.com
>
>
>
>


------------------------------------------------------------------------------
EditLive Enterprise is the world's most technically advanced content
authoring tool. Experience the power of Track Changes, Inline Image
Editing and ensure content is compliant with Accessibility Checking.
http://p.sf.net/sfu/ephox-dev2dev
_______________________________________________
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