downtime large number of hosts?

Jayson Broughton jbroughton at truecos.com
Wed Jan 14 03:02:45 CET 2009


Shai,

The example scripts are actual scripts that you can use..for example:

http://www.nagios.org/developerinfo/externalcommands/commandinfo.php?command
_id=36

 

#!/bin/sh

# This is a sample shell script showing how you can submit the
DISABLE_HOST_SVC_NOTIFICATIONS command

# to Nagios.  Adjust variables to fit your environment as necessary.

 

now=`date +%s`

commandfile='/usr/local/nagios/var/rw/nagios.cmd'

 

/bin/printf "[%lu] DISABLE_HOST_SVC_NOTIFICATIONS;host1\n" $now >
$commandfile

 

 

 

That is the 'example' script.

 

Just create a file and name it whatever you want..for me I use the hostname
in the file name. DISABLE_HOST_SVC_NOTIFICATIONS_HOSTNAME, then chmod the
file for execution: chmod u+x DISABLE_HOST_SVC_NOTIFICATIONS_HOSTNAME

 

Edit the file and replace host1 with the hostname that you want to affect,
the hostname has to be spelled the same way that it is in your .cfg file.
Now you can either run the file manually when you want a downtime, or set it
to run in a cronjob.  For you since you want a large list of hosts that you
want to disable notifications, then try the disable hostgroup script.   

 

~Jayson

 

From: Shai [mailto:shaibn at gmail.com] 
Sent: Tuesday, January 13, 2009 8:53 AM
To: nagios-users at lists.sourceforge.net
Subject: Re: [Nagios-users] downtime large number of hosts?

 

Hi,

I've seen the help on the nagios external command, but I'm not exactly sure
how to make the script. Can someone show me an example?

Shai

On Fri, Jan 9, 2009 at 5:12 PM, Jayson Broughton <jbroughton at truecos.com>
wrote:

We have some linux servers here that peg-out on CPU/Mem when they are doing
a full backup, so I have used the wonderful 'Nagios External Command List'
website to custom tailor my alert notifications for hosts/hostgroups every
day during a certain time.  Specifically the DISABLE_HOST_SVC_NOTIFICATIONS
and DISABLE_HOST_SVC_CHECKS.  Then when it's time to re-monitor, a crontab
entry runs: ENABLE_HOST_SVC_NOTIFICATIONS & ENABLE_HOST_SVC_CHECKS.

Check out those 4 options on:
http://www.nagios.org/developerinfo/externalcommands/commandlist.php

The examples give you an excellent base script to work off of.

~Jayson



-----Original Message-----
From: Marc Powell [mailto:marc at ena.com]
Sent: Thursday, January 08, 2009 8:05 AM
To: Nagios Users
Subject: Re: [Nagios-users] downtime large number of hosts?


On Jan 8, 2009, at 8:51 AM, Mahmoud Hanafi wrote:

> Is there a easy way to schedule down time for large number of hosts/
> services at the same time? The downtime web interface doesn't accept
> wildcard characters.

If they are all in the same hostgroup you can click on the hostgroup
name (in ()'s) and schedule downtime for all of them at once,
otherwise, no not that I am aware of outside of  some simple scripting
to send the appropriate external command for each host through the
external command file.

--
Marc


----------------------------------------------------------------------------
--
Check out the new SourceForge.net Marketplace.
It is the best place to buy or sell services for
just about anything Open Source.
http://p.sf.net/sfu/Xq1LFB
_______________________________________________
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

The information in this electronic mail message and any attached files is
confidential and may be legally privileged.  If you are not the intended
recipient, delete this message and contact the sender immediately.  Access
to this message by anyone other than its intended recipient is unauthorized.
You must not use or disseminate this information as it is proprietary
property of the True companies.  Communications on or through the True
companies' computer systems may be monitored or recorded to secure effective
system operation and for other lawful purposes.  Thank you.



----------------------------------------------------------------------------
--
Check out the new SourceForge.net Marketplace.
It is the best place to buy or sell services for
just about anything Open Source.
http://p.sf.net/sfu/Xq1LFB
_______________________________________________
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

 


The information in this electronic mail message and any attached files is confidential and may be legally privileged.  If you are not the intended recipient, delete this message and contact the sender immediately.  Access to this message by anyone other than its intended recipient is unauthorized.  You must not use or disseminate this information as it is proprietary property of the True companies.  Communications on or through the True companies' computer systems may be monitored or recorded to secure effective system operation and for other lawful purposes.  Thank you.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.monitoring-lists.org/archive/users/attachments/20090113/b7c8761d/attachment.html>
-------------- next part --------------
------------------------------------------------------------------------------
This SF.net email is sponsored by:
SourcForge Community
SourceForge wants to tell your story.
http://p.sf.net/sfu/sf-spreadtheword
-------------- next part --------------
_______________________________________________
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