I set up workhours and us-holidays in 
/usr/local/icinga/etc/objects/timeperiods.cfg on my CentOS 5.5 Icinga 1.2.1 
server.  I have data going back into November so I ran an Availability report 
on Last Month using workhours_sans_holidays and the hostgroup the customer is 
interested in.  I checked the CVS box and unfortunately got 23 days of data 
instead of the expected 21.  If I had screwed it up I'd expect I'd get 31 days 
of seconds.

   December 2010
Su Mo Tu We Th Fr Sa
          1  2  3  4
 5  6  7  8  9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31

The 24th and 31st are both defined as holidays, workhours are 8 til 5, so I'd 
expect 21 x 9 hours x 1440 or 272160 seconds. Instead I get 23 days worth, or 
745200 seconds.  If it makes a difference, I defined the holidays this January, 
so maybe it is reporting whatever data is available, which would be a bug as 
one can choose different periods for the report.

Example line from the report:
'phs-innlabxp15';'0';'0.000%';'0.000%';'745200';'0.000%';'0.000%';'745200';'100.000%';'100.000%';'0';'0.000%';'0.000%';'0';'0.000%';'0.000%';'0';'0.000%';'0.000%';'0';'0.000%';'0.000%';'0';'0.000%';'0.000%';'0';'0.000%';'0.000%';'0';'0.000%';'0';'0.000%';'0';'0.000%';

Sorry about the word-wrap, I don't have Eudora (yet) on my new laptop, so I've 
also attached the files.

Attachment: sample.cvs
Description: Binary data

Attachment: timeperiods.cfg
Description: Binary data

Here are the pertinent parts of timperiods.cfg (full file sans header comments 
attached).  Note that I also tried
       use             workhours,us-holidays
in workhours_sans_holidays (bouncing icinga each time).

 
# 'workhours' timeperiod definition
define timeperiod{
       name            workhours
       timeperiod_name workhours
       alias           Normal Work Hours
       monday          08:00-17:00
       tuesday         08:00-17:00
       wednesday       08:00-17:00
       thursday        08:00-17:00
       friday          08:00-17:00
       }

# As of 2011-01-12 the holidays are set through 2020 (latest available at that
# time from http://www.opm.gov/Operating_Status_Schedules/fedhol/Index.asp ).
define timeperiod{
       name                    us-holidays
       timeperiod_name         us-holidays
       alias                   U.S. Holidays

       2010-12-24              00:00-00:00     ; Christmas (official holiday, 
2010)
       2010-12-31              00:00-00:00     ; New Years (official holiday, 
2011)
       january 1               00:00-00:00     ; New Years
       monday 3 january        00:00-00:00     ; Birthday of Martin Luther 
King, Jr.
       2010-12-24              00:00-00:00     ; Christmas (official holiday, 
2010)
       2010-12-31              00:00-00:00     ; New Years (official holiday, 
2011)
       january 1               00:00-00:00     ; New Years
       monday 3 january        00:00-00:00     ; Birthday of Martin Luther 
King, Jr.
       monday 3 february       00:00-00:00     ; Washington's Birthday 
(President's Day)
       monday -1 may           00:00-00:00     ; Memorial Day (last Monday in 
May)
       july 4                  00:00-00:00     ; Independence Day
       monday 1 september      00:00-00:00     ; Labor Day (first Monday in 
September)
       monday 2 october        00:00-00:00     ; Columbus Day
       november 11             00:00-00:00     ; Veterans Day
       thursday -1 november    00:00-00:00     ; Thanksgiving (last Thursday in 
November)
       december 25             00:00-00:00     ; Christmas
       2011-12-26              00:00-00:00     ; Christmas (official holiday, 
2011)
       2012-01-02              00:00-00:00     ; New Years (official holiday, 
2012)
       2012-11-12              00:00-00:00     ; Veterans Day (official 
holiday, 2012)
       2015-07-03              00:00-00:00     ; Independence Day (official 
holiday, 2015)
       2016-12-26              00:00-00:00     ; Christmas (official holiday, 
2016)
       2017-01-02              00:00-00:00     ; New Years (official holiday, 
2017)
       2018-11-12              00:00-00:00     ; Veterans Day (official 
holiday, 2018)
       2020-07-03              00:00-00:00     ; Independence Day (official 
holiday, 2020)
       }

# This defines a modified "workhours" timeperiod that covers every day of the
# year, except for U.S. holidays (defined in the timeperiod above).
define timeperiod{
       timeperiod_name workhours_sans_holidays
       alias           Work Hours Sans Holidays
       use             workhours               ; Start with this
       exclude         us-holidays             ; Get holiday exceptions
       }


Brian Timares
------------------------------------------------------------------------------
Protect Your Site and Customers from Malware Attacks
Learn about various malware tactics and how to avoid them. Understand 
malware threats, the impact they can have on your business, and how you 
can protect your company and customers by using code signing.
http://p.sf.net/sfu/oracle-sfdevnl
_______________________________________________
icinga-users mailing list
icinga-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/icinga-users

Reply via email to