xymon

Check-in [523b41d601]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:add acknowledgements.sh report (Thanks, Andy Smith) git-svn-id: http://svn.code.sf.net/p/xymon/code/branches/4.3.19@7602 44351d6e-118b-4698-b696-ce33095ecaa4
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk | origin/4.3.19
Files: files | file ages | folders
SHA3-256: 523b41d601f881a9b67d543233de396b622f47386c0630b1f5906a64386bf493
User & Date: jccleaver@users.sf.net 2015-03-21 00:01:03
Context
2015-03-21
09:58
Backport logfetch r6811 from trunk git-svn-id: http://svn.code.sf.net/p/xymon/code/branches/4.3.19@7603 44351d6e-118b-4698-b696-ce33095ecaa4 check-in: 8edb8f41d7 user: jccleaver@users.sf.net tags: trunk, origin/4.3.19
00:01
add acknowledgements.sh report (Thanks, Andy Smith) git-svn-id: http://svn.code.sf.net/p/xymon/code/branches/4.3.19@7602 44351d6e-118b-4698-b696-ce33095ecaa4 check-in: 523b41d601 user: jccleaver@users.sf.net tags: trunk, origin/4.3.19
2015-03-15
18:36
msgs/html pre-tag fixes, pt.2 git-svn-id: http://svn.code.sf.net/p/xymon/code/branches/4.3.19@7601 44351d6e-118b-4698-b696-ce33095ecaa4 check-in: 615c833eb0 user: jccleaver@users.sf.net tags: trunk, origin/4.3.19
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to include/libxymon.h.

57
58
59
60
61
62
63

64
65
66
67
68
69
70

/* Generates HTML */
#include "../lib/acklog.h"
#include "../lib/eventlog.h"
#include "../lib/headfoot.h"
#include "../lib/htmllog.h"
#include "../lib/notifylog.h"

#include "../lib/reportlog.h"

#include "../lib/availability.h"
#include "../lib/calc.h"
#include "../lib/cgi.h"
#include "../lib/color.h"
#include "../lib/crondate.h"







>







57
58
59
60
61
62
63
64
65
66
67
68
69
70
71

/* Generates HTML */
#include "../lib/acklog.h"
#include "../lib/eventlog.h"
#include "../lib/headfoot.h"
#include "../lib/htmllog.h"
#include "../lib/notifylog.h"
#include "../lib/acknowledgementslog.h"
#include "../lib/reportlog.h"

#include "../lib/availability.h"
#include "../lib/calc.h"
#include "../lib/cgi.h"
#include "../lib/color.h"
#include "../lib/crondate.h"

Changes to lib/Makefile.

1
2
3
4
5
6
7
8
9
10
11
..
58
59
60
61
62
63
64



65
66
67
68
69
70
71
# Xymon library Makefile
#

XYMONLIBOBJS = osdefs.o acklog.o availability.o calc.o cgi.o cgiurls.o clientlocal.o color.o crondate.o digest.o encoding.o environ.o errormsg.o eventlog.o files.o headfoot.o xymonrrd.o holidays.o htmllog.o ipaccess.o loadalerts.o loadcriticalconf.o links.o matching.o md5.o memory.o misc.o msort.o netservices.o notifylog.o readmib.o reportlog.o rmd160c.o sha1.o sha2.o sig.o stackio.o strfunc.o suid.o timefunc.o tree.o url.o webaccess.o

XYMONCOMMLIBOBJS = $(XYMONLIBOBJS) loadhosts.o locator.o sendmsg.o xymond_ipc.o xymond_buffer.o
XYMONTIMELIBOBJS = run.o timing.o

CLIENTLIBOBJS = osdefs.o cgiurls.o color-client.o crondate.o digest.o encoding.o environ-client.o errormsg.o holidays.o ipaccess.o md5.o memory.o misc.o msort.o rmd160c.o sha1.o sha2.o sig.o stackio.o strfunc.o suid.o timefunc-client.o tree.o
ifeq ($(LOCALCLIENT),yes)
	CLIENTLIBOBJS += matching.o
................................................................................
	$(CC) $(CFLAGS) -c -o $@ loadhosts.c

eventlog.o: eventlog.c
	$(CC) $(CFLAGS) $(PCREINCDIR) -c -o $@ $<

notifylog.o: notifylog.c
	$(CC) $(CFLAGS) $(PCREINCDIR) -c -o $@ $<




headfoot.o: headfoot.c
	$(CC) $(CFLAGS) $(PCREINCDIR) -c -o $@ $<

loadalerts.o: loadalerts.c
	$(CC) $(CFLAGS) $(PCREINCDIR) -c -o $@ $<




|







 







>
>
>







1
2
3
4
5
6
7
8
9
10
11
..
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
# Xymon library Makefile
#

XYMONLIBOBJS = osdefs.o acklog.o availability.o calc.o cgi.o cgiurls.o clientlocal.o color.o crondate.o digest.o encoding.o environ.o errormsg.o eventlog.o files.o headfoot.o xymonrrd.o holidays.o htmllog.o ipaccess.o loadalerts.o loadcriticalconf.o links.o matching.o md5.o memory.o misc.o msort.o netservices.o notifylog.o acknowledgementslog.o readmib.o reportlog.o rmd160c.o sha1.o sha2.o sig.o stackio.o strfunc.o suid.o timefunc.o tree.o url.o webaccess.o

XYMONCOMMLIBOBJS = $(XYMONLIBOBJS) loadhosts.o locator.o sendmsg.o xymond_ipc.o xymond_buffer.o
XYMONTIMELIBOBJS = run.o timing.o

CLIENTLIBOBJS = osdefs.o cgiurls.o color-client.o crondate.o digest.o encoding.o environ-client.o errormsg.o holidays.o ipaccess.o md5.o memory.o misc.o msort.o rmd160c.o sha1.o sha2.o sig.o stackio.o strfunc.o suid.o timefunc-client.o tree.o
ifeq ($(LOCALCLIENT),yes)
	CLIENTLIBOBJS += matching.o
................................................................................
	$(CC) $(CFLAGS) -c -o $@ loadhosts.c

eventlog.o: eventlog.c
	$(CC) $(CFLAGS) $(PCREINCDIR) -c -o $@ $<

notifylog.o: notifylog.c
	$(CC) $(CFLAGS) $(PCREINCDIR) -c -o $@ $<

acknowledgementslog.o: acknowledgementslog.c
	$(CC) $(CFLAGS) $(PCREINCDIR) -c -o $@ $<

headfoot.o: headfoot.c
	$(CC) $(CFLAGS) $(PCREINCDIR) -c -o $@ $<

loadalerts.o: loadalerts.c
	$(CC) $(CFLAGS) $(PCREINCDIR) -c -o $@ $<

Added lib/acknowledgementslog.c.





































































































































































































































































































































































































































































































































































































































































































































































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
/*----------------------------------------------------------------------------*/
/* Xymon monitor library.                                                     */
/*                                                                            */
/* This displays the "acknowledgements" log.                                  */
/*                                                                            */
/* Copyright (C) 2002-2011 Henrik Storner <henrik@storner.dk>                 */
/* Host/test/color/start/end filtering code by Eric Schwimmer 2005            */
/*                                                                            */
/* This program is released under the GNU General Public License (GPL),       */
/* version 2. See the file "COPYING" for details.                             */
/*                                                                            */
/*----------------------------------------------------------------------------*/

static char rcsid[] = "$Id: acknowledgementslog.c 7085 2012-07-16 11:08:37Z storner $";

#include <limits.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <ctype.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <dirent.h>
#include <unistd.h>
#include <fcntl.h>
#include <errno.h>
#include <time.h>

#include <pcre.h>

#include "libxymon.h"

typedef struct acknowledgements_t {
	void *host;
	struct htnames_t *service;
	time_t  eventtime;
	char *recipient;
	char *message;
	struct acknowledgements_t *next;
} acknowledgements_t;


static time_t convert_time(char *timestamp)
{
	time_t event = 0;
	unsigned int year,month,day,hour,min,sec,count;
	struct tm timeinfo;

	count = sscanf(timestamp, "%u/%u/%u@%u:%u:%u",
		&year, &month, &day, &hour, &min, &sec);
	if(count != 6) {
		return -1;
	}
	if(year < 1970) {
		return 0;
	}
	else {
		memset(&timeinfo, 0, sizeof(timeinfo));
		timeinfo.tm_year  = year - 1900;
		timeinfo.tm_mon   = month - 1;
		timeinfo.tm_mday  = day;
		timeinfo.tm_hour  = hour;
		timeinfo.tm_min   = min;
		timeinfo.tm_sec   = sec;
		timeinfo.tm_isdst = -1;
		event = mktime(&timeinfo);		
	}

	return event;
}

static htnames_t *namehead = NULL;
static htnames_t *getname(char *name, int createit)
{
	htnames_t *walk;

	for (walk = namehead; (walk && strcmp(walk->name, name)); walk = walk->next) ;
	if (walk || (!createit)) return walk;

	walk = (htnames_t *)malloc(sizeof(htnames_t));
	walk->name = strdup(name);
	walk->next = namehead;
	namehead = walk;

	return walk;
}

void do_acknowledgementslog(FILE *output, 
		  int maxcount, int maxminutes, char *fromtime, char *totime, 
		  char *pageregex, char *expageregex,
		  char *hostregex, char *exhostregex,
		  char *testregex, char *extestregex,
		  char *rcptregex, char *exrcptregex)
{
	FILE *acknowledgementslog;
	char acknowledgementslogfilename[PATH_MAX];
	time_t firstevent = 0;
	time_t lastevent = getcurrenttime(NULL);
	acknowledgements_t *head, *walk;
	struct stat st;
	char l[MAX_LINE_LEN];
	char title[200];

	/* For the PCRE matching */
	const char *errmsg = NULL;
	int errofs = 0;
	pcre *pageregexp = NULL;
	pcre *expageregexp = NULL;
	pcre *hostregexp = NULL;
	pcre *exhostregexp = NULL;
	pcre *testregexp = NULL;
	pcre *extestregexp = NULL;
	pcre *rcptregexp = NULL;
	pcre *exrcptregexp = NULL;

	if (maxminutes && (fromtime || totime)) {
		fprintf(output, "<B>Only one time interval type is allowed!</B>");
		return;
	}

	if (fromtime) {
		firstevent = convert_time(fromtime);
		if(firstevent < 0) {
			fprintf(output,"<B>Invalid 'from' time: %s</B>", htmlquoted(fromtime));
			return;
		}
	}
	else if (maxminutes) {
		firstevent = getcurrenttime(NULL) - maxminutes*60;
	}
	else {
		firstevent = getcurrenttime(NULL) - 86400;
	}

	if (totime) {
		lastevent = convert_time(totime);
		if (lastevent < 0) {
			fprintf(output,"<B>Invalid 'to' time: %s</B>", htmlquoted(totime));
			return;
		}
		if (lastevent < firstevent) {
			fprintf(output,"<B>'to' time must be after 'from' time.</B>");
			return;
		}
	}

	if (!maxcount) maxcount = 100;

	if (pageregex && *pageregex) pageregexp = pcre_compile(pageregex, PCRE_CASELESS, &errmsg, &errofs, NULL);
	if (expageregex && *expageregex) expageregexp = pcre_compile(expageregex, PCRE_CASELESS, &errmsg, &errofs, NULL);
	if (hostregex && *hostregex) hostregexp = pcre_compile(hostregex, PCRE_CASELESS, &errmsg, &errofs, NULL);
	if (exhostregex && *exhostregex) exhostregexp = pcre_compile(exhostregex, PCRE_CASELESS, &errmsg, &errofs, NULL);
	if (testregex && *testregex) testregexp = pcre_compile(testregex, PCRE_CASELESS, &errmsg, &errofs, NULL);
	if (extestregex && *extestregex) extestregexp = pcre_compile(extestregex, PCRE_CASELESS, &errmsg, &errofs, NULL);
	if (rcptregex && *rcptregex) rcptregexp = pcre_compile(rcptregex, PCRE_CASELESS, &errmsg, &errofs, NULL);
	if (exrcptregex && *exrcptregex) exrcptregexp = pcre_compile(exrcptregex, PCRE_CASELESS, &errmsg, &errofs, NULL);

	sprintf(acknowledgementslogfilename, "%s/acknowledge.log", xgetenv("XYMONSERVERLOGS"));
	acknowledgementslog = fopen(acknowledgementslogfilename, "r");

	if (acknowledgementslog && (stat(acknowledgementslogfilename, &st) == 0)) {
		time_t curtime;
		int done = 0;

		/* Find a spot in the acknowledgements log file close to where the firstevent time is */
		fseeko(acknowledgementslog, 0, SEEK_END);
		do {
			/* Go back maxcount*80 bytes - one entry is ~80 bytes */
			if (ftello(acknowledgementslog) > maxcount*80) {
				unsigned int uicurtime;
				fseeko(acknowledgementslog, -maxcount*80, SEEK_CUR); 
				if (fgets(l, sizeof(l), acknowledgementslog) && /* Skip to start of line */
				    fgets(l, sizeof(l), acknowledgementslog)) {
                                        /* 2015-03-07 18:17:03 myserver disk andy 1 1425724570 1425752223 1425838623 testing message */
					sscanf(l, "%*u-%*u-%*u %*u:%*u:%*u %*s %*s %*s %*u %*u %u %*u %*s", &uicurtime);
					curtime = uicurtime;
					done = (curtime < firstevent);
				}
				else { 
					fprintf(output, "Error reading logfile %s: %s\n", acknowledgementslogfilename, strerror(errno));
					return;
				}
			}
			else {
				rewind(acknowledgementslog);
				done = 1;
			}
		} while (!done);
	}
	
	head = NULL;

	while (acknowledgementslog && (fgets(l, sizeof(l), acknowledgementslog))) {

		unsigned int etim;
		time_t eventtime;
		char host[MAX_LINE_LEN];
		char svc[MAX_LINE_LEN];
		char recipient[MAX_LINE_LEN];
		char message[MAX_LINE_LEN];
		char *hostname, *svcname, *p;
		int itemsfound, pagematch, hostmatch, testmatch, rcptmatch;
		acknowledgements_t *newrec;
		void *eventhost;
		struct htnames_t *eventcolumn;
		int ovector[30];

		/*itemsfound = sscanf(l, "%*u-%*u-%*u %*u:%*u:%*u %s %s %s %*u %*u %u %*u %s", host, svc, recipient, &etim, message);*/
		itemsfound = sscanf(l, "%*u-%*u-%*u %*u:%*u:%*u %s %s %s %*u %*u %u %*u %[^\t\n]", host, svc, recipient, &etim, message);
		eventtime = etim;
		if (itemsfound != 5) continue;
		if (eventtime < firstevent) continue;
		if (eventtime > lastevent) break;

		hostname = host; svcname = svc;
		eventhost = hostinfo(hostname);
		if (!eventhost) continue; /* Dont report hosts that no longer exist */
		eventcolumn = getname(svcname, 1);

		p = strchr(recipient, '['); if (p) *p = '\0';

		if (pageregexp) {
			char *pagename;

			pagename = xmh_item_multi(eventhost, XMH_PAGEPATH);
			pagematch = 0;
			while (!pagematch && pagename) {
			pagematch = (pcre_exec(pageregexp, NULL, pagename, strlen(pagename), 0, 0, 
					ovector, (sizeof(ovector)/sizeof(int))) >= 0);
				pagename = xmh_item_multi(NULL, XMH_PAGEPATH);
			}
		}
		else
			pagematch = 1;
		if (!pagematch) continue;

		if (expageregexp) {
			char *pagename;

			pagename = xmh_item_multi(eventhost, XMH_PAGEPATH);
			pagematch = 0;
			while (!pagematch && pagename) {
			pagematch = (pcre_exec(expageregexp, NULL, pagename, strlen(pagename), 0, 0, 
					ovector, (sizeof(ovector)/sizeof(int))) >= 0);
				pagename = xmh_item_multi(NULL, XMH_PAGEPATH);
			}
		}
		else
			pagematch = 0;
		if (pagematch) continue;

		if (hostregexp)
			hostmatch = (pcre_exec(hostregexp, NULL, hostname, strlen(hostname), 0, 0, 
					ovector, (sizeof(ovector)/sizeof(int))) >= 0);
		else
			hostmatch = 1;
		if (!hostmatch) continue;

		if (exhostregexp)
			hostmatch = (pcre_exec(exhostregexp, NULL, hostname, strlen(hostname), 0, 0, 
					ovector, (sizeof(ovector)/sizeof(int))) >= 0);
		else
			hostmatch = 0;
		if (hostmatch) continue;

		if (testregexp)
			testmatch = (pcre_exec(testregexp, NULL, svcname, strlen(svcname), 0, 0, 
					ovector, (sizeof(ovector)/sizeof(int))) >= 0);
		else
			testmatch = 1;
		if (!testmatch) continue;

		if (extestregexp)
			testmatch = (pcre_exec(extestregexp, NULL, svcname, strlen(svcname), 0, 0, 
					ovector, (sizeof(ovector)/sizeof(int))) >= 0);
		else
			testmatch = 0;
		if (testmatch) continue;

		if (rcptregexp)
			rcptmatch = (pcre_exec(rcptregexp, NULL, recipient, strlen(recipient), 0, 0, 
					ovector, (sizeof(ovector)/sizeof(int))) >= 0);
		else
			rcptmatch = 1;
		if (!rcptmatch) continue;

		if (exrcptregexp)
			rcptmatch = (pcre_exec(exrcptregexp, NULL, recipient, strlen(recipient), 0, 0, 
					ovector, (sizeof(ovector)/sizeof(int))) >= 0);
		else
			rcptmatch = 0;
		if (rcptmatch) continue;

		newrec = (acknowledgements_t *) malloc(sizeof(acknowledgements_t));
		newrec->host       = eventhost;
		newrec->service    = eventcolumn;
		newrec->eventtime  = eventtime;
		newrec->recipient  = strdup(recipient);
		newrec->message  = strdup(message);
		newrec->next       = head;
		head = newrec;
	}

	if (head) {
		char *bgcolors[2] = { "#000000", "#000066" };
		int  bgcolor = 0;
		int  count;
		struct acknowledgements_t *lasttoshow = head;

		count=0;
		walk=head; 
		do {
			count++;
			lasttoshow = walk;
			walk = walk->next;
		} while (walk && (count<maxcount));

		if (maxminutes)  { 
			sprintf(title, "%d acknowledgements in the past %u minutes", 
				count, (unsigned int)((getcurrenttime(NULL) - lasttoshow->eventtime) / 60));
		}
		else {
			sprintf(title, "%d events acknowledged.", count);
		}

		fprintf(output, "<BR><BR>\n");
		fprintf(output, "<TABLE SUMMARY=\"Acknowledgements log\" BORDER=0>\n");
		fprintf(output, "<TR BGCOLOR=\"#333333\">\n");
		fprintf(output, "<TD ALIGN=CENTER COLSPAN=5><FONT SIZE=-1 COLOR=\"#33ebf4\">%s</FONT></TD></TR>\n", htmlquoted(title));
		fprintf(output, "<TR BGCOLOR=\"#333333\"><TH>Time</TH><TH>Host</TH><TH>Service</TH><TH>Acknowledged By</TH><TH>Message</TH></TR>\n");

		for (walk=head; (walk != lasttoshow->next); walk=walk->next) {
			char *hostname = xmh_item(walk->host, XMH_HOSTNAME);

			fprintf(output, "<TR BGCOLOR=%s>\n", bgcolors[bgcolor]);
			bgcolor = ((bgcolor + 1) % 2);

			fprintf(output, "<TD ALIGN=LEFT>%s</TD>\n", ctime(&walk->eventtime));

			fprintf(output, "<TD ALIGN=LEFT>%s</TD>\n", hostname);
			fprintf(output, "<TD ALIGN=LEFT>%s</TD>\n", walk->service->name);
			fprintf(output, "<TD ALIGN=LEFT>%s</TD>\n", walk->recipient);
			fprintf(output, "<TD ALIGN=LEFT>%s</TD>\n", walk->message);
		}

		fprintf(output, "</TABLE>\n");

		/* Clean up */
		walk = head;
		do {
			struct acknowledgements_t *tmp = walk;

			walk = walk->next;
			xfree(tmp->recipient);
			xfree(tmp->message);
			xfree(tmp);
		} while (walk);
	}
	else {
		/* No acknowledgements during the past maxminutes */
		if (acknowledgementslog)
			sprintf(title, "No events acknowledged in the last %d minutes", maxminutes);
		else
			strcpy(title, "No acknowledgements logged");

		fprintf(output, "<CENTER><BR>\n");
		fprintf(output, "<TABLE SUMMARY=\"%s\" BORDER=0>\n", title);
		fprintf(output, "<TR BGCOLOR=\"#333333\">\n");
		fprintf(output, "<TD ALIGN=CENTER COLSPAN=6><FONT SIZE=-1 COLOR=\"#33ebf4\">%s</FONT></TD>\n", htmlquoted(title));
		fprintf(output, "</TR>\n");
		fprintf(output, "</TABLE>\n");
		fprintf(output, "</CENTER>\n");
	}

	if (acknowledgementslog) fclose(acknowledgementslog);

	if (pageregexp)   pcre_free(pageregexp);
	if (expageregexp) pcre_free(expageregexp);
	if (hostregexp)   pcre_free(hostregexp);
	if (exhostregexp) pcre_free(exhostregexp);
	if (testregexp)   pcre_free(testregexp);
	if (extestregexp) pcre_free(extestregexp);
	if (rcptregexp)   pcre_free(rcptregexp);
	if (exrcptregexp) pcre_free(exrcptregexp);
}

Added lib/acknowledgementslog.h.











































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
/*----------------------------------------------------------------------------*/
/* Xymon monitor library.                                                     */
/*                                                                            */
/* Copyright (C) 2002-2011 Henrik Storner <henrik@storner.dk>                 */
/*                                                                            */
/* This program is released under the GNU General Public License (GPL),       */
/* version 2. See the file "COPYING" for details.                             */
/*                                                                            */
/*----------------------------------------------------------------------------*/

#ifndef __ACKNOWLEDGEMENTSLOG_H_
#define __ACKNOWLEDGEMENTSLOG_H_

extern void do_acknowledgementslog(FILE *output, int maxcount, int maxminutes, char *fromtime, char *totime, 
			 char *pagematch, char *expagematch,
			 char *hostmatch, char *exhostmatch, 
			 char *testmatch, char *extestmatch,
			 char *rcptmatch, char *exrcptmatch);

#endif

Changes to web/Makefile.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
..
34
35
36
37
38
39
40

41
42
43
44
45
46
47
...
126
127
128
129
130
131
132



133
134
135
136
137
138
139
XYMONLIB = ../lib/libxymon.a
XYMONLIBS = $(XYMONLIB)
XYMONCOMMLIB = ../lib/libxymoncomm.a
XYMONCOMMLIBS = $(XYMONCOMMLIB) $(SSLLIBS) $(NETLIBS) $(LIBRTDEF)
XYMONTIMELIB = ../lib/libxymontime.a
XYMONTIMELIBS = $(XYMONTIMELIB) $(LIBRTDEF)

PROGRAMS = history.cgi eventlog.cgi report.cgi reportlog.cgi snapshot.cgi findhost.cgi csvinfo.cgi acknowledge.cgi xymonpage datepage.cgi svcstatus.cgi enadis.cgi confreport.cgi criticalview.cgi criticaleditor.cgi ackinfo.cgi statusreport.cgi boilerplate.cgi hostgraphs.cgi ghostlist.cgi notifications.cgi hostlist.cgi useradm.cgi appfeed.cgi cgiwrap
CGISCRIPTS = history.sh eventlog.sh report.sh reportlog.sh snapshot.sh findhost.sh csvinfo.sh columndoc.sh datepage.sh svcstatus.sh historylog.sh confreport.sh confreport-critical.sh criticalview.sh certreport.sh nongreen.sh hostgraphs.sh ghostlist.sh notifications.sh hostlist.sh topchanges.sh appfeed.sh appfeed-critical.sh
SECCGISCRIPTS = acknowledge.sh enadis.sh criticaleditor.sh ackinfo.sh useradm.sh

ifeq ($(DORRD),yes)
	PROGRAMS += showgraph.cgi perfdata.cgi
	CGISCRIPTS += showgraph.sh perfdata.sh
endif

................................................................................
CRITEDITOBJS    = criticaleditor.o
ACKINFOOBJS     = ackinfo.o
CONFREPOBJS     = confreport.o
STATUSREPOBJS   = statusreport.o
MAILACKOBJS     = xymon-mailack.o
GHOSTOBJS       = ghostlist.o
NOTIFYOBJS      = notifications.o

HOSTLISTOBJS    = hostlist.o
PERFDATAOBJS	= perfdata.o
USERADMOBJS	= useradm.o

HOSTGRAPHSOBJS  = hostgraphs.o
BOILERPLATEOBJS = boilerplate.o

................................................................................

ghostlist.cgi: $(GHOSTOBJS) $(XYMONCOMMLIB)
	$(CC) $(CFLAGS) -o $@ $(RPATHOPT) $(GHOSTOBJS) $(XYMONCOMMLIBS) $(PCRELIBS)

notifications.cgi: $(NOTIFYOBJS) $(XYMONCOMMLIB)
	$(CC) $(CFLAGS) -o $@ $(RPATHOPT) $(NOTIFYOBJS) $(XYMONCOMMLIBS) $(PCRELIBS)




hostlist.cgi: $(HOSTLISTOBJS) $(XYMONCOMMLIB)
	$(CC) $(CFLAGS) -o $@ $(RPATHOPT) $(HOSTLISTOBJS) $(XYMONCOMMLIBS) $(PCRELIBS)

perfdata.o: perfdata.c
	$(CC) $(CFLAGS) $(PCREINCDIR) $(RRDDEF) $(RRDINCDIR) -c -o $@ $<

# Need -lm on perfdata because it refers to isnan()







|
|







 







>







 







>
>
>







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
..
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
...
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
XYMONLIB = ../lib/libxymon.a
XYMONLIBS = $(XYMONLIB)
XYMONCOMMLIB = ../lib/libxymoncomm.a
XYMONCOMMLIBS = $(XYMONCOMMLIB) $(SSLLIBS) $(NETLIBS) $(LIBRTDEF)
XYMONTIMELIB = ../lib/libxymontime.a
XYMONTIMELIBS = $(XYMONTIMELIB) $(LIBRTDEF)

PROGRAMS = history.cgi eventlog.cgi report.cgi reportlog.cgi snapshot.cgi findhost.cgi csvinfo.cgi acknowledge.cgi xymonpage datepage.cgi svcstatus.cgi enadis.cgi confreport.cgi criticalview.cgi criticaleditor.cgi ackinfo.cgi statusreport.cgi boilerplate.cgi hostgraphs.cgi ghostlist.cgi notifications.cgi acknowledgements.cgi hostlist.cgi useradm.cgi appfeed.cgi cgiwrap
CGISCRIPTS = history.sh eventlog.sh report.sh reportlog.sh snapshot.sh findhost.sh csvinfo.sh columndoc.sh datepage.sh svcstatus.sh historylog.sh confreport.sh confreport-critical.sh criticalview.sh certreport.sh nongreen.sh hostgraphs.sh ghostlist.sh notifications.sh acknowledgements.sh hostlist.sh topchanges.sh appfeed.sh appfeed-critical.sh
SECCGISCRIPTS = acknowledge.sh enadis.sh criticaleditor.sh ackinfo.sh useradm.sh

ifeq ($(DORRD),yes)
	PROGRAMS += showgraph.cgi perfdata.cgi
	CGISCRIPTS += showgraph.sh perfdata.sh
endif

................................................................................
CRITEDITOBJS    = criticaleditor.o
ACKINFOOBJS     = ackinfo.o
CONFREPOBJS     = confreport.o
STATUSREPOBJS   = statusreport.o
MAILACKOBJS     = xymon-mailack.o
GHOSTOBJS       = ghostlist.o
NOTIFYOBJS      = notifications.o
ACKNOWLEDGEOBJS = acknowledgements.o
HOSTLISTOBJS    = hostlist.o
PERFDATAOBJS	= perfdata.o
USERADMOBJS	= useradm.o

HOSTGRAPHSOBJS  = hostgraphs.o
BOILERPLATEOBJS = boilerplate.o

................................................................................

ghostlist.cgi: $(GHOSTOBJS) $(XYMONCOMMLIB)
	$(CC) $(CFLAGS) -o $@ $(RPATHOPT) $(GHOSTOBJS) $(XYMONCOMMLIBS) $(PCRELIBS)

notifications.cgi: $(NOTIFYOBJS) $(XYMONCOMMLIB)
	$(CC) $(CFLAGS) -o $@ $(RPATHOPT) $(NOTIFYOBJS) $(XYMONCOMMLIBS) $(PCRELIBS)

acknowledgements.cgi: $(ACKNOWLEDGEOBJS) $(XYMONCOMMLIB)
	$(CC) $(CFLAGS) -o $@ $(RPATHOPT) $(ACKNOWLEDGEOBJS) $(XYMONCOMMLIBS) $(PCRELIBS)

hostlist.cgi: $(HOSTLISTOBJS) $(XYMONCOMMLIB)
	$(CC) $(CFLAGS) -o $@ $(RPATHOPT) $(HOSTLISTOBJS) $(XYMONCOMMLIBS) $(PCRELIBS)

perfdata.o: perfdata.c
	$(CC) $(CFLAGS) $(PCREINCDIR) $(RRDDEF) $(RRDINCDIR) -c -o $@ $<

# Need -lm on perfdata because it refers to isnan()

Added web/acknowledgements.c.



























































































































































































































































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
/*----------------------------------------------------------------------------*/
/* Xymon acknowledgements log viewer                                              */
/*                                                                            */
/* Copyright (C) 2007-2011 Henrik Storner <henrik@storner.dk>                 */
/*                                                                            */
/* This program is released under the GNU General Public License (GPL),       */
/* version 2. See the file "COPYING" for details.                             */
/*                                                                            */
/*----------------------------------------------------------------------------*/

static char rcsid[] = "$Id: acknowledgements.c 6712 2011-07-31 21:01:52Z storner $";

#include <limits.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <ctype.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <dirent.h>
#include <unistd.h>
#include <fcntl.h>
#include <errno.h>
#include <time.h>

#include "libxymon.h"

int	maxcount = 100;		/* Default: Include last 100 events */
int	maxminutes = 1440;	/* Default: for the past 24 hours */
char	*totime = NULL;
char	*fromtime = NULL;
char	*pageregex = NULL;
char	*expageregex = NULL;
char	*hostregex = NULL;
char	*exhostregex = NULL;
char	*testregex = NULL;
char	*extestregex = NULL;
char	*rcptregex = NULL;
char	*exrcptregex = NULL;
cgidata_t *cgidata = NULL;

static void parse_query(void)
{
	cgidata_t *cwalk;

	cwalk = cgidata;
	while (cwalk) {
		/*
		 * cwalk->name points to the name of the setting.
		 * cwalk->value points to the value (may be an empty string).
		 */

		if (strcasecmp(cwalk->name, "MAXCOUNT") == 0) {
			maxcount = atoi(cwalk->value);
		}
		else if (strcasecmp(cwalk->name, "MAXTIME") == 0) {
			maxminutes = atoi(cwalk->value);
		}
		else if (strcasecmp(cwalk->name, "FROMTIME") == 0) {
			if (*(cwalk->value)) fromtime = strdup(cwalk->value);
		}
		else if (strcasecmp(cwalk->name, "TOTIME") == 0) {
			if (*(cwalk->value)) totime = strdup(cwalk->value);
		}
		else if (strcasecmp(cwalk->name, "HOSTMATCH") == 0) {
			if (*(cwalk->value)) hostregex = strdup(cwalk->value);
		}
		else if (strcasecmp(cwalk->name, "EXHOSTMATCH") == 0) {
			if (*(cwalk->value)) exhostregex = strdup(cwalk->value);
		}
		else if (strcasecmp(cwalk->name, "TESTMATCH") == 0) {
			if (*(cwalk->value)) testregex = strdup(cwalk->value);
		}
		else if (strcasecmp(cwalk->name, "EXTESTMATCH") == 0) {
			if (*(cwalk->value)) extestregex = strdup(cwalk->value);
		}
		else if (strcasecmp(cwalk->name, "PAGEMATCH") == 0) {
			if (*(cwalk->value)) pageregex = strdup(cwalk->value);
		}
		else if (strcasecmp(cwalk->name, "EXPAGEMATCH") == 0) {
			if (*(cwalk->value)) expageregex = strdup(cwalk->value);
		}
		else if (strcasecmp(cwalk->name, "RCPTMATCH") == 0) {
			if (*(cwalk->value)) rcptregex = strdup(cwalk->value);
		}
		else if (strcasecmp(cwalk->name, "EXRCPTMATCH") == 0) {
			if (*(cwalk->value)) exrcptregex = strdup(cwalk->value);
		}

		cwalk = cwalk->next;
	}
}

int main(int argc, char *argv[])
{
	int argi;
	char *envarea = NULL;

	for (argi = 1; (argi < argc); argi++) {
		if (argnmatch(argv[argi], "--env=")) {
			char *p = strchr(argv[argi], '=');
			loadenv(p+1, envarea);
		}
		else if (argnmatch(argv[argi], "--area=")) {
			char *p = strchr(argv[argi], '=');
			envarea = strdup(p+1);
		}
		else if (strcmp(argv[argi], "--debug") == 0) {
			debug = 1;
		}
	}

	redirect_cgilog("acknowledgements");
	load_hostnames(xgetenv("HOSTSCFG"), NULL, get_fqdn());

	fprintf(stdout, "Content-type: %s\n\n", xgetenv("HTMLCONTENTTYPE"));

	cgidata = cgi_request();
	if (cgidata == NULL) {
		/* Present the query form */
		sethostenv("", "", "", colorname(COL_BLUE), NULL);
		showform(stdout, "acknowledgements", "acknowledgements_form", COL_BLUE, getcurrenttime(NULL), NULL, NULL);
		return 0;
	}

	parse_query();

	/* Now generate the webpage */
	headfoot(stdout, "acknowledgements", "", "header", COL_GREEN);
	fprintf(stdout, "<center>\n");
	do_acknowledgementslog(stdout, maxcount, maxminutes, fromtime, totime, 
			pageregex, expageregex, 
			hostregex, exhostregex, 
			testregex, extestregex,
			rcptregex, exrcptregex);
	fprintf(stdout, "</center>\n");
	headfoot(stdout, "acknowledgements", "", "footer", COL_GREEN);

	return 0;
}

Changes to web/cgiwrap.c.

87
88
89
90
91
92
93

94
95
96
97
98
99
100
	else if (strcmp(cgipgm, "ghostlist.cgi") == 0)           {                              addoptl("CGI_GHOSTS_OPTS");      }
	else if (strcmp(cgipgm, "history.cgi") == 0)             {                              addoptl("CGI_HIST_OPTS");        }
	else if (strcmp(cgipgm, "historylog.cgi") == 0)          { cgipgm = "svcstatus.cgi";    addoptl("CGI_SVCHIST_OPTS");     addopt("--historical"); }
	else if (strcmp(cgipgm, "hostgraphs.cgi") == 0)          {                              addoptl("CGI_HOSTGRAPHS_OPTS");  }
	else if (strcmp(cgipgm, "hostlist.cgi") == 0)            {                              addoptl("CGI_HOSTLIST_OPTS");    }
	else if (strcmp(cgipgm, "nongreen.cgi") == 0)            { cgipgm = "statusreport.cgi";                                  addopt("--filter=\"color=red,yellow\""); addopt("--all"); addopt("--heading=\"All non-green systems\""); addopt("--show-column"); addopt("--show-summary"); addopt("--link"); }
	else if (strcmp(cgipgm, "notifications.cgi") == 0)       {                              addoptl("CGI_NOTIFYLOG_OPTS");   }

	else if (strcmp(cgipgm, "perfdata.cgi") == 0)            {                              addoptl("CGI_PERFDATA_OPTS");    }
	else if (strcmp(cgipgm, "reportlog.cgi") == 0)           {                              addoptl("CGI_REPLOG_OPTS");      }
	else if (strcmp(cgipgm, "report.cgi") == 0)              {                              addoptl("CGI_REP_OPTS");         addoptl("XYMONGENREPOPTS"); }
	else if (strcmp(cgipgm, "showgraph.cgi") == 0)           {                              addoptl("CGI_SHOWGRAPH_OPTS");   }
	else if (strcmp(cgipgm, "snapshot.cgi") == 0)            {                              addoptl("CGI_SNAPSHOT_OPTS");    addopt("XYMONGENSNAPOPTS"); }
	else if (strcmp(cgipgm, "svcstatus-hist.cgi") == 0)      { cgipgm = "svcstatus.cgi";    addoptl("CGI_SVCHIST_OPTS");     addopt("--historical"); }
	else if (strcmp(cgipgm, "svcstatus.cgi") == 0)           {                              addoptl("CGI_SVC_OPTS");         }







>







87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
	else if (strcmp(cgipgm, "ghostlist.cgi") == 0)           {                              addoptl("CGI_GHOSTS_OPTS");      }
	else if (strcmp(cgipgm, "history.cgi") == 0)             {                              addoptl("CGI_HIST_OPTS");        }
	else if (strcmp(cgipgm, "historylog.cgi") == 0)          { cgipgm = "svcstatus.cgi";    addoptl("CGI_SVCHIST_OPTS");     addopt("--historical"); }
	else if (strcmp(cgipgm, "hostgraphs.cgi") == 0)          {                              addoptl("CGI_HOSTGRAPHS_OPTS");  }
	else if (strcmp(cgipgm, "hostlist.cgi") == 0)            {                              addoptl("CGI_HOSTLIST_OPTS");    }
	else if (strcmp(cgipgm, "nongreen.cgi") == 0)            { cgipgm = "statusreport.cgi";                                  addopt("--filter=\"color=red,yellow\""); addopt("--all"); addopt("--heading=\"All non-green systems\""); addopt("--show-column"); addopt("--show-summary"); addopt("--link"); }
	else if (strcmp(cgipgm, "notifications.cgi") == 0)       {                              addoptl("CGI_NOTIFYLOG_OPTS");   }
	else if (strcmp(cgipgm, "acknowledgements.cgi") == 0)    {                              addoptl("CGI_ACKNOWLEDGEMENTSLOG_OPTS");   }
	else if (strcmp(cgipgm, "perfdata.cgi") == 0)            {                              addoptl("CGI_PERFDATA_OPTS");    }
	else if (strcmp(cgipgm, "reportlog.cgi") == 0)           {                              addoptl("CGI_REPLOG_OPTS");      }
	else if (strcmp(cgipgm, "report.cgi") == 0)              {                              addoptl("CGI_REP_OPTS");         addoptl("XYMONGENREPOPTS"); }
	else if (strcmp(cgipgm, "showgraph.cgi") == 0)           {                              addoptl("CGI_SHOWGRAPH_OPTS");   }
	else if (strcmp(cgipgm, "snapshot.cgi") == 0)            {                              addoptl("CGI_SNAPSHOT_OPTS");    addopt("XYMONGENSNAPOPTS"); }
	else if (strcmp(cgipgm, "svcstatus-hist.cgi") == 0)      { cgipgm = "svcstatus.cgi";    addoptl("CGI_SVCHIST_OPTS");     addopt("--historical"); }
	else if (strcmp(cgipgm, "svcstatus.cgi") == 0)           {                              addoptl("CGI_SVC_OPTS");         }

Changes to xymond/etcfiles/cgioptions.cfg.DIST.

57
58
59
60
61
62
63


64
65
66
67
68
69
70
71
72
# enadis.cgi options
CGI_ENADIS_OPTS="--env=$XYMONENV"

# hostlist options
CGI_HOSTLIST_OPTS="--env=$XYMONENV"
# notifications options
CGI_NOTIFYLOG_OPTS="--env=$XYMONENV"


# perfdata options
CGI_PERFDATA_OPTS="--env=$XYMONENV"
# topchanges options
CGI_TOPCHANGE_OPTS="--env=$XYMONENV --top"
# useradm options
CGI_USERADM_OPTS="--env=$XYMONENV"
# appfeed options
CGI_APPFEED_OPTS="--env=$XYMONENV"








>
>









57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
# enadis.cgi options
CGI_ENADIS_OPTS="--env=$XYMONENV"

# hostlist options
CGI_HOSTLIST_OPTS="--env=$XYMONENV"
# notifications options
CGI_NOTIFYLOG_OPTS="--env=$XYMONENV"
# acknowledgements options
CGI_ACKNOWLEDGEMENTSLOG_OPTS="--env=$XYMONENV"
# perfdata options
CGI_PERFDATA_OPTS="--env=$XYMONENV"
# topchanges options
CGI_TOPCHANGE_OPTS="--env=$XYMONENV --top"
# useradm options
CGI_USERADM_OPTS="--env=$XYMONENV"
# appfeed options
CGI_APPFEED_OPTS="--env=$XYMONENV"

Changes to xymond/etcfiles/xymonmenu.cfg.

12
13
14
15
16
17
18

19
20
21
22
23
24
25
	<a class="inner" href="$XYMONSERVERCGIURL/report.sh">Availability Report</a><span class="invis"> | </span>
	<a class="inner" href="$XYMONSERVERCGIURL/snapshot.sh">Snapshot Report</a><span class="invis"> | </span>
	<a class="inner" href="$XYMONSERVERCGIURL/confreport.sh">Config Report</a><span class="invis"> | </span>
	<a class="inner" href="$XYMONSERVERCGIURL/confreport-critical.sh">Config Report (Critical)</a><span class="invis"> | </span>
	<a class="inner" href="$XYMONSERVERCGIURL/hostgraphs.sh">Metrics Report</a><span class="invis"> | </span>
	<a class="inner" href="$XYMONSERVERCGIURL/ghostlist.sh">Ghost Clients</a><span class="invis"> | </span>
	<a class="inner" href="$XYMONSERVERCGIURL/notifications.sh">Notification Report</a>

    </div>
    <div class="outer">
      <span class="menutag"><a href="javascript:;">Administration</a><span class="invis">: </span></span>
	<a class="inner-1" href="$XYMONSERVERCGIURL/findhost.sh">Find host</a><span class="invis"> | </span>
	<a class="inner" href="$XYMONSERVERSECURECGIURL/acknowledge.sh">Acknowledge alert</a><span class="invis"> | </span>
	<a class="inner" href="$XYMONSERVERSECURECGIURL/enadis.sh">Enable/disable</a><span class="invis"> | </span>
	<a class="inner" href="$XYMONSERVERSECURECGIURL/criticaleditor.sh">Edit critical systems</a>







>







12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
	<a class="inner" href="$XYMONSERVERCGIURL/report.sh">Availability Report</a><span class="invis"> | </span>
	<a class="inner" href="$XYMONSERVERCGIURL/snapshot.sh">Snapshot Report</a><span class="invis"> | </span>
	<a class="inner" href="$XYMONSERVERCGIURL/confreport.sh">Config Report</a><span class="invis"> | </span>
	<a class="inner" href="$XYMONSERVERCGIURL/confreport-critical.sh">Config Report (Critical)</a><span class="invis"> | </span>
	<a class="inner" href="$XYMONSERVERCGIURL/hostgraphs.sh">Metrics Report</a><span class="invis"> | </span>
	<a class="inner" href="$XYMONSERVERCGIURL/ghostlist.sh">Ghost Clients</a><span class="invis"> | </span>
	<a class="inner" href="$XYMONSERVERCGIURL/notifications.sh">Notification Report</a>
	<a class="inner" href="$XYMONSERVERCGIURL/acknowledgements.sh">Acknowledgements</a>
    </div>
    <div class="outer">
      <span class="menutag"><a href="javascript:;">Administration</a><span class="invis">: </span></span>
	<a class="inner-1" href="$XYMONSERVERCGIURL/findhost.sh">Find host</a><span class="invis"> | </span>
	<a class="inner" href="$XYMONSERVERSECURECGIURL/acknowledge.sh">Acknowledge alert</a><span class="invis"> | </span>
	<a class="inner" href="$XYMONSERVERSECURECGIURL/enadis.sh">Enable/disable</a><span class="invis"> | </span>
	<a class="inner" href="$XYMONSERVERSECURECGIURL/criticaleditor.sh">Edit critical systems</a>

Added xymond/webfiles/acknowledgements_footer.



>
1
stdnormal_footer

Added xymond/webfiles/acknowledgements_form.









































































































































































































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
<CENTER>
<FORM METHOD="GET" ACTION="&SCRIPT_NAME">
   <TABLE BORDER=0 SUMMARY="Acknowledgement time period">
     <TR>
       <TD><TABLE BORDER=0>
         <TR>
           <TD><FONT FACE="Arial, Helvetica" COLOR="silver"><B>Starting </B></FONT></TD>
           <TD><INPUT TYPE=TEXT NAME="MAXTIME" SIZE=40></TD>
           <TD><FONT FACE="Arial, Helvetica" COLOR="silver"><B> minutes ago </B>( Default 1440 )</FONT></TD> 
         </TR>
         <TR>
           <TD COLSPAN=3 ALIGN=CENTER><FONT FACE="Arial, Helvetica" COLOR="silver"><B>&nbsp;- OR -&nbsp;</B></FONT></TD>
         </TR>
         <TR>
           <TD><FONT FACE="Arial, Helvetica" COLOR="silver"><B>From: </B></FONT></TD> 
           <TD><INPUT TYPE=TEXT NAME="FROMTIME" SIZE=40 ID="starttime"></TD>
           <TD><FONT FACE="Arial, Helvetica" COLOR="silver">(ccyy/mm/dd@hh:mm:ss)</FONT></TD>
         </TR>
         <TR>
           <TD><FONT FACE="Arial, Helvetica" COLOR="silver"><B>To: </B></FONT></TD> 
           <TD><INPUT TYPE=TEXT NAME="TOTIME" SIZE=40 ID="endtime"></TD>
           <TD><FONT FACE="Arial, Helvetica" COLOR="silver">(ccyy/mm/dd@hh:mm:ss)</FONT></TD>
         </TR>
       </TABLE></TD>
     </TR>
     <TR><TD>
        <button onclick="document.getElementById('starttime').value='&EVENTLASTYEARBEGIN'; document.getElementById('endtime').value='&EVENTCURRYEARBEGIN'; return false">Last year</button>
        <button onclick="document.getElementById('starttime').value='&EVENTLASTMONTHBEGIN'; document.getElementById('endtime').value='&EVENTCURRMONTHBEGIN'; return false">Last month</button>
        <button onclick="document.getElementById('starttime').value='&EVENTLASTWEEKBEGIN'; document.getElementById('endtime').value='&EVENTCURRWEEKBEGIN'; return false">Last week</button>
        <button onclick="document.getElementById('starttime').value='&EVENTCURRYEARBEGIN'; document.getElementById('endtime').value=''; return false">This year</button>
        <button onclick="document.getElementById('starttime').value='&EVENTCURRMONTHBEGIN'; document.getElementById('endtime').value=''; return false">This month</button>
        <button onclick="document.getElementById('starttime').value='&EVENTCURRWEEKBEGIN'; document.getElementById('endtime').value=''; return false">This week</button>
        <button onclick="document.getElementById('starttime').value='&EVENTYESTERDAY'; document.getElementById('endtime').value='&EVENTTODAY'; return false">Yesterday</button>
        <button onclick="document.getElementById('starttime').value='&EVENTTODAY'; document.getElementById('endtime').value='&EVENTNOW'; return false">Today</button>
     </TD></TR>
   </TABLE>

   <BR><BR>

   <TABLE BORDER=0 SUMMARY="Acknowledgement criteria">
     <TR>
       <TD ALIGN=LEFT><FONT FACE="Arial, Helvetica" COLOR="silver"><B>Max&nbsp;#&nbsp;of&nbsp;acknowledgements</B></FONT></TD>
       <TD WIDTH=10>&nbsp;</TD>
       <TD ALIGN=LEFT><INPUT TYPE=TEXT NAME="MAXCOUNT" SIZE=40 VALUE=100></TD>
       <TD ALIGN=LEFT><FONT FACE="Arial, Helvetica" COLOR="silver"> ( Default 100 )</FONT></TD>
     </TR>

     <TR>
       <TD ALIGN=LEFT><FONT FACE="Arial, Helvetica" COLOR="silver"><B>Hosts&nbsp;to&nbsp;match</B></FONT></TD>
       <TD WIDTH=10>&nbsp;</TD>
       <TD ALIGN=LEFT><INPUT TYPE=TEXT NAME="HOSTMATCH" SIZE=40></TD>
       <TD ALIGN=LEFT><FONT FACE="Arial, Helvetica" COLOR="silver"> ( ex: ^host.*$ )</FONT></TD>
     </TR>

     <TR>
       <TD ALIGN=LEFT><FONT FACE="Arial, Helvetica" COLOR="silver"><B>Hosts&nbsp;to&nbsp;skip</B></FONT></TD>
       <TD WIDTH=10>&nbsp;</TD>
       <TD ALIGN=LEFT><INPUT TYPE=TEXT NAME="EXHOSTMATCH" SIZE=40></TD>
       <TD ALIGN=LEFT><FONT FACE="Arial, Helvetica" COLOR="silver"> ( ex: ^host.*$ )</FONT></TD>
     </TR>

     <TR>
       <TD ALIGN=LEFT><FONT FACE="Arial, Helvetica" COLOR="silver"><B>Pages&nbsp;to&nbsp;match</B></FONT></TD>
       <TD WIDTH=10>&nbsp;</TD>
       <TD ALIGN=LEFT><INPUT TYPE=TEXT NAME="PAGEMATCH" ID="PAGEMATCH" SIZE=40></TD>
       <td ALIGN=LEFT>
          <select name="PATHLIST" ID="PATHLIST" onChange="document.getElementById('PAGEMATCH').value=document.getElementById('PATHLIST').value; return false">
	  &PAGEPATH_DROPDOWN
	  </select>
       </td>
     </TR>

     <TR>
       <TD ALIGN=LEFT><FONT FACE="Arial, Helvetica" COLOR="silver"><B>Pages&nbsp;to&nbsp;skip</B></FONT></TD>
       <TD WIDTH=10>&nbsp;</TD>
       <TD ALIGN=LEFT><INPUT TYPE=TEXT NAME="EXPAGEMATCH" SIZE=40></TD>
       <TD ALIGN=LEFT><FONT FACE="Arial, Helvetica" COLOR="silver"> ( ex: ^webservers/.*$ )</FONT></TD>
     </TR>

     <TR>
       <TD ALIGN=LEFT><FONT FACE="Arial, Helvetica" COLOR="silver"><B>Tests&nbsp;to&nbsp;match</B></FONT></TD>
       <TD WIDTH=10>&nbsp;</TD>
       <TD ALIGN=LEFT><INPUT TYPE=TEXT NAME="TESTMATCH" SIZE=40></TD>
       <TD ALIGN=LEFT><FONT FACE="Arial, Helvetica" COLOR="silver"> ( ex: cpu|vmstat )</FONT></TD>
     </TR>

     <TR>
       <TD ALIGN=LEFT><FONT FACE="Arial, Helvetica" COLOR="silver"><B>Tests&nbsp;to&nbsp;skip</B></FONT></TD>
       <TD WIDTH=10>&nbsp;</TD>
       <TD ALIGN=LEFT><INPUT TYPE=TEXT NAME="EXTESTMATCH" SIZE=40></TD>
       <TD ALIGN=LEFT><FONT FACE="Arial, Helvetica" COLOR="silver"> ( ex: cpu|vmstat )</FONT></TD>
     </TR>

     <TR>
       <TD ALIGN=LEFT><FONT FACE="Arial, Helvetica" COLOR="silver"><B>Operators&nbsp;to&nbsp;match</B></FONT></TD>
       <TD WIDTH=10>&nbsp;</TD>
       <TD ALIGN=LEFT><INPUT TYPE=TEXT NAME="RCPTMATCH" SIZE=40></TD>
       <TD ALIGN=LEFT><FONT FACE="Arial, Helvetica" COLOR="silver"> ( ex: admin@test.com )</FONT></TD>
     </TR>

     <TR>
       <TD ALIGN=LEFT><FONT FACE="Arial, Helvetica" COLOR="silver"><B>Operators&nbsp;to&nbsp;skip</B></FONT></TD>
       <TD WIDTH=10>&nbsp;</TD>
       <TD ALIGN=LEFT><INPUT TYPE=TEXT NAME="EXRCPTMATCH" SIZE=40></TD>
       <TD ALIGN=LEFT><FONT FACE="Arial, Helvetica" COLOR="silver"> ( ex: admin@test.com )</FONT></TD>
     </TR>

     <TR>
        <TD COLSPAN=3 ALIGN=CENTER>
          <BR><BR>
          <INPUT TYPE="SUBMIT" NAME="Send" VALUE="View log" ALT="View log">
        </TD>
     </TR>
   </TABLE>
</FORM>
</CENTER>

Added xymond/webfiles/acknowledgements_header.

















































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
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
32
33
34
35
36
37
38
39
40
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="EXPIRES" CONTENT="Sat, 01 Jan 2001 00:00:00 GMT">
<TITLE>&XYMWEBBACKGROUND : Xymon - Acknowledgement Log @ &XYMWEBDATE</TITLE>

<!-- Styles for the Xymon body  -->
<link rel="stylesheet" type="text/css" href="&XYMONBODYCSS">

<!-- Styles for the menu bar -->
<link rel="stylesheet" type="text/css" href="&XYMONBODYMENUCSS">

<!-- The favicon image -->
<link rel="shortcut icon" href="&XYMONSKIN/favicon-&XYMWEBBACKGROUND.ico">

</HEAD>

<BODY class="&XYMWEBBACKGROUND">

&XYMONBODYHEADER

<TABLE SUMMARY="Topline" WIDTH="100%">
<TR><TD HEIGHT=16>&nbsp;</TD></TR>  <!-- For the menu bar -->
<TR>
  <TD VALIGN=MIDDLE ALIGN=LEFT WIDTH="30%">
    <FONT FACE="Arial, Helvetica" SIZE="+1" COLOR="silver"><B>&XYMONLOGO</B></FONT>
  </TD>
  <TD VALIGN=MIDDLE ALIGN=CENTER WIDTH="40%">
    <CENTER><FONT FACE="Arial, Helvetica" SIZE="+1" COLOR="silver"><B>Acknowledgement Log</B></FONT></CENTER>
  </TD>
  <TD VALIGN=MIDDLE ALIGN=RIGHT WIDTH="30%">
   <FONT FACE="Arial, Helvetica" SIZE="+1" COLOR="silver"><B>&XYMWEBDATE</B></FONT>
  </TD>
</TR>
<TR>
  <TD COLSPAN=3> <HR WIDTH="100%"> </TD>
</TR>
</TABLE>
<BR>