New Features #2
list Ian Marsh
Whilst we're on the subject of new features would it be possible to have easier access to the acknowledgement code for an alert? As things stand at the moment the only place that you can get the ack code is on the email notification that gets sent out once the alert has been triggered. With our setup this means that we have to wait for the frontline support people to contact us before we can ack the alert, even if we knew about it as soon as it happened. What I'd like to be able to do is to pre-empt the alert by having access to the ack code earlier, as soon as the status changes to red, and have the code displayed on the individual test page. The way I envisage this happening is that the ack code is generated when the test turns red rather than when an alert is sent out. This code can then be included on the tests status page where we have easy access to it. The text could be displayed in a similar fashion to the text currently added when an alert is acknowledged. I know that we could turn the test offline without the ack code but that tends to leave a hole in the graphs, acknowledging the alert allows everything to be logged/graphed as per normal. Does this sort of behaviour sound feasible? Thanks, Ian Marsh
list Asif Iqbal
▸
On Tue, Apr 19, 2005 at 10:44:36AM, Marsh, Ian wrote:
Whilst we're on the subject of new features would it be possible to have easier access to the acknowledgement code for an alert? As things
I like that idea too
stand at the moment the only place that you can get the ack code is on
Actually in a situation like that I query against hobbitdboard to get the ACKCODE bb 127.0.0.1 "hobbitdboard" | grep HOSTNAME | grep SERVICE man bb for more details
▸
the email notification that gets sent out once the alert has been triggered. With our setup this means that we have to wait for the frontline support people to contact us before we can ack the alert, even if we knew about it as soon as it happened.
--
Asif Iqbal
PGP Key: 0xE62693C5 KeyServer: pgp.mit.edu
"..there are two kinds of people: those who work and those who take the credit...try
to be in the first group;...less competition there." - Indira Gandhi
list Henrik Størner
▸
On Tue, Apr 19, 2005 at 08:00:57AM -0400, Asif Iqbal wrote:
Actually in a situation like that I query against hobbitdboard to get the ACKCODE bb 127.0.0.1 "hobbitdboard" | grep HOSTNAME | grep SERVICE
A simpler method (at least for the server to handle) is bb 127.0.0.1 "hobbitdboard host=HOSTNAME test=TESTNAME fields=cookie" Henrik
list Henrik Størner
▸
On Tue, Apr 19, 2005 at 10:44:36AM +0100, Marsh, Ian wrote:
What I'd like to be able to do is to pre-empt the alert by having access to the ack code earlier, as soon as the status changes to red, and have the code displayed on the individual test page. The way I envisage this happening is that the ack code is generated when the test turns red rather than when an alert is sent out. This code can then be included on the tests status page where we have easy access to it. The text could be displayed in a similar fashion to the text currently added when an alert is acknowledged.
Try the attached patch - should work against 4.0.2. Apply with
cd hobbit-4.0.2
patch -p0 </tmp/hobbit-4.0.2-cookies.patch
make
stop hobbit
make install (as root)
start hobbit
This makes the cookie appear on the detailed status page if it has not
yet been acknowledged. By default I've disabled this - you must add
the option "--publish-cookies" to the hobbitsvc.cgi command in
~/server/cgi-bin/bb-hostsvc.sh to enable this.
I haven't yet made up my mind if this is a good idea or not. Another
solution I've thought about is to make an acknowledge webpage similar
to the enable/disable webpage, where you can choose which tests to
acknowledge. And publishing the cookies on the status-page becomes
more difficult with the planned changes to the alerting where
escalations are handled.
Regards,
Henrik
-------------- next part --------------
--- lib/htmllog.c 2005/04/16 17:01:36 1.24
+++ lib/htmllog.c 2005/04/19 12:12:26
@@ -86,7 +86,7 @@
int color, char *sender, char *flags,
time_t logtime, char *timesincechange,
char *firstline, char *restofmsg,
- time_t acktime, char *ackmsg,
+ time_t acktime, char *ackmsg, int ackcookie,
time_t disabletime, char *dismsg,
int is_history, int wantserviceid, int htmlfmt, int hobbitd,
char *multigraphs,
@@ -219,7 +219,10 @@
MEMUNDEFINE(ackuntil);
}
• + else if (ackcookie > 0) {
+ fprintf(output, "<font %s>Acknowledgment cookie: %d</font><br>\n", ackfont, ackcookie);
+ }
• fprintf(output, "</font></td></tr>\n");
fprintf(output, "</table>\n");
--- lib/htmllog.h 2005/03/22 09:16:49 1.8
+++ lib/htmllog.h 2005/04/19 12:08:51
@@ -21,7 +21,7 @@
int color, char *sender, char *flags,
time_t logtime, char *timesincechange,
char *firstline, char *restofmsg,
- time_t acktime, char *ackmsg,
+ time_t acktime, char *ackmsg, int ackcookie,
time_t disabletime, char *dismsg,
int is_history, int wantserviceid, int htmlfmt, int hobbitd,
char *multigraphs,
--- hobbitd/hobbitd_filestore.c 2005/03/25 21:13:41 1.40
+++ hobbitd/hobbitd_filestore.c 2005/04/19 12:12:49
@@ -120,7 +120,7 @@
color, sender, flags,
logtime, timestr,
firstline, restofmsg,
- acktime, ackmsg,
+ acktime, ackmsg, -1,
disabletime, dismsg,
0, 1, 0, 1, multigraphs, output);
--- hobbitd/hobbitsvc.c 2005/04/17 19:34:17 1.37
+++ hobbitd/hobbitsvc.c 2005/04/19 12:18:49
@@ -31,6 +31,7 @@
static enum { SRC_HOBBITD, SRC_HISTLOGS, SRC_MEM } source = SRC_HOBBITD;
static int wantserviceid = 1;
static char *multigraphs = ",disk,inode,qtree,";
+static int publishcookies = 0;
/* CGI params */
static char *hostname = NULL;
@@ -118,6 +119,7 @@
time_t logtime = 0, acktime = 0, disabletime = 0;
char *log = NULL, *firstline = NULL, *sender = NULL, *flags = NULL; /* These are free'd */
char *restofmsg = NULL, *ackmsg = NULL, *dismsg = NULL; /* These are just used */
+ int ackcookie = -1;
if (parse_query() != 0) return 1;
@@ -192,6 +194,8 @@
if (items[8] && strlen(items[8])) disabletime = atoi(items[8]);
sender = strdup(items[9]);
+ if (items[10] && strlen(items[10])) ackcookie = atoi(items[10]);
• if (items[11] && strlen(items[11])) ackmsg = items[11];
if (ackmsg) nldecode(ackmsg);
@@ -295,7 +299,7 @@
logtime, timesincechange,
(firstline ? firstline : ""),
(restofmsg ? restofmsg : ""),
- acktime, ackmsg,
+ acktime, ackmsg, (publishcookies ? ackcookie : -1),
disabletime, dismsg,
(source == SRC_HISTLOGS),
wantserviceid,
@@ -346,6 +350,9 @@
char *p = strchr(argv[argi], '=');
loadenv(p+1);
}
+ else if (strcmp(argv[argi], "--publish-cookies") == 0) {
+ publishcookies = 1;
+ }
else if (strcmp(argv[argi], "--no-svcid") == 0) {
wantserviceid = 0;
}
list Ian Marsh
To be honest I don't mind where the cookie info appears, just so long as I can get at it! My original suggestion was loosely based around the proposed new enable/disable system. I'd be more than happy with an 'acknowledge page' as you've suggested as that brings them all into one place. Thanks, Ian Marsh
▸
-----Original Message-----
From: Henrik Stoerner [mailto:user-ce4a2c883f75@xymon.invalid]
Sent: 19 April 2005 13:37
To: user-ae9b8668bcde@xymon.invalid
Subject: Re: [hobbit] New Features #2
On Tue, Apr 19, 2005 at 10:44:36AM +0100, Marsh, Ian wrote:
What I'd like to be able to do is to pre-empt the alert by having access to the ack code earlier, as soon as the status changes to red, and have the code displayed on the individual test page. The way I envisage this happening is that the ack code is generated when the test turns red rather than when an alert is sent out. This code can then be included on the tests status page where we have easy access to it. The text could be displayed in a similar fashion to the text currently added when an alert is acknowledged.
Try the attached patch - should work against 4.0.2. Apply with cd hobbit-4.0.2 patch -p0 </tmp/hobbit-4.0.2-cookies.patch make stop hobbit make install (as root) start hobbit This makes the cookie appear on the detailed status page if it has not yet been acknowledged. By default I've disabled this - you must add the option "--publish-cookies" to the hobbitsvc.cgi command in ~/server/cgi-bin/bb-hostsvc.sh to enable this. I haven't yet made up my mind if this is a good idea or not. Another solution I've thought about is to make an acknowledge webpage similar to the enable/disable webpage, where you can choose which tests to acknowledge. And publishing the cookies on the status-page becomes more difficult with the planned changes to the alerting where escalations are handled. Regards, Henrik