Service definition with * and host-templates

Lori Adams ladams at cloudmark.com
Wed Feb 8 04:07:48 CET 2006


The notification looks right to me.  

A template can be valid hosts or services according to nagios, as long
as all required values for a host config are present in the template
config.  If they are not all there, then the config is allowed as long
as it has a register = 0.  

Your template called router has all required values.  To make it so that
"router" does not send a PING notification, you would remove "router" as
the host_name for your router host template.  (see below)

-Lori



> -----Original Message-----
> From: nagios-users-admin at lists.sourceforge.net [mailto:nagios-users-
> admin at lists.sourceforge.net] On Behalf Of Kai Reese
> Sent: Monday, February 06, 2006 1:19 AM
> To: Nagios Users Mailing List
> Subject: [Nagios-users] Service definition with * and host-templates
> 
> Hey list.
> 
> I'm having a slight problem with understanding templates, it seems.
> 
> I use a service definition:
> ## PING
> define service{
>         host_name               *,!sv-proxy
>         use                     PING
> }
> 
> where PING is:
> ## PING Template
> define service{
>         host_name               PING
>         name                    PING
>         service_description     PING
>         use                     generic
>         check_command           check_ping!100.0,20%!500.0,60%
>         register                0
> }
> 
> and generic is:
> define service{
>         host_name               GENERIC
>         name                    generic
>         service_description     generic
>         is_volatile             0
>         check_period            24x7
>         max_check_attempts      3
>         normal_check_interval   5
>         retry_check_interval    1
>         contact_groups          admin
>         notification_interval   120
>         notification_period     workhours
>         notification_options    c,r
>         register                0
> }
> 
> 
> And have host definitions using templates as well.
> 
> ## generic template
> define host{
>         host_name               generic
>         alias                   GenericTemplate
>         contact_groups          admin
>         check_command           check-host-alive
>         max_check_attempts      5
>         notification_options    d,u,r
>         notification_interval   24x7
>         name                    generic
>         register                0
> }
> 
> ## router template
> define host{
>         use             generic
=====> remove the host_name here.  
>         host_name       router
>         alias           Template: Router
>         name            router
>         register        0
> }
> 
> 
> And now I keep getting mail notifications telling me:
> ***** Nagios  *****
> 
> Notification Type: PROBLEM
> 
> Service: PING
> Host: Template: Router
> Address: <IP>
> State: CRITICAL
> 
> Date/Time: Mon Feb 6 09:44:32 CET 2006
> 
> Additional Info:
> 
> CRITICAL - Plugin timed out after 10 seconds
> 
> 
> 
> I wonder, if the name is just wrong in the notification email, because
> the ip is one of the routers I use, or if I really receive a
> notification about a >register 0< template.
> 
> Anyone ?
> Thanks, Kai
> 
> 
> -------------------------------------------------------
> This SF.net email is sponsored by: Splunk Inc. Do you grep through log
> files
> for problems?  Stop!  Download the new AJAX search engine that makes
> searching your log files as easy as surfing the  web.  DOWNLOAD
SPLUNK!
> http://sel.as-us.falkag.net/sel?cmd=k&kid3432&bid#0486&dat1642
> _______________________________________________
> 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


-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid3432&bid#0486&dat1642
_______________________________________________
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