LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
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
  Search this Thread
Old 06-03-2010, 10:10 AM   #1
knockout_artist
Member
 
Registered: Sep 2005
Distribution: fedora core 9
Posts: 324

Rep: Reputation: 33
nagios don't send mail for individual hosts


Hi,

It does not send mail if I only add contact_groups in host definition.
Code:
define host{
        use             generic-host        ; Inherit default values from a template
        host_name       NAME1          ; The name we're giving to this switch
        address         XX.X.X.X     ; IP address of the switch
        hostgroups      GROP1                ; Host groups this switch is associated with
         contact_groups    wadmins
        }
But If in same host-config file I add contact_groups in service definition it works.

Code:
define service{
        use                     generic-service ; Inherit values from a template
        host_name               NAME1  ; The name of the host the service is associated with
        service_description     PING            ; The service description
        check_command           check_ping!200.0,20%!600.0,60%  ; The command used to monitor the service
        normal_check_interval   5               ; Check the service every 5 minutes under normal conditions
        retry_check_interval    1               ; Re-check the service every minute until its final/hard state is determined
        
 contact_groups    wadmins

}

Any ideas ?

Last edited by knockout_artist; 06-03-2010 at 10:11 AM.
 
Old 06-03-2010, 01:40 PM   #2
never say never
Member
 
Registered: Sep 2009
Location: Indiana, USA
Distribution: SLES, SLED, OpenSuse, CentOS, ubuntu 10.10, OpenBSD, FreeBSD
Posts: 195

Rep: Reputation: 37
You need to add these options in your hosts definitions (and services):

Code:
        notification_interval           30
        notification_period             24x7
        notification_options            w,u,c,r
Where notification_interval is in minutes; notification_period is defined timeperiod; and notification_options are a comma separated list containing: w,u,c,r (w = Warning, u = Undefined, c = Critical, r = Recovery)

A timeperiod is defined like this:

Code:
# '24x7' timeperiod definition
define timeperiod{
        timeperiod_name 24x7
        alias           24 Hours A Day, 7 Days A Week
        sunday          00:00-24:00
        monday          00:00-24:00
        tuesday         00:00-24:00
        wednesday       00:00-24:00
        thursday        00:00-24:00
        friday          00:00-24:00
        saturday        00:00-24:00
        }
And you will only receive notifications within those time periods.

Hope this helps.
 
Old 06-07-2010, 12:14 PM   #3
knockout_artist
Member
 
Registered: Sep 2005
Distribution: fedora core 9
Posts: 324

Original Poster
Rep: Reputation: 33
Thanks for your reply, but options you gave are only about when and who to contact.

Should it not send an email regardless, from host definition structure?

Because it does send email once I put it in service structure.
 
Old 06-07-2010, 12:28 PM   #4
never say never
Member
 
Registered: Sep 2009
Location: Indiana, USA
Distribution: SLES, SLED, OpenSuse, CentOS, ubuntu 10.10, OpenBSD, FreeBSD
Posts: 195

Rep: Reputation: 37
Well there may be a place to set a default value somewhere, but I have always set it for each host and service. I have over 100 hosts and over 500 services monitored by Nagios and I have something like 10 groups. Some get e-mails 24x7, some don't care if the copier goes down at 3 AM. I have never had a problem.

If you don't define
Code:
notification_interval   120
        notification_period     24x7
        notification_options    d,u,r
How is it to know who to contact and how often if you don't' tell it?
 
  


Reply



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



Similar Threads
Thread Thread Starter Forum Replies Last Post
Using /etc/mail/acess to allow certain hosts to send us mail glt Red Hat 4 04-03-2008 01:30 PM
Postfix : mail cannot send to send outside ( can send/receive locally) bobbinsupport Linux - Networking 3 12-15-2007 10:40 PM
Help on calculating individual Hosts/IP Adresses Janusz11 General 1 04-19-2006 04:03 AM
Individual user's mail file in /var/spool/mail Swakoo Linux - General 1 09-07-2005 06:33 AM
Maddening sendmail problem -- cant send mail to remote hosts! HELP! Bungo2000 Linux - Networking 11 06-09-2003 03:33 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 02:38 PM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration