[prev in list] [next in list] [prev in thread] [next in thread] 

List:       nagios-users
Subject:    Re: [Nagios-users] How to set up sending alerts?
From:       "Luis H. Forchesatto" <luisforchesatto () gmail ! com>
Date:       2012-08-22 12:03:10
Message-ID: CAKGZsx=savKZt2mfZXkF17cXDPoWFGPKGfcGK2bjsCwUSSObQg () mail ! gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


Make this test: try to send a mail with the syntax you are using: # printf
"blablablabla" | sendEmail "etc...etc...etc..." you@yourdomain.com.

2012/8/22 Aravinth Anto Intern <t-aravinth@juspay.in>

> Hi all,
>
> I'm very new to nagios. I followed this blog to set up the smtp server for
> sending emails :
> http://danxlog.blogspot.in/2010/07/nagios-use-external-smtp-server-to-send.html
> .
>
> But that doesn't seem to be working for me. I have
> my /usr/local/nagios/etc/resource.cfg file as :
>
>
> $USER1$=/usr/local/nagios/libexec
>
> $USER5$=smtp.gmail.com:587
>
> $USER9$=myaccount@gmail.com
> $USER10$=mypassword
>
> And in my commands file I added these two as said in the blog post :
>
> define command{
>                 command_name notify-host-by-email
>                 command_line /usr/bin/printf "%b" "***** Nagios
> *****\n\nNotification Type: $NOTIFICATIONTYPE$\nHost: $HOSTNAME$\nState:
> $HOSTSTATE$\nAddress: $HOSTADDRESS$\nInfo: $HOSTOUTPUT$\n\nDate/Time:
> $LONGDATETIME$\n" | /usr/local/bin/sendEmail -s $USER7$ -t $CONTACTEMAIL$
> -f $USER5$ -l /var/log/sendEmail -u "** $NOTIFICATIONTYPE$ Host Alert:
> $HOSTNAME$ is $HOSTSTATE$ **" -m "***** Nagios *****\n\nNotification Type:
> $NOTIFICATIONTYPE$\nHost: $HOSTNAME$\nState: $HOSTSTATE$\nAddress:
> $HOSTADDRESS$\nInfo: $HOSTOUTPUT$\n\nDate/Time: $LONGDATETIME$\n"
>          }
>
>
> define command{
>         command_name notify-service-by-email
>         command_line /usr/bin/printf "%b" "***** Nagios
> *****\n\nNotification Type: $NOTIFICATIONTYPE$\n\nService:
> $SERVICEDESC$\nHost: $HOSTALIAS$\nAddress: $HOSTADDRESS$\nState:
> $SERVICESTATE$\n\nDate/Time: $LONGDATETIME$\n\nAdditional
> Info:\n\n$SERVICEOUTPUT$" | /usr/local/bin/sendEmail -s $USER7$ -t
> $CONTACTEMAIL$ -f $USER5$ -l /var/log/sendEmail -u "** $NOTIFICATIONTYPE$
> Service Alert: $HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE$ **" -m "*****
> Nagios *****\n\nNotification Type: $NOTIFICATIONTYPE$\n\nService:
> $SERVICEDESC$\nHost: $HOSTALIAS$\nAddress: $HOSTADDRESS$\nState:
> $SERVICESTATE$\n\nDate/Time: $LONGDATETIME$\n\nAdditional
> Info:\n\n$SERVICEOUTPUT$"
>  }
>
> I restarted it. But it seems to be working! Can anyone help in this regard?
>
>
> ------------------------------------------------------------------------------
> Live Security Virtual Conference
> Exclusive live event will cover all the ways today's security and
> threat landscape has changed and how IT managers can respond. Discussions
> will include endpoint security, mobile security and the latest in malware
> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
> _______________________________________________
> Nagios-users mailing list
> Nagios-users@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
>



-- 
Att.*
***

[Attachment #5 (text/html)]

Make this test: try to send a mail with the syntax you are using: # printf \
&quot;blablablabla&quot; | sendEmail &quot;etc...etc...etc...&quot; <a \
href="mailto:you@yourdomain.com">you@yourdomain.com</a>.<br><br><div \
class="gmail_quote"> 2012/8/22 Aravinth Anto Intern <span dir="ltr">&lt;<a \
href="mailto:t-aravinth@juspay.in" \
target="_blank">t-aravinth@juspay.in</a>&gt;</span><br><blockquote \
class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc \
solid;padding-left:1ex"> Hi all, <div><br></div><div>I&#39;m very new to nagios. I \
followed this blog to set up the smtp server for sending emails : <a \
href="http://danxlog.blogspot.in/2010/07/nagios-use-external-smtp-server-to-send.html" \
target="_blank">http://danxlog.blogspot.in/2010/07/nagios-use-external-smtp-server-to-send.html</a>.</div>


<div><br></div><div>But that doesn&#39;t seem to be working for me. I have my \
/usr/local/nagios/etc/resource.cfg file as \
:</div><div><br></div><div><br></div><div><div>$USER1$=/usr/local/nagios/libexec</div><div><br></div>


<div>$USER5$=<a href="http://smtp.gmail.com:587" \
target="_blank">smtp.gmail.com:587</a></div><div><br></div><div>$USER9$=<a \
href="mailto:myaccount@gmail.com" \
target="_blank">myaccount@gmail.com</a></div><div>$USER10$=mypassword</div> \
</div><div><br></div> <div>And in my commands file I added these two as said in the \
blog post :</div><div><br></div><div><div>define command{</div><div>                \
command_name notify-host-by-email</div><div>                command_line \
/usr/bin/printf &quot;%b&quot; &quot;***** Nagios *****\n\nNotification Type: \
$NOTIFICATIONTYPE$\nHost: $HOSTNAME$\nState: $HOSTSTATE$\nAddress: \
$HOSTADDRESS$\nInfo: $HOSTOUTPUT$\n\nDate/Time: $LONGDATETIME$\n&quot; | \
/usr/local/bin/sendEmail -s $USER7$ -t $CONTACTEMAIL$ -f $USER5$ -l \
/var/log/sendEmail -u &quot;** $NOTIFICATIONTYPE$ Host Alert: $HOSTNAME$ is \
$HOSTSTATE$ **&quot; -m &quot;***** Nagios *****\n\nNotification Type: \
$NOTIFICATIONTYPE$\nHost: $HOSTNAME$\nState: $HOSTSTATE$\nAddress: \
$HOSTADDRESS$\nInfo: $HOSTOUTPUT$\n\nDate/Time: $LONGDATETIME$\n&quot;</div>

<div>         }</div></div><div><br></div><div><br></div><div><div>define \
command{</div><div>        command_name notify-service-by-email</div><div>        \
command_line /usr/bin/printf &quot;%b&quot; &quot;***** Nagios *****\n\nNotification \
Type: $NOTIFICATIONTYPE$\n\nService: $SERVICEDESC$\nHost: $HOSTALIAS$\nAddress: \
$HOSTADDRESS$\nState: $SERVICESTATE$\n\nDate/Time: $LONGDATETIME$\n\nAdditional \
Info:\n\n$SERVICEOUTPUT$&quot; | /usr/local/bin/sendEmail -s $USER7$ -t \
$CONTACTEMAIL$ -f $USER5$ -l /var/log/sendEmail -u &quot;** $NOTIFICATIONTYPE$ \
Service Alert: $HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE$ **&quot; -m &quot;***** \
Nagios *****\n\nNotification Type: $NOTIFICATIONTYPE$\n\nService: \
$SERVICEDESC$\nHost: $HOSTALIAS$\nAddress: $HOSTADDRESS$\nState: \
$SERVICESTATE$\n\nDate/Time: $LONGDATETIME$\n\nAdditional \
Info:\n\n$SERVICEOUTPUT$&quot;</div>

<div> }</div></div><div><br></div><div>I restarted it. But it seems to be working! \
Can anyone help in this regard?</div> \
<br>------------------------------------------------------------------------------<br>
 Live Security Virtual Conference<br>
Exclusive live event will cover all the ways today&#39;s security and<br>
threat landscape has changed and how IT managers can respond. Discussions<br>
will include endpoint security, mobile security and the latest in malware<br>
threats. <a href="http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/" \
target="_blank">http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/</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<br></blockquote></div><br><br clear="all"><div><br></div>-- \
<br>Att.<b><br></b><b></b><br>



------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/

_______________________________________________
Nagios-users mailing list
Nagios-users@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

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic