Jelajahi Sumber

Add ./tarball_archive/symon-2.52.tar.gz

Wictor Lund 3 tahun lalu
induk
melakukan
ae6ac94877

+ 34 - 1
symon/CHANGELOG

@@ -1,3 +1,36 @@
+18/10/2002 - 2.52
+
+   Julien Touche reported that symon/symux do not report initial cfg errors on
+   the commandline - fixed.
+
+   Reinhard Sammer, Julien and Henning Brouwer all noticed that the php
+   code needed globals - fixed. Passing by reference at call time resulted in
+   php warnings - fixed.
+
+   Henning thought it was nice to see a single machine at a time. Julien wanted
+   clickable magnification for individual graphs. Both options can now be
+   configured in datasources.inc.
+
+   Resolved a bug reported by Vincent Kessler (who also provided the fix -
+   cheers mate) in the rrdupdate call in symux - optind needs to be cleared
+   ahead of the getopt call in rrdupdate.
+
+   The Makefile.inc no longer overwrites CFLAGS. Configuration directories are
+   now taken from the environment as expected by the openbsd ports
+   system. (Thanks to Nick Nauwelaerts for pointing this out)
+
+   Installation of symon now also generates a default symon.conf file if the
+   system does not already have one. 
+   
+   Someone at www.deadly.org pointed out that symon is no longer compatible
+   with OpenBSD 3.0 - removed claim from the website.
+
+   Added -f <file> switch to symon.
+
+   The lexer started parsing from character position 1 instead of 0. 
+
+   symux would bomb out after a hup - fixed.
+
 14/09/2002 - 2.51 
 
    Steve Shockley reported that the port Makefile did not install rrd
@@ -152,4 +185,4 @@
 29/09/2001 - Lexer had trouble dealing with ip-addresses. Cleaned up the number	
              parsing code and removed a second comment reader.
 
-$Id: CHANGELOG,v 1.7 2002/09/16 06:26:23 dijkstra Exp $
+$Id: CHANGELOG,v 1.8 2002/10/18 12:29:09 dijkstra Exp $

+ 15 - 2
symon/INSTALL

@@ -74,7 +74,20 @@ Less quick, but more verbose
 
 - Only if you need the webinterface: symon2web is installed in
   $PREFIX/$SHRDIR/. Copy the files to a convenient apache directory and modify
-  the symon2web/datasources.inc to reflect your filelocations.
+  the symon2web/datasources.inc to reflect your filelocations. datasources.inc
+  also contains some settings on how the data is displayed.
+
+     + $symon2web["view"] = show all graphs for all machines ('all') or show
+       only graphs for a single selected machine ('one').
+
+     + $symon2web["magnify"] = to which format should the graph be magnified if
+       clicked on. Values are:
+          '' for no magnification, 
+          'tiny'   =  100 x  75, 
+          'small'  =  200 x 125,
+          'normal' =  300 x 225, 
+          'big'    =  600 x 450, 
+          'huge'   = 1024 x 640.
 
 Portability
 ===========
@@ -85,5 +98,5 @@ symon2web run on POSIX compliant unixes, but the monitoring application itself
 
 Willem Dijkstra <wpd@xs4all.nl>
 
-$Id: INSTALL,v 1.6 2002/09/14 15:58:45 dijkstra Exp $
+$Id: INSTALL,v 1.7 2002/10/18 12:29:09 dijkstra Exp $
 

+ 8 - 4
symon/Makefile.inc

@@ -1,13 +1,13 @@
-# $Id: Makefile.inc,v 1.9 2002/09/16 06:26:24 dijkstra Exp $
+# $Id: Makefile.inc,v 1.10 2002/10/18 12:29:09 dijkstra Exp $
 
-V=2.51
+V=2.52
 
 AR=	ar
 CC=	cc
 .ifdef DEBUG
-CFLAGS= -g -Wall
+CFLAGS+= -g -Wall
 .else
-CFLAGS= -O2 -Wall
+CFLAGS+=-Wall
 .endif
 INSTALL=install
 LORDER=	lorder
@@ -24,6 +24,10 @@ WEBDIR= ${SHRDIR}/web
 PREFIX=/usr/local
 .endif
 
+.ifndef SYSCONDIR
+SYSCONFDIR=/etc
+.endif
+
 .SUFFIXES: .c .o .8 .cat8
 
 .c.o:

+ 3 - 1
symon/TODO

@@ -1,6 +1,8 @@
 TODO:
 
 == current problems / short term
+- rewrite symon2web to allow use on internet websites
+- allow editing of graphing parameters in symon2web
 - add symon2web manual page / readme, explain weird format
 - remove mon packet limit
 
@@ -9,4 +11,4 @@ TODO:
 - write a muxer that supports unix pipes
 - write a client that drives a crystal fontz lcd
 
-$Id: TODO,v 1.19 2002/09/14 15:58:45 dijkstra Exp $
+$Id: TODO,v 1.20 2002/10/18 12:29:09 dijkstra Exp $

+ 4 - 3
symon/lib/lex.c

@@ -1,4 +1,4 @@
-/* $Id: lex.c,v 1.11 2002/08/29 19:38:52 dijkstra Exp $ */
+/* $Id: lex.c,v 1.12 2002/09/20 09:38:11 dijkstra Exp $ */
 
 /*
  * Copyright (c) 2001-2002 Willem Dijkstra
@@ -117,12 +117,13 @@ lex_readline(struct lex *l)
     char *bp;
 
     bp = l->buffer;
-    
+
     if (l->buffer) {
 	if ((l->curpos < l->endpos) && 
 	    ((l->bsize - l->endpos) < _POSIX2_LINE_MAX)) {
 	    l->bsize += _POSIX2_LINE_MAX;
 	    l->buffer = xrealloc(l->buffer, l->bsize);
+	    bp = l->buffer;
 	    bp += l->endpos;
 	} else {
 	    l->curpos = 0;
@@ -308,7 +309,7 @@ open_lex(const char *filename)
 	return NULL;
     }
 
-    lex_nextchar(l);
+    lex_readline(l);
     return l;
 }
 /* Destroy a lexical analyser */

+ 10 - 13
symon/ports/symon/Makefile

@@ -1,20 +1,23 @@
-# $OpenBSD: $
-# $Id: Makefile,v 1.5 2002/09/13 07:42:54 dijkstra Exp $
+# $OpenBSD: Makefile,v 1.1 2002/10/08 07:56:42 dhartmei Exp $
 
 COMMENT=		"active monitoring tool"
-V=			2.51
+V=			2.52
 DISTNAME=		symon-${V}
 CATEGORIES=		net sysutils
 NEED_VERSION=		1.502
 MASTER_SITES=		http://www.xs4all.nl/~wpd/symon/
+
 HOMEPAGE=		http://www.xs4all.nl/~wpd/symon/
 MAINTAINER=		Willem Dijkstra <wpd@xs4all.nl>
 
+# BSD
 PERMIT_PACKAGE_CDROM=	Yes
 PERMIT_PACKAGE_FTP=	Yes
 PERMIT_DISTFILES_CDROM=	Yes
 PERMIT_DISTFILES_FTP=	Yes
 
+SUBPACKAGE?=
+
 # client only package
 MULTI_PACKAGES+=	-mon
 COMMENT-mon=		"active host monitor"
@@ -22,16 +25,11 @@ MON_DEPENDS=
 # gatherer only package
 MULTI_PACKAGES+=	-mux
 COMMENT-mux=		"symon data gatherer"
-MUX_DEPENDS=		rrd.*::net/rrdtool 
-
-# Web frontend only package also depends on php4,
-# but php4.2.2 needs an :php4->=4:www/php4
-# and php<     needs an :php4-core->=4:www/php4
-# => net result = it won't work without php, but the package does not force you
-# to have it.
+MUX_DEPENDS=		rrd:rrdtool-*:net/rrdtool 
+# web frontend only package
 MULTI_PACKAGES+=	-web
 COMMENT-web=		"symon web frontend"
-WEB_DEPENDS=		rrd.*::net/rrdtool
+WEB_DEPENDS=		rrd:rrdtool-*:net/rrdtool php:php4->=4.2.3:www/php4/core
 
 .for i in ${MULTI_PACKAGES}
 FULLPKGNAME${i}=        symon${i}-${V}
@@ -45,7 +43,6 @@ MESSAGE=                ${PKGDIR}/MESSAGE${SUBPACKAGE}
 
 WRKDIST=		${WRKDIR}/symon
 SUBST_VARS=		V
-LIB_DEPENDS=		rrd.*::net/rrdtool 
+BUILD_DEPENDS=		rrd:rrdtool-*:net/rrdtool 
 
 .include <bsd.port.mk>
-

+ 25 - 0
symon/ports/symon/pkg/DEINSTALL-mon

@@ -0,0 +1,25 @@
+#!/bin/sh
+# $Id: DEINSTALL-mon,v 1.1 2002/10/18 12:26:28 dijkstra Exp $
+#
+# symon de-installation
+
+set -e
+PATH=/bin:/usr/bin:/sbin:/usr/sbin
+PREFIX=${PKG_PREFIX:-/usr/local}
+CONFIG_FILE=${SYSCONFDIR}/lftp.conf
+
+if [ -e $CONFIG_FILE ]; then
+    echo
+    echo "+---------------"
+    echo "| To completely deinstall the $1 package you need to perform"
+    echo "| this step as root:"
+    echo "|"
+    echo "|           rm -f $CONFIG_FILE"
+    echo "|"
+    echo "| Do not do this if you plan on re-installing $1"
+    echo "| at some future time."
+    echo "+---------------"
+    echo
+fi
+
+exit 0

+ 1 - 1
symon/ports/symon/pkg/DESCR

@@ -1,5 +1,5 @@
 symon is a lightweight system monitor that measures cpu, memory,
-interface and disk st atistics every 5 seconds. This information is
+interface and disk statistics every 5 seconds. This information is
 then spooled over "the network" to symux for further processing.
 
 The port will yield 4 packages: 

+ 1 - 1
symon/ports/symon/pkg/DESCR-mon

@@ -1,4 +1,4 @@
 symon is a lightweight system monitor that measures cpu, memory,
-interface and disk st atistics every 5 seconds. This information is
+interface and disk statistics every 5 seconds. This information is
 then spooled over "the network" to symux for further processing.
 

+ 1 - 1
symon/ports/symon/pkg/DESCR-web

@@ -1,5 +1,5 @@
 symon is a lightweight system monitor that measures cpu, memory,
-interface and disk st atistics every 5 seconds. This information is
+interface and disk statistics every 5 seconds. This information is
 then spooled over "the network" to symux for further processing.
 
 symon2web is a set of php scripts that provide a view on the data that

+ 67 - 0
symon/ports/symon/pkg/INSTALL-mon

@@ -0,0 +1,67 @@
+#!/bin/sh
+# $Id: INSTALL-mon,v 1.1 2002/10/18 12:26:28 dijkstra Exp $
+#
+# Pre/post-installation setup of symon monitor
+
+# exit on errors, use a sane path and install prefix
+#
+set -e
+PATH=/bin:/usr/bin:/sbin:/usr/sbin
+PREFIX=${PKG_PREFIX:-/usr/local}
+CONFIG_FILE=${SYSCONFDIR}/symon.conf
+SAMPLE_CONFIG_FILE=$PREFIX/share/symon/symon.conf
+
+do_notice()
+{
+    echo
+    echo "+---------------"
+    echo "| The existing $1 configuration file, $CONFIG_FILE,"
+    echo "| has NOT been changed. You may want to compare it to the"
+    echo "| current sample file, $SAMPLE_CONFIG_FILE,"
+    echo "| and update your configuration as needed."
+    echo "+---------------"
+    echo
+}
+
+do_install()
+{
+    $PREFIX/share/symon/c_config.sh 127.0.0.1 2100 > $CONFIG_FILE
+
+    echo
+    echo "+---------------"
+    echo "| The $1 configuration file, $CONFIG_FILE, has been generated by"
+    echo "| $PREFIX/share/symon/c_config.sh.  It has been filled with cpu, memory,"
+    echo "| pf, default disks and interfaces. Please review this file and change"
+    echo "| the configuration to suit your needs."
+    echo "+---------------"
+    echo 
+}
+
+# verify proper execution
+#
+if [ $# -ne 2 ]; then
+    echo "usage: $0 distname { PRE-INSTALL | POST-INSTALL }" >&2
+    exit 1
+fi
+
+# Verify/process the command
+#
+case $2 in
+    PRE-INSTALL)
+        : nothing to pre-install for this port
+        ;;
+    POST-INSTALL)
+	if [ -f $CONFIG_FILE ]; then
+	    do_notice $1
+	else
+	    do_install $1
+	fi
+        ;;
+    *)
+        echo "usage: $0 distname { PRE-INSTALL | POST-INSTALL }" >&2
+        exit 1
+        ;;
+esac
+
+exit 0
+

+ 2 - 2
symon/ports/symon/pkg/PLIST

@@ -1,5 +1,5 @@
-@comment $Id: PLIST,v 1.1 2002/09/09 22:03:27 dijkstra Exp $
-@comment $OpenBSD$
+@comment $Id: PLIST,v 1.2 2002/10/18 12:26:28 dijkstra Exp $
+@comment $OpenBSD: PLIST,v 1.1 2002/10/08 07:56:42 dhartmei Exp $
 libexec/symon
 libexec/symux
 man/cat8/symon.0

+ 3 - 2
symon/ports/symon/pkg/PLIST-mon

@@ -1,6 +1,7 @@
-@comment $Id: PLIST-mon,v 1.1 2002/09/09 22:03:27 dijkstra Exp $
-@comment $OpenBSD$
+@comment $Id: PLIST-mon,v 1.1 2002/10/18 12:26:28 dijkstra Exp $
+@comment $OpenBSD: PLIST-mon,v 1.1 2002/10/08 07:56:42 dhartmei Exp $
 libexec/symon
 man/cat8/symon.0
 share/symon/symon.conf
+share/symon/c_config.sh
 @dirrm share/symon

+ 2 - 2
symon/ports/symon/pkg/PLIST-mux

@@ -1,5 +1,5 @@
-@comment $Id: PLIST-mux,v 1.1 2002/09/09 22:03:27 dijkstra Exp $
-@comment $OpenBSD$
+@comment $Id: PLIST-mux,v 1.2 2002/10/18 12:26:28 dijkstra Exp $
+@comment $OpenBSD: PLIST-mux,v 1.1 2002/10/08 07:56:42 dhartmei Exp $
 libexec/symux
 man/cat8/symux.0
 share/symon/c_smrrds.sh

+ 2 - 2
symon/ports/symon/pkg/PLIST-web

@@ -1,5 +1,5 @@
-@comment $Id: PLIST-web,v 1.2 2002/09/10 18:33:54 dijkstra Exp $
-@comment $OpenBSD$
+@comment $Id: PLIST-web,v 1.3 2002/10/18 12:26:28 dijkstra Exp $
+@comment $OpenBSD: PLIST-web,v 1.1 2002/10/08 07:56:42 dhartmei Exp $
 share/symon/web/class_cpu.inc        
 share/symon/web/class_graph.inc      
 share/symon/web/class_if.inc         

+ 12 - 2
symon/symon/Makefile

@@ -1,4 +1,4 @@
-# $Id: Makefile,v 1.26 2002/09/14 15:49:39 dijkstra Exp $
+# $Id: Makefile,v 1.27 2002/10/18 12:29:48 dijkstra Exp $
 .include "../Makefile.inc"
 
 LIBS=	-L../lib -lsymon
@@ -15,11 +15,21 @@ symon: ${OBJS}
 .endif
 
 clean:
-	rm -f symon symon.cat8 ${OBJS}
+	rm -f conf.h symon symon.cat8 ${OBJS}
 
 install: symon symon.cat8 symon.conf
 	${INSTALL} -c -m 555  -g wheel -o root symon      ${PREFIX}/${BINDIR}
 	${INSTALL} -c -m 444  -g wheel -o root symon.cat8 ${PREFIX}/${MANDIR}/cat8/symon.0
 	${INSTALL} -d -m 555  -g bin   -o root ${PREFIX}/${SHRDIR}
 	${INSTALL} -c -m 444  -g bin   -o root symon.conf ${PREFIX}/${SHRDIR}
+	${INSTALL} -c -m 555  -g wheel -o root c_config.sh ${PREFIX}/${SHRDIR}
 
+conf.h:  Makefile
+	@echo Generating conf.h
+	@echo "/* This file was automagically generated by make */" > $@
+	@echo "#define SYMON_CONFIG_FILE \"$(SYSCONFDIR)/symon.conf\""  >> $@
+	@echo "#define SYMON_VERSION \"$(V)\"" >> $@
+
+symon.h: conf.h
+
+symon.o: symon.h

+ 41 - 0
symon/symon/c_config.sh

@@ -0,0 +1,41 @@
+#!/bin/sh
+# $Id: c_config.sh,v 1.1 2002/10/18 12:29:48 dijkstra Exp $
+#
+# Create an example configuration file for symon on a host and print to stdout
+
+# exit on errors, use a sane path and install prefix
+#
+set -e
+PATH=/bin:/usr/bin:/sbin:/usr/sbin
+
+# verify proper execution
+#
+if [ $# -ge 3 ]; then
+    echo "usage: $0 [host] [port]" >&2
+    exit 1
+fi
+
+interfaces=`netstat -ni | sed '1,1d;s/^\([a-z]*[0-9]\).*$/\1/g' | uniq`
+for i in $interfaces; do
+case $i in
+bridge*|enc*|gif*|gre*|lo*|pflog*|ppp*|sl*|tun*|vlan*)
+	# ignore this interface
+	;;
+*)
+	if="if($i), $if"
+	;;
+esac
+done
+io=`mount | sed '1,1d;s/^\/dev\/\([a-z]*[0-9]\).*$/io(\1), /g' | uniq | tr -d \\\n`
+host=${1:-127.0.0.1}
+port=${2:-2100}
+cat <<EOF
+#
+# symon configuration generated by  
+# `basename $0` $1 $2 
+#
+monitor { $if 
+          $io 
+          cpu(0), mem } stream to $host:$port
+EOF
+

+ 1 - 3
symon/symon/readconf.c

@@ -1,4 +1,4 @@
-/* $Id: readconf.c,v 1.10 2002/09/14 15:49:39 dijkstra Exp $ */
+/* $Id: readconf.c,v 1.11 2002/10/18 12:29:48 dijkstra Exp $ */
 
 /*
  * Copyright (c) 2001-2002 Willem Dijkstra
@@ -190,8 +190,6 @@ read_config_file(struct muxlist *muxlist,
     if ((l = open_lex(filename)) == NULL)
 	return 0;
     
-    info("reading configfile '%s'", filename);
-
     while (lex_nexttoken(l)) {
     /* expecting keyword now */
 	switch (l->op) {

+ 6 - 0
symon/symon/symon.8

@@ -36,6 +36,7 @@
 .Sh SYNOPSIS
 .Nm 
 .Op Fl vd
+.Op Fl f Ar filename
 .Pp
 .Sh DESCRIPTION
 .Nm
@@ -71,6 +72,11 @@ Show version information.
 Stop 
 .Nm
 from becoming a daemon and show debug information on stdout.
+.It Fl f Ar filename
+Read configuration from 
+.Ar filename
+instead of 
+.Pa /etc/symon.conf .
 .El
 .Sh CONFIGURATION
 .Nm

+ 57 - 29
symon/symon/symon.c

@@ -1,4 +1,4 @@
-/* $Id: symon.c,v 1.24 2002/09/14 15:49:39 dijkstra Exp $ */
+/* $Id: symon.c,v 1.26 2002/10/18 12:29:48 dijkstra Exp $ */
 
 /*
  * Copyright (c) 2001-2002 Willem Dijkstra
@@ -38,6 +38,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
+#include <sysexits.h>
 #include <syslog.h>
 #include <unistd.h>
 
@@ -67,7 +68,7 @@ struct funcmap streamfunc[] = {
     {MT_EOT, NULL, NULL}
 };
 
-/* Alarmhandler that gets called every SYMON_INTERVAL */
+/* alarmhandler that gets called every SYMON_INTERVAL */
 void 
 alarmhandler(int s) {
     /* EMPTY */
@@ -106,6 +107,10 @@ main(int argc, char *argv[])
     struct stream *stream;
     struct mux *mux;
     FILE *f;
+    char *cfgfile;
+    char *cfgpath;
+    char *stringptr;
+    int maxstringlen;
     int ch;
     int i;
 
@@ -114,20 +119,45 @@ main(int argc, char *argv[])
     /* reset flags */
     flag_debug = 0;
     flag_daemon = 0;
+    cfgfile = SYMON_CONFIG_FILE;
 
-    while ((ch = getopt(argc, argv, "dv")) != -1) {
+    while ((ch = getopt(argc, argv, "dvf:")) != -1) {
 	switch (ch) {
 	case 'd':
 	    flag_debug = 1;
+	    break;
+	case 'f':
+	    if (optarg && optarg[0] != '/') {
+		/* cfg path needs to be absolute, we will be a daemon soon */
+		if ((cfgpath = getwd(NULL)) == NULL)
+		    fatal("could not get working directory");
+		
+		maxstringlen = strlen(cfgpath) + strlen(optarg) + 1;
+		cfgfile = xmalloc(maxstringlen);
+		strncpy(cfgfile, cfgpath, maxstringlen);
+		stringptr = cfgfile + strlen(cfgpath);
+		stringptr[0] = '/';
+		stringptr++;
+		strncpy(stringptr, optarg, maxstringlen - (cfgfile - stringptr));
+		cfgfile[maxstringlen] = '\0';
+
+		free(cfgpath);
+	    } else 
+		cfgfile = xstrdup(optarg);
+
 	    break;
 	case 'v':
 	    info("symon version %s", SYMON_VERSION);
 	default:
-	    info("usage: %s [-d] [-v]", __progname);
-	    exit(1);
+	    info("usage: %s [-d] [-v] [-f cfgfile]", __progname);
+	    exit(EX_USAGE);
 	}
     }
 
+    /* parse configuration file */
+    if (!read_config_file(&mul, cfgfile))
+	fatal("configuration contained errors; quitting");
+
     setegid(getgid());
     setgid(getgid());
 
@@ -147,20 +177,17 @@ main(int argc, char *argv[])
 
     info("symon version %s", SYMON_VERSION);
 
-    if (!read_config_file(&mul, SYMON_CONFIG_FILE))
-	fatal("configuration contained errors; quitting");
-
     if (flag_debug == 1)
 	info("program id=%d", (u_int) getpid());
 
-    /* Setup signal handlers */
+    /* setup signal handlers */
     signal(SIGALRM, alarmhandler);
     signal(SIGHUP, huphandler);
     signal(SIGINT, exithandler); 
     signal(SIGQUIT, exithandler); 
     signal(SIGTERM, exithandler); 
 
-    /* Prepare crc32 */
+    /* prepare crc32 */
     init_crc32();
 
     /* init modules */
@@ -171,7 +198,7 @@ main(int argc, char *argv[])
 	}
     }
 
-    /* Setup alarm */
+    /* setup alarm */
     timerclear(&alarminterval.it_interval);
     timerclear(&alarminterval.it_value);
     alarminterval.it_interval.tv_sec=
@@ -189,13 +216,13 @@ main(int argc, char *argv[])
 
 	    SLIST_INIT(&newmul);
 
-	    if (!read_config_file(&newmul, SYMON_CONFIG_FILE)) {
+	    if (!read_config_file(&newmul, cfgfile)) {
 		info("new configuration contains errors; keeping old configuration");
 		free_muxlist(&newmul);
 	    } else {
 		free_muxlist(&mul);
 		mul = newmul;
-		info("read configuration file succesfully");
+		info("read configuration file '%.100s' succesfully", cfgfile);
 
 		/* init modules */
 		SLIST_FOREACH(mux, &mul, muxes) {
@@ -205,24 +232,25 @@ main(int argc, char *argv[])
 		    }
 		}
 	    }
-	}
-
-	/* populate data space for modules that get all their measurements in
-           one go */
-	for (i=0; i<MT_EOT; i++)
-	    if (streamfunc[i].gets != NULL)
-		(streamfunc[i].gets)();
-
-	SLIST_FOREACH(mux, &mul, muxes) {
-	    prepare_packet(mux);
+	} else {
 	    
-	    SLIST_FOREACH(stream, &mux->sl, streams)
-		stream_in_packet(stream, mux);
-
-	    finish_packet(mux);
-
-	    send_packet(mux);
+	    /* populate for modules that get all their measurements in one go */
+	    for (i=0; i<MT_EOT; i++)
+		if (streamfunc[i].gets != NULL)
+		    (streamfunc[i].gets)();
+	    
+	    SLIST_FOREACH(mux, &mul, muxes) {
+		prepare_packet(mux);
+		
+		SLIST_FOREACH(stream, &mux->sl, streams)
+		    stream_in_packet(stream, mux);
+		
+		finish_packet(mux);
+		
+		send_packet(mux);
+	    }
 	}
     }
     /* NOTREACHED */
+    return (EX_SOFTWARE);
 }

+ 2 - 9
symon/symon/symon.conf

@@ -1,14 +1,7 @@
 #
-# $Id: mon.conf,v 1.8 2002/08/29 19:38:53 dijkstra Exp $
+# $Id: symon.conf,v 1.9 2002/10/18 12:29:48 dijkstra Exp $
 #
-# Initial mon.conf demonstrates how I configure mon.
-
-# monitor { <cpu(arg)|mem|if(arg)|io(arg)> } stream [to] <host>:<port>
-#
-# cpu(x) - gather stats for cpu nr. x
-# mem    - gather memory stats
-# if(x)  - gather io stats for interface x
-# io(x)  - gather io stats for disk x.
+# Demo configuration for symon. See symon(8) for BNF.
 
 monitor { cpu(0),  mem,     if(xl0), if(de0),
 	  if(lo0), if(wi0), io(wd0), io(wd1), 

+ 2 - 3
symon/symon/symon.h

@@ -1,4 +1,4 @@
-/* $Id: symon.h,v 1.20 2002/09/16 06:26:26 dijkstra Exp $ */
+/* $Id: symon.h,v 1.21 2002/10/18 12:29:48 dijkstra Exp $ */
 
 /*
  * Copyright (c) 2001-2002 Willem Dijkstra
@@ -37,10 +37,9 @@
 
 #include "lex.h"
 #include "data.h"
+#include "conf.h"
 
-#define SYMON_CONFIG_FILE "/etc/symon.conf"
 #define SYMON_PID_FILE    "/var/run/symon.pid"
-#define SYMON_VERSION     "2.51"
 #define SYMON_INTERVAL 5                           /* measurement interval */
 #define SYMON_WARN_SENDERR 50                      /* warn every x errors */
 #define SYMON_MAX_DOBJECTS  100                    /* max dynamic alloction

+ 2 - 2
symon/symon2web/class_graph.inc

@@ -1,5 +1,5 @@
 <?php
-// $Id: class_graph.inc,v 1.5 2002/08/16 12:50:16 dijkstra Exp $
+// $Id: class_graph.inc,v 1.6 2002/10/18 12:30:20 dijkstra Exp $
 //
 // Base class for all graph classes. 
 
@@ -96,7 +96,7 @@ class Graph {
 		    $ar = $this->shortcut[$key][$value];
 		    while (list($itemkey,$itemvalue) = each($ar)) {
 			if (is_array($this->shortcut[$key][$value][$itemkey])) {
-			    $myparams[$itemkey] = array_merge(array(),&$this->shortcut[$key][$value][$itemkey]);
+			    $myparams[$itemkey] = array_merge(array(),$this->shortcut[$key][$value][$itemkey]);
 			} else if (is_scalar($itemvalue)) {
 			    $myparams[$itemkey] = $itemvalue;
 			}

+ 11 - 1
symon/symon2web/datasources.inc

@@ -1,7 +1,17 @@
 <?php
-// $Id: datasources.inc,v 1.9 2002/09/14 15:55:54 dijkstra Exp $
+// $Id: datasources.inc,v 1.10 2002/10/18 12:30:20 dijkstra Exp $
 //
 // Contains definitions where the data files are to be found
 $symon2web["tree"]='/export/store_3/symon';
 
+// Show all datasources at once or provide a selection of hosts to be shown
+// Values: all|one
+//$symon2web["view"]='one';
+$symon2web["view"]='all';
+
+// Click on graph is zoom to this size
+// Values: '' = not clickable | tiny | small | normal | big | huge
+//$symon2web["magnify"]='';
+$symon2web["magnify"]='big';
+
 ?>

+ 1 - 1
symon/symon2web/graph_cpu.php

@@ -2,6 +2,6 @@
 require_once("datasources.inc");
 require_once("class_cpu.inc");
 $g = new CPU_Graph();
-$g->execute($GLOBALS["QUERY_STRING"]);;
+$g->execute($HTTP_SERVER_VARS["QUERY_STRING"]);
 $g->sendimage();
 ?>

+ 1 - 1
symon/symon2web/graph_if.php

@@ -2,6 +2,6 @@
 require_once("datasources.inc");
 require_once("class_if.inc");
 $g = new IF_Graph();
-$g->execute($GLOBALS["QUERY_STRING"]);
+$g->execute($HTTP_SERVER_VARS["QUERY_STRING"]);
 $g->sendimage();
 ?>

+ 1 - 1
symon/symon2web/graph_io.php

@@ -2,6 +2,6 @@
 require_once("datasources.inc");
 require_once("class_io.inc");
 $g = new IO_Graph();
-$g->execute($GLOBALS["QUERY_STRING"]);
+$g->execute($HTTP_SERVER_VARS["QUERY_STRING"]);
 $g->sendimage();
 ?>

+ 1 - 1
symon/symon2web/graph_mem.php

@@ -2,6 +2,6 @@
 require_once("datasources.inc");
 require_once("class_mem.inc");
 $g = new MEM_Graph();
-$g->execute($GLOBALS["QUERY_STRING"]);
+$g->execute($HTTP_SERVER_VARS["QUERY_STRING"]);
 $g->sendimage();
 ?>

+ 1 - 1
symon/symon2web/graph_pf.php

@@ -2,6 +2,6 @@
 require_once("datasources.inc");
 require_once("class_pf.inc");
 $g = new PF_Graph();
-$g->execute($GLOBALS["QUERY_STRING"]);
+$g->execute($HTTP_SERVER_VARS["QUERY_STRING"]);
 $g->sendimage();
 ?>

+ 72 - 28
symon/symon2web/index.php

@@ -6,8 +6,8 @@ require_once('class_io.inc');
 require_once('class_mem.inc');
 require_once('class_pf.inc');
 
-if (!empty($GLOBALS["QUERY_STRING"])) {
-    $args = $GLOBALS["QUERY_STRING"];
+if (!empty($HTTP_SERVER_VARS["QUERY_STRING"])) {
+    $args = $HTTP_SERVER_VARS["QUERY_STRING"];
     // rework args to contain ony last set 'command' 
     $options = array();
     $allargs = explode('&', $args);
@@ -15,6 +15,10 @@ if (!empty($GLOBALS["QUERY_STRING"])) {
     while ($i < count($allargs)) {
 	$operand = split('=', $allargs[$i]);
 	if (count($operand) == 2) {
+	    // options for this page
+	    if ($operand[0] == "machine") {
+		$selected_machine = $operand[1];
+	    }
 	    $options[$operand[0]]=$operand[1];
 	}
 	$i++;
@@ -145,17 +149,39 @@ function print_index_url($new_args) {
         <table bgcolor="#6699CC" border="0" cellpadding="0" cellspacing="0">
          <tr>
 <?
+	 // get machines
 	 $root_dir = dir($symon2web["tree"]);
          while ($machine = $root_dir->read()) {
 	     if ($machine != '.' && 
 		 $machine != '..' && 
 		 is_dir($symon2web["tree"]."/".$machine)) {
-		 print '
+		 $symon2web["machine"][$machine] = $symon2web["tree"]."/".$machine;
+
+		 if ($machine == $selected_machine) {
+		     $selected_dir = $symon2web["machine"][$machine];
+		 }
+	     }
+	 }
+
+         // show blue bar
+         if ($symon2web["view"] == "one") {
+	     print '
           <td><a class="blue" href="';
-		 print_index_url("#" . $machine);
-		 print '">'. $machine . '</a>&nbsp;&nbsp;&nbsp;</td>
+	     print_index_url("machine=all");
+	     print '">all machines</a>&nbsp;&nbsp;&nbsp;</td>
 ';
+	 }
+	     
+         reset($symon2web["machine"]);
+         while (list($machine, $dir) = each($symon2web["machine"])) {
+	     print '
+          <td><a class="blue" href="';
+	     if ($symon2web["view"] == "one") {
+		 print_index_url("machine=" . $machine);
+	     } else {
+		 print_index_url("#" . $machine);
 	     }
+	     print '">'. $machine . "</a>&nbsp;&nbsp;&nbsp;</td>\n";
 	 }
 ?>
 	 </tr>
@@ -166,44 +192,62 @@ function print_index_url($new_args) {
 	
 <?php
 // traverse through the symonrrd tree
-  $root_dir = dir($symon2web["tree"]);
   $found_machine = 0;
-  while ($machine = $root_dir->read()) {
-      if ($machine != '.' && 
-	  $machine != '..' && 
-	  is_dir($symon2web["tree"]."/".$machine)) {
-	  print '
+  reset($symon2web["machine"]);
+// only allow a single machine in the machine array if selected machine is set
+  if ($symon2web["view"] == "one" && $selected_machine != "all" ) {
+      unset($symon2web["machine"]);
+      if ($selected_machine) {
+	  $symon2web["machine"][$selected_machine] = $selected_dir;
+      }
+  }
+// show graphs for each machine in the machine array
+  while (list($machine, $dir) = each($symon2web["machine"])) {
+      print '
         <!-- item start -->
         <div class="header">
 	 <a class="header" name="'. $machine . '">'. $machine. '</a><br />
 	</div>
 ';
-	  $machine_dir = dir($symon2web["tree"]."/".$machine);
-	  while ($filename = $machine_dir->read()) {
-	      $file = $symon2web["tree"]."/".$machine."/".$filename;
-	      if (is_file($file) && 
-		  preg_match("/^(cpu|if|io|mem|pf)(_([a-z]+))?([0-9]?).rrd$/", 
-			     $filename, $match)) {
-		  $rrdtype = $match[1];
-		  $rrdwhat = $match[3];
-		  $rrdwhich = $match[4];
-		  
-		  $cmd = make_graph_url($rrdtype,
-					"rrdfile=".$file.
-					"&name=".$rrdwhat.$rrdwhich);
+      $machine_dir = dir($dir);
+      while ($filename = $machine_dir->read()) {
+	  $file = $dir."/".$filename;
+	  if (is_file($file) && 
+	      preg_match("/^(cpu|if|io|mem|pf)(_([a-z]+))?([0-9]?).rrd$/", 
+			 $filename, $match)) {
+	      $rrdtype = $match[1];
+	      $rrdwhat = $match[3];
+	      $rrdwhich = $match[4];
+	      
+	      $cmd = make_graph_url($rrdtype,
+				    "rrdfile=".$file.
+				    "&name=".$rrdwhat.$rrdwhich);
+	      if ($symon2web["magnify"] != '') {
+		  $magcmd = make_graph_url($rrdtype,
+					   "rrdfile=".$file.
+					   "&name=".$rrdwhat.$rrdwhich.
+					   "&size=".$symon2web["magnify"]);
+		  print '<a class="graph" href="'. $magcmd . '"> <img src="' . $cmd . 
+		      '" alt="'. $rrdtype . $rrdwhat . $rrdwhich .'"></a>'."\n";
+	      } else {
 		  print '<img src="' . $cmd . '" alt="'. $rrdtype . $rrdwhat . $rrdwhich .'">'."\n";
-		  $found_machine++;
 	      }
+
+	      $found_machine++;
 	  }
-	  print '
+      }
+      print '
         <div class="item-footer"></div>
 ';
 
-      }
   }
   
   if ($found_machine == 0) {
-      print 'Did not find any host directories in '.$symon2web["tree"].'<br>';
+      if ($symon2web["view"] == "one") {
+	  print 'Please select a machine';
+      } else {
+	  print 'Did not find any host directories in '.$symon2web["tree"].'<br>';
+      }
   }
 ?>
        <div class="copyright">Copyright &copy; 2002 Willem Dijkstra</div>

+ 10 - 0
symon/symon2web/symon.css

@@ -61,6 +61,16 @@ a.blue:hover {
 	background-color:#4578AB;
 } 
 
+a.graph { 
+	text-decoration: none; 
+	padding-left:0px; 
+	padding-right:0px; 
+	font-size:11px; 
+	color: #FFFFFF; 
+	line-height:0px; 
+	background-color:#FFFFF;
+} 
+
 a.source { 
 	font-family:Courier, MS Courier New, Prestige, Everson Mono; 
 	font-size:12px; 

+ 11 - 2
symon/symux/Makefile

@@ -1,4 +1,4 @@
-# $Id: Makefile,v 1.14 2002/09/14 15:54:55 dijkstra Exp $
+# $Id: Makefile,v 1.15 2002/10/18 12:30:48 dijkstra Exp $
 .include "../Makefile.inc"
 
 SRCS=	symux.c readconf.c symuxnet.c share.c
@@ -15,7 +15,7 @@ symux: ${OBJS}
 .endif
 
 clean:
-	rm -f symux symux.cat8 ${OBJS}
+	rm -f conf.h symux symux.cat8 ${OBJS}
 
 install: symux symux.cat8 c_smrrds.sh symux.conf
 	${INSTALL} -c -m 555 -g bin   -o root symux      ${PREFIX}/${BINDIR}
@@ -28,3 +28,12 @@ cleanipc:
 	ipcs | egrep "^m" | awk '{print $$2}' | xargs -n1 ipcrm -m &
 	ipcs | egrep "^s" | awk '{print $$2}' | xargs -n1 ipcrm -s 
 
+conf.h:  Makefile
+	@echo Generating conf.h
+	@echo "/* This file was automagically generated by make */" > $@
+	@echo "#define SYMUX_CONFIG_FILE \"$(SYSCONFDIR)/symux.conf\""  >> $@
+	@echo "#define SYMUX_VERSION \"$(V)\"" >> $@
+
+symux.h: conf.h
+
+symux.o: symux.h

+ 1 - 3
symon/symux/readconf.c

@@ -1,4 +1,4 @@
-/* $Id: readconf.c,v 1.13 2002/09/14 15:54:55 dijkstra Exp $ */
+/* $Id: readconf.c,v 1.14 2002/10/18 12:30:48 dijkstra Exp $ */
 
 /*
  * Copyright (c) 2001-2002 Willem Dijkstra
@@ -263,8 +263,6 @@ read_config_file(struct muxlist *mul,
     if ((l = open_lex(filename)) == NULL)
 	return 0;
     
-    info("reading configfile '%s'", filename);
-
     while (lex_nexttoken(l)) {
     /* expecting keyword now */
 	switch (l->op) {

+ 93 - 88
symon/symux/symux.c

@@ -1,4 +1,4 @@
-/* $Id: symux.c,v 1.22 2002/09/14 15:54:56 dijkstra Exp $ */
+/* $Id: symux.c,v 1.24 2002/10/18 12:30:48 dijkstra Exp $ */
 
 /*
  * Copyright (c) 2001-2002 Willem Dijkstra
@@ -71,7 +71,7 @@ exithandler(int s) {
 }
 void
 huphandler(int s) {
-    info("sighup (%d) received", s);
+    info("hup received");
     flag_hup = 1;
 }
 /* 
@@ -117,16 +117,16 @@ main(int argc, char *argv[])
 	
     /* reset flags */
     flag_debug = 0;
-    flag_daemon = 0;
-    
+    flag_daemon = 0;    
     cfgfile = SYMUX_CONFIG_FILE;
+
     while ((ch = getopt(argc, argv, "dvf:")) != -1) {
 	switch (ch) {
 	case 'd':
 	    flag_debug = 1;
 	    break;
 	case 'f':
-	    if (optarg && optarg[1] != '/') {
+	    if (optarg && optarg[0] != '/') {
 		/* cfg path needs to be absolute, we will be a daemon soon */
 		if ((cfgpath = getwd(NULL)) == NULL)
 		    fatal("could not get working directory");
@@ -153,6 +153,13 @@ main(int argc, char *argv[])
 	}
     }
 
+    /* parse configuration file */
+    if (!read_config_file(&mul, &sol, cfgfile))
+	fatal("configuration contained errors; quitting");
+
+    setegid(getgid());
+    setgid(getgid());
+
     if (flag_debug != 1) {
 	if (daemon(0,0) != 0)
 	    fatal("daemonize failed");
@@ -169,11 +176,6 @@ main(int argc, char *argv[])
     
     info("symux version %s", SYMUX_VERSION);
 
-    /* parse configuration file */
-    if (!read_config_file(&mul, &sol, cfgfile))
-	fatal("configuration contained errors; quitting");
-
-
     if (flag_debug == 1)
 	info("program id=%d", (u_int) getpid());
 
@@ -190,7 +192,7 @@ main(int argc, char *argv[])
     signal(SIGTERM, exithandler);
     signal(SIGTERM, exithandler); 
 
-    /* Prepare crc32 */
+    /* prepare crc32 */
     init_crc32();
 
     getsymonsocket(mux);
@@ -210,7 +212,7 @@ main(int argc, char *argv[])
 		free_muxlist(&newmul);
 		free_sourcelist(&newsol);
 	    } else {
-		info("read configuration file succesfully");
+		info("read configuration file '%.100s' succesfully", cfgfile);
 		free_muxlist(&mul);
 		free_sourcelist(&sol);
 		mul = newmul;
@@ -219,93 +221,96 @@ main(int argc, char *argv[])
 		getsymonsocket(mux);
 		getclientsocket(mux);
 	    }
-	    break; /* wait for next alarm */
-	} 
+	} else {
 
-	/* Put information from packet into stringbuf (shared region). Note
-	 * that the stringbuf is used twice: 1) to update the rrdfile and 2) to
-	 * collect all the data from a single packet that needs to shared to
-	 * the clients. This is the reason for the hasseling with stringptr.
-	 */
-	
-	offset = mux->offset;
-	maxstringlen = shared_getmaxlen();
-	/* put time:ip: into shared region */
-	master_forbidread();
-	timestamp = (time_t) packet.header.timestamp;
-	stringbuf = (char *)shared_getmem();
-	snprintf(stringbuf, maxstringlen, "%u.%u.%u.%u;",
-		 IPAS4BYTES(source->ip));
-	
-	/* hide this string region from rrd update */
-	maxstringlen -= strlen(stringbuf);
-	stringptr = stringbuf + strlen(stringbuf);
-	
-	while (offset < packet.header.length) {
-	    bzero(&ps, sizeof(struct packedstream));
-	    offset += sunpack(packet.data + offset, &ps);
+	    /* Put information from packet into stringbuf (shared region). Note
+	     * that the stringbuf is used twice: 1) to update the rrdfile and 2) to
+	     * collect all the data from a single packet that needs to shared to
+	     * the clients. This is the reason for the hasseling with stringptr.
+	     */
 	    
-	    /* find stream in source */
-	    stream = find_source_stream(source, ps.type, ps.args);
+	    offset = mux->offset;
+	    maxstringlen = shared_getmaxlen();
+	    /* put time:ip: into shared region */
+	    master_forbidread();
+	    timestamp = (time_t) packet.header.timestamp;
+	    stringbuf = (char *)shared_getmem();
+	    snprintf(stringbuf, maxstringlen, "%u.%u.%u.%u;",
+		     IPAS4BYTES(source->ip));
 	    
-	    if (stream != NULL) {
-		/* put type in and hide from rrd */
-		snprintf(stringptr, maxstringlen, "%s:", type2str(ps.type));
-		maxstringlen -= strlen(stringptr);
-		stringptr += strlen(stringptr);
-		/* put arguments in and hide from rrd */
-		snprintf(stringptr, maxstringlen, "%s:", 
-			 ((ps.args == NULL) ? "0" : ps.args));
-		maxstringlen -= strlen(stringptr);
-		stringptr += strlen(stringptr);
-		/* put timestamp in and show to rrd */
-		snprintf(stringptr, maxstringlen, "%u", timestamp);
-		arg_ra[3] = stringptr;
-		maxstringlen -= strlen(stringptr);
-		stringptr += strlen(stringptr);
+	    /* hide this string region from rrd update */
+	    maxstringlen -= strlen(stringbuf);
+	    stringptr = stringbuf + strlen(stringbuf);
+	    
+	    while (offset < packet.header.length) {
+		bzero(&ps, sizeof(struct packedstream));
+		offset += sunpack(packet.data + offset, &ps);
 		
-		/* put measurements in */
-		ps2strn(&ps, stringptr, maxstringlen, PS2STR_RRD);
+		/* find stream in source */
+		stream = find_source_stream(source, ps.type, ps.args);
 		
-		if (stream->file != NULL) {
-		    /* save if file specified */
-		    arg_ra[0] = "rrdupdate";
-		    arg_ra[1] = "--";
-		    arg_ra[2] = stream->file;
+		if (stream != NULL) {
+		    /* put type in and hide from rrd */
+		    snprintf(stringptr, maxstringlen, "%s:", type2str(ps.type));
+		    maxstringlen -= strlen(stringptr);
+		    stringptr += strlen(stringptr);
+		    /* put arguments in and hide from rrd */
+		    snprintf(stringptr, maxstringlen, "%s:", 
+			     ((ps.args == NULL) ? "0" : ps.args));
+		    maxstringlen -= strlen(stringptr);
+		    stringptr += strlen(stringptr);
+		    /* put timestamp in and show to rrd */
+		    snprintf(stringptr, maxstringlen, "%u", timestamp);
+		    arg_ra[3] = stringptr;
+		    maxstringlen -= strlen(stringptr);
+		    stringptr += strlen(stringptr);
 		    
-		    /* This call will cost a lot (symux will become
-		     * unresponsive and eat up massive amounts of cpu) if
-		     * the rrdfile is out of sync. While I could update the
-		     * rrd in a separate process, I choose not to at this
-		     * time.  
-		     */
-		    rrd_update(4, arg_ra);
+		    /* put measurements in */
+		    ps2strn(&ps, stringptr, maxstringlen, PS2STR_RRD);
 		    
-		    if (rrd_test_error()) {
-			warning("rrd_update:%s", rrd_get_error());
-			warning("%s %s %s %s", arg_ra[0], arg_ra[1], 
-				arg_ra[2], arg_ra[3]);
-			rrd_clear_error();                                                            
-		    } else {
-			if (flag_debug == 1) 
-			    debug("%s %s %s %s", arg_ra[0], arg_ra[1], 
-				  arg_ra[2], arg_ra[3]);
+		    if (stream->file != NULL) {
+			/* clear optind for getopt call by rrdupdate */
+			optind = 0;
+			/* save if file specified */
+			arg_ra[0] = "rrdupdate";
+			arg_ra[1] = "--";
+			arg_ra[2] = stream->file;
+			
+			/* This call will cost a lot (symux will become
+			 * unresponsive and eat up massive amounts of cpu) if
+			 * the rrdfile is out of sync. While I could update the
+			 * rrd in a separate process, I choose not to at this
+			 * time.  
+			 */
+			rrd_update(4, arg_ra);
+			
+			if (rrd_test_error()) {
+			    warning("rrd_update:%s", rrd_get_error());
+			    warning("%s %s %s %s", arg_ra[0], arg_ra[1], 
+				    arg_ra[2], arg_ra[3]);
+			    rrd_clear_error();                                                            
+			} else {
+			    if (flag_debug == 1) 
+				debug("%s %s %s %s", arg_ra[0], arg_ra[1], 
+				      arg_ra[2], arg_ra[3]);
+			}
 		    }
-		}
-		maxstringlen -= strlen(stringptr);
-		stringptr += strlen(stringptr);
-		snprintf(stringptr, maxstringlen, ";");
+		    maxstringlen -= strlen(stringptr);
+		    stringptr += strlen(stringptr);
+		    snprintf(stringptr, maxstringlen, ";");
 		maxstringlen -= strlen(stringptr);
 		stringptr += strlen(stringptr);
+		}
 	    }
-	}
-	/* packet = parsed and in ascii in shared region -> copy to clients */
-	snprintf(stringptr, maxstringlen, "\n");
-	stringptr += strlen(stringptr);
-	shared_setlen((stringptr - stringbuf));
-	debug("Churnbuffer used: %d", (stringptr - stringbuf));
-	master_permitread();
-    }
+	    /* packet = parsed and in ascii in shared region -> copy to clients */
+	    snprintf(stringptr, maxstringlen, "\n");
+	    stringptr += strlen(stringptr);
+	    shared_setlen((stringptr - stringbuf));
+	    debug("Churnbuffer used: %d", (stringptr - stringbuf));
+	    master_permitread();
+	} /* flag_hup == 0 */
+    } /* forever */
+
     /* NOT REACHED */
     return (EX_SOFTWARE);
 }

+ 3 - 26
symon/symux/symux.conf

@@ -1,38 +1,14 @@
 #
-# $Id: symux.conf,v 1.17 2002/09/14 15:54:56 dijkstra Exp $
-#
-# Initial symux.conf demonstrates how I configure symux.
-
-#
-# hub <hubname> defines the destination of all monitored data described in this
-# configuration file.
-#
-# note that symux listens for incoming symon traffic on udp 2100 and incoming
-# client connections on tcp 2100
+# $Id: symux.conf,v 1.18 2002/10/18 12:30:48 dijkstra Exp $
 #
+# Demo symux configuration. See symux(8) for BNF.
 
 mux 10.0.0.1:2100
 
-#
-# source <hostname> defines a source of monitored data. 
-#
 source 10.0.0.1 {
-
-	# All accepted formats have to be defined explicitly. 
-	#
-	# cpu(x) - gather stats for cpu nr. x
-	# mem    - gather memory stats
-	# if(x)  - gather io stats for interface x
-	# io(x)  - gather io stats for disk x.
-
 	accept { cpu(0), mem, if(xl0), if(de0),
 	         if(lo0), io(wd0), io(wd1), 
                  io(wd2), io(wd3), io(cd0)}
-	
-	# Define where data should be put
-	#
-	# Accepted sources that are not written out will be 
-	# discarded.
 
 	write cpu(0)   in "/export/symon/www/cpu0.rrd"
 	write mem      in "/export/symon/www/mem.rrd"
@@ -48,6 +24,7 @@ source 10.0.0.1 {
 
 	write io(cd0)  in "/export/symon/www/io_cd0.rrd"
 }
+
 source 10.0.0.2 {
 	accept { cpu(0), mem, if(sis0), if(sis1),
 		 if(lo0), if(wi0), io(wd0) }

+ 3 - 3
symon/symux/symux.h

@@ -1,4 +1,4 @@
-/* $Id: symux.h,v 1.14 2002/09/16 06:26:27 dijkstra Exp $ */
+/* $Id: symux.h,v 1.15 2002/10/18 12:30:48 dijkstra Exp $ */
 
 /*
  * Copyright (c) 2001-2002 Willem Dijkstra
@@ -33,9 +33,9 @@
 #ifndef _SYMUX_SYMUX_H
 #define _SYMUX_SYMUX_H
 
-#define SYMUX_CONFIG_FILE "/etc/symux.conf"
+#include "conf.h"
+
 #define SYMUX_PID_FILE "/var/run/symux.pid"
-#define SYMUX_VERSION "2.51"
 
 /* Amount of connections allowed in listen backlog 
  * - note that more than 128 makes no sense in OpenBSD