[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [hobbit] BB-Hosts DOWNTIME
- To: hobbit (at) hswn.dk
- Subject: Re: [hobbit] BB-Hosts DOWNTIME
- From: Dominique Frise <dominique.frise (at) unil.ch>
- Date: Wed, 29 Apr 2009 15:37:23 +0200
- References: <OF4BFEF19C.13D4B511-ON882575A6.005DCEA5-882575A6.005DE706 (at) hra.com> <F9BA6682-A95F-4F38-8FE9-8C5AA65F0D2E (at) skurfer.com> <c6fda93d0904290516w515e063cj810a7273e1abfefd (at) mail.gmail.com>
- User-agent: Thunderbird 2.0.0.14 (X11/20080531)
Patrick Nixon wrote:
I'd have to agree to that.
On my info page for the previously provided downtime, I have:
Planned Downtime: cam:60:0000:2400:Offline2, cam:W:1930:0830:Offline
Doesn't seem to be parsing it properly, but it does work appropriately.
On Tue, Apr 28, 2009 at 3:16 PM, Rob McBroom <mailinglist0 (at) skurfer.com> wrote:
On 2009-Apr-28, at 1:05 PM, MFisher (at) hra.com wrote:
I have just changed my BB-HOsts to reflect the following....I have a
suspision that my issue was with letting bb-hosts get regnerated before i
come to a conclusion of it not working..
BB-HOSTS entry = DOWNTIME=*:1000:1100
The information page shows the following
Planned downtime:All days:1000:1100
In my experience, the syntax that makes the information page look correct is
not the syntax that will actually work. I'm guessing the code that parses
the DOWNTIME option was duplicated in two places and those two places are
now out of sync.
--
Rob McBroom
<http://www.skurfer.com/>
To unsubscribe from the hobbit list, send an e-mail to
hobbit-unsubscribe (at) hswn.dk
To unsubscribe from the hobbit list, send an e-mail to
hobbit-unsubscribe (at) hswn.dk
Yes, I also do agree with this!
BTW, this was already spotted in
http://www.hswn.dk/hobbiton/2008/05/msg00042.html
After digging into the code, I found 2 issues around the DOWNTIME behaviour.
1. Internal handling of DOWNTIME values do not reflect the specification
of the bb-hosts(5) man page.
The man page says:
DOWNTIME=[columns:]day:starttime:endtime:cause[,day:starttime:endtime:cause]
But the check_downtime function code in lib/timefunc.c says:
---- extract of ./lib/timefunc.c ----
...
303 do {
304 /* Its either DAYS:START:END or
SERVICE:DAYS:START:END:CAUSE */
305
306 s1 = p; p += strcspn(p, ":"); if (*p !=
'\0') { *p = '\0'; p++; }
307 s2 = p; p += strcspn(p, ":"); if (*p !=
'\0') { *p = '\0'; p++; }
...
--------------------------------------
According to this, the man page should say:
DOWNTIME=day:starttime:endtime:[,day:starttime:endtime]
OR
DOWNTIME=columns:day:starttime:endtime:cause[,columns,day:starttime:endtime:cause]
2. The "Planned Downtime" line displayed in info column do not honor the
optional "columns" tag at all. The generate_info function in
./web/hobbitsvc-info.c calls the timespec_text function that handles
day:starttime:endtime values only. (like REPORTTIME).
------------- extract of /web/hobbitsvc-info.c---------
871 val = bbh_item(hostwalk, BBH_DOWNTIME);
872 if (val) {
873 char *s = timespec_text(val);
874 addtobuffer(infobuf, "<tr><th
align=left>Planned downtime:</th><td align=left>");
875 addtobuffer(infobuf, s);
876 addtobuffer(infobuf, "</td></tr>\n");
877 }
------------------------------------------------------
There is no quick hacks to solve both problems :-(
I think only the boss -Henrik- can make the appropriate redesign/changes.
Dominique