<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">

<head>
<meta http-equiv=Content-Type content="text/html; charset=us-ascii">
<meta name=Generator content="Microsoft Word 12 (filtered medium)">
<style>
<!--
 /* Font Definitions */
 @font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;}
@page Section1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.Section1
        {page:Section1;}
-->
</style>
<!--[if gte mso 9]><xml>
 <o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
 <o:shapelayout v:ext="edit">
  <o:idmap v:ext="edit" data="1" />
 </o:shapelayout></xml><![endif]-->
</head>

<body lang=EN-US link=blue vlink=purple>

<div class=Section1>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>Shai,<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>The example scripts are actual scripts that you can use..for
example:<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><a
href="http://www.nagios.org/developerinfo/externalcommands/commandinfo.php?command_id=36">http://www.nagios.org/developerinfo/externalcommands/commandinfo.php?command_id=36</a><o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p> </o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>#!/bin/sh<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'># This is a sample shell script showing how you can submit the
DISABLE_HOST_SVC_NOTIFICATIONS command<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'># to Nagios.  Adjust variables to fit your environment as
necessary.<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p> </o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>now=`date +%s`<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>commandfile='/usr/local/nagios/var/rw/nagios.cmd'<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p> </o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>/bin/printf "[%lu]
DISABLE_HOST_SVC_NOTIFICATIONS;host1\n" $now > $commandfile<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p> </o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p> </o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p> </o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>That is the ‘example’ script.<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p> </o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>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<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p> </o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>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.   <o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p> </o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>~Jayson<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p> </o:p></span></p>

<div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in'>

<p class=MsoNormal><b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>From:</span></b><span
style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'> Shai
[mailto:shaibn@gmail.com] <br>
<b>Sent:</b> Tuesday, January 13, 2009 8:53 AM<br>
<b>To:</b> nagios-users@lists.sourceforge.net<br>
<b>Subject:</b> Re: [Nagios-users] downtime large number of hosts?<o:p></o:p></span></p>

</div>

<p class=MsoNormal><o:p> </o:p></p>

<div>

<p class=MsoNormal style='margin-bottom:12.0pt'>Hi,<br>
<br>
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?<br>
<br>
Shai<o:p></o:p></p>

<div>

<p class=MsoNormal>On Fri, Jan 9, 2009 at 5:12 PM, Jayson Broughton <<a
href="mailto:jbroughton@truecos.com">jbroughton@truecos.com</a>> wrote:<o:p></o:p></p>

<p class=MsoNormal>We have some linux servers here that peg-out on CPU/Mem when
they are doing<br>
a full backup, so I have used the wonderful 'Nagios External Command List'<br>
website to custom tailor my alert notifications for hosts/hostgroups every<br>
day during a certain time.  Specifically the
DISABLE_HOST_SVC_NOTIFICATIONS<br>
and DISABLE_HOST_SVC_CHECKS.  Then when it's time to re-monitor, a crontab<br>
entry runs: ENABLE_HOST_SVC_NOTIFICATIONS & ENABLE_HOST_SVC_CHECKS.<br>
<br>
Check out those 4 options on:<br>
<a href="http://www.nagios.org/developerinfo/externalcommands/commandlist.php"
target="_blank">http://www.nagios.org/developerinfo/externalcommands/commandlist.php</a><br>
<br>
The examples give you an excellent base script to work off of.<br>
<br>
~Jayson<o:p></o:p></p>

<div>

<div>

<p class=MsoNormal><br>
<br>
-----Original Message-----<br>
From: Marc Powell [mailto:<a href="mailto:marc@ena.com">marc@ena.com</a>]<br>
Sent: Thursday, January 08, 2009 8:05 AM<br>
To: Nagios Users<br>
Subject: Re: [Nagios-users] downtime large number of hosts?<br>
<br>
<br>
On Jan 8, 2009, at 8:51 AM, Mahmoud Hanafi wrote:<br>
<br>
> Is there a easy way to schedule down time for large number of hosts/<br>
> services at the same time? The downtime web interface doesn't accept<br>
> wildcard characters.<br>
<br>
If they are all in the same hostgroup you can click on the hostgroup<br>
name (in ()'s) and schedule downtime for all of them at once,<br>
otherwise, no not that I am aware of outside of  some simple scripting<br>
to send the appropriate external command for each host through the<br>
external command file.<br>
<br>
--<br>
Marc<br>
<br>
<br>
----------------------------------------------------------------------------<br>
--<br>
Check out the new SourceForge.net Marketplace.<br>
It is the best place to buy or sell services for<br>
just about anything Open Source.<br>
<a href="http://p.sf.net/sfu/Xq1LFB" target="_blank">http://p.sf.net/sfu/Xq1LFB</a><br>
_______________________________________________<br>
Nagios-users mailing list<br>
<a href="mailto:Nagios-users@lists.sourceforge.net">Nagios-users@lists.sourceforge.net</a><br>
<a href="https://lists.sourceforge.net/lists/listinfo/nagios-users"
target="_blank">https://lists.sourceforge.net/lists/listinfo/nagios-users</a><br>
::: Please include Nagios version, plugin version (-v) and OS when reporting<br>
any issue.<br>
::: Messages without supporting info will risk being sent to /dev/null<o:p></o:p></p>

</div>

</div>

<p class=MsoNormal>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.<o:p></o:p></p>

<div>

<div>

<p class=MsoNormal><br>
<br>
------------------------------------------------------------------------------<br>
Check out the new SourceForge.net Marketplace.<br>
It is the best place to buy or sell services for<br>
just about anything Open Source.<br>
<a href="http://p.sf.net/sfu/Xq1LFB" target="_blank">http://p.sf.net/sfu/Xq1LFB</a><br>
_______________________________________________<br>
Nagios-users mailing list<br>
<a href="mailto:Nagios-users@lists.sourceforge.net">Nagios-users@lists.sourceforge.net</a><br>
<a href="https://lists.sourceforge.net/lists/listinfo/nagios-users"
target="_blank">https://lists.sourceforge.net/lists/listinfo/nagios-users</a><br>
::: Please include Nagios version, plugin version (-v) and OS when reporting
any issue.<br>
::: Messages without supporting info will risk being sent to /dev/null<o:p></o:p></p>

</div>

</div>

</div>

<p class=MsoNormal><o:p> </o:p></p>

</div>

</div>

</body>

</html>

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.