LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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 08-11-2010, 01:58 AM   #31
Xanios
Member
 
Registered: Jul 2010
Posts: 216

Original Poster
Rep: Reputation: 30

Hi,

this is the commands i had in contacts.cfg:

Code:
define contact{
        contact_name                    nagiosadmin             
        use                             generic-contact         
        alias                           Nagios Admin            
        host_notifications_enabled      1
        service_notifications_enabled   1
        host_notification_period        24x7
        service_notification_options    w,u,c,r
        host_notification_options       d,u,r
        service_notification_commands   notify-service-by-email
        host_notification_commands      notify-host-by-email
        email                           xanios@gmail.com  
        }
So i suppose that codes send email notifications 24x7 as stated under 'host-notifications-period'


And, for

Code:
/etc/init.d/nagios status
i got ...

Code:
nagios (pid 21096) is running...
So my nagios is running.


thank you
 
Old 08-11-2010, 02:25 AM   #32
EricTRA
LQ Guru
 
Registered: May 2009
Location: Gibraltar, Gibraltar
Distribution: Fedora 20 with Awesome WM
Posts: 6,805
Blog Entries: 1

Rep: Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295
Hi,

So your Nagios is up and running, that's a good thing. If I'm not mistaking you also need to define the check and notification periods in the service/service escalation, host/host escalations. Without those I don't think you'll be running checks and sending notifications as should.

Kind regards,

Eric
 
Old 08-11-2010, 02:31 AM   #33
Xanios
Member
 
Registered: Jul 2010
Posts: 216

Original Poster
Rep: Reputation: 30
Hi,

Sorry but the service escalations.. i tried to enter the file as follows:

Code:
sudo vi usr/local/nagios/etc/objects/escalations.cfg
but can't. Sorry.


So you say i have to add in this host_notification_period in escalations.cfg?


Thanks again(:
 
Old 08-11-2010, 02:41 AM   #34
EricTRA
LQ Guru
 
Registered: May 2009
Location: Gibraltar, Gibraltar
Distribution: Fedora 20 with Awesome WM
Posts: 6,805
Blog Entries: 1

Rep: Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295
Hello,

In your host and service definitions you refer to a template (like generic-service, generic-host, or something like that). Check if in the templates you have the periods set correctly. If you have it set in the templates then it applies to all hosts/services that use that template as base.

Kind regards,

Eric
 
Old 08-11-2010, 02:44 AM   #35
sem007
Member
 
Registered: Nov 2006
Distribution: RHEL, CentOS, Debian Lenny, Ubuntu
Posts: 638

Rep: Reputation: 113Reputation: 113
@ EricTRA

serive/host escalation not really require to send notification. It is used when you want to escalate problem to other.

@ Xanios
One thing i found in contacts.cfg file is you have only mention host notification period.
just add service notification perios.

Code:
service_notification_period             24x7
and don't forget to restart nagios service.
 
Old 08-11-2010, 02:46 AM   #36
EricTRA
LQ Guru
 
Registered: May 2009
Location: Gibraltar, Gibraltar
Distribution: Fedora 20 with Awesome WM
Posts: 6,805
Blog Entries: 1

Rep: Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295
Quote:
Originally Posted by sem007 View Post
@ EricTRA

serive/host escalation not really require to send notification. It is used when you want to escalate problem to other.

@ Xanios
One thing i found in contacts.cfg file is you have only mention host notification period.
just add service notification perios.

Code:
service_notification_period             24x7
and don't forget to restart nagios service.
Hi sem007,

Good call! Missed that one.

Kind regards,

Eric
 
Old 08-11-2010, 03:02 AM   #37
Xanios
Member
 
Registered: Jul 2010
Posts: 216

Original Poster
Rep: Reputation: 30
Hi sem007 and Eric,

Okay i have added

Code:
service_notification_period             24x7
to contacts.cfg,

and restarted Nagios service too.

Not sure if it works because right now the Nagios i'm using (the mail isn't working properly) Hmm.
Will update to you guys soon when i get back the working one :x
Sorry and thanks.

But one thing i haven't point out,

i have specified host notification period in contacts.cfg, but even so i ain't receiving any downed host notifications too ):
 
Old 08-11-2010, 11:18 PM   #38
Xanios
Member
 
Registered: Jul 2010
Posts: 216

Original Poster
Rep: Reputation: 30
Hello,

adding of service_notification_period seems to work, BUT somehow something's not right.
I received 15 new notifications again of the downed services, but after that they stopped.
I clearly had more than 15 downed services in Nagios but they only sent me 15. so what does that signifies?
I don't think it's a normal behavior.. Hmm.

By right, Nagios should keep send notifications when the services are still down, but in my case it's not.
Once it has sent once, it would stop.

thank you
 
Old 08-12-2010, 01:14 AM   #39
EricTRA
LQ Guru
 
Registered: May 2009
Location: Gibraltar, Gibraltar
Distribution: Fedora 20 with Awesome WM
Posts: 6,805
Blog Entries: 1

Rep: Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295
Quote:
Originally Posted by Xanios View Post
Hello,

adding of service_notification_period seems to work, BUT somehow something's not right.
I received 15 new notifications again of the downed services, but after that they stopped.
I clearly had more than 15 downed services in Nagios but they only sent me 15. so what does that signifies?
I don't think it's a normal behavior.. Hmm.

By right, Nagios should keep send notifications when the services are still down, but in my case it's not.
Once it has sent once, it would stop.

thank you
Hello,

There is some fine-tuning in Nagios that indicates the check interval, maximum attempts and retry check interval. Check either in your template file or host/service file if they are set correctly. For example if you only want to check a service once a day you'd set check_interval to 1440 minutes.

This is an example of the generic-service template:
Code:
define service {
        name                            generic-service
        is_volatile                     0
        check_period                    24x7
        max_check_attempts              3
        normal_check_interval           10
        retry_check_interval            1
        active_checks_enabled           1
        passive_checks_enabled          1
        parallelize_check               1
        obsess_over_service             0
        check_freshness                 1
        freshness_threshold             0
        notifications_enabled           1
        notification_interval           60
        notification_period             24x7
        notification_options            u,c,w,r
        event_handler_enabled           1
        flap_detection_enabled          1
        process_perf_data               1
        retain_status_information       1
        retain_nonstatus_information    1
        contact_groups                  nagiosadmin
        register                        0
}
Kind regards,

Eric
 
Old 08-12-2010, 01:42 AM   #40
Xanios
Member
 
Registered: Jul 2010
Posts: 216

Original Poster
Rep: Reputation: 30
Hello,

so i had this in templates.cfg

Code:
define service{
        name                            generic-service         ; The 'name' of this service template
        active_checks_enabled           1                       ; Active service checks are enabled
        passive_checks_enabled          1                       ; Passive service checks are enabled/accepted
        parallelize_check               1                       ; Active service checks should be parallelized (disabling this can lead to major performance problems)
        obsess_over_service             1                       ; We should obsess over this service (if necessary)
        check_freshness                 0                       ; Default is to NOT check service 'freshness'
        notifications_enabled           1                       ; Service notifications are enabled
        event_handler_enabled           1                       ; Service event handler is enabled
        flap_detection_enabled          1                       ; Flap detection is enabled
        failure_prediction_enabled      1                       ; Failure prediction is enabled
	process_perf_data               1                       ; Process performance data
        retain_status_information       1                       ; Retain status information across program restarts
        retain_nonstatus_information    1                       ; Retain non-status information across program restarts
        is_volatile                     0                       ; The service is not volatile
        check_period                    24x7                    ; The service can be checked at any time of the day
        max_check_attempts              3                       ; Re-check the service up to 3 times in order to determine its final (hard) state
        normal_check_interval           1                       ; Check the service every 10 minutes under normal conditions
        retry_check_interval            2                       ; Re-check the service every two minutes until a hard state can be determined
        contact_groups                  admins                  ; Notifications get sent out to everyone in the 'admins' group
        notification_options            w,u,c,r                 ; Send notifications about warning, unknown, critical, and recovery events
        notification_interval           60                      ; Re-notify about service problems every hour
	notification_period             24x7                    ; Notifications can be sent out at any time
        register                        0                      ; DONT REGISTER THIS DEFINITION - ITS NOT A REAL SERVICE, JUST A TEMPLATE!
        }
You mentioned about setting check_interval to 1440 minutes.. the check_interval is...

Code:
normal_check_interval           1                       
retry_check_interval            2
is that it? but they are in '1' and '2'. lets say if i want to check the services every 5 mins, i have to set it as..?

x_x sorry and thanks again(:
 
Old 08-12-2010, 01:57 AM   #41
EricTRA
LQ Guru
 
Registered: May 2009
Location: Gibraltar, Gibraltar
Distribution: Fedora 20 with Awesome WM
Posts: 6,805
Blog Entries: 1

Rep: Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295
Hi,

If you want to check every 5 minutes you have to set the normal_check_interval to 5. This will continue to check every five minutes if there's a change in state. If there's no change in state then nothing will be done. In your template you also have this:
Code:
notification_interval           60
If I'm not mistaking this means that you'll only send out notifications once every hour.

To try to troubleshoot this, can you take ONE service of which you're sure is down and should send out notifications on regular basis. Of that ONE service can you post all relevant config files? Also post the lines beginning with
Code:
cfg_file=
from your nagios.cfg file to see what config files are loaded at start. Post configuration of the time period relevant to your service (timeperiods.cfg), configuration of the service itself, configuration of contact, host, contact group if any, host group if any.

There must be some config error why you're not receiving notifications as expected. Let's try and find out

Kind regards,

Eric
 
Old 08-12-2010, 02:20 AM   #42
Xanios
Member
 
Registered: Jul 2010
Posts: 216

Original Poster
Rep: Reputation: 30
Hi,

these are in timeperiods.cfg:

Code:
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
        }

define timeperiod{
        timeperiod_name workhours
        alias           Normal Work Hours
        monday          09:00-17:00
        tuesday         09:00-17:00
        wednesday       09:00-17:00
        thursday        09:00-17:00
        friday          09:00-17:00
        }

define timeperiod{
        timeperiod_name none
        alias           No Time Is A Good Time
        }

define timeperiod{
        name                    us-holidays
        timeperiod_name         us-holidays
        alias                   U.S. Holidays

        january 1               00:00-00:00     ; New Years
        monday -1 may           00:00-00:00     ; Memorial Day (last Monday in May)
        july 4                  00:00-00:00     ; Independence Day
        monday 1 september      00:00-00:00     ; Labor Day (first Monday in September)
        thursday -1 november    00:00-00:00     ; Thanksgiving (last Thursday in November)
        december 25             00:00-00:00     ; Christmas
        }

define timeperiod{
        timeperiod_name 24x7_sans_holidays
        alias           24x7 Sans Holidays

        use             us-holidays             ; Get holiday exceptions from other timeperiod

        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
        }
In contacts.cfg

Code:
define contact{
        contact_name                    nagiosadmin             ; Short name of user
        use                             generic-contact         ; Inherit default values from generic-contact template (defined above)
        alias                           Nagios Admin            ; Full name of user
        host_notifications_enabled      1
        service_notifications_enabled   1
        host_notification_period        24x7
        service_notification_period     24x7
        service_notification_options    w,u,c,r
        host_notification_options       d,u,r
        service_notification_commands   notify-service-by-email
        host_notification_commands      notify-host-by-email
        email                           xanios@gmail.com   ; email
        }


define contactgroup {
        contactgroup_name       admins
        alias                   Nagios Administrators
        members                 nagiosadmin
        }


Sorry i forgot how to access to hosts.cfg..

And sorry i don't quite understand this:

Code:
To try to troubleshoot this, can you take ONE service of which you're sure is down and should send out notifications on regular basis. Of that ONE service can you post all relevant config files?
How to make it send out on a regular basis? Very sorry.. i'm stupid.


thank you for your patience >.<
i tried

Code:
sudo vi /usr/local/nagios/etc/objects/hosts.cfg
but it isn't the right command.
 
Old 08-12-2010, 02:36 AM   #43
EricTRA
LQ Guru
 
Registered: May 2009
Location: Gibraltar, Gibraltar
Distribution: Fedora 20 with Awesome WM
Posts: 6,805
Blog Entries: 1

Rep: Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295
Hello,

By the ONE service I meant post that part of the service file that refers to that one service. In other words, your services are configured in services.cfg or minimal.cfg or other (not sure about the name, look inside nagios.cfg for what config files are loaded). Post a service configuration and a host configuration.

And nobody believes you're stupid, we all need to start at some point and take it from there

Kind regards,

Eric
 
Old 08-12-2010, 02:48 AM   #44
Xanios
Member
 
Registered: Jul 2010
Posts: 216

Original Poster
Rep: Reputation: 30
Hi,

Oh oh okay i think i got it.
So you mean the services and hosts config for that ONE service which is sure to be down all the time.

So here it is:

Code:
define service{
        use                     generic-service
        host_name               wins xp sp2
        service_description     MYSQL
        check_command           check_mysql
        }
For host, i declared as such :
Code:
define host{
      use                    generic-host
      host_name              wins xp sp2
      alias                  wins xp sp2
      address                172.20.130.71
      check_command          check-host-alive
      max_check_attempts     10
      notification_interval  120
      notification_period    24x7
      notification_options   d,u,r
      contact_groups         admins
      notifications_enabled  1
}
 
Old 08-12-2010, 02:48 AM   #45
Xanios
Member
 
Registered: Jul 2010
Posts: 216

Original Poster
Rep: Reputation: 30
Hi,

Oh oh okay i think i got it.
So you mean the services and hosts config for that ONE service which is sure to be down all the time.

So here it is:

Code:
define service{
        use                     generic-service
        host_name               wins xp sp2
        service_description     MYSQL
        check_command           check_mysql
        }
For host, i declared as such :
Code:
define host{
      use                    generic-host
      host_name              wins xp sp2
      alias                  wins xp sp2
      address                172.20.130.71
      check_command          check-host-alive
      max_check_attempts     10
      notification_interval  120
      notification_period    24x7
      notification_options   d,u,r
      contact_groups         admins
      notifications_enabled  1
}
 
  


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



Similar Threads
Thread Thread Starter Forum Replies Last Post
Delivery status notification from Cron. glore2002 Debian 4 10-12-2009 06:43 PM
Delivery status notification- Using Postfix 2.2.7 on Clarkconnect Enterprise 4.2 cgreen6911 Linux - Enterprise 0 03-26-2009 05:39 PM
How to disable delivery status notification courier sci3ntist Linux - Server 0 01-15-2008 07:35 AM
delivery failure notification pansarevaibhav Linux - Newbie 1 12-16-2006 04:21 AM

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

All times are GMT -5. The time now is 03:30 AM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration