Host Dependency Object Inheritance Issue

Aidan Anderson mail at aidananderson.co.uk
Thu Apr 22 17:18:55 CEST 2010


Aidan Anderson wrote:
> Hi,
>
> Using Nagios v3.2.1
>
> I am have problems defining host dependency object inheritance 
> (chaining) using templates.  It "appears" that if you use 2 levels of 
> inheritance, Nagios doesn't like it and aborts with the following error:
>
> Error: Could not expand dependent hostgroups and/or hosts specified in 
> host dependency (config file 
> '/usr/local/nagios/etc/manual/templates-hosts.cfg', starting on line 123)
>
> Here is my config.
>
>
> I created the following host dependency templates in 
> '/usr/local/nagios/etc/manual/templates-hosts.cfg'.  This is where the 
> error is found so I've highlighted line 123:
>
>
> define hostdependency{
>        name                            dc-ping-proxy
>        execution_failure_criteria      d,u,p
>        notification_failure_criteria   d,u,p
>        register                        0
>        }
>
> define hostdependency{
>        use                             dc-ping-proxy
>        name                            cam-ping-proxy
>        host_name                       rp1b
>        register                        0
>        }
>
> define hostdependency{                                             
> <------- Line 123
>        use                             dc-ping-proxy
>        name                            tcl-ping-proxy
>        host_name                       rp1a
>        register                        0
>        }
>
>
> I then created the following 2 host dependency definitions which use 
> the bottom 2 templates:
>
>
> define hostdependency{
>        use                             cam-ping-proxy
>        dependent_host_name             cam-int
>        }
>
> define hostdependency{
>        use                             tcl-ping-proxy
>        dependent_host_name             tcl-int
>        }
>
>
> This should expand as follows:
>
>
> define hostdependency{
>        host_name                       rp1b
>        dependent_host_name             cam-int
>        execution_failure_criteria      d,u,p
>        notification_failure_criteria   d,u,p
>        }
>
> define hostdependency{
>        host_name                       rp1a
>        dependent_host_name             tcl-int
>        execution_failure_criteria      d,u,p
>        notification_failure_criteria   d,u,p
>        }
>
> but I get the error.
>
>
> I then changed the configs to remove 1 level of inheritance.  My 
> templates and definitions now look like this:
>
> Template:
>
> define hostdependency{
>        name                            dc-ping-proxy
>        execution_failure_criteria      d,u,p
>        notification_failure_criteria   d,u,p
>        register                        0
>        }
>
>
> Definitions:
>
> define hostdependency{
>        use                             dc-ping-proxy
>        host_name                       rp1b
>        dependent_host_name             cam-int
>        }
>
> define hostdependency{
>        use                             dc-ping-proxy
>        host_name                       rp1a
>        dependent_host_name             tcl-int
>        }
>
> This should expand to the same configuration as when there were 2 
> levels of inheritance.
>
> However, the second configuration works fine but the first one 
> doesn't.  Also, I have created a similar service dependency setup with 
> 2 levels of inheritance and that works fine.
>
> Can someone cast their eye over the configs listed above to see if 
> there is anything obvious that I have done wrong with the inheritance?
>
> regards,
> Aidan
>
I've changed the why I work out the host_name of the host being depended 
upon to make it more dynamic so this is no longer an issue for me.

If someone could double check my syntax to make sure I have not made an 
error, I will post to nagios-dev as a possible bug.

cheers,
Aidan


------------------------------------------------------------------------------
_______________________________________________
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