HOW TO CONFIGURE EMAIL & SMS ALERT
-
- Posts: 8
- Joined: Thu Nov 07, 2013 2:06 am
HOW TO CONFIGURE EMAIL & SMS ALERT
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
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
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.
After that you have to configure the contacts in contacts.cfg file, to define contacts, for example:
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$
}
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.define contact{
use generic-contact
contact_name nagiosnandha
alias Nagios
email yourusername@yourdomain.com
}
Re: HOW TO CONFIGURE EMAIL & SMS ALERT
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.
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.
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
-
- Posts: 8
- Joined: Thu Nov 07, 2013 2:06 am
Re: HOW TO CONFIGURE EMAIL & SMS ALERT
Hi,
Can i configure that in gmail or yahoo
--
Regards.
Nantha
Can i configure that in gmail or yahoo
--
Regards.
Nantha
-
- Posts: 7698
- Joined: Mon Apr 23, 2012 4:28 pm
- Location: Travelling through time and space...
Re: HOW TO CONFIGURE EMAIL & SMS ALERT
Well, you can send notifications there, yes. You can use sendmail or SMTP for this.
Re: HOW TO CONFIGURE EMAIL & SMS ALERT
Nagios doesn't have any bias for one email provider or another, so yes you can do this for gmail or yahoo,
Former Nagios employee
-
- Posts: 8
- Joined: Thu Nov 07, 2013 2:06 am
Re: HOW TO CONFIGURE EMAIL & SMS ALERT
Hi,
I tried but its not working, please send that configuration.
--
Regards,
Nanthakumar.
I tried but its not working, please send that configuration.
--
Regards,
Nanthakumar.
-
- Posts: 8
- Joined: Thu Nov 07, 2013 2:06 am
Re: HOW TO CONFIGURE EMAIL & SMS ALERT
for email alert. ie) contact.cfg
Re: HOW TO CONFIGURE EMAIL & SMS ALERT
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?
Are you trying to get gmail/yahoo addresses working? What specifically is not working?
Former Nagios employee