Codebase list xymon / 85d9006
Update upstream source from tag 'upstream/4.3.29_r8060' Update to upstream version '4.3.29~r8060' with Debian dir fc355bfb19e8add0d41dd4d7a9020f22c73f38bf Axel Beckert 5 years ago
71 changed file(s) with 387 addition(s) and 138 deletion(s). Raw diff Collapse all Expand all
+0
-13
.gitignore less more
0 syntax:glob
1 debian/hobbit
2 debian/hobbit-client
3 debian/xymon
4 debian/xymon-client
5 debian/files
6 debian/*.debhelper
7 debian/*.debhelper.log
8 debian/*.substvars
9 build-stamp
10 stamp-patched
11 .pc
12 *~
2222 Tom Georgoulias
2323 Laurent Grilli
2424 Kevin Hanrahan
25 John Horne
2526 Malcolm Hunter
2627 Knud Højgaard
2728 Asif Iqbal
0 Changes from 4.3.28 -> 4.3.29 ()
1 ===========================================
2
3 * rev
4
5 * Deal with Set-Cookie deprecation on normal pages (Thanks, Erik Schminke)
6 * Support glibc->tirpc migration on newer distributions
7 * Fix certain flags not being set on GCC 8/9
8 * Fix wrong doc for --merge-clientlocal option (Thanks, Thomas Eckert)
9 * Fix CSP errors on trends pages (Thanks, John Thurston)
10 * Accept minimum libcares version >= 1.5.1; update bundled to 1.15.0
11 * Fix RRD parsing for recent netstat (net-tools) on Linux
12 * Ensure Content-Type always set in HTML headers (Thanks, Christoph Berg)
13 * Ignore additional common tmpfs partitions on recent Linux
14 * Fix NONETPAGE parsing (Thanks, John Horne)
15 * Increase hard max xymon message size from 10MB to 64MB to match 4.4-alpha
16 * Fix line-off-by-one error in logfetch retrieval when triggers are used
17 (Thanks, Toshimitsu FUJIWARA)
18 * Fixes to do_temperature parsing (Thanks, Michael Pins)
19 * Add support for GNU Hurd and GNU/kFreeBSD
20 * Don't require apache authz_groupfile module by default when not needed
21 * Add --no-cpu-listing option to xymond_client to block 'top' output in
22 cpu test (Thanks, John Horne)
23 * Double-quote the display name of host titles handed to RRD
24 * Ensure NTP checks not hung for unreachable hosts (Thanks, Tom Schmidt)
25
26
027 Changes from 4.3.27 -> 4.3.28 (17 Jan 2017)
128 ===========================================
229
00 <<<<<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>>>>>>
1 * * * Release notes for Xymon 4.3.28 * * *
1 * * * Release notes for Xymon 4.3.29 * * *
22 <<<<<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>>>>>>
33
44
77
88 For a full list of changes and enhancements, please see the
99 Changes file.
10
11
12 Changes for 4.3.29
13 ==================
14
15 On Linux, a few additional tmpfs volumes are ignored by default
16 on new (or unmodified) installs. This includes /run/user/<uid>,
17 which is a transient, per-session tmpfs on some systems. To re-
18 enable monitoring for this (if you are running services under
19 a user with a login session), you may need to edit the analysis.cfg(5)
20 file.
21
22 After upgrade, these partitions will no longer be alerted on or
23 tracked, and their associated RRD files may also be removed:
24
25 /run/user/<uid> (but NOT /run)
26 /dev (but NOT /dev/shm)
27 /sys/fs/cgroup
28 /lib/init/rw
29
30
31 The default hard limit for an incoming message has been raised from
32 10MB to 64MB
33
34 The secure apache config snippet no longer requires a xymongroups file
35 to be present (and module loaded), since it's not used by default. This
36 will not affect existing installs.
37
38 A --no-cpu-listing option has been added to xymond_client to suppress the
39 'top' output in cpu test status messages.
1040
1141
1242 Changes for 4.3.28
0 # Xymon compile-time settings for GNU (Hurd) systems
1
2 OSDEF = -DLINUX
3
4 # NETLIBS: None needed
5 NETLIBS =
6
7 # Compile flags for normal build
8 CC = gcc
9 CFLAGS += -g -O2 -Wall -Wno-unused -D_REENTRANT $(LFSDEF) $(OSDEF)
10
11 ifndef PKGBUILD
12 RPATH = -Wl,--rpath,
13 endif
14
15 # Compile flags for debugging
16 # CFLAGS = -g -DDEBUG -Wall -D_REENTRANT $(LFSDEF) $(OSDEF)
17
18 # For profiling
19 # CFLAGS = -g -pg -Wall -D_REENTRANT $(LFSDEF) $(OSDEF)
20 # Note: Do 'export GMON_OUT_PREFIX=/var/tmp/FILENAME' to save profiling output in /var/tmp
21 # Use gprof to analyse
22
23 # By default, Xymon uses a static library for common code.
24 # To save some diskspace and run-time memory, you can use a
25 # shared library by un-commenting this.
26 # XYMONLIBRARY=libxymon.so
27
28 # Mail program: This must support "CMD -s SUBJECT ADDRESS" to send out a mail with a subject
29 # Typically, this will be "mail" or "mailx"
30 MAILPROGRAM="mail"
31
0 # Xymon compile-time settings for GNU/kFreeBSD systems
1
2 OSDEF =
3
4 # NETLIBS: None needed
5 NETLIBS =
6
7 # Compile flags for normal build
8 CC = gcc
9 CFLAGS += -g -O2 -Wall -Wno-unused -D_REENTRANT $(LFSDEF) $(OSDEF)
10
11 ifndef PKGBUILD
12 RPATH = -Wl,--rpath,
13 endif
14
15 # Compile flags for debugging
16 # CFLAGS = -g -DDEBUG -Wall -D_REENTRANT $(LFSDEF) $(OSDEF)
17
18 # For profiling
19 # CFLAGS = -g -pg -Wall -D_REENTRANT $(LFSDEF) $(OSDEF)
20 # Note: Do 'export GMON_OUT_PREFIX=/var/tmp/FILENAME' to save profiling output in /var/tmp
21 # Use gprof to analyse
22
23 # By default, Xymon uses a static library for common code.
24 # To save some diskspace and run-time memory, you can use a
25 # shared library by un-commenting this.
26 # XYMONLIBRARY=libxymon.so
27
28 # Mail program: This must support "CMD -s SUBJECT ADDRESS" to send out a mail with a subject
29 # Typically, this will be "mail" or "mailx"
30 MAILPROGRAM="mail"
31
11
22 OSDEF = -DLINUX
33
4 # NETLIBS: None needed on Linux
5 NETLIBS =
4 # NETLIBS: Use replacement rpc
5 NETLIBS = -ltirpc
66
77 # Compile flags for normal build
88 CC = gcc
9 GCCVER := $(shell gcc -dumpversion|cut -d. -f1)
10 ifeq ($(GCCVER),4)
11 CFLAGS = -g -O2 -Wall -Wno-unused -Wno-pointer-sign -D_REENTRANT $(LFSDEF) $(OSDEF)
9 GCCVER := $(shell test 0`gcc -dumpversion|cut -d. -f1` -ge 4 && echo yes)
10 ifeq ($(GCCVER),yes)
11 CFLAGS = -g -O2 -Wall -Wno-unused -I/usr/include/tirpc -Wno-pointer-sign -D_REENTRANT $(LFSDEF) $(OSDEF)
1212 else
13 CFLAGS = -g -O2 -Wall -Wno-unused -D_REENTRANT $(LFSDEF) $(OSDEF)
13 CFLAGS = -g -O2 -Wall -Wno-unused -I/usr/include/tirpc -D_REENTRANT $(LFSDEF) $(OSDEF)
1414 endif
1515
1616 ifndef PKGBUILD
5050 INSTALLWWWDIR = $(XYMONHOME)/www
5151 endif
5252
53 ARESVER = 1.12.0
53 MINARESVER = 1.5.1
54 ARESVER = 1.15.0
5455 FPINGVER = 3.0
5556
5657 IDTOOL := $(shell if test `uname -s` = "SunOS"; then echo /usr/xpg4/bin/id; else echo id; fi)
44 @$(CC) $(CFLAGS) $(CARESINC) -o test-cares.o -c test-cares.c
55
66 test-link:
7 @$(CC) $(CFLAGS) $(CARESLIB) -o test-cares test-cares.o -lcares && ./test-cares $(ARESVER)
7 @$(CC) $(CFLAGS) $(CARESLIB) -o test-cares test-cares.o -lcares && ./test-cares $(MINARESVER)
88
99 ares-clean:
1010 @rm -f test-cares.o test-cares
77
88 #ifndef PATH_MAX
99 res = pathconf("/", _PC_PATH_MAX);
10 if (res == -1) res = 4096;
1011 printf("#define PATH_MAX %ld\n", res);
1112 #endif
1213
1111 /* */
1212 /*----------------------------------------------------------------------------*/
1313
14 static char rcsid[] = "$Id: logfetch.c 7982 2016-11-05 19:02:06Z jccleaver $";
14 static char rcsid[] = "$Id: logfetch.c 8046 2019-04-09 09:33:47Z jccleaver $";
1515
1616 #include <sys/types.h>
1717 #include <sys/stat.h>
1818 #include <sys/time.h>
1919 #include <stdio.h>
20 #include <stdint.h>
2021 #include <string.h>
2122 #include <unistd.h>
2223 #include <stdlib.h>
319320
320321 /* Mark where we left off */
321322 bytesin += strlen(fillpos);
322 if (!curpos && (bytesin >= bytestocurrent)) {
323 if (!curpos && (bytesin > bytestocurrent)) {
323324 char *t;
324325
325326 dbgprintf(" - Last position was %u, found curpos location at %u in current buffer.\n", logdef->lastpos[1], bytesin);
367368 if (force_trigger) {
368369 /* Oops. We actually wanted this line poked through */
369370 /* At the moment, we're only entering this state when we've added 'CURRENT\n' to the existing line */
370 /* Since we're guaranteeing to downstream users that we're ignoring this, just truncate the line */
371 /* to the first newline. If we start using force_trigger for other purposes, we might have to change */
371 /* Since we're guaranteeing to downstream users that we're ignoring this, just skip the line */
372 /* until the first newline. If we start using force_trigger for other purposes, we might have to change */
372373 /* the logic here. */
373374 char *eoln;
374375
375 eoln = strchr(fillpos, '\n'); if (eoln) *++eoln = '\0'; // still need the final newline
376 eoln = strchr(fillpos, '\n'); if (eoln && *(eoln + 1)) fillpos = eoln + 1; // skip first line
376377 }
377378 else if (match) continue;
378379 }
00 #!/bin/sh
11
22 # Configure script for Xymon client
3 # $Id: configure.client 7426 2014-02-11 08:18:25Z storner $
3 # $Id: configure.client 8052 2019-04-22 18:20:02Z jccleaver $
44
55 echo ""
66 echo "Configuration script for Xymon client"
193193 echo "LIBRTDEF = $LIBRTDEF" >>Makefile
194194
195195 echo "" >>Makefile
196 if test -r build/Makefile.`uname -s`
197 then
198 echo "include build/Makefile.`uname -s`" >>Makefile
199 echo ""
200 echo "Using `uname -s` Makefile settings"
196 if test -r build/Makefile.`uname -s | tr '/' '_'`
197 then
198 echo "include build/Makefile.`uname -s | tr '/' '_'`" >>Makefile
199 echo ""
200 echo "Using `uname -s | tr '/' '_'` Makefile settings"
201201 echo ""
202202 else
203203 echo "include build/Makefile.generic" >>Makefile
204204 echo ""
205 echo "Using GENERIC Makefile settings"
205 echo "Using GENERIC Makefile settings (uname -s is `uname -s`)"
206206 echo ""
207207 echo "If this fails, change the compile settings in Makefile"
208208 echo ""
00 #!/bin/sh
11
22 # Configure script for Xymon server
3 # $Id: configure.server 7954 2016-03-22 02:26:22Z jccleaver $
3 # $Id: configure.server 8052 2019-04-22 18:20:02Z jccleaver $
44
55 echo ""
66 echo "Configuration script for Xymon"
536536 echo "LFSDEF = $LFS" >>Makefile
537537
538538 echo "" >>Makefile
539 if test -r build/Makefile.`uname -s`
540 then
541 echo "include build/Makefile.`uname -s`" >>Makefile
542 echo ""
543 echo "Using `uname -s` Makefile settings"
539 if test -r build/Makefile.`uname -s | tr '/' '_'`
540 then
541 echo "include build/Makefile.`uname -s | tr '/' '_'`" >>Makefile
542 echo ""
543 echo "Using `uname -s | tr '/' '_'` Makefile settings"
544544 echo ""
545545 else
546546 echo "include build/Makefile.generic" >>Makefile
547547 echo ""
548 echo "Using GENERIC Makefile settings"
548 echo "Using GENERIC Makefile settings (uname -s is `uname -s`)"
549549 echo ""
550550 echo "If this fails, change the compile settings in Makefile"
551551 echo ""
7676 Prevent status messages from going purple when they are no longer valid.
7777 Unlike the standard bbd daemon, purple-handling is done by xymond.
7878 <P>
79 <DT>--merge-clientconfig<DD>
79 <DT>--merge-clientlocal<DD>
8080 The
8181 <I><A HREF="../man5/client-local.cfg.5.html">client-local.cfg</A>(5)</I>
8282
00 /*----------------------------------------------------------------------------*/
11 /* Xymon monitor */
22 /* */
3 /* Copyright (C) 2002-2015 Henrik Storner <henrik@storner.dk> */
3 /* Copyright (C) 2002-2019 Henrik Storner <henrik@storner.dk> */
44 /* */
55 /* This program is released under the GNU General Public License (GPL), */
66 /* version 2. See the file "COPYING" for details. */
1010 #ifndef __VERSION_H__
1111 #define __VERSION_H__
1212
13 #define VERSION "4.3.28"
13 #define VERSION "4.3.29"
1414
1515 #endif
1616
1010 /* */
1111 /*----------------------------------------------------------------------------*/
1212
13 static char rcsid[] = "$Id: cgi.c 7949 2016-03-03 23:44:55Z jccleaver $";
13 static char rcsid[] = "$Id: cgi.c 8015 2017-12-05 13:16:12Z jccleaver $";
1414
1515 #include <ctype.h>
1616 #include <string.h>
274274 else if (strncmp(str, "ackinfo", 7) == 0) csppol = strdup("script-src 'self'; connect-src 'self'; form-action 'self';");
275275 else if (strncmp(str, "acknowledge", 11) == 0) csppol = strdup("script-src 'self'; connect-src 'self'; form-action 'self';");
276276 else if (strncmp(str, "criticaleditor", 14) == 0) csppol = strdup("script-src 'self'; connect-src 'self'; form-action 'self';");
277 else if (strncmp(str, "svcstatus-trends", 16) == 0) csppol = strdup("script-src 'self' 'unsafe-inline'; connect-src 'self'; form-action 'self'; sandbox allow-forms allow-scripts;");
277 else if (strncmp(str, "svcstatus-trends", 16) == 0) csppol = strdup("script-src 'self' 'unsafe-inline'; connect-src 'self'; form-action 'self'; sandbox allow-forms allow-scripts allow-same-origin;");
278278 else if (strncmp(str, "svcstatus-info", 14) == 0) csppol = strdup("script-src 'self' 'unsafe-inline'; connect-src 'self'; form-action 'self'; sandbox allow-forms allow-same-origin allow-scripts allow-modals allow-popups;");
279279 else if (strncmp(str, "svcstatus", 9) == 0) csppol = strdup("script-src 'self'; connect-src 'self'; form-action 'self'; sandbox allow-forms allow-same-origin;");
280280 else if (strncmp(str, "historylog", 10) == 0) csppol = strdup("script-src 'self'; connect-src 'self'; form-action 'self'; sandbox allow-forms;");
99
1010 #ifndef __URL_H__
1111 #define __URL_H__
12
13 /* Fix building on GNU */
14 #ifndef MAXPATHLEN
15 # ifdef PATH_MAX
16 # define MAXPATHLEN PATH_MAX
17 # elif defined(MAX_PATH)
18 # define MAXPATHLEN MAX_PATH
19 # elif defined(_MAX_PATH)
20 # define MAXPATHLEN _MAX_PATH
21 # elif defined(CCHMAXPATH)
22 # define MAXPATHLEN CCHMAXPATH
23 # else
24 # define MAXPATHLEN 1024
25 # endif
26 #endif
1227
1328 extern int obeybbproxysyntax;
1429
106106 The \fB/usr/local/bin/graphtitle\fR command is then called with
107107 the hostname, the graphtype, the period string, and all of the
108108 RRD files used as parameters. The script must generate one line of output,
109 which is then used as the title of the graph.
109 which is then used as the title of the graph. Each of the RRD pathname
110 parameters will be enclosed in double quotes.
110111
111112 .SH ENVIRONMENT
112113 .BR TEST2RRD
1010 /* */
1111 /*----------------------------------------------------------------------------*/
1212
13 static char rcsid[] = "$Id: showgraph.c 7678 2015-10-01 14:42:42Z jccleaver $";
13 static char rcsid[] = "$Id: showgraph.c 8058 2019-04-29 17:22:14Z jccleaver $";
1414
1515 #include <limits.h>
1616 #include <stdio.h>
10471047 if (!gdef->title) gdef->title = strdup("");
10481048 if (strncmp(gdef->title, "exec:", 5) == 0) {
10491049 char *pcmd;
1050 int i, pcmdlen = 0;
1050 int i, pcmdlen = 7;
10511051 FILE *pfd;
10521052 char *p;
1053
1054 pcmdlen = strlen(gdef->title+5) + strlen(displayname) + strlen(service) + strlen(glegend) + 5;
1053 char *param_str = "%s \"%s\" %s \"%s\"";
1054
1055 pcmdlen += (strlen(gdef->title+5) + strlen(displayname) + strlen(service) + strlen(glegend));
10551056 for (i=0; (i<rrddbcount); i++) pcmdlen += (strlen(rrddbs[i].rrdfn) + 3);
10561057
10571058 p = pcmd = (char *)malloc(pcmdlen+1);
1058 p += sprintf(p, "%s %s %s \"%s\"", gdef->title+5, displayname, service, glegend);
1059 p += sprintf(p, param_str, gdef->title+5, displayname, service, glegend);
10591060 for (i=0; (i<rrddbcount); i++) {
10601061 if ((firstidx == -1) || ((i >= firstidx) && (i <= lastidx))) {
10611062 p += sprintf(p, " \"%s\"", rrddbs[i].rrdfn);
345345 # will result in the load-limits being 7.0/12.0 for the "bax.foo.com" host,
346346 # and 3.0/8.0 for all other foo.com hosts.
347347 #
348
349
350 CLASS=linux
351 # Ignore some usually uninteresting tmpfs mounts.
352 DISK /dev IGNORE
353 DISK /lib/init/rw IGNORE
354 DISK /sys/fs/cgroup IGNORE
355 DISK %^/run/user/\d+$ IGNORE
356 INODE /dev IGNORE
357 INODE /lib/init/rw IGNORE
358 INODE /sys/fs/cgroup IGNORE
359 INODE %^/run/user/\d+$ IGNORE
360
361
362
348363 # The special DEFAULT section can modify the built-in defaults - this must
349364 # be placed at the end of the file. It should ONLY be used to modify the
350365 # default thresholds, do NOT put PROC, LOG, DISK or any other lines here
6565 # chmod 640 @INSTALLETCDIR@/xymonpasswd
6666 # Add more users / change passwords with: "htpasswd @INSTALLETCDIR@/xymonpasswd USERNAME"
6767 #
68 AuthUserFile @INSTALLETCDIR@/xymonpasswd
69
6870 # You can also use a group file to restrict admin access to members of a
6971 # group, instead of anyone who is logged in. In that case you must setup
7072 # the "xymongroups" file, and change the "Require" settings to require
7173 # a specific group membership. See the Apache docs for more details.
74 # You may also need to explicitly load the mod_authz_groupfile module
75 # AuthGroupFile @INSTALLETCDIR@/xymongroups
7276
73 AuthUserFile @INSTALLETCDIR@/xymonpasswd
74 AuthGroupFile @INSTALLETCDIR@/xymongroups
7577 AuthType Basic
7678 AuthName "Xymon Administration"
79 <RequireAll>
80 # "valid-user" restricts access to anyone who is logged in.
81 Require valid-user
7782
78 # "valid-user" restricts access to anyone who is logged in.
79 Require valid-user
80
81 # "group admins" restricts access to users who have logged in, AND
82 # are members of the "admins" group in xymongroups.
83 # Require group admins
84
83 # "group admins" restricts access to users who have logged in, AND
84 # are members of the "admins" group in xymongroups.
85 # Require group admins
86 </RequireAll>
8587 </Directory>
8688
8789 # Rewrite-rules for migrating from the URL's used in Hobbit
77 /* */
88 /*----------------------------------------------------------------------------*/
99
10 static char netstat_rcsid[] = "$Id: do_netstat.c 7609 2015-03-22 00:21:16Z jccleaver $";
10 static char netstat_rcsid[] = "$Id: do_netstat.c 8036 2019-03-20 23:20:21Z jccleaver $";
1111
1212 static char *netstat_params[] = { "DS:udpInDatagrams:DERIVE:600:0:U",
1313 "DS:udpOutDatagrams:DERIVE:600:0:U",
264264 NULL
265265 };
266266
267 /* This one matches all Linux systems */
268 static char *netstat_linux_markers[] = {
267 /* This one matches most older Linux systems using traditional netstat */
268 static char *netstat_linux_legacy_markers[] = {
269269 "packets received",
270270 "packets sent",
271271 "packet receive errors",
282282 "segments received",
283283 "",
284284 "segments retransmited",
285 NULL
286 };
287
288 /* This one matches Linux systems using net-tools from approx 2016 onwards */
289 static char *netstat_linux_markers[] = {
290 "packets received",
291 "packets sent",
292 "packet receive errors",
293 "active connection openings",
294 "passive connection openings",
295 "failed connection attempts",
296 "connection resets received",
297 "connections established",
298 "",
299 "",
300 "",
301 "",
302 "segments sent out",
303 "segments received",
304 "",
305 "segments retransmitted",
285306 NULL
286307 };
287308
505526 case OS_ZOS:
506527 /* These are of the form "<value> <marker" */
507528 datapart = strstr(datapart, "\nTcp:"); /* Skip to the start of "Tcp" (udp comes after) */
508 if (datapart) havedata = do_valbeforemarker(netstat_linux_markers, datapart, outp);
529
530 /* The net-tools project changed formats recently, but not in enough */
531 /* of a way to warrant switching to regex; we can branch on a former typo. */
532 if (datapart) {
533 if (strstr(datapart, "segments sent out")) havedata = do_valbeforemarker(netstat_linux_markers, datapart, outp);
534 else havedata = do_valbeforemarker(netstat_linux_legacy_markers, datapart, outp);
535 }
509536 break;
510537
511538 case OS_SNMP:
77 /* */
88 /*----------------------------------------------------------------------------*/
99
10 static char temperature_rcsid[] = "$Id: do_temperature.c 7248 2013-07-30 12:47:38Z storner $";
10 /* Sample input reports:
1111
12 int do_temperature_rrd(char *hostname, char *testname, char *classname, char *pagepaths, char *msg, time_t tstamp)
13 {
12
13 Device Temp LowShutdown LowWarning HighWarning HighShutdown
14 ----------------------------------------------------------------------------------------------------
15 &green hard-disk1 hard-disk1 44 0 5 55 60
16 &green CPU 0 Die 86 -10 0 95 100
17 &green CPU 1 Die 80 -10 0 95 100
18 &green CPU 0 Ambient 54 -8 0 70 75
19 &green System Outtake Ambient 53 -10 0 70 75
20 &green System Intake Ambient 33 -11 0 45 70
21 &green CPU 1 Ambient 42 -9 0 70 75
22 ----------------------------------------------------------------------------------------------------
23
24 Device Temp Warning Critical
25 ---------------------------------------------------------
26 &green CPU0 60 63 68
27 &green CPU1 58 63 68
28 &clear MB0 46
29 &clear MB1 36
30 &green PDB 40 53 58
31 &clear SCSI 33
32 ---------------------------------------------------------
33
34 Device Temp High Crit
35 -----------------------------------------------------
36 &green Package id 0 42 86 100
37 &green Core 0 41 86 100
38 &green Core 1 42 86 100
39 &green temp1 37 98
40 -----------------------------------------------------
41
42 */
43
44 static char temperature_rcsid[] = "$Id: do_temperature.c 8050 2019-04-17 23:56:30Z jccleaver $";
45
46 int do_temperature_rrd(char *hostname, char *testname, char *classname, char *pagepaths, char *msg, time_t tstamp)
47 {
1448 static char *temperature_params[] = { "DS:temperature:GAUGE:600:1:U",
1549 NULL };
16 static void *temperature_tpl = NULL;
50 static void *temperature_tpl = NULL;
1751
18 /* Sample input report:
19 Device Temp(C) Temp(F)
20 -----------------------------------
21 &green Motherboard#0 31 87
22 &green Motherboard#1 28 82
23 &green AMBIENT 25 77
24 &green CPU0 40 104
25 &green CPU1 40 104
26 &green CPU2 40 104
27 &green CPU3 40 104
28 &green Board 0 29 84
29 &green Board 1 35 95
30 &green Board 2 30 86
31 &green Board 3 37 98
32 &green Board 4 28 82
33 &green Board 6 28 82
34 &green Board CLK 27 80
35 &green MB 24 75
36 &green IOB 19 66
37 &green DBP0 19 66
38 &green CPU 0 Die 79 174
39 &green CPU 0 Ambient 27 80
40 &green CPU 1 Die 73 163
41 &green CPU 1 Ambient 26 78
42 -----------------------------------
43 Status green: All devices look okay
44 */
45
46 char *bol, *eol, *comment, *p;
52 char *bol, *eol, *p;
4753 int tmpC;
4854
4955 if (temperature_tpl == NULL) temperature_tpl = setup_template(temperature_params);
5561 bol = p + 1;
5662 eol = strchr(bol, '\n'); if (eol) *eol = '\0';
5763
58 /* See if there's a comment in parenthesis */
59 comment = strchr(bol, '('); /* Begin comment */
60 p = strchr(bol, ')'); /* End comment */
61 if (comment && p && (comment < p)) *comment = '\0'; /* Cut off the comment */
62
63 if (strncmp(bol, "&green", 6) == 0) { bol += 6; gotone = 1; }
64 if (strncmp(bol, "&green", 6) == 0) { bol += 6; gotone = 1; }
6465 else if (strncmp(bol, "&yellow", 7) == 0) { bol += 7; gotone = 1; }
65 else if (strncmp(bol, "&red", 4) == 0) { bol += 4; gotone = 1; }
66 else if (strncmp(bol, "&red", 4) == 0) { bol += 4; gotone = 1; }
6667 else if (strncmp(bol, "&clear", 6) == 0) { bol += 6; gotone = 1; }
6768
6869 if (gotone) {
7071
7172 bol += strspn(bol, " \t");
7273
73 /* Strip off any leading bold and italic HTML tags */
74 if (strncasecmp(bol, "<i><b>", 6) == 0) { bol += 6; }
75 else if (strncasecmp(bol, "<i>", 3) == 0) { bol += 3; }
76 else if (strncasecmp(bol, "<b><i>", 6) == 0) { bol += 6; }
77 else if (strncasecmp(bol, "<b>", 3) == 0) { bol += 3; }
78 bol += strspn(bol, " \t");
79
80 p = bol + strlen(bol) - 1;
81 while ((p > bol) && isspace((int)*p)) p--;
82 while ((p > bol) && isdigit((int)*p)) p--;
83 // tmpF = atoi(p);
84 while ((p > bol) && isspace((int)*p)) p--;
85 while ((p > bol) && isdigit((int)*p)) p--;
74 p = strstr(bol, "\t");
8675 tmpC = atoi(p);
8776 while ((p > bol) && isspace((int)*p)) p--;
8877
89 savech = *(p+1); *(p+1) = '\0';
78 savech = *(p+1); *(p+1) = '\0';
9079 setupfn2("%s.%s.rrd", "temperature", bol); *(p+1) = savech;
9180
9281 snprintf(rrdvalues, sizeof(rrdvalues), "%d:%d", (int)tstamp, tmpC);
9382 create_and_update_rrd(hostname, testname, classname, pagepaths, temperature_params, temperature_tpl);
9483 }
9584
96 if (comment) *comment = '(';
9785 if (eol) *eol = '\n';
9886 }
9987
00 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
11 <HTML>
22 <HEAD>
3 <META HTTP-EQUIV="Content-Type" CONTENT="&HTMLCONTENTTYPE">
34
45 <TITLE>Xymon - Acknowledge Alert</TITLE>
56
00 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
11 <HTML>
22 <HEAD>
3 <META HTTP-EQUIV="Content-Type" CONTENT="&HTMLCONTENTTYPE">
34 <META HTTP-EQUIV="EXPIRES" CONTENT="Sat, 01 Jan 2001 00:00:00 GMT">
45 <TITLE>&XYMWEBBACKGROUND : Xymon - Acknowledgement Log @ &XYMWEBDATE</TITLE>
56
00 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
11 <HTML>
22 <HEAD>
3
3 <META HTTP-EQUIV="Content-Type" CONTENT="&HTMLCONTENTTYPE">
44 <TITLE>Xymon - Change Password</TITLE>
55
66 <!-- Styles for the Xymon body -->
00 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
11 <HTML>
22 <HEAD>
3 <META HTTP-EQUIV="Content-Type" CONTENT="&HTMLCONTENTTYPE">
34 <TITLE>&XYMWEBBACKGROUND : Xymon - Documentation</TITLE>
45
56 <!-- Styles for the Xymon body -->
00 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
11 <html>
2 <head><title>Xymon configuration Report</title></head>
2 <head>
3 <META HTTP-EQUIV="Content-Type" CONTENT="&HTMLCONTENTTYPE">
4 <title>Xymon configuration Report</title>
5 </head>
36
47 <body>
58
00 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
11 <HTML>
22 <HEAD>
3 <META HTTP-EQUIV="Content-Type" CONTENT="&HTMLCONTENTTYPE">
34
45 <TITLE>Xymon - Critical Systems editor</TITLE>
56
00 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
11 <HTML>
22 <HEAD>
3 <META HTTP-EQUIV="Content-Type" CONTENT="&HTMLCONTENTTYPE">
34 <META HTTP-EQUIV="REFRESH" CONTENT="&XYMWEBREFRESH">
45 <META HTTP-EQUIV="EXPIRES" CONTENT="Sat, 01 Jan 2001 00:00:00 GMT">
56 <TITLE>&XYMWEBBACKGROUND : Xymon - Status @ &XYMWEBDATE</TITLE>
00 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
11 <HTML>
22 <HEAD>
3 <META HTTP-EQUIV="Content-Type" CONTENT="&HTMLCONTENTTYPE">
34 <META HTTP-EQUIV="REFRESH" CONTENT="&XYMWEBREFRESH">
45 <META HTTP-EQUIV="EXPIRES" CONTENT="Sat, 01 Jan 2001 00:00:00 GMT">
56 <TITLE>&XYMWEBBACKGROUND : Xymon - Status @ &XYMWEBDATE</TITLE>
00 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
11 <HTML>
22 <HEAD>
3 <META HTTP-EQUIV="Content-Type" CONTENT="&HTMLCONTENTTYPE">
34 <META HTTP-EQUIV="EXPIRES" CONTENT="Sat, 01 Jan 2001 00:00:00 GMT">
45 <TITLE>&XYMWEBBACKGROUND : Xymon - Eventlog @ &XYMWEBDATE</TITLE>
56
00 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
11 <HTML>
22 <HEAD>
3 <META HTTP-EQUIV="Content-Type" CONTENT="&HTMLCONTENTTYPE">
34
45 <TITLE>Xymon - Find Host</TITLE>
56
00 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
11 <HTML>
22 <HEAD>
3 <META HTTP-EQUIV="Content-Type" CONTENT="&HTMLCONTENTTYPE">
34
45 <TITLE>Xymon - Ghost Clients</TITLE>
56
00 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
11 <HTML>
22 <HEAD>
3 <META HTTP-EQUIV="Content-Type" CONTENT="&HTMLCONTENTTYPE">
34 <TITLE>&XYMWEBBACKGROUND : Xymon - Status @ &XYMWEBDATE</TITLE>
45
56 <!-- Styles for the Xymon body -->
00 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
11 <HTML>
22 <HEAD>
3 <META HTTP-EQUIV="Content-Type" CONTENT="&HTMLCONTENTTYPE">
34 <META HTTP-EQUIV="Set-Cookie" CONTENT="pagepath=; path=/">
45 <META HTTP-EQUIV="Set-Cookie" CONTENT="host=&XYMWEBHIKEY; path=/">
56 <TITLE>&XYMWEBBACKGROUND : Xymon - History @ &XYMWEBDATE</TITLE>
00 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
11 <HTML>
22 <HEAD>
3 <META HTTP-EQUIV="Content-Type" CONTENT="&HTMLCONTENTTYPE">
34 <META HTTP-EQUIV="Set-Cookie" CONTENT="pagepath=; path=/">
45 <META HTTP-EQUIV="Set-Cookie" CONTENT="host=&XYMWEBHIKEY; path=/">
56 <TITLE>Xymon Historical Status: &XYMWEBHOST - &XYMWEBSVC @ &LOGTIME</TITLE>
00 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
11 <HTML>
22 <HEAD>
3 <META HTTP-EQUIV="Content-Type" CONTENT="&HTMLCONTENTTYPE">
34
45 <TITLE>Xymon - Metrics Report</TITLE>
56
00 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
11 <HTML>
22 <HEAD>
3 <META HTTP-EQUIV="Content-Type" CONTENT="&HTMLCONTENTTYPE">
34
45 <TITLE>Xymon - List of Hosts</TITLE>
56
00 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
11 <HTML>
22 <HEAD>
3 <META HTTP-EQUIV="Content-Type" CONTENT="&HTMLCONTENTTYPE">
34 <META HTTP-EQUIV="REFRESH" CONTENT="&XYMWEBREFRESH">
45 <META HTTP-EQUIV="EXPIRES" CONTENT="Sat, 01 Jan 2001 00:00:00 GMT">
56 <META HTTP-EQUIV="Set-Cookie" CONTENT="pagepath=; path=/">
00 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
11 <HTML>
22 <HEAD>
3 <META HTTP-EQUIV="Content-Type" CONTENT="&HTMLCONTENTTYPE">
34 <META HTTP-EQUIV="Set-Cookie" CONTENT="pagepath=; path=/">
45 <META HTTP-EQUIV="Set-Cookie" CONTENT="host=&XYMWEBHIKEY; path=/">
56 <TITLE>Xymon - &XYMWEBHOST Host Information</TITLE>
00 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
11 <HTML>
22 <HEAD>
3 <META HTTP-EQUIV="Content-Type" CONTENT="&HTMLCONTENTTYPE">
34
45 <TITLE>Xymon - Maintenance</TITLE>
56
00 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
11 <HTML>
22 <HEAD>
3 <META HTTP-EQUIV="Content-Type" CONTENT="&HTMLCONTENTTYPE">
34
45 <TITLE>Xymon - Maintenance</TITLE>
56
00 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
11 <HTML>
22 <HEAD>
3 <META HTTP-EQUIV="Content-Type" CONTENT="&HTMLCONTENTTYPE">
34 <META HTTP-EQUIV="EXPIRES" CONTENT="Sat, 01 Jan 2001 00:00:00 GMT">
45 <TITLE>&XYMWEBBACKGROUND : Xymon - Notification Log @ &XYMWEBDATE</TITLE>
56
00 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
11 <HTML>
22 <HEAD>
3 <META HTTP-EQUIV="Content-Type" CONTENT="&HTMLCONTENTTYPE">
34 <META HTTP-EQUIV="EXPIRES" CONTENT="Sat, 01 Jan 2001 00:00:00 GMT">
45 <TITLE>&XYMWEBBACKGROUND : Xymon - Performance data @ &XYMWEBDATE</TITLE>
56
00 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
11 <HTML>
22 <HEAD>
3 <META HTTP-EQUIV="Content-Type" CONTENT="&HTMLCONTENTTYPE">
34 <TITLE>Xymon Availability Report : &XYMWEBHOST - &XYMWEBSVC &XYMWEBDATE</TITLE>
45
56 <!-- Styles for the Xymon body -->
00 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
11 <HTML>
22 <HEAD>
3 <META HTTP-EQUIV="Content-Type" CONTENT="&HTMLCONTENTTYPE">
34 <META HTTP-EQUIV="Set-Cookie" CONTENT="pagepath=&XYMWEBPAGEPATH; path=/">
45 <META HTTP-EQUIV="Set-Cookie" CONTENT="host=; path=/">
56 <TITLE>Xymon Availability Report : &XYMWEBDATE</TITLE>
00 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
11 <HTML>
22 <HEAD>
3 <META HTTP-EQUIV="Content-Type" CONTENT="&HTMLCONTENTTYPE">
34
45 <TITLE>Xymon - Availability Report</TITLE>
56
00 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
11 <HTML>
22 <HEAD>
3 <META HTTP-EQUIV="Content-Type" CONTENT="&HTMLCONTENTTYPE">
34 <TITLE>&XYMWEBBACKGROUND : Xymon - Snapshot @ &XYMWEBDATE</TITLE>
45
56 <!-- Styles for the Xymon body -->
00 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
11 <HTML>
22 <HEAD>
3 <META HTTP-EQUIV="Content-Type" CONTENT="&HTMLCONTENTTYPE">
34 <TITLE>&XYMWEBBACKGROUND : Xymon - Snapshot</TITLE>
45
56 <!-- Styles for the Xymon body -->
00 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
11 <HTML>
22 <HEAD>
3 <META HTTP-EQUIV="Content-Type" CONTENT="&HTMLCONTENTTYPE">
34 <META HTTP-EQUIV="Set-Cookie" CONTENT="pagepath=&XYMWEBPAGEPATH; path=/">
45 <META HTTP-EQUIV="Set-Cookie" CONTENT="host=; path=/">
56 <TITLE>Xymon Snapshot Report : &XYMWEBDATE</TITLE>
00 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
11 <HTML>
22 <HEAD>
3 <META HTTP-EQUIV="Content-Type" CONTENT="&HTMLCONTENTTYPE">
34
45 <TITLE>Xymon - Snapshot Report</TITLE>
56
00 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
11 <HTML>
22 <HEAD>
3 <META HTTP-EQUIV="Content-Type" CONTENT="&HTMLCONTENTTYPE">
34 <META HTTP-EQUIV="REFRESH" CONTENT="&XYMWEBREFRESH">
45 <META HTTP-EQUIV="EXPIRES" CONTENT="Sat, 01 Jan 2001 00:00:00 GMT">
56 <TITLE>&XYMWEBBACKGROUND : Xymon - Status @ &XYMWEBDATE</TITLE>
00 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
11 <HTML>
22 <HEAD>
3 <META HTTP-EQUIV="Content-Type" CONTENT="&HTMLCONTENTTYPE">
34 <META HTTP-EQUIV="REFRESH" CONTENT="&XYMWEBREFRESH">
45 <META HTTP-EQUIV="EXPIRES" CONTENT="Sat, 01 Jan 2001 00:00:00 GMT">
56 <TITLE>&XYMWEBBACKGROUND : Xymon - Status @ &XYMWEBDATE</TITLE>
88 </TR>
99 </TABLE>
1010
11 <!-- Don't rely just on HTML to set the cookies -->
12 <!-- http://lists.xymon.com/pipermail/xymon/2018-June/045538.html -->
13 <script type="text/javascript">
14 var metas = document.getElementsByTagName('meta');
15
16 for (var i=0; i<metas.length; i++) {
17 var type = metas[i].getAttribute("HTTP-EQUIV");
18 if (type == "Set-Cookie") {
19 var prop = metas[i].getAttribute("CONTENT");
20 document.cookie = prop;
21 }
22 }
23 </script>
24
1125 &XYMONBODYFOOTER
1226
1327 </BODY>
00 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
11 <HTML>
22 <HEAD>
3 <META HTTP-EQUIV="Content-Type" CONTENT="&HTMLCONTENTTYPE">
34 <META HTTP-EQUIV="REFRESH" CONTENT="&XYMWEBREFRESH">
45 <META HTTP-EQUIV="EXPIRES" CONTENT="Sat, 01 Jan 2001 00:00:00 GMT">
56 <META HTTP-EQUIV="Set-Cookie" CONTENT="pagepath=&XYMWEBPAGEPATH; path=/">
00 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
11 <HTML>
22 <HEAD>
3 <META HTTP-EQUIV="Content-Type" CONTENT="&HTMLCONTENTTYPE">
34 <META HTTP-EQUIV="EXPIRES" CONTENT="Sat, 01 Jan 2001 00:00:00 GMT">
45 <TITLE>&XYMWEBBACKGROUND : Xymon - Top Changes @ &XYMWEBDATE</TITLE>
56
00 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
11 <HTML>
22 <HEAD>
3 <META HTTP-EQUIV="Content-Type" CONTENT="&HTMLCONTENTTYPE">
34 <META HTTP-EQUIV="Set-Cookie" CONTENT="pagepath=; path=/">
45 <META HTTP-EQUIV="Set-Cookie" CONTENT="host=&XYMWEBHIKEY; path=/">
56 <TITLE>Xymon - &XYMWEBHOST Host Trends</TITLE>
00 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
11 <HTML>
22 <HEAD>
3 <META HTTP-EQUIV="Content-Type" CONTENT="&HTMLCONTENTTYPE">
34
45 <TITLE>Xymon - Manage Users</TITLE>
56
5959 Prevent status messages from going purple when they are no longer valid.
6060 Unlike the standard bbd daemon, purple-handling is done by xymond.
6161
62 .IP "\-\-merge\-clientconfig"
62 .IP "\-\-merge\-clientlocal"
6363 The
6464 .I client-local.cfg(5)
6565 file contains client-configuration which can be found matching a client
2424 /* */
2525 /*----------------------------------------------------------------------------*/
2626
27 static char rcsid[] = "$Id: xymond.c 7999 2017-01-06 02:00:06Z jccleaver $";
27 static char rcsid[] = "$Id: xymond.c 8045 2019-04-09 03:32:37Z jccleaver $";
2828
2929 #include <limits.h>
3030 #include <sys/time.h>
4242 #include <fcntl.h>
4343 #include <stdlib.h>
4444 #include <string.h>
45 #include <stdint.h>
4546 #include <stdio.h>
4647 #include <netdb.h>
4748 #include <ctype.h>
6263 * The absolute maximum size we'll grow our buffers to accommodate an incoming message.
6364 * This is really just an upper bound to squash the bad guys trying to data-flood us.
6465 */
65 #define MAX_XYMON_INBUFSZ (10*1024*1024) /* 10 MB */
66 #define MAX_XYMON_INBUFSZ (64*1024*1024) /* 64 MB */
6667
6768 /* The initial size of an input buffer. Make this large enough for most traffic. */
6869 #define XYMON_INBUF_INITIAL (128*1024)
5252 received from the client. If you prefer to just have the monitored
5353 ports shown, this option will turn off the full netstat-listing.
5454
55 .IP "\-\-no\-cpu\-listing"
56 Normally the "cpu" status message includes the full cpu-listing
57 received from the client. If you prefer to just have the monitored
58 cpu load shown, this option will turn off the full cpu-listing.
59
5560 .IP "\-\-uptime\-status"
5661 Generate a separate "uptime" status column. The uptime is normally
5762 just reported in the "cpu" status column, but if you would like a
1010 /* */
1111 /*----------------------------------------------------------------------------*/
1212
13 static char rcsid[] = "$Id: xymond_client.c 7886 2016-02-02 20:16:19Z jccleaver $";
13 static char rcsid[] = "$Id: xymond_client.c 8058 2019-04-29 17:22:14Z jccleaver $";
1414
1515 #include <stdio.h>
1616 #include <string.h>
3939 } sectlist_t;
4040 static sectlist_t *defsecthead = NULL;
4141
42 int cpulistincpu = 1;
4243 int pslistinprocs = 1;
4344 int portlistinports = 1;
4445 int svclistinsvcs = 1;
512513 addtostrstatus(cpumsg);
513514 addtostatus("\n");
514515 }
515 if (topstr) {
516 if (topstr && cpulistincpu == 1) {
516517 addtostatus("\n");
517518 addtostatus(topstr);
518519 }
20872088 else if (strcmp(argv[argi], "--no-port-listing") == 0) {
20882089 portlistinports = 0;
20892090 }
2091 else if (strcmp(argv[argi], "--no-cpu-listing") == 0) {
2092 cpulistincpu = 0;
2093 }
20902094 else if (strcmp(argv[argi], "--no-clear-msgs") == 0) {
20912095 sendclearmsgs = 0;
20922096 }
1010 /* */
1111 /*----------------------------------------------------------------------------*/
1212
13 static char rcsid[] = "$Id: wmlgen.c 7684 2015-10-08 03:01:23Z jccleaver $";
13 static char rcsid[] = "$Id: wmlgen.c 8031 2019-03-13 08:59:50Z jccleaver $";
1414
1515 #include <limits.h>
1616 #include <stdlib.h>
xymonnet/c-ares-1.12.0.tar.gz less more
Binary diff not shown
99 /* */
1010 /*----------------------------------------------------------------------------*/
1111
12 static char rcsid[] = "$Id: httpresult.c 7773 2015-11-22 02:19:43Z jccleaver $";
12 static char rcsid[] = "$Id: httpresult.c 8043 2019-04-08 22:51:15Z jccleaver $";
1313
1414 #include <sys/types.h>
1515 #include <stdlib.h>
127127 /* Check if this service is a NOPAGENET service. */
128128 nopagename = (char *) malloc(strlen(svcname)+3);
129129 sprintf(nopagename, ",%s,", svcname);
130 nopage = (strstr(nonetpage, svcname) != NULL);
130 nopage = (strstr(nonetpage, nopagename) != NULL);
131131 xfree(nopagename);
132132
133133 dbgprintf("Calc http color host %s : ", host->hostname);
428428 /* Check if this service is a NOPAGENET service. */
429429 nopagename = (char *) malloc(strlen(contenttestname)+3);
430430 sprintf(nopagename, ",%s,", contenttestname);
431 nopage = (strstr(nonetpage, contenttestname) != NULL);
431 nopage = (strstr(nonetpage, nopagename) != NULL);
432432 xfree(nopagename);
433433
434434 dbgprintf("Calc content color host %s : ", host->hostname);
99 /* */
1010 /*----------------------------------------------------------------------------*/
1111
12 static char rcsid[] = "$Id: ldaptest.c 7678 2015-10-01 14:42:42Z jccleaver $";
12 static char rcsid[] = "$Id: ldaptest.c 8043 2019-04-08 22:51:15Z jccleaver $";
1313
1414 #include <sys/types.h>
1515 #include <stdlib.h>
407407 /* Check if this service is a NOPAGENET service. */
408408 nopagename = (char *) malloc(strlen(svcname)+3);
409409 sprintf(nopagename, ",%s,", svcname);
410 nopage = (strstr(nonetpage, svcname) != NULL);
410 nopage = (strstr(nonetpage, nopagename) != NULL);
411411 xfree(nopagename);
412412
413413 dbgprintf("Calc ldap color host %s : ", host->hostname);
77 /* */
88 /*----------------------------------------------------------------------------*/
99
10 static char rcsid[] = "$Id: xymonnet.c 7967 2016-09-10 03:13:43Z jccleaver $";
10 static char rcsid[] = "$Id: xymonnet.c 8060 2019-05-01 23:59:23Z jccleaver $";
1111
1212 #include <limits.h>
1313 #include <stdio.h>
106106 char *defaultsourceip = NULL;
107107 int loadhostsfromxymond = 0;
108108 int sslminkeysize = 0;
109 char *warnbuf = NULL;
110 static unsigned int warnbufsize = 0;
109111
110112 void dump_hostlist(void)
111113 {
875877 /* Already have the IP setup */
876878 }
877879 else {
880 char msg[512];
878881 /* Cannot resolve hostname */
879882 h->dnserror = 1;
883 /* Make this a warning rather than an error
880884 errprintf("xymonnet: Cannot resolve IP for host %s\n", h->hostname);
885 */
886 sprintf(msg, "xymonnet: Cannot resolve IP for host %s\n", h->hostname);
887 if (warnbuf == NULL) {
888 warnbufsize = 8192;
889 warnbuf = (char *) malloc(warnbufsize);
890 *warnbuf = '\0';
891 }
892 else if ((strlen(warnbuf) + strlen(msg)) > warnbufsize) {
893 warnbufsize += 8192;
894 warnbuf = (char *) realloc(warnbuf, warnbufsize);
895 }
896 strcat(warnbuf, msg);
881897 }
882898 }
883899
10651081 strcpy(cmdpath, (use_sntp ? xgetenv("SNTP") : xgetenv("NTPDATE")) );
10661082
10671083 for (t=service->items; (t); t = t->next) {
1068 if (!t->host->dnserror) {
1084 /* Do not run NTP test if host does not resolve in DNS or is down */
1085 if (!t->host->dnserror && !t->host->pingerror) {
10691086 if (use_sntp) {
10701087 sprintf(cmd, "%s %s -d %d %s 2>&1", cmdpath, xgetenv("SNTPOPTS"), extcmdtimeout-1, ip_to_test(t->host));
10711088 }
10891106 p = xgetenv("RPCINFO");
10901107 strcpy(cmdpath, (p ? p : "rpcinfo"));
10911108 for (t=service->items; (t); t = t->next) {
1092 if (!t->host->dnserror && (t->host->downcount == 0)) {
1109 /* Do not run RPCINFO test if host does not resolve in DNS or is down */
1110 if (!t->host->dnserror && (t->host->downcount == 0) && !t->host->pingerror) {
10931111 sprintf(cmd, "%s -p %s 2>&1", cmdpath, ip_to_test(t->host));
10941112 t->open = (run_command(cmd, NULL, t->banner, 1, extcmdtimeout) == 0);
10951113 }
14651483 strcat(cause, " down ");
14661484 color = COL_YELLOW;
14671485 }
1486
1487 /* Set pingerror for later use by NTP and RPCINFO tests */
1488 test->host->pingerror = (color == COL_RED ? 1 : 0);
14681489
14691490 /* Handle "badconn" */
14701491 if ((color == COL_RED) && (test->host->downcount < test->host->badconn[2])) {
16191640 /* Check if this service is a NOPAGENET service. */
16201641 nopagename = (char *) malloc(strlen(svcname)+3);
16211642 sprintf(nopagename, ",%s,", svcname);
1622 if (strstr(nonetpage, svcname) != NULL) color = COL_YELLOW;
1643 if (strstr(nonetpage, nopagename) != NULL) color = COL_YELLOW;
16231644 xfree(nopagename);
16241645 }
16251646
22352256 printf("Usage: %s [options] [host1 host2 host3 ...]\n", argv[0]);
22362257 printf("General options:\n");
22372258 printf(" --timeout=N : Timeout (in seconds) for service tests\n");
2259 printf(" --cmdtimeout=N : Timeout for external commands for testing NTP, RPC and traceroute\n");
22382260 printf(" --concurrency=N : Number of tests run in parallel\n");
22392261 printf(" --dns-timeout=N : DNS lookups timeout and fail after N seconds [30]\n");
22402262 printf(" --dns=[only|ip|standard] : How IP's are decided\n");
26042626 addtostatus(prehtmlquoted(errbuf));
26052627 }
26062628
2629 if (warnbuf) {
2630 addtostatus("\n\nWarning output:\n");
2631 addtostatus(prehtmlquoted(warnbuf));
2632 }
2633
26072634 show_timestamps(&timestamps);
26082635 addtostatus(timestamps);
26092636
4141 * banner nosslcert | |
4242 * certinfo dodns | |
4343 * duration dnserror | |
44 * badtest ////////// | |
44 * badtest pingerror | |
4545 * downcount repeattest | |
4646 * downstart noconn | |
4747 * privdata ----+ noping | |
9090 int hidehttp; /* hidehttp flag */
9191 int dodns; /* set while loading tests if we need to do a DNS lookup */
9292 int dnserror; /* set internally if we cannot find the host's IP */
93 int pingerror; /* set internally if host does not answer ping */
9394 int repeattest; /* Set if this host goes on the quick poll list */
9495 char *hosttype; /* For the "Intermediate HOSTTYPE is down" message */
9596