Migrated from OMD 1.20 (nagios core 3.5 ) to checkmk 2.0 raw edition(nagios core 3.5.1)

Notifications are not working after migrating to check mk 2.0 raw edition. Noticing the below error related to livestatus in nagios.log . The nagios config files under /omd/sites/nagios/etc/nagios/conf.d are same in both versions.

[1641450296] livestatus: Timeperiod cache not updated, there are no timeperiods (yet)

Please advise how to overcome this issue to send the notifications.

Hi,
looks like that the time periods not take over during migration. Try to create a new time period config.
Cheers,
Christian

Time period config has been set in timeperiod.cfg file . I expect it should work, should there be any special config required?

Hi,
what’s the content of etc/check_mk/conf.d/wato/timeperiods.mk?

Karl

No timeperiods.mk file but timeperiods.cfg file is under etc/nagios/conf.d

ls -l etc/check_mk/conf.d/wato/
total 24
-rw-rw----. 1 nagios nagios 265 Dec 31 14:48 contacts.mk
-rw-rw----. 1 nagios nagios 1826 Jan 4 15:48 global.mk
-rw-rw----. 1 nagios nagios 158 Nov 26 14:45 groups.mk
-rw-rw----. 1 nagios nagios 276 Nov 26 14:45 notifications.mk
-rw-rw----. 1 nagios nagios 3716 Nov 26 14:45 rules.mk
-rw-rw----. 1 nagios nagios 665 Nov 26 14:45 tags.mk

ls -l etc/nagios/conf.d/timeperiods.cfg
-rwxr-xr-x. 1 nagios nagios 6089 Nov 9 11:25 etc/nagios/conf.d/timeperiods.cfg

Hi,
create time periods and activate the changes.

Karl

1 Like

You mean to say create timeperiods.mk under etc/check_mk/conf.d/wato/ and activate the changes?

Hi,
I mean: Setup > Time periods > Add time period

Karl

By default time period settings 24x7 is already available . However, I have added new time period as shtime_period_1_1 as shown in attached screenshot . But still notifications are not working . var/log/nagios.log has below error message.

notifications test, please ignore
[1641897080] livestatus: Timeperiod cache not updated, there are no timeperiods (yet)
[1641897140] livestatus: Timeperiod cache not updated, there are no timeperiods (yet)
[1641897200] livestatus: Timeperiod cache not updated, there are no timeperiods (yet)
[1641897260] livestatus: Timeperiod cache not updated, there are no timeperiods (yet)

Hi,
do you have the file timeperiods.mk now? Can you see the configuration from this file in timeperiods.cfg?

Karl

Yes timeperiods.mk created under etc/check_mk/conf.d/wato/ and the config is as below

timeperiods.update({‘time_period_1’: {‘alias’: ‘always1’, ‘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’)], ‘sunday’: [(‘00:00’, ‘24:00’)]}})

The config in etc/nagios/conf.d/timeperiods.cfg is as below

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
}

Hi,
on my test site there’s no file timeperiods.cfg in etc/nagios/conf.d/. I can find the file check_mk_objects.cfg with the section define timeperiod. Do you have this section in check_mk_objects.cfg?

Can you find your new timeperiod in one of the nagios configuration files?

In your example output I can’t see the new timeperiod always1.

Karl

Yes, Its available in below file. Do you think that copying all the contents of etc/nagios/conf.d/timeperiods.cfg to etc/nagios/conf.d/check_mk_objects.cfg will work?

cat etc/nagios/conf.d/check_mk_objects.cfg

define timeperiod {
alias always1
friday 00:00-24:00
monday 00:00-24:00
saturday 00:00-24:00
sunday 00:00-24:00
thursday 00:00-24:00
timeperiod_name time_period_1
tuesday 00:00-24:00
wednesday 00:00-24:00
}

Hi,
that’s not necessary. When activating changes in Checkmk the Nagios configuration files will be created.

Karl

I have defined the time period (time_period_1) I have created in check_mk dashboard in service for which i’m testing the notifications but still its not working.

So in my case the time period defined from check_mk dashboard which added entries to etc/nagios/conf.d/check_mk_objects.cfg and my time period config from previous version which is under etc/nagios/conf.d/timeperiods.cfg both these options not sending the notifications.