LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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

Reply
 
LinkBack Search this Thread
Old 03-02-2011, 01:14 AM   #1
zoomzatag
LQ Newbie
 
Registered: Aug 2010
Posts: 14

Rep: Reputation: -3
Question 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
 
Old 03-02-2011, 01:40 AM   #2
EricTRA
Guru
 
Registered: May 2009
Location: Gibraltar, Gibraltar
Distribution: Fedora 18 with Awesome WM
Posts: 6,805
Blog Entries: 1

Rep: Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290
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.
Old 03-02-2011, 02:21 AM   #3
zoomzatag
LQ Newbie
 
Registered: Aug 2010
Posts: 14

Original Poster
Rep: Reputation: -3
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.
 
Old 03-02-2011, 02:52 AM   #4
EricTRA
Guru
 
Registered: May 2009
Location: Gibraltar, Gibraltar
Distribution: Fedora 18 with Awesome WM
Posts: 6,805
Blog Entries: 1

Rep: Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290
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
 
Old 07-20-2011, 04:23 AM   #5
Babs
LQ Newbie
 
Registered: Jul 2011
Posts: 4

Rep: Reputation: Disabled
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.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Nagios Email Notification Assistance deibertine Linux - Newbie 7 10-05-2012 12:19 PM
HELP! Nagios email notification using Postfix tagzfernando Linux - Newbie 14 02-16-2011 08:08 PM
HELP! Nagios email notification using Postfix tagzfernando Linux - Networking 2 02-15-2011 03:49 AM
Nagios has stopped sending email notification s deibertine Linux - Software 7 05-06-2010 08:22 PM


All times are GMT -5. The time now is 04:01 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration