check_interval

Support requests, bug reports, questions etc.
Locked
csingh@lightspeedresearch.com

check_interval

Post by csingh@lightspeedresearch.com » Thu Sep 03, 2009 22:04

Using Nconf, is it possible to set different “normal_check_interval” and “retry_check_interval” per service?

Although Nconf lets you define/change those parameters when you define a timeperiod using Nconf GUI and this timeperiod can then be associated with a service, it appears that when nconf generates config (i.e. converts the data under its database to Nagios config files, it doesn’t include those parameters in timeperiods.cfg which makes it impossible to have custom “normal_check_interval” and “retry_check_interval” per service when managing Nagios configuration using Nconf.

Has anyone come across this issue? Is there a workaround to this issue?

User avatar
agargiulo
NConf developer
NConf developer
Posts: 725
Joined: Fri Mar 06, 2009 17:50
Location: Zurich, Switzerland
Contact:

Re: check_interval

Post by agargiulo » Tue Sep 08, 2009 13:22

Hi.

The parameters “normal_check_interval”, “retry_check_interval” etc. are managed over timeperiods in NConf, but then written to the services.cfg file.
There is no way to assign a custom “normal_check_interval” value to a service in NConf.

A workaround would be to define a new timeperiod with a different “normal_check_interval”, and then assign this timeperiod only to the individual service(s) you want to customize.

I hope this helps...

charanbeer78
starter
starter
Posts: 2
Joined: Thu Sep 03, 2009 22:09

Re: check_interval

Post by charanbeer78 » Tue Sep 08, 2009 18:02

Thanks for the suggested workaround. I have tried exactly that,

Defined timeperiod test with 20 minutes "check interval" and "normal check interval"
Image

Then used that time period for a service that monitors hardware
Image

Generated NAGIOS config using NCONF GUI and restarted NAGIOS. But it appears that the service checks are still happening every five minutes:

Sep 8 11:17:33 ewr-ftp sudo: nagios : TTY=unknown ; PWD=/ ; USER=root ; COMMAND=/usr/local/nagios/libexec/check_hpasm
Sep 8 11:22:33 ewr-ftp sudo: nagios : TTY=unknown ; PWD=/ ; USER=root ; COMMAND=/usr/local/nagios/libexec/check_hpasm
Sep 8 11:27:33 ewr-ftp sudo: nagios : TTY=unknown ; PWD=/ ; USER=root ; COMMAND=/usr/local/nagios/libexec/check_hpasm

I am using NConf v. 1.2.5. What am I missing?

Thanks!
Charanbeer

User avatar
agargiulo
NConf developer
NConf developer
Posts: 725
Joined: Fri Mar 06, 2009 17:50
Location: Zurich, Switzerland
Contact:

Re: check_interval

Post by agargiulo » Wed Sep 09, 2009 12:59

Could you please post the contents of your services.cfg file for the appropriate service? Maybe there is a problem with generating the files...

charanbeer78
starter
starter
Posts: 2
Joined: Thu Sep 03, 2009 22:09

Re: check_interval

Post by charanbeer78 » Thu Sep 10, 2009 21:53

Here it is. It doesnt look like the value defined in the GUI is being picked correctly in the config file. All other changes seem to work fine though.

define service {
service_description check_hpasm
check_command check_nrpe!check_hpasm -t 60
host_name ewr-ftp
check_period test
notification_period 24x7
contact_groups unix_admins,admins
event_handler_enabled 0
max_check_attempts 3
normal_check_interval 5
retry_check_interval 1
notification_interval 15
notification_options w,u,c,r
active_checks_enabled 1
passive_checks_enabled 0
notifications_enabled 1
check_freshness 0
freshness_threshold 86400
}

User avatar
agargiulo
NConf developer
NConf developer
Posts: 725
Joined: Fri Mar 06, 2009 17:50
Location: Zurich, Switzerland
Contact:

Re: check_interval

Post by agargiulo » Fri Sep 11, 2009 18:13

Thank you for posting this. There is a bug in the routine that generated the configuration. The attributes which you set in NConf within your timeperiod are only written to the hosts or services if you set the "notification_period" attribute to that timeperiod, the "check_period" is ignored.
In your case this would mean setting the notification_period of your services to "test", then NConf will apply the proper normal_check_interval.

I have already implemented a fix and it will be included in the upcoming version of NConf.
If you need a quicker fix, let me know, and I can post the exact changes you have to make (it's quite a bit).

fras.marco

Re: check_interval

Post by fras.marco » Fri Oct 09, 2009 17:15

I'm interested in this fix, can you post some detail?
Thanks

Marco
fras.marco at gmail dot com

User avatar
agargiulo
NConf developer
NConf developer
Posts: 725
Joined: Fri Mar 06, 2009 17:50
Location: Zurich, Switzerland
Contact:

Re: check_interval

Post by agargiulo » Wed Oct 14, 2009 13:50

Hi.

Unfortunately the generate_config functionality has been changed considerably within the last few days. It's better and safer to wait for the next release, which should be due in 2-3 weeks.

Locked