Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place! |
| Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
 |
GNU/Linux Basic Guide
This 255-page guide will provide you with the keys to understand the philosophy of free software, teach you how to use and handle it, and give you the tools required to move easily in the world of GNU/Linux. Many users and administrators will be taking their first steps with this GNU/Linux Basic guide and it will show you how to approach and solve the problems you encounter.
Click Here to receive this Complete Guide absolutely free. |
|
 |
03-02-2011, 01:14 AM
|
#1
|
|
LQ Newbie
Registered: Aug 2010
Posts: 14
Rep:
|
Nagios Email Notification
Hi,
i have installed nagios in centos and its working fine.
i need to configure email alerts for nagios
I have already configured nagios to send email alerts for warning,critical and recovery for 24/7.
1) i need to configure nagios to send email alerts twice a day
a) morning at 8am
b) evening at 6pm
2)i need nagios to send email alerts only "current status" of the host and services twice a day (morning and evening).
thanks
ZommZ
|
|
|
|
03-02-2011, 01:40 AM
|
#2
|
|
Guru
Registered: May 2009
Location: Gibraltar, Gibraltar
Distribution: Fedora 18 with Awesome WM
Posts: 6,796
|
Hello,
Nagios itself doesn't have a mailserver included. It uses the one installed on your system. If you don't have something like Postfix or Sendmail installed/configured on your system then do so and Nagios will be able to send out mails.
Kind regards,
Eric
|
|
|
1 members found this post helpful.
|
03-02-2011, 02:21 AM
|
#3
|
|
LQ Newbie
Registered: Aug 2010
Posts: 14
Original Poster
Rep:
|
Erictra thanks for your reply,
i have already configured nagios to send notification using sendmail.
now i need to configure nagios send me normal status update twice day.
ex: i need nagios to send alert about current status of host and services at 8 am morning.
|
|
|
|
03-02-2011, 02:52 AM
|
#4
|
|
Guru
Registered: May 2009
Location: Gibraltar, Gibraltar
Distribution: Fedora 18 with Awesome WM
Posts: 6,796
|
Hi,
As far as I remember Nagios only sends out notification by default if a change in status occurs (warning, critical). I don't think Nagios has any configuration included to send you updates of the status of your devices like you want/need. So that'll be completely up to you to configure. The meaning of Nagios as I understand it is to notify you when something happens, not when all is stable and functioning.
Kind regards,
Eric
|
|
|
|
07-20-2011, 04:23 AM
|
#5
|
|
LQ Newbie
Registered: Jul 2011
Posts: 4
Rep: 
|
Nagios Email Notification
I think what you trying to do is possible. Although I am new to this forum and I have also got a question similar to this, what you need to do is to first make sure you have definition in contact.cfg, contactgroups.cfg. This is tricky as you have to have entries in this format in timeperiods.cfg to look something like this::
define timeperiod{
timeperiod_name jackemail_daily
alias jack mail Hours
monday 07:30-07:40
tuesday 07:30-07:40
wednesday 07:30-07:40
thursday 07:30-07:40
friday 07:30-07:40
saturday 07:30-07:40
sunday 07:30-07:40
}
This is the one I did of resent but I have edited my company details of the time period and the alias.
You can give the timeperiod_name anything you want and alias in a format similar to the time period name.
Your contactgroup.cfg settings should look like this:
define contactgroup{
contactgroup_name jack-mail-group
alias jack mail
members jack-mail-monitoring (depending on what your group name is)
}
your contacts.cfg
define contact{
contact_name jack-mail-monitoring
alias jack mail
service_notification_period 24x7
host_notification_period 24x7
service_notification_options w,u,c,r
host_notification_options d,u,r
service_notification_commands notify-by-email
host_notification_commands host-notify-by-email
email jack-mail-monitoring@whatever -youlike.com
}
Make sure there is aliases entries for jack-mail-monitoring
jack-mail-monitoring: jack.smith, yyy.peter (Depending on the format used in you mail system)
Now you can use a cron to sort out the rest, at best I would advice you set out the cron in /etc/nagios if your environment is using subversion then you would not miss out
your cron should look this formatin /etc/nagios/crontab/nagios
# crontab for nagios.
MAILTO= (group e-mail without brackets)
# check jack-email status & mail
0 8 * * * python /etc/nagios/plugins/jackmail.py | mail -s "comment like hello world" (followed by all emails seperated by space without brackets)
If you have a plugin to be check make entries for it otherwise you can omit it.
This works for me and I hope it works for you.
|
|
|
|
| Thread Tools |
Search this Thread |
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -5. The time now is 11:20 AM.
|
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|