<div dir="ltr"><br><br>
<div class="gmail_quote">On Tue, Sep 16, 2008 at 3:46 PM, Assaf Flatto <span dir="ltr"><<a href="mailto:assaf.flatto@ssp.uk.com">assaf.flatto@ssp.uk.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">look in the contact and escalations sections:<br><br><a href="http://nagios.sourceforge.net/docs/3_0/configobject.html" target="_blank">http://nagios.sourceforge.net/docs/3_0/configobject.html</a><br>

<div class="Ih2E3d"><br> </div></blockquote>
<div> </div>
<div>I was able to solve this simle query </div>
<div> </div>
<div>
<div>There are cases when you want to send email notification  to specific email ID for specific host. </div>
<div> </div>
<div>there is a configuration file called as contacts.<span class="goog-spellcheck-word" style="BACKGROUND: yellow">cfg</span> , here we need to add the following : </div>
<div> </div>
<div>define contact{<br>        contact_name                    <span class="goog-spellcheck-word" style="BACKGROUND: yellow">cocubes</span><br>        use                             generic-contact-1<br>        alias                           <span class="goog-spellcheck-word" style="BACKGROUND: yellow">cocubes</span><br>
        email                     user_name<a href="mailto:user_name@gmail.com">@gmail.com</a><br>        }<br></div>
<div>contact_name is a general name you give to this contact. </div>
<div>use --- this  the set template mentioned in template.<span class="goog-spellcheck-word" style="BACKGROUND: yellow">cfg</span> </div>
<div>alias is a general user  name </div>
<div>email is the email id  </div>
<div> </div>
<div>NOTE:  open the   templeate.cfg</div>
<div> </div>
<div>we create a new template called generic-contact-1 , which has the following template</div>
<div> </div>
<div>define contact{<br>  name              generic-contact-1         ; The name of this contact template<br>  host_notification_period        24x7                    ; host notifications can be sent anytime<br>  host_notification_options       d,u,r,f,s               ; send notifications for all host states, flapping events, and scheduled downtime events<br>
  service_notification_commands   notify-service-by-email ; send service notifications via email<br>  host_notification_commands      notify-host-by-email    ; send host notifications via email<br>  register                        0                       ; DONT REGISTER THIS DEFINITION - ITS NOT A REAL CONTACT, JUST A TEMPLATE!<br>
        }<br><br>This template basically tell nagios to only send notification if the server is down and not to send service warning.  </div>
<div> </div>
<div> </div>
<div>Now <span class="goog-spellcheck-word" style="BACKGROUND: yellow">tha</span>t we have set the email address we have to set  the host that we want to monitor</div>
<div>lets open the file windows.<span class="goog-spellcheck-word" style="BACKGROUND: yellow">cfg</span> </div>
<div> </div>
<div>we add <em>contacts</em> variable to the host object </div>
<div> </div>
<div>vi /<span class="goog-spellcheck-word" style="BACKGROUND: yellow">usr</span>/local/<span class="goog-spellcheck-word" style="BACKGROUND: yellow">nagios</span>/etc/objects/windows.<span class="goog-spellcheck-word" style="BACKGROUND: yellow">cfg</span></div>

<div> </div>
<div>define host{<br>        use             windows-server  <br>        host_name      <span class="goog-spellcheck-word" style="BACKGROUND: yellow">cocubes</span><br>        alias           <span class="goog-spellcheck-word" style="BACKGROUND: yellow">cocubes</span>.<span class="goog-spellcheck-word" style="BACKGROUND: yellow">qualispace</span>.com<br>
        <strong><em>contacts        <span class="goog-spellcheck-word" style="BACKGROUND: yellow">cocubes</span><br></em></strong>        address       202.XX.XXX.XX<br>        }<br></div>
<div> </div>
<div>now restart <span class="goog-spellcheck-word" style="BACKGROUND: yellow">nagios</span> </div>
<div> </div>
<div> <br clear="all"><br>-- <br>Regards <br><span class="goog-spellcheck-word" style="BACKGROUND: yellow">Agnello</span> <span class="goog-spellcheck-word" style="BACKGROUND: yellow">D'souza</span><br><a href="http://www.linux-vashi.blogspot.com/" target="_blank">www.<span class="goog-spellcheck-word" style="BACKGROUND: yellow">linux</span>-<span class="goog-spellcheck-word" style="BACKGROUND: yellow">vashi</span>.<span class="goog-spellcheck-word" style="BACKGROUND: yellow">blogspot</span>.com</a><br>
<a href="http://www.bible-study-india.blogspot.com/" target="_blank">www.bible-study-<span class="goog-spellcheck-word" style="BACKGROUND: yellow">india</span>.<span class="goog-spellcheck-word" style="BACKGROUND: yellow">blogspot</span>.com</a><br>
</div></div></div></div>