Antwort: Service Definition Efficiency

Ralph.Grothe at itdz-berlin.de Ralph.Grothe at itdz-berlin.de
Mon Jul 25 13:52:18 CEST 2005


Hi Sascha,

discovered your trick in the Time Saving Section of the Nagios
docs.

http://nagios.sourceforge.net/docs/2_0/templatetricks.html#servic
e


But this is somewhat inconsistent with the listing of allowed
attributes in the Service Definition section

http://nagios.sourceforge.net/docs/2_0/xodtemplate.html#service

In this list I cannot find the hostname_group attribute at all,
only the host_name attribute which has red coloured font to
indicate that this is a required entry!

And as I learned somewhere else in the docs that such object
definitions that lack required attributes should be regarded as
templates (similar to abstract classes in OO) and have to be
marked by "register 0".
But you are suggesting the opposite (viz. "register 1")?


Sorry, but to me the Nagios docs is pretty messy and should
urgently undergo a revision by the developers.
Then all the obfuscation possibly would magically fade and made
it much easier for someone to follow it.
But maybe this isn't wanted, and the Nagios folks simply modified
a notorious cryptographers' slogan about security to "Proficiency
by Obscurity"?



> -----Original Message-----
> From: srunschke at abit.de [mailto:srunschke at abit.de]
> Sent: Monday, July 25, 2005 12:42 PM
> To: nagios-users at lists.sourceforge.net
> Cc: Ralph.Grothe at itdz-berlin.de
> Subject: Antwort: [Nagios-users] Service Definition Efficiency
> 
> 
> > Because I want to safe me from repetitive editing I thought
one
> > could define a service group in servicegroups.cfg
> > that comprises every host of our site that runs an SSH daemon
in
> > the member list.
> > 
> > Then I'd like to define a generic check-ssh service that kind
of
> > being only template defined.
> > But I stumbled over that each service requires a
check_command
> > statement,
> > which again would force me into a hundred times buffer
copying
> > and editing.
> > 
> > Can what I wish to accomplish be set up in abt. less than ten
> > lines?
> 
> 1. Create an empty hostgroup named SSH-HOSTGROUP
> 2. Create a generic service template generic-CHECK_SSH 
>    with "check_command check_ssh"
> 3. Put "hostgroups SSH-HOSTGROUP" into the appropiate hosts
> 4. Create a servicecheck:
> 
> define service {
> use                             generic-CHECK_SSH
> hostgroup_name                  SSH-HOSTGROUP
> service_description             SSH
> register                        1
> contact_groups                  your_contactgroup
> }
> 
> Once you have this setup, you only need to edit the
> hostfiles and add/remove the SSH-HOSTGROUP from the
> host to add/remove the check. No more editing of any
> other file in the future.
> 
> But take care that the hostgroup should never have 0
> members or Nagios will bail and refuse to start.



-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
_______________________________________________
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