service groups?

David Maynard dmaynard at outserv.net
Thu May 22 00:51:57 CEST 2003


Until 2.0 is out, I had two suggestions that might help.  You may already be
using one or both of them.
 
1) Make sure you are using service dependencies to the fullest extent
possible.  This could limit the number of things that you have to place in
maintenance.
 
This option has some significant limitations since the dependency graph
isn't always a pretty tree.  In particular, any services where there are
clusters or redundant servers make it hard to define meaningful
dependencies.
 
2) Use shell/perl scripts to schedule the maintenance.
 
This option helps if the set of services is repeated more than once or if
you can easily generate a list of them to program against.  Here is a simple
example from a system still running NetSaint.  I'm not sure how much the
external command interface has changed for Nagios, but the idea should be
similar.  There was some discussion of using other programs to generate
external commands recently.  You might try searching the archives.
 
#!/bin/sh
CMDFILE="/home/netsaint/var/rw/netsaint.cmd"
 
start_time=`date -d "today 0200" +%s`
end_time=`date -d "today 0530" +%s`
 
svc_descr="Content-uncached"
 
now=`date +%s`
 
echo "[$now]
SCHEDULE_SVC_DOWNTIME;machine1;$svc_descr;$start_time;$end_time" >$CMDFILE
echo "[$now]
SCHEDULE_SVC_DOWNTIME;machine2;$svc_descr;$start_time;$end_time" >$CMDFILE
echo "[$now]
SCHEDULE_SVC_DOWNTIME;machine3;$svc_descr;$start_time;$end_time" >$CMDFILE
echo "[$now] SCHEDULE_SVC_DOWNTIME;www2;$svc_descr;$start_time;$end_time"
>$CMDFILE
 
In this case, the list of machines was static, so I just used cut/paste to
build it.  You can always write a loop to crunch through a list.  Be sure to
run the script as a user that has permission to write to the command socket.
 
In this case, we ended up making this work a regularly scheduled maintenance
task, so we defined an appropriate timeperiod and told NetSaint not to
complain about the affected services during the scheduled maintenance
windows.  The script idea still applies if the work isn't performed on a
fixed schedule though.
 
-dpm
 
-- 
  David P. Maynard
  OutServ.net, Inc. -- Coordinated IT Operations Solutions 
  Email: dmaynard at outserv.net, Tel: +1 512 977 8918, Fax: +1 512 977 0986 
-- 
 
 
 -----Original Message-----
From: Hochberg, Keith [mailto:Keith.Hochberg at mtvi.com] 
Sent: Wednesday, May 21, 2003 4:13 PM
To: nagios-users at lists.sourceforge.net
Subject: [Nagios-users] service groups?



Hi All, 

Whenever my company runs a maintenance we try to identify all hosts and
services which will be affected and put them into maintenance mode.  I am
finding that this would an easier process if there were service groups
defined in nagios.  Specifically on our web servers (which have instances
for over 25 different sites) we have to go in and manually put each instance
on each webserver (which are defined as services) into maintenance mode.
Sometimes we have to put over 100 different services into maintenance mode
if more than one site will be affected during a maintenance.  It would be
great if we could group all services into a service group and put the whole
group into maintenance mode.  has anyone ran into a similar problem?  I have
over 2,000 service checks defined in our nagios build and it is getting hard
to manage only using hostgroups.  

Much thanks in advance, 

Keith Hochberg 

------------------------------------------------------- This SF.net email is
sponsored by: ObjectStore. If flattening out C++ or Java code to make your
application fit in a relational database is painful, don't do it! Check out
ObjectStore. Now part of Progress Software.
http://www.objectstore.net/sourceforge
_______________________________________________ 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

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.monitoring-lists.org/archive/users/attachments/20030521/a1bdd4ce/attachment.html>


More information about the Users mailing list