[Xymon] Bug in holidays calculation
Tom Schmidt (tschmidt)
tschmidt at micron.com
Tue Feb 2 22:34:35 CET 2016
I have noticed a bug in the holidays feature of Xymon. I am using Xymon
4.3.24 and have seen it on previous releases as well. The issue is that
the US Holiday of Thanksgiving is not showing the correct date during
leap years. Thanksgiving is the fourth Thursday in November, so is
using this entry in holidays.cfg:
Thanksgiving:type=thu month=11 offset=4
This works correctly during non-leap years, but it is a day off during
leap years like 2016. I added these simple entries to holidays.cfg to
better show the issue:
November Week 1 Thu:type=thu month=11 offset=1
November Week 2 Thu:type=thu month=11 offset=2
November Week 3 Thu:type=thu month=11 offset=3
When I look at the holidays that it calculates, I get this in the info
column:
Holidays 2015/2016 (USA)
November Week 1 Thu Nov 05
November Week 2 Thu Nov 12
November Week 3 Thu Nov 19
Thanksgiving Nov 26
Christmas Day Dec 25
New Year's Day Jan 01
Easter Sunday Mar 27
Memorial Day May 30
Independence Day Jul 04
Labor Day Sep 05
November Week 1 Thu Nov 03
November Week 2 Thu Nov 09
November Week 3 Thu Nov 16
Thanksgiving Nov 23
Note that the November 2015 dates are correct, but the November 2016
dates for Week 2 and later are a day early. Thus it thinks Thanksgiving
2016 is on November 23 instead of the correct November 24 date.
I looked at the source code some, but I could not follow the logic of
how it is calculating this date incorrectly. It is a minor bug only
affecting those that use the holidays feature for alerts or look at the
holidays table in the info tab. Can someone figure out why it is not
calculating the date offsets correctly? It only seems to be doing this
during leap years.
Thanks...Tom
--
Micron Technology, Inc., Confidential and Proprietary
Tom L. Schmidt
Central Engineering System Administrator Lead
Micron Technology, Inc. http://www.micron.com/
8000 S. Federal Way P.O. Box 6 Mail Stop 01-351 Boise, Idaho USA
83707-0006
mailto:tschmidt at micron.com
More information about the Xymon
mailing list