Page 1 of 1
HOW TO CONFIGURE EMAIL & SMS ALERT
Posted: Wed Jan 08, 2014 6:43 am
by nagiosnandha
Dear All,
I have configured nagios core in my concern, its working fine. may i know the steps to configure email and sms alert on Nagios.
--
Regards,
Nantha
Re: HOW TO CONFIGURE EMAIL & SMS ALERT
Posted: Wed Jan 08, 2014 7:27 am
by MPIvan
Hi,
Firs you have to choose one of the mail clients ( i for example use postfix ) and i have configured to work as null client, just to send mails not receive. But this is you choice. After that you have to configure command.cfg files, find the "notify-host-by-email" part and change the path to the mail service.
Code: Select all
# 'notify-host-by-email' command definition
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" | /bin/mail -s "** $NOTIFICATIONTYPE$ Host Alert: $HOSTNAME$ is $HOSTSTATE$ **" $CONTACTEMAIL$
}
# 'notify-service-by-email' command definition
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$\n" | /bin/mail -s "** $NOTIFICATIONTYPE$ Service Alert: $HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE$ **" $CONTACTEMAIL$
}
After that you have to configure the contacts in contacts.cfg file, to define contacts, for example:
define contact{
use generic-contact
contact_name nagiosnandha
alias Nagios
email
[email protected]
}
and the final part is to add this contact to one of the services or hosts depending of how and for what you would like to receive mail.
Re: HOW TO CONFIGURE EMAIL & SMS ALERT
Posted: Wed Jan 08, 2014 12:31 pm
by abrist
Just to add on to MPIvan's post:
Most people send sms through their carriers email gateway. A few use sms modems. If you wish to just send to a mobile carriers email gateway, you will need to find out their email gateway server hostname and send the notifications to the gateway. Most carriers use your phone number for the email address username, while others do not. You may have to do some research on what your carrier provides.
Re: HOW TO CONFIGURE EMAIL & SMS ALERT
Posted: Thu Jan 09, 2014 1:26 am
by nagiosnandha
Hi,
Can i configure that in gmail or yahoo
--
Regards.
Nantha
Re: HOW TO CONFIGURE EMAIL & SMS ALERT
Posted: Thu Jan 09, 2014 10:35 am
by slansing
Well, you can send notifications there, yes. You can use sendmail or SMTP for this.
Re: HOW TO CONFIGURE EMAIL & SMS ALERT
Posted: Thu Jan 09, 2014 10:43 am
by tmcdonald
Nagios doesn't have any bias for one email provider or another, so yes you can do this for gmail or yahoo,
Re: HOW TO CONFIGURE EMAIL & SMS ALERT
Posted: Tue Jan 21, 2014 1:15 am
by nagiosnandha
Hi,
I tried but its not working, please send that configuration.
--
Regards,
Nanthakumar.
Re: HOW TO CONFIGURE EMAIL & SMS ALERT
Posted: Tue Jan 21, 2014 10:18 am
by tmcdonald
Please send what configuration?
Re: HOW TO CONFIGURE EMAIL & SMS ALERT
Posted: Wed Jan 22, 2014 7:30 am
by nagiosnandha
for email alert. ie) contact.cfg
Re: HOW TO CONFIGURE EMAIL & SMS ALERT
Posted: Wed Jan 22, 2014 10:36 am
by tmcdonald
I'm a little confused. Do you want to see my contacts.cfg?
Are you trying to get gmail/yahoo addresses working? What specifically is not working?