Selaa lähdekoodia

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

Wictor Lund 3 vuotta sitten
vanhempi
commit
907a0fc143

+ 90 - 73
symon/CHANGELOG

@@ -1,89 +1,103 @@
+24/01/2002 - 2.58
+
+   Gustavo Chamone helped find a rare bug in symon/sm_io.c. strsep()
+   would clobber stream information and make the first stream in the
+   configuration file disappear.
+
+   Daniel Hartmeier patched symon/sm_pf.c to deal with changes pf. His
+   patch should also work for previous versions of pf.
+
 10/01/2002 - 2.57
 
-   Christian Weisgerber reported that netinet/ip_ipsp.h already defines htonq - fixed.
-   Will Wainwright reported 1) a small bug in test_config.php - fixed, 2) that
-   I left out some files (class_proc.inc and class_debug.inc) from the PLIST
-   files.
+   Christian Weisgerber reported that netinet/ip_ipsp.h already defines
+   htonq - fixed. Will Wainwright reported 1) a small bug in
+   test_config.php - fixed, 2) that I left out some files
+   (class_proc.inc and class_debug.inc) from the PLIST files.
 
 29/12/2002 - 2.56
 
-   Added proc and debug symon2web frontends. Debug has limited useability, you
-   are better off defining one for yourself.
+   Added proc and debug symon2web frontends. Debug has limited
+   useability, you are better off defining one for yourself.
 
 14/12/2002 - 
 
-   Added the proc module. This can be used to retrieve accumulated information
-   about processes with the same name. A proc(httpd) statement in symon.conf,
-   for instance, will result in the reporting of the number of processes called
-   "httpd" and the amounts of cpu and memory that they take.
+   Added the proc module. This can be used to retrieve accumulated
+   information about processes with the same name. A proc(httpd)
+   statement in symon.conf, for instance, will result in the reporting
+   of the number of processes called "httpd" and the amounts of cpu and
+   memory that they take.
   
-   Added em device to c_smrrds.sh - thanks to Jung.
-   Fixed typo in SymuxClient.pm - thanks Tobias Gresch.
-   c_config.sh did not deal with type mfs devices - thanks Dom De Vitto.
+   Added em device to c_smrrds.sh - thanks to Jung.  Fixed typo in
+   SymuxClient.pm - thanks Tobias Gresch.  c_config.sh did not deal with
+   type mfs devices - thanks Dom De Vitto.
 
 29/11/2002 - 2.55
 
-   Markus Friedl reported that unresolvable ip addresses cannot be used in the
-   configuration file - fixed.
+   Markus Friedl reported that unresolvable ip addresses cannot be used
+   in the configuration file - fixed.
 
-   Overhauled the networking code. Everything is now ip6 aware. This does mean
-   that the ':' is no longer a keyword in the lexer; i.e. '<host>:<port>'
-   statements should now be written as '<host> <port>' or '<host> port <port>'.
+   Overhauled the networking code. Everything is now ip6 aware. This
+   does mean that the ':' is no longer a keyword in the lexer;
+   i.e. '<host>:<port>' statements should now be written as '<host>
+   <port>' or '<host> port <port>'.
 
-   Added the debug module. This can be used to retrieve debug0 ... debug19
-   variables from the kernel.
+   Added the debug module. This can be used to retrieve debug0
+   ... debug19 variables from the kernel.
 
 08/11/2002 - 2.54
 
-   Added a perl module that allows ppl to connect to symux and do something
-   with the measurements as they come in. (I plan to drive an LCD using this,
-   but it could also be used to get, say, daily bandwidth usage)
+   Added a perl module that allows ppl to connect to symux and do
+   something with the measurements as they come in. (I plan to drive an
+   LCD using this, but it could also be used to get, say, daily
+   bandwidth usage)
  
-   Clients of symux would not sleep after they had read and relayed data symux
-   gave to them. This could lead to one child eating up multiple 'semaphore
-   slots' and starvation in other clients - fixed.
+   Clients of symux would not sleep after they had read and relayed data
+   symux gave to them. This could lead to one child eating up multiple
+   'semaphore slots' and starvation in other clients - fixed.
 
 25/10/2002 - 2.53
 
-   Henning Brauer suggested a datadir statement for symux configuration -
-   added.
+   Henning Brauer suggested a datadir statement for symux configuration
+   - added.
 
    Henning also reported that c_smrrds.sh cannot create vlan10 and
-   up. c_smrrds.sh now has a special case for pseudo-interfaces (bridge, enc,
-   faith, gif, ppp, sppp, strip, tun, vlan)
+   up. c_smrrds.sh now has a special case for pseudo-interfaces (bridge,
+   enc, faith, gif, ppp, sppp, strip, tun, vlan)
 
-   Nick Nauwelaerts helped improve dependency definitions in the port Makefile.
+   Nick Nauwelaerts helped improve dependency definitions in the port
+   Makefile.
 
 18/10/2002 - 2.52
 
-   Julien Touche reported that symon/symux do not report initial cfg errors on
-   the commandline - fixed.
+   Julien Touche reported that symon/symux do not report initial cfg
+   errors on the commandline - fixed.
 
-   Reinhard Sammer, Julien and Henning Brauer all noticed that the php code
-   needed globals - fixed. Passing by reference at call time resulted in php
-   warnings - fixed.
+   Reinhard Sammer, Julien and Henning Brauer 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.
+   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.
+   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)
+   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. 
+   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.
+   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. 
+   The lexer started parsing from character position 1 instead of 0.
 
    symux would bomb out after a hup - fixed.
 
@@ -94,11 +108,11 @@
 
 13/09/2002 - 2.5 - kvm gone, renamed mon to symon
 
-   Rewrote io.c to obtain information via sysctl only. All kvm code is now
-   gone.
+   Rewrote io.c to obtain information via sysctl only. All kvm code is
+   now gone.
 
-   Renamed mon to symon, monmux to symux and mon2web to symon2web. I liked mon
-   better, but that name is already taken.
+   Renamed mon to symon, monmux to symux and mon2web to symon2web. I
+   liked mon better, but that name is already taken.
 
    Cleaned up webpages to be XHTML 1.0.
 
@@ -109,19 +123,20 @@
 
 09/09/2002 - Towards a better port makefile
 
-   Reworked port Makefile. It now generates a number of packages that can be
-   used to just install mon, monmux or mon2web. The KVM stuff has become a special
-   flavor of the monitor package.
+   Reworked port Makefile. It now generates a number of packages that
+   can be used to just install mon, monmux or mon2web. The KVM stuff has
+   become a special flavor of the monitor package.
 
 06/09/2002 - Cosmetics again
 
    monmux/c_monrrds.sh:
-     - Added RRD_ARGS support. All created rrds have start=epoch. Incoming data
-       from hosts may be from an earlier time than rrd creation now.
+     - Added RRD_ARGS support. All created rrds have
+       start=epoch. Incoming data from hosts may be from an earlier time
+       than rrd creation now.
 
    mon2web/class_[io|if|mem|cpu].inc, index.php:
-     - Rewrote argument representation of the graphs to be the same as how it
-       is configured in the configuration files.
+     - Rewrote argument representation of the graphs to be the same as
+       how it is configured in the configuration files.
 
    mon2web/class_pf.inc, graph_pf.php:
      - Initial pf support.
@@ -136,15 +151,16 @@
      - header structure is now safely transported across the network.
 
    lib/data.c
-     - added streamtypes b(yte) and s(hort) in preparation for new streams.
+     - added streamtypes b(yte) and s(hort) in preparation for new
+       streams.
 
 31/08/2002 - 2.3
 
     Makefiles, mon/mon.c: 
-     - Environment variable KVM will enable the building of a setgid kmem
-       version of the monitor. If this environment variable is not present, a
-       non priviledged monitor will be built. (Note that all kvm dependant
-       modules will fail during operation)
+     - Environment variable KVM will enable the building of a setgid
+       kmem version of the monitor. If this environment variable is not
+       present, a non priviledged monitor will be built. (Note that all
+       kvm dependant modules will fail during operation)
 
        After today's changes, only the io probe needs kvm.
 
@@ -166,8 +182,8 @@
 29/08/2002 - 2.2
 
     Merged contributions by Daniel Hartmeier:
-     - cpu probe had a nasty va_arg bug that only showed up on big-endian
-       machines.
+     - cpu probe had a nasty va_arg bug that only showed up on
+       big-endian machines.
     
 29/08/2002 - 2.1
 
@@ -177,10 +193,11 @@
 
 28/08/2002 - released 2.0
 
-    monitoring behaviour (mon) separated from storage/forwarding (monmux) and
-    picture display (mon2web). Only mon has to run with kmem priviledges
-    because of the if and io probes. Although the entire package was built with
-    portability to other OpenBSD architectures in mind, it was never tested.
+    monitoring behaviour (mon) separated from storage/forwarding
+    (monmux) and picture display (mon2web). Only mon has to run with
+    kmem priviledges because of the if and io probes. Although the
+    entire package was built with portability to other OpenBSD
+    architectures in mind, it was never tested.
 
 ==== unreleased ====
 
@@ -241,4 +258,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.14 2003/01/08 16:04:40 dijkstra Exp $
+$Id: CHANGELOG,v 1.16 2003/01/24 13:33:49 dijkstra Exp $

+ 1 - 1
symon/Makefile

@@ -1,4 +1,4 @@
-# $Id: Makefile,v 1.10 2002/11/08 15:40:11 dijkstra Exp $
+# $Id: Makefile,v 1.11 2003/01/18 09:55:31 dijkstra Exp $
 
 SUBDIR=	lib symon symux symon2web client
 

+ 2 - 2
symon/Makefile.inc

@@ -1,6 +1,6 @@
-# $Id: Makefile.inc,v 1.14 2003/01/08 16:04:40 dijkstra Exp $
+# $Id: Makefile.inc,v 1.15 2003/01/24 13:33:50 dijkstra Exp $
 
-V=2.57
+V=2.58
 
 AR=	ar
 CC=	cc

+ 1 - 1
symon/ports/symon/Makefile

@@ -1,7 +1,7 @@
 # $OpenBSD: Makefile,v 1.1 2002/10/08 07:56:42 dhartmei Exp $
 
 COMMENT=		"active monitoring tool"
-V=			2.57
+V=			2.58
 DISTNAME=		symon-${V}
 CATEGORIES=		net sysutils
 

+ 1 - 1
symon/ports/symon/pkg/PLIST

@@ -1,4 +1,4 @@
-@comment $Id: PLIST,v 1.4 2002/12/14 14:03:47 dijkstra Exp $
+@comment $Id: PLIST,v 1.5 2003/01/18 09:55:34 dijkstra Exp $
 @comment $OpenBSD: PLIST,v 1.1 2002/10/08 07:56:42 dhartmei Exp $
 libexec/symon
 libexec/symux

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

@@ -1,4 +1,4 @@
-@comment $Id: PLIST-web,v 1.4 2002/12/14 14:03:47 dijkstra Exp $
+@comment $Id: PLIST-web,v 1.5 2003/01/18 09:55:34 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      

+ 13 - 4
symon/symon/sm_io.c

@@ -1,4 +1,4 @@
-/* $Id: sm_io.c,v 1.10 2002/12/15 14:22:36 dijkstra Exp $ */
+/* $Id: sm_io.c,v 1.11 2003/01/24 13:33:52 dijkstra Exp $ */
 
 /*
  * Copyright (c) 2001-2002 Willem Dijkstra
@@ -122,8 +122,17 @@ gets_io()
 
     p = io_dkstr;
     io_dks = 0;
-    while ((io_dknames[io_dks] = strsep(&p, ",")) != NULL)
-	io_dks++;
+    
+    io_dknames[io_dks] = p;
+
+    while ((*p != '\0') && ((p - io_dkstr) < io_maxstr)) {
+	if ((*p == ',') && (*p+1 != '\0')) {
+	    *p = '\0';
+	    io_dks++; p++;
+	    io_dknames[io_dks] = p;
+	}
+	p++;
+    }
 }
 /* Prepare io module for first use */
 void 
@@ -138,7 +147,7 @@ get_io(char *symon_buf, int maxlen, char *disk)
     int i;
 
     /* look for disk */
-    for (i = 0; i < io_dks; i++) {
+    for (i = 0; i <= io_dks; i++) {
 	if (strncmp(io_dknames[i], disk,
 		    (io_dkstr + io_maxstr - io_dknames[i])) == 0)
 	    return snpack(symon_buf, maxlen, disk, MT_IO,

+ 12 - 12
symon/symon/sm_pf.c

@@ -92,18 +92,18 @@ get_pf(char *symon_buf, int maxlen, char *arg)
 
     n = s.states;
     return snpack(symon_buf, maxlen, arg, MT_PF,
-		  s.bcounters[0][PF_IN],
-		  s.bcounters[0][PF_OUT],
-		  s.bcounters[1][PF_IN],
-		  s.bcounters[1][PF_OUT],
-		  s.pcounters[0][PF_IN][PF_PASS],
-		  s.pcounters[0][PF_IN][PF_DROP],
-		  s.pcounters[0][PF_OUT][PF_PASS],
-		  s.pcounters[0][PF_OUT][PF_DROP],
-		  s.pcounters[1][PF_IN][PF_PASS],
-		  s.pcounters[1][PF_IN][PF_DROP],
-		  s.pcounters[1][PF_OUT][PF_PASS],
-		  s.pcounters[1][PF_OUT][PF_DROP],
+		  s.bcounters[0][0],
+		  s.bcounters[0][1],
+		  s.bcounters[1][0],
+		  s.bcounters[1][1],
+		  s.pcounters[0][0][PF_PASS],
+		  s.pcounters[0][0][PF_DROP],
+		  s.pcounters[0][1][PF_PASS],
+		  s.pcounters[0][1][PF_DROP],
+		  s.pcounters[1][0][PF_PASS],
+		  s.pcounters[1][0][PF_DROP],
+		  s.pcounters[1][1][PF_PASS],
+		  s.pcounters[1][1][PF_DROP],
 		  n,
 		  s.fcounters[0],
 		  s.fcounters[1],

+ 1 - 1
symon/symon2web/Makefile

@@ -1,4 +1,4 @@
-# $Id: Makefile,v 1.3 2002/12/14 14:03:49 dijkstra Exp $
+# $Id: Makefile,v 1.4 2003/01/18 09:55:35 dijkstra Exp $
 .include "../Makefile.inc"
 
 all:

+ 1 - 1
symon/symon2web/test_config.php

@@ -18,7 +18,7 @@ require_once('class_pf.inc');
 // Test to see if we can run rrdtool
 print "Trying to find rrdtool:<b>";
 $g = new CPU_Graph();
-$g->init(); $g->parseoptions("");
+$g->init(); $a = ""; $g->parseoptions($a);
 $rrdtool = substr($g->get("rrdtool"), 0, strpos($g->get("rrdtool"), " "));
 print $rrdtool . "<br>\n";
 if (!is_string($rrdtool)) {

+ 40 - 13
symon/symux/c_smrrds.sh

@@ -1,5 +1,5 @@
 #!/bin/sh
-# $Id: c_smrrds.sh,v 1.17 2002/12/29 16:20:31 dijkstra Exp $
+# $Id: c_smrrds.sh,v 1.18 2003/01/17 16:21:35 dijkstra Exp $
 
 #
 # Copyright (c) 2001-2002 Willem Dijkstra
@@ -38,7 +38,35 @@
 # --- user configuration starts here
 INTERVAL=`grep SYMON_INTERVAL ../symon/symon.h 2>/dev/null | cut -f3 -d\ `
 INTERVAL=${INTERVAL:-5}
-# RRA setup:
+RRD_ARGS="--step=$INTERVAL --start=0"
+# --- user configuration ends here
+
+# get arguments
+for i
+do
+case $i in
+child)
+    child=1
+    ;;
+oneday)	
+    config=$i
+# today only RRA setup:
+# - 1   day  of  5 second  samples = 17280 x 5 second samples
+    RRA_SETUP=" RRA:AVERAGE:0.5:1:17280 
+	    RRA:MAX:0.5:1:17280 
+	    RRA:MIN:0.5:1:17280"
+    if [ X"$child" == "X" ]; then 
+	echo "RRDs will only contain a single day of data"
+    fi
+    ;;
+*)
+    args="$args $i"
+    ;;
+esac
+done
+
+if [ X"$RRA_SETUP" == "X" ]; then
+# default RRA setup:
 # - 2   days of  5 second  samples = 34560 x 5 second samples
 # - 14  days of 30 minutes samples = 672 x 360 x 5 second samples 
 # - 50  days of  2 hour    samples = 600 x 1440 x 5 second samples
@@ -55,8 +83,7 @@ RRA_SETUP=" RRA:AVERAGE:0.5:1:34560
 	    RRA:MIN:0.5:360:672 
 	    RRA:MIN:0.5:1440:600 
 	    RRA:MIN:0.5:17280:600"
-RRD_ARGS="--step=$INTERVAL --start=0"
-# --- user configuration ends here
+fi
 
 # All interfaces and disks
 INTERFACES="an|awi|be|bge|bm|cnw|dc|de|ec|ef|eg|el|em|ep|ex|fea|fpa|fxp|gem|gm|gre|hme|ie|kue|lc|le|lge|lmc|lo|ne|ne|nge|ray|rl|qe|qec|sf|sis|sk|skc|sl|sm|siop|ste|stge|ti|tl|tr|tx|txp|vme|vr|wb|we|wi|wx|xe|xl"
@@ -84,7 +111,7 @@ DISKS=`addsuffix $DISKS [0-9]`
 INTERFACES=`addsuffix $INTERFACES [0-9]`
 VIRTUALINTERFACES=`addsuffix $VIRTUALINTERFACES \\.\\*`
 
-for i
+for i in $args
 do
 # add if_*.rrd if it is an interface
 if [ `echo $i | egrep -e "^($INTERFACES)$"` ]; then i=if_$i.rrd; fi
@@ -103,20 +130,20 @@ case $i in
 
 all)
     echo "Creating rrd files for {cpu0|mem|disks|interfaces|pf}"
-    sh $this cpu0 mem
-    sh $this interfaces
-    sh $this disks
-    sh $this pf
+    sh $this child $config cpu0 mem
+    sh $this child $config interfaces
+    sh $this child $config disks
+    sh $this child $config pf
     ;;
 
 if|interfaces)
     # obtain all network cards
-    sh $this `ifconfig -a| egrep -e "^($INTERFACES):" | cut -f1 -d\:  | sort -u`
+    sh $this child $config `ifconfig -a| egrep -e "^($INTERFACES):" | cut -f1 -d\:  | sort -u`
     ;;
 
 io|disks)
     # obtain all disks
-    sh $this `df | grep dev | sed 's/^\/dev\/\(.*\)[a-z] .*$/\1/' | sort -u`
+    sh $this child $config `df | grep dev | sed 's/^\/dev\/\(.*\)[a-z] .*$/\1/' | sort -u`
     ;;
 
 cpu[0-9].rrd)
@@ -221,8 +248,8 @@ io_*.rrd)
 *)
     # Default match
     cat <<EOF
-Usage: $0 all
-       $0 cpu0|mem|pf|debug|<if>|<io>
+Usage: $0 [oneday] all
+       $0 [oneday] cpu0|mem|pf|debug|proc|<if>|<io>
 
 Where:
 if=	`echo $INTERFACES|

+ 1 - 1
symon/symux/readconf.c

@@ -1,4 +1,4 @@
-/* $Id: readconf.c,v 1.17 2002/12/15 14:28:10 dijkstra Exp $ */
+/* $Id: readconf.c,v 1.18 2003/01/18 09:55:37 dijkstra Exp $ */
 
 /*
  * Copyright (c) 2001-2002 Willem Dijkstra