Antwort: Service Definition Efficiency

srunschke at abit.de srunschke at abit.de
Mon Jul 25 12:42:27 CEST 2005


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

--------------------------------------------------
Sascha Runschke
Netzwerk Administration
IT-Services

ABIT AG
Robert-Bosch-Str. 1
40668 Meerbusch

Tel.:+49 (0) 2150.9153.226
Mobil:+49 (0) 173.5419665
mailto:SRunschke at abit.de

http://www.abit.net
http://www.abit-epos.net
http://www.my-academy.net
--------------------------------------------------
Der Inhalt dieser Email sowie die Anhänge sind ausschließlich für den 
bezeichneten Adressaten bestimmt. Wenn Sie nicht der vorgesehene Adressat 
dieser Email oder dessen Vertreter sein sollten, so beachten Sie bitte, 
daß jede Form der Kenntnisnahme, Veröffentlichung,  Vervielfältigung oder 
Weitergabe des Inhalts dieser Email unzulässig ist. Wir möchten Sie 
außerdem darauf hinweisen, daß die Kommunikation per Email über das 
Internet unsicher ist, da fuer unberechtigte Dritte grundsätzlich die 
Möglichkeit der Kenntnisnahme und Manipulation besteht. Wenn Sie diese 
Nachricht versehentlich erhalten, informieren Sie bitte den Absender und 
löschen diese Nachricht mit den Anhängen. Herzlichen Dank

The information and any attachments contained in this email are intended 
solely for the addressee. Access to this email by anyone else is 
unauthorized. If you are not the intended recipient, any form of 
disclosure, reproduction, distribution or any action taken or refrained 
from in reliance on it, is prohibited and may be unlawful. We also like to 
inform you that communication via email over the internet is insecure 
because third parties may have the possibility to access and manipulate 
emails. If you have received the message in error, please advise the 
sender and delete the message and any attachments. Thank you very much.


-------------------------------------------------------
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_idt77&alloc_id492&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