Page 1 of 1

I think there's an[other] import bug

Posted: Thu Sep 12, 2019 10:22 am
by eloyd
So, possibly related to (but different from) https://support.nagios.com/forum/viewto ... 16&t=55547, I now have this:

If I import the following timeperiods.cfg file:

Code: Select all

define timeperiod {
 timeperiod_name 3am-4am daily
 alias 3am to 4am every day
 day 1 - -1 03:00-04:00
}

define timeperiod {
 timeperiod_name 4am-3am daily
 alias 4am to 3am every day (all times except 3am-4am)
 day 1 - -1 00:00-24:00
 exclude 3am-4am daily
}
The import goes fine. Note that all tabs have been replaced with spaces and all multiple spaces replaced with single spaces. Again, the import works.

The verify, however, fails with:

Code: Select all

Error: Excluded time period '3am-4am         daily' specified in timeperiod '4am-3am daily' is not defined anywhere!
Note here that the excluded period has a really weird spacing. In the created /usr/local/nagios/etc/timeperiods.cfg file, here's what's there:

Code: Select all

define timeperiod {
    timeperiod_name         3am-4am daily
    alias                   3am to 4am every day
    day 1 - -1              03:00-04:00
}

define timeperiod {
    timeperiod_name         4am-3am daily
    alias                   4am to 3am every day (all times except 3am-4am)
    day 1 - -1              00:00-24:00
    exclude 3am-4am         daily
}
Note that what looks like space between "3am-4am" and "daily" in the exclude is actually multiple spaces.

So I'm back to "I think there's an[other] import bug."

Re: I think there's an[other] import bug

Posted: Thu Sep 12, 2019 10:50 am
by eloyd
As a follow-up, if I manually remove the extra spaces that got added to the "exclude" line, it passes the verify. However, I'd really rather not have to do this with every import. :-)

Re: I think there's an[other] import bug

Posted: Thu Sep 12, 2019 11:42 am
by scottwilkerson
another fix, same file

Code: Select all

/usr/local/nagiosxi/html/includes/components/ccm/classes/import.class.php
import.class.zip

Re: I think there's an[other] import bug

Posted: Thu Sep 12, 2019 11:46 am
by eloyd
Thanks. Will test in a few minutes.

Re: I think there's an[other] import bug

Posted: Thu Sep 12, 2019 11:51 am
by scottwilkerson
sounds good

Re: I think there's an[other] import bug

Posted: Thu Sep 12, 2019 12:10 pm
by eloyd
Yay! Our 300 time periods just imported without issue!

Thanks again, Scott. I'll let you know when I find the next import bug. :-)

Re: I think there's an[other] import bug

Posted: Thu Sep 12, 2019 12:23 pm
by scottwilkerson
eloyd wrote:Thanks again, Scott. I'll let you know when I find the next import bug.
Sounds good!!

Locking thread