[Nagios-users] Service Template Inheritance

2009-03-23 Thread Ken Netzorg
I am working on setting up Nagios for the first time and am trying to search
different forums to find my answers, but it appears forums.meulie.net has
been down for several days (or I can't seem to get there from my network)
and SF is giving me Search Server timeout errors when I try and search this
forum.
This is a long way of apologizing up front if this question is therefore
redundant to topics already covered at length in the past.

I am struggling with getting service template inheritance to work properly
as it relates to placing the check_command in an inherited template

I did see a brief post about this from around 2003, but I wasn't able to
fully follow the chain.

Having read the documentation and doing some pondering, I am looking to
break my service monitoring into two notification trees: Production and
Development. That way, I am not bothered by development services alerting
off hours and only get production notifications off hours. (If there is a
better way to set this up, I'm open to suggestions.) Additionally, when I am
working with one platform, I can define the one command centrally and not
have to worry about changing it in several places if I choose to go a
different route.

Therefore, I am setting up my services as follows:

define service {
 name global_service  # All the settings found in the global-service
example in the quickstart setup
 
 register 0
}

define service { name  windows_service
 use  global_service
 servicegroups windows_services  # This will group all windows services
together
 register  0
}


# Define the central definition of Client Version
define service {
 name w_client_version   # Windows Service, get Client Version of
NSClient++
 use  windows_service
 service_description NSClient Version
 check_command check_nt!CLIENTVERSION
 register 0 # Don't register this yet as it will be referenced
later!
}

# No inheritance here, begin the production shell of notification periods to
override any global settings
define service {
 nameproduction_service
 notification_period  24x7# Set 24x7 notification and other
intervals/options
 .
 register 0
}

## Now for putting the command and the service level together such that it
is production and will notify based on the production_service entry when the
w_client_version command is executed:
define service {
 name production_client_version
 use  production_service,w_client_version  # Merge the
Production definition with the service command
}

I keep getting an error when validating the configuration (nagios -v
nagios.cfg) that the w_client_version is a duplicate within the config files
and I have searched for it only finding it in one location.

Can the check_command only be defined at the lowest level? Is this a valid
configuration or are there better examples of separating development alerts
from production alerts?

(I'm using Nagios v 3.0.6)

Thanks,
Ken
--
Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are
powering Web 2.0 with engaging, cross-platform capabilities. Quickly and
easily build your RIAs with Flex Builder, the Eclipse(TM)based development
software that enables intelligent coding and step-through debugging.
Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com___
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

Re: [Nagios-users] Service Template Inheritance

2009-03-23 Thread Ken Netzorg
Think I've gotten to the root of my rookie issue. Using # instead of ;
inside a definition for commenting. In addition to realizing the cfg_dir
definition in the nagios.cfg is recursive and I didn't need to define each
directory under the base directory it was pointing to.
Still interested in anyone's thoughts on breaking up services into
Production/Development and avoiding defining the commands in multiple
places. Is my approach similar to others out there or has someone tried this
approach and found there are limitations and moved to something different?

Thanks!
Ken

On Mon, Mar 23, 2009 at 11:59 AM, Ken Netzorg knetz...@gmail.com wrote:

 I am working on setting up Nagios for the first time and am trying to
 search different forums to find my answers, but it appears
 forums.meulie.net has been down for several days (or I can't seem to get
 there from my network) and SF is giving me Search Server timeout errors when
 I try and search this forum.
 This is a long way of apologizing up front if this question is therefore
 redundant to topics already covered at length in the past.

 I am struggling with getting service template inheritance to work properly
 as it relates to placing the check_command in an inherited template

 I did see a brief post about this from around 2003, but I wasn't able to
 fully follow the chain.

 Having read the documentation and doing some pondering, I am looking to
 break my service monitoring into two notification trees: Production and
 Development. That way, I am not bothered by development services alerting
 off hours and only get production notifications off hours. (If there is a
 better way to set this up, I'm open to suggestions.) Additionally, when I am
 working with one platform, I can define the one command centrally and not
 have to worry about changing it in several places if I choose to go a
 different route.

 Therefore, I am setting up my services as follows:

 define service {
  name global_service  # All the settings found in the
 global-service example in the quickstart setup
  
  register 0
 }

 define service { name  windows_service
  use  global_service
  servicegroups windows_services  # This will group all windows services
 together
  register  0
 }


 # Define the central definition of Client Version
 define service {
  name w_client_version   # Windows Service, get Client Version of
 NSClient++
  use  windows_service
  service_description NSClient Version
  check_command check_nt!CLIENTVERSION
  register 0 # Don't register this yet as it will be referenced
 later!
 }

 # No inheritance here, begin the production shell of notification periods
 to override any global settings
 define service {
  nameproduction_service
  notification_period  24x7# Set 24x7 notification and other
 intervals/options
  .
  register 0
 }

 ## Now for putting the command and the service level together such that it
 is production and will notify based on the production_service entry when the
 w_client_version command is executed:
 define service {
  name production_client_version
  use  production_service,w_client_version  # Merge the
 Production definition with the service command
 }

 I keep getting an error when validating the configuration (nagios -v
 nagios.cfg) that the w_client_version is a duplicate within the config files
 and I have searched for it only finding it in one location.

 Can the check_command only be defined at the lowest level? Is this a valid
 configuration or are there better examples of separating development alerts
 from production alerts?

 (I'm using Nagios v 3.0.6)

 Thanks,
 Ken

--
Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are
powering Web 2.0 with engaging, cross-platform capabilities. Quickly and
easily build your RIAs with Flex Builder, the Eclipse(TM)based development
software that enables intelligent coding and step-through debugging.
Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com___
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

Re: [Nagios-users] Service Template Inheritance

2009-03-23 Thread Ken Netzorg
Think I've gotten to the root of my rookie issue. Using # instead of ;
inside a definition for commenting. In addition to realizing the cfg_dir
definition in the nagios.cfg is recursive and I didn't need to define each
directory under the base directory it was pointing to.
Still interested in anyone's thoughts on breaking up services into
Production/Development and avoiding defining the commands in multiple
places. Is my approach similar to others out there or has someone tried this
approach and found there are limitations and moved to something different?

Thanks!
Ken

On Mon, Mar 23, 2009 at 11:59 AM, Ken Netzorg knetz...@gmail.com wrote:

 I am working on setting up Nagios for the first time and am trying to
 search different forums to find my answers, but it appears
 forums.meulie.net has been down for several days (or I can't seem to get
 there from my network) and SF is giving me Search Server timeout errors when
 I try and search this forum.
 This is a long way of apologizing up front if this question is therefore
 redundant to topics already covered at length in the past.

 I am struggling with getting service template inheritance to work properly
 as it relates to placing the check_command in an inherited template

 I did see a brief post about this from around 2003, but I wasn't able to
 fully follow the chain.

 Having read the documentation and doing some pondering, I am looking to
 break my service monitoring into two notification trees: Production and
 Development. That way, I am not bothered by development services alerting
 off hours and only get production notifications off hours. (If there is a
 better way to set this up, I'm open to suggestions.) Additionally, when I am
 working with one platform, I can define the one command centrally and not
 have to worry about changing it in several places if I choose to go a
 different route.

 Therefore, I am setting up my services as follows:

 define service {
  name global_service  # All the settings found in the
 global-service example in the quickstart setup
  
  register 0
 }

 define service { name  windows_service
  use  global_service
  servicegroups windows_services  # This will group all windows services
 together
  register  0
 }


 # Define the central definition of Client Version
 define service {
  name w_client_version   # Windows Service, get Client Version of
 NSClient++
  use  windows_service
  service_description NSClient Version
  check_command check_nt!CLIENTVERSION
  register 0 # Don't register this yet as it will be referenced
 later!
 }

 # No inheritance here, begin the production shell of notification periods
 to override any global settings
 define service {
  nameproduction_service
  notification_period  24x7# Set 24x7 notification and other
 intervals/options
  .
  register 0
 }

 ## Now for putting the command and the service level together such that it
 is production and will notify based on the production_service entry when the
 w_client_version command is executed:
 define service {
  name production_client_version
  use  production_service,w_client_version  # Merge the
 Production definition with the service command
 }

 I keep getting an error when validating the configuration (nagios -v
 nagios.cfg) that the w_client_version is a duplicate within the config files
 and I have searched for it only finding it in one location.

 Can the check_command only be defined at the lowest level? Is this a valid
 configuration or are there better examples of separating development alerts
 from production alerts?

 (I'm using Nagios v 3.0.6)

 Thanks,
 Ken

--
Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are
powering Web 2.0 with engaging, cross-platform capabilities. Quickly and
easily build your RIAs with Flex Builder, the Eclipse(TM)based development
software that enables intelligent coding and step-through debugging.
Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com___
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

Re: [Nagios-users] Service Template Inheritance

2009-03-23 Thread Chris Beattie
Ken Netzorg wrote:
 
 Having read the documentation and doing some pondering, I am looking to 
 break my service monitoring into two notification trees: Production and 
 Development. That way, I am not bothered by development services 
 alerting off hours and only get production notifications off hours. (If 
 there is a better way to set this up, I'm open to suggestions.) 

Service checks can inherit their notification period from their 
associated host object.  I set up my host templates for my dev and 
production servers with different notification periods, but I can use 
the same service templates for both since I haven't got a notification 
period defined in my service template..  The production server host 
template can notify 24x7, but the dev server host template is limitited 
to notifying during work hours.  The check period is 24x7 for both types 
of hosts, so Nagios always knows what's going on, even if it isn't 
saying anything about it.

Services can also inherit their contacts from their associated hosts, so 
my prod host template includes a pager contact group that my dev host 
template does not.


  name production_client_version
  use  production_service,w_client_version  # Merge the 
 Production definition with the service command
 }
 
 I keep getting an error when validating the configuration (nagios -v 
 nagios.cfg) that the w_client_version is a duplicate within the config 
 files and I have searched for it only finding it in one location.

I haven't tried referencing two templates in a definition before, so I 
can't tell you if that works or not.  My instinct is to try it with just 
one template and see if the error goes away.

 Can the check_command only be defined at the lowest level? Is this a 
 valid configuration or are there better examples of separating 
 development alerts from production alerts?

You can set the check_command in the service template and/or the service 
definition.  Anything you set in the service definition that's already 
been set in the service template will override the template's settings.

For example, I have an SSL-enabled site service template defined to use 
/ as its URL (my standard_service template has other things defined):

define service {
use standard_service
nameSSL Site
check_command   check_ssl_site!/
notes   blah blah blah
register0
}

For a host where I want to check /, all I need is:

define service {
use SSL Site
host_name   foo
}

But for a host where I want to check a different URL, I use:

define service {
use SSL Site
host_name   different-foo
check_command   check_ssl_site!/foo/bar/bat.asp
}

The second one is still inheriting everything except the check_command 
from the SSL Site template.

However, I think the answer to splitting up your dev and prod service 
types is just letting them inherit the notification period from the 
host.  You'll have half the service templates to manage if you can do that.

Look for implied inheritance on this page:
http://nagios.sourceforge.net/docs/3_0/objectinheritance.html

-- 
Chris Beattie

Nothing in this message is intended to make or accept and offer or to form a 
contract, except that an attachment that is an image of a contract bearing the 
signature of an officer of our company may be or become a contract. This 
message (including any attachments) is intended only for the use of the 
individual or entity to whom it is addressed. It may contain information that 
is non-public, proprietary, privileged, confidential, and exempt from 
disclosure under applicable law or may constitute as attorney work product. If 
you are not the intended recipient, we hereby notify you that any use, 
dissemination, distribution, or copying of this message is strictly prohibited. 
If you have received this message in error, please notify us immediately by 
telephone and delete this message immediately.

Thank you.

--
Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are
powering Web 2.0 with engaging, cross-platform capabilities. Quickly and
easily build your RIAs with Flex Builder, the Eclipse(TM)based development
software that enables intelligent coding and step-through debugging.
Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com
___
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


Re: [Nagios-users] Service Template Inheritance

2009-03-23 Thread Ken Netzorg
Chris,
Thanks for the detailed info. I had gone through the inheritance
documentation you'd listed below, but I didn't put the facts together that I
can mix my host template with my service template such that I can have a
host's notification settings apply to a service. I had been trying to figure
out how to merge the two since I want the service checks associated with my
development hosts to take on the host notifications. I'll have to go back
and re-evaluate this and see if I can get this working. If so, I agree, it
will cut down on the number of templates and areas I have to define
notifications.

Ken

On Mon, Mar 23, 2009 at 1:27 PM, Chris Beattie cbeat...@geninfo.com wrote:

 Ken Netzorg wrote:


 Having read the documentation and doing some pondering, I am looking to
 break my service monitoring into two notification trees: Production and
 Development. That way, I am not bothered by development services alerting
 off hours and only get production notifications off hours. (If there is a
 better way to set this up, I'm open to suggestions.)


 Service checks can inherit their notification period from their associated
 host object.  I set up my host templates for my dev and production servers
 with different notification periods, but I can use the same service
 templates for both since I haven't got a notification period defined in my
 service template..  The production server host template can notify 24x7, but
 the dev server host template is limitited to notifying during work hours.
  The check period is 24x7 for both types of hosts, so Nagios always knows
 what's going on, even if it isn't saying anything about it.

 Services can also inherit their contacts from their associated hosts, so my
 prod host template includes a pager contact group that my dev host template
 does not.


  name production_client_version
 use  production_service,w_client_version  # Merge the
 Production definition with the service command
 }

 I keep getting an error when validating the configuration (nagios -v
 nagios.cfg) that the w_client_version is a duplicate within the config files
 and I have searched for it only finding it in one location.


 I haven't tried referencing two templates in a definition before, so I
 can't tell you if that works or not.  My instinct is to try it with just one
 template and see if the error goes away.

  Can the check_command only be defined at the lowest level? Is this a valid
 configuration or are there better examples of separating development alerts
 from production alerts?


 You can set the check_command in the service template and/or the service
 definition.  Anything you set in the service definition that's already been
 set in the service template will override the template's settings.

 For example, I have an SSL-enabled site service template defined to use /
 as its URL (my standard_service template has other things defined):

 define service {
use standard_service
nameSSL Site
check_command   check_ssl_site!/
notes   blah blah blah
register0
 }

 For a host where I want to check /, all I need is:

 define service {
use SSL Site
host_name   foo
 }

 But for a host where I want to check a different URL, I use:

 define service {
use SSL Site
host_name   different-foo
check_command   check_ssl_site!/foo/bar/bat.asp
 }

 The second one is still inheriting everything except the check_command from
 the SSL Site template.

 However, I think the answer to splitting up your dev and prod service types
 is just letting them inherit the notification period from the host.  You'll
 have half the service templates to manage if you can do that.

 Look for implied inheritance on this page:
 http://nagios.sourceforge.net/docs/3_0/objectinheritance.html

 --
 Chris Beattie

 Nothing in this message is intended to make or accept and offer or to form
 a contract, except that an attachment that is an image of a contract bearing
 the signature of an officer of our company may be or become a contract. This
 message (including any attachments) is intended only for the use of the
 individual or entity to whom it is addressed. It may contain information
 that is non-public, proprietary, privileged, confidential, and exempt from
 disclosure under applicable law or may constitute as attorney work product.
 If you are not the intended recipient, we hereby notify you that any use,
 dissemination, distribution, or copying of this message is strictly
 prohibited. If you have received this message in error, please notify us
 immediately by telephone and delete this message immediately.

 Thank you.

--
Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are
powering Web 2.0 with engaging, cross-platform capabilities. Quickly and
easily build your