Page 1 of 2

NagiosXi - Time periods ranges

Posted: Mon Jul 06, 2020 7:04 am
by Bala.Mutyam
Hi,

Is it possible to include Time period ranges like Monday - Friday as Time Definition and 07:00-19:00 as Time Range. I have tired but giving an error "Error: Could not parse timerange #1 for day 1 of timeperiod (config file '/usr/local/nagios/etc/timeperiods.cfg', starting on line 53)" .

Also can we also have run checks for 24/7 but send alerts for a particular time period (say 0:700-19:00) and for a specific group?

Re: NagiosXi - Time periods ranges

Posted: Mon Jul 06, 2020 8:53 am
by scottwilkerson
monday - friday wouldn't be valid, you would need to add each day separately.

There are a lot of different ranges that are valid but that isn't one that exists

See:
https://assets.nagios.com/downloads/nag ... riods.html

Re: NagiosXi - Time periods ranges

Posted: Mon Jul 06, 2020 9:53 am
by Bala.Mutyam
@scottwilkerson - Thanks for the update.

Also possible to run checks for 24/7 and only send alerts between 7:00-19:00 for a particular hostgroups?

Re: NagiosXi - Time periods ranges

Posted: Mon Jul 06, 2020 10:06 am
by scottwilkerson
Yes, you can set a separate time-period for notifications when editing a host/service in the CCM
Alert Settings Tab -> Notification period

Re: NagiosXi - Time periods ranges

Posted: Tue Jul 21, 2020 3:29 am
by Bala.Mutyam
@scottwilkerson - Thanks for the update.

For some reason notification is not working.
Here are the definitions:

timeperiod:

Code: Select all

define timeperiod {
    timeperiod_name         cp-standard-timeperiod
    alias                   CP standard timings
    monday                  07:00-19:00
    tuesday                 07:00-19:00
    wednesday               07:00-19:00
    thursday                07:00-19:00
    friday                  07:00-19:00
}
Service:

Code: Select all

define service {
    host_name                 server_name
    service_description      Local Disks
    check_command            check_xi_ncpa!-t 'NagiosXi' -P 5693 -M 'plugins/check_disk' -q 'args=-l -w 20% -c 10%'
    max_check_attempts       2
    check_interval           5
    retry_interval           1
    check_period             24x7
    notification_interval    5
    notification_period      cp-standard-timeperiod
    contact_groups           Linux-Alerts
    register                 1
}
contactsgroup:

Code: Select all

define contactgroup {
    contactgroup_name    Linux-Alerts
    alias                Linux Systems Alerts
    members              member1,member2
}
As per the definitions, we are supposed to receive alerts from 7am to 7pm but we are not receiving any alerts? please have a look.

Thannks

Re: NagiosXi - Time periods ranges

Posted: Tue Jul 21, 2020 7:59 am
by scottwilkerson
Do the notification events show up in the Notification Log & State History?

Re: NagiosXi - Time periods ranges

Posted: Tue Jul 21, 2020 8:13 am
by Bala.Mutyam
I can see events in the Notifications but nothing in state log on NagiosXi under Reports.

Re: NagiosXi - Time periods ranges

Posted: Tue Jul 21, 2020 8:16 am
by scottwilkerson
Are the notifications for member1,member2 on server_name Local Disks?

Re: NagiosXi - Time periods ranges

Posted: Tue Jul 21, 2020 8:24 am
by Bala.Mutyam
Yes.

Re: NagiosXi - Time periods ranges

Posted: Tue Jul 21, 2020 9:12 am
by scottwilkerson
Can you verify that member1 and member2 have all the correct items set in their Notification settings, see page 2,3 here
https://assets.nagios.com/downloads/nag ... ios-XI.pdf

make sure the notification method and preferences are set to receive the types you want.