> -----Original Message----- > From: [EMAIL PROTECTED] [mailto:nagios-users- > [EMAIL PROTECTED] On Behalf Of Tiernan, Michael C. > Sent: Wednesday, May 10, 2006 3:12 PM > To: nagios-users@lists.sourceforge.net > Subject: [Nagios-users] About object definitions. > > Another question about definitions, did I miss something in the > documentation? > > I'd like to define a host object: > define host{ > check_command check-host-alive > max_check_attempts 1 > check_period 24x7 > contact_groups testadmins > notification_interval 1 > notification_period anytime > notification_options d,u,r,f > name unix_hosts > } > > and then be able to use it: > > define host { > host_name myhost > alias big box > address 10.0.0.0 > use unix_hosts > } > > but it complains about the original definition being blank/null. > > I know the object definition works right if I do this: > > define host{ > host_name thatbox > alias Bob's Linux Machine > address 10.1.0.0 > check_command check-host-alive > max_check_attempts 1 > check_period 24x7 > contact_groups testadmins > notification_interval 1 > notification_period anytime > notification_options d,u,r,f > name unix_hosts > } > > and then use 'unix_hosts" after that. > Simplified, can I define unix_hosts without assigning a machine name to > it?
Yep. http://nagios.sourceforge.net/docs/2_0/templaterecursion.html. Add 'register 0' to your template object. "register [0/1] The third variable is register. This variable is used to indicate whether or not the object definition should be "registered" with Nagios. By default, all object definitions are registered. If you are using a partial object definition as a template, you would want to prevent it from being registered (an example of this is provided later). Values are as follows: 0 = do NOT register object definition, 1 = register object definition (this is the default). This variable is NOT inherited; every (partial) object definition used as a template must explicitly set the register directive to be 0. This prevents the need to override an inherited register directive with a value of 1 for every object that should be registered." ------------------------------------------------------- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid0709&bid&3057&dat1642 _______________________________________________ Nagios-users mailing list Nagios-users@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