Parcourir la source

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

Wictor Lund il y a 3 ans
Parent
commit
fc5eec6f01

+ 64 - 48
symon/CHANGELOG

@@ -1,12 +1,25 @@
+06/01/2008 - 2.78
+
+   - lib/sylimits.h: DFNAMESIZE bumped from 16 to 64 chars
+     (Mahlon E. Smith)
+
+   - if and mem probes upgraded to report in u_int64_t values. symux will
+     accept reports from older symons that use the old u_int32_t
+     format. The old if and mem rrd files need no adjustments to accept
+     the new data.
+
+   - c_smrrds.sh now specifies the start time at graph creation in such a
+     way that it can be used by both rrdtool 1.0.x and rrdtool 1.2.x.
+
 29/11/2007 - 2.77
 29/11/2007 - 2.77
 
 
-   - symon/symux -t can now be used to check configuration files before running
-     in anger.
+   - symon/symux -t can now be used to check configuration files before
+     running in anger.
 
 
-   - symon now also calculates maximum message size; with symux using twice the
-     calculated value to ensure that configuration errors between
-     sy[mon|mux].conf are detected in the logs. Both enforce maximum message =
-     sizeof(udp payload).
+   - symon now also calculates maximum message size; with symux using
+     twice the calculated value to ensure that configuration errors
+     between sy[mon|mux].conf are detected in the logs. Both enforce
+     maximum message = sizeof(udp payload).
 
 
    - Martin van der Werff donated the Linux/sm_df probe.
    - Martin van der Werff donated the Linux/sm_df probe.
 
 
@@ -14,20 +27,21 @@
      sensor_*. (Daniel Spizak, Evgeniy Sudyr)
      sensor_*. (Daniel Spizak, Evgeniy Sudyr)
 
 
    - pfq probes must be specified as pfq(interface/queue) in symon and are
    - pfq probes must be specified as pfq(interface/queue) in symon and are
-     treated as pfq_interface_symon.rrd by symux.
+     treated as pfq_interface_queue.rrd by symux.
 
 
-   - platform/Linux/sm_mem modified to better reflect OpenBSD's idea of the
-     vm_meter stats.
+   - platform/Linux/sm_mem modified to better reflect OpenBSD's idea of
+     the vm_meter stats.
 
 
 05/07/2007 - 2.76
 05/07/2007 - 2.76
 
 
-   - symux/readconf.c resolve from host, but discard result. (Henning Brauer)
+   - symux/readconf.c resolve from host, but discard result. (Henning
+     Brauer)
 
 
    - symux/symux.c -f used strncpy wrong and broke when using gcc4
    - symux/symux.c -f used strncpy wrong and broke when using gcc4
      (Mechiel Lukkien)
      (Mechiel Lukkien)
 
 
-   - platform/Linux/sm_cpu now uses iowait + hardirq + softirq + steal as its
-     cpu "interrupt". My feeling is that this is the most accurate
+   - platform/Linux/sm_cpu now uses iowait + hardirq + softirq + steal as
+     its cpu "interrupt". My feeling is that this is the most accurate
      representation of what the values mean for the *BSDs.
      representation of what the values mean for the *BSDs.
 
 
    - platform/NetBSD/sm_io uses new iostat_sysctl of NetBSD4
    - platform/NetBSD/sm_io uses new iostat_sysctl of NetBSD4
@@ -40,14 +54,14 @@
    - platform/OpenBSD/sm_if removed obselete netipx includes
    - platform/OpenBSD/sm_if removed obselete netipx includes
      (Christian Weisgerber)
      (Christian Weisgerber)
 
 
-   - Daemon needs to be able to bind /dev/null - drop privileges after daemon
-     call (Markus Friedl).
+   - Daemon needs to be able to bind /dev/null - drop privileges after
+     daemon call (Markus Friedl).
 
 
-   - data.c/free_muxlist closed fd 0 at HUP. This makes symux unresponsive on
-     OpenBSD and makes it stop on FreeBSD. (Marco Pfatschbacher).
+   - data.c/free_muxlist closed fd 0 at HUP. This makes symux unresponsive
+     on OpenBSD and makes it stop on FreeBSD. (Marco Pfatschbacher).
 
 
-   - platform/OpenBSD/sm_cpu fixed to call CPTIME2 only for machines with more
-     than one cpu. (Henning Brauer)
+   - platform/OpenBSD/sm_cpu fixed to call CPTIME2 only for machines with
+     more than one cpu. (Henning Brauer)
 
 
 13/02/2007 - 2.75
 13/02/2007 - 2.75
 
 
@@ -57,17 +71,18 @@
 
 
 11/02/2007 - 2.74
 11/02/2007 - 2.74
 
 
-   - symon can be told what local interface to send data from (Henning Brauer)
+   - symon can be told what local interface to send data from (Henning
+     Brauer)
 
 
    - removed typos in client/SymuxClient.pm (Sandeep Kr Sangwan)
    - removed typos in client/SymuxClient.pm (Sandeep Kr Sangwan)
 
 
    - OpenBSD sm_sensor upgrade to sensor_dev (Constantine A. Murenin)
    - OpenBSD sm_sensor upgrade to sensor_dev (Constantine A. Murenin)
 
 
-   - NetBSD can use OpenBSD sm_pf, sm_mem and sm_pfq with little modifications
-     (Jean-Yves Moulin)
+   - NetBSD can use OpenBSD sm_pf, sm_mem and sm_pfq with little
+     modifications (Jean-Yves Moulin)
 
 
-   - symon network protocol version bumped to allow stream arguments upto 63
-     characters.
+   - symon network protocol version bumped to allow stream arguments upto
+     63 characters.
 
 
 19/12/2006 - 2.73
 19/12/2006 - 2.73
 
 
@@ -77,14 +92,14 @@
    - NetBSD compiles on 2.1 after addition of rrd.h location in
    - NetBSD compiles on 2.1 after addition of rrd.h location in
      NetBSD/Makefile.inc
      NetBSD/Makefile.inc
 
 
-   - FreeBSD/platform.h now also includes sys/socket.h and sys/dkstat.h, which
-     makes the FreeBSD probes compile on 4/5/6.
+   - FreeBSD/platform.h now also includes sys/socket.h and sys/dkstat.h,
+     which makes the FreeBSD probes compile on 4/5/6.
 
 
    - FreeBSD/sm_pf and OpenBSD/sm_pf were broken when pf was not available
    - FreeBSD/sm_pf and OpenBSD/sm_pf were broken when pf was not available
      (Ulrich Spörlein)
      (Ulrich Spörlein)
 
 
-   - c_smrrds.sh now accepts filenames, not descriptions. Intended use is now
-     c_smrrds.sh `symux -l`.
+   - c_smrrds.sh now accepts filenames, not descriptions. Intended use is
+     now c_smrrds.sh `symux -l`.
 
 
    - symux -l lists rrd files in active configuration.
    - symux -l lists rrd files in active configuration.
 
 
@@ -96,8 +111,8 @@
    - Library deps now split between symon and symux. Not all libraries are
    - Library deps now split between symon and symux. Not all libraries are
      needed on a host if only symon/symux is compiled.
      needed on a host if only symon/symux is compiled.
 
 
-   - OpenBSD/Makefile.inc now includes fontconfig library needed for
-     gd > 2.0.33. This breaks symux compilation for OpenBSD < 3.9.
+   - OpenBSD/Makefile.inc now includes fontconfig library needed for gd >
+     2.0.33. This breaks symux compilation for OpenBSD < 3.9.
 
 
    - OpenBSD/sm_cpu is smp aware
    - OpenBSD/sm_cpu is smp aware
 
 
@@ -123,8 +138,8 @@
    - OpenBSD/sm_if.c no longer uses netns (Mitja Muzenic)
    - OpenBSD/sm_if.c no longer uses netns (Mitja Muzenic)
 
 
    - symux/share.c now uses a ringbuffer to distribute symon packets to
    - symux/share.c now uses a ringbuffer to distribute symon packets to
-     connected tcp clients. Clients that can not keep up with the datarate are
-     still killed, but have a bit more time to catch up.
+     connected tcp clients. Clients that can not keep up with the datarate
+     are still killed, but have a bit more time to catch up.
 
 
    - Ulrich Spörlein updated proc probe for FreeBSD-current.
    - Ulrich Spörlein updated proc probe for FreeBSD-current.
 
 
@@ -136,17 +151,17 @@
 
 
 19/03/2005 - 2.71
 19/03/2005 - 2.71
 
 
-   - Ulrich Spörlein updated mem probe for FreeBSD-current and removed some
-     bugs from FreeBSD/conf.sh.
+   - Ulrich Spörlein updated mem probe for FreeBSD-current and removed
+     some bugs from FreeBSD/conf.sh.
 
 
-   - J. Martin Petersen contributed the FreeBSD io probe and a new probe called
-     pfq that can monitor pf altq queues on Free and OpenBSD.
+   - J. Martin Petersen contributed the FreeBSD io probe and a new probe
+     called pfq that can monitor pf altq queues on Free and OpenBSD.
 
 
 22/02/2005 - 2.70
 22/02/2005 - 2.70
 
 
-   - Ulrich Spörlein updated the FreeBSD proc and mem probes, found a bug in
-     the mem probe for OpenBSD and helped extend the shell config files for
-     FreeBSD.
+   - Ulrich Spörlein updated the FreeBSD proc and mem probes, found a bug
+     in the mem probe for OpenBSD and helped extend the shell config files
+     for FreeBSD.
 
 
    - Linux/Makefile.inc TSORT should be cat not echo
    - Linux/Makefile.inc TSORT should be cat not echo
 
 
@@ -167,7 +182,8 @@
    - platform/*BSD/sm_proc transferred cpucpt as uint16 instead of double
    - platform/*BSD/sm_proc transferred cpucpt as uint16 instead of double
      (Jamie Herre)
      (Jamie Herre)
 
 
-   - states_entries is a GAUGE, not a ABSOLUTE (Lars Hansson, Marco Pfatschbacher)
+   - states_entries is a GAUGE, not a ABSOLUTE (Lars Hansson, Marco
+     Pfatschbacher)
 
 
    - NetBSD/plaform.h -> platform.h (Joel Andersson)
    - NetBSD/plaform.h -> platform.h (Joel Andersson)
 
 
@@ -176,8 +192,8 @@
 09/08/2004 - 2.67
 09/08/2004 - 2.67
 
 
    - Matthew Gream contributed the port and probes to NetBSD and FreeBSD.
    - Matthew Gream contributed the port and probes to NetBSD and FreeBSD.
-     Probes for FreeBSD: cpu, debug, mbuf, mem and proc.  Probes for NetBSD:
-     cpu, debug, if, io, mbuf, proc and sensor.
+     Probes for FreeBSD: cpu, debug, mbuf, mem and proc.  Probes for
+     NetBSD: cpu, debug, if, io, mbuf, proc and sensor.
 
 
    - Added initial support for Linux: cpu and if.
    - Added initial support for Linux: cpu and if.
 
 
@@ -194,8 +210,8 @@
      will use more characters if specified in monitoring, but will only
      will use more characters if specified in monitoring, but will only
      send the first 15 over the network. (Michael)
      send the first 15 over the network. (Michael)
 
 
-   - Textual: symux.8 and c_smrrds.sh agree on stream names.
-     (Okan Demirmen)
+   - Textual: symux.8 and c_smrrds.sh agree on stream names.  (Okan
+     Demirmen)
 
 
 29/02/2004 - 2.65
 29/02/2004 - 2.65
 
 
@@ -205,10 +221,10 @@
 
 
 27/02/2004 - 2.64
 27/02/2004 - 2.64
 
 
-   - Added new disk structure. symon has a single notion of "io" - the
-     new or the old depending on the machine it was built on. symux
-     deals with legacy streams and knows about "io1" (upto 3.4)
-     and "io" (3.5+). symux will accept legacy symons.
+   - Added new disk structure. symon has a single notion of "io" - the new
+     or the old depending on the machine it was built on. symux deals with
+     legacy streams and knows about "io1" (upto 3.4) and "io"
+     (3.5+). symux will accept legacy symons.
 
 
    - c_smrrds.sh complains if files cannot be built. (Daniel Polak)
    - c_smrrds.sh complains if files cannot be built. (Daniel Polak)
 
 
@@ -532,4 +548,4 @@
 29/09/2001 - Lexer had trouble dealing with ip-addresses. Cleaned up the number
 29/09/2001 - Lexer had trouble dealing with ip-addresses. Cleaned up the number
              parsing code and removed a second comment reader.
              parsing code and removed a second comment reader.
 
 
-$Id: CHANGELOG,v 1.72 2007/11/29 13:55:30 dijkstra Exp $
+$Id: CHANGELOG,v 1.76 2008/01/06 14:25:44 dijkstra Exp $

+ 2 - 2
symon/Makefile.inc

@@ -1,6 +1,6 @@
-# $Id: Makefile.inc,v 1.38 2007/10/29 14:59:43 dijkstra Exp $
+# $Id: Makefile.inc,v 1.39 2007/12/12 12:16:16 dijkstra Exp $
 
 
-V=2.77
+V=2.78
 OS!=uname -s
 OS!=uname -s
 
 
 AR?=	ar
 AR?=	ar

+ 9 - 5
symon/lib/data.c

@@ -1,4 +1,4 @@
-/* $Id: data.c,v 1.34 2007/11/29 19:36:03 dijkstra Exp $ */
+/* $Id: data.c,v 1.35 2007/12/11 14:17:59 dijkstra Exp $ */
 
 
 /*
 /*
  * Copyright (c) 2001-2007 Willem Dijkstra
  * Copyright (c) 2001-2007 Willem Dijkstra
@@ -99,8 +99,8 @@ struct {
 } streamform[] = {
 } streamform[] = {
     { MT_IO1, "LLL" },
     { MT_IO1, "LLL" },
     { MT_CPU, "ccccc" },
     { MT_CPU, "ccccc" },
-    { MT_MEM, "lllll" },
-    { MT_IF, "llllllllll" },
+    { MT_MEM1, "lllll" },
+    { MT_IF1, "llllllllll" },
     { MT_PF, "LLLLLLLLLLLLLLLLLLLLLL" },
     { MT_PF, "LLLLLLLLLLLLLLLLLLLLLL" },
     { MT_DEBUG, "llllllllllllllllllll" },
     { MT_DEBUG, "llllllllllllllllllll" },
     { MT_PROC, "lLLLlcll" },
     { MT_PROC, "lLLLlcll" },
@@ -109,6 +109,8 @@ struct {
     { MT_IO2, "LLLLL" },
     { MT_IO2, "LLLLL" },
     { MT_PFQ, "LLLL" },
     { MT_PFQ, "LLLL" },
     { MT_DF, "LLLLLLL" },
     { MT_DF, "LLLLLLL" },
+    { MT_MEM2, "LLLLL" },
+    { MT_IF2, "LLLLLLLLLL" },
     { MT_TEST, "LLLLDDDDllllssssccccbbbb" },
     { MT_TEST, "LLLLDDDDllllssssccccbbbb" },
     { MT_EOT, "" }
     { MT_EOT, "" }
 };
 };
@@ -119,8 +121,8 @@ struct {
 } streamtoken[] = {
 } streamtoken[] = {
     { MT_IO1, LXT_IO1 },
     { MT_IO1, LXT_IO1 },
     { MT_CPU, LXT_CPU },
     { MT_CPU, LXT_CPU },
-    { MT_MEM, LXT_MEM },
-    { MT_IF, LXT_IF },
+    { MT_MEM1, LXT_MEM1 },
+    { MT_IF1, LXT_IF1 },
     { MT_PF, LXT_PF },
     { MT_PF, LXT_PF },
     { MT_DEBUG, LXT_DEBUG },
     { MT_DEBUG, LXT_DEBUG },
     { MT_PROC, LXT_PROC },
     { MT_PROC, LXT_PROC },
@@ -129,6 +131,8 @@ struct {
     { MT_IO2, LXT_IO },
     { MT_IO2, LXT_IO },
     { MT_PFQ, LXT_PFQ },
     { MT_PFQ, LXT_PFQ },
     { MT_DF, LXT_DF },
     { MT_DF, LXT_DF },
+    { MT_MEM2, LXT_MEM },
+    { MT_IF2, LXT_IF },
     { MT_EOT, LXT_BADTOKEN }
     { MT_EOT, LXT_BADTOKEN }
 };
 };
 /* parallel crc32 table */
 /* parallel crc32 table */

+ 29 - 12
symon/lib/data.h

@@ -1,4 +1,4 @@
-/* $Id: data.h,v 1.31 2007/11/29 13:13:17 dijkstra Exp $ */
+/* $Id: data.h,v 1.32 2007/12/11 14:17:59 dijkstra Exp $ */
 
 
 /*
 /*
  * Copyright (c) 2001-2007 Willem Dijkstra
  * Copyright (c) 2001-2007 Willem Dijkstra
@@ -74,10 +74,6 @@ static inline u_int64_t
  * version 1 and 2:
  * version 1 and 2:
  * symon_version:timestamp:length:crc:n*packedstream
  * symon_version:timestamp:length:crc:n*packedstream
  * packedstream = type:arg[<SYMON_PS_ARGLENVx]:data
  * packedstream = type:arg[<SYMON_PS_ARGLENVx]:data
- *
- * Note that the data portion is limited. The current (20/01/2007) largest
- * streamtype (pf) needs 88 bytes without arguments. _POSIX2_LINE_MAX is 2k, so
- * that works out to about 23 packedstreams in a single symon packet.
  */
  */
 #define SYMON_PACKET_VER  2
 #define SYMON_PACKET_VER  2
 #define SYMON_UNKMUX   "<unknown mux>"  /* mux nodes without host addr */
 #define SYMON_UNKMUX   "<unknown mux>"  /* mux nodes without host addr */
@@ -148,8 +144,8 @@ SLIST_HEAD(muxlist, mux);
 /* Stream types */
 /* Stream types */
 #define MT_IO1    0
 #define MT_IO1    0
 #define MT_CPU    1
 #define MT_CPU    1
-#define MT_MEM    2
-#define MT_IF     3
+#define MT_MEM1   2
+#define MT_IF1    3
 #define MT_PF     4
 #define MT_PF     4
 #define MT_DEBUG  5
 #define MT_DEBUG  5
 #define MT_PROC   6
 #define MT_PROC   6
@@ -158,8 +154,10 @@ SLIST_HEAD(muxlist, mux);
 #define MT_IO2    9
 #define MT_IO2    9
 #define MT_PFQ    10
 #define MT_PFQ    10
 #define MT_DF     11
 #define MT_DF     11
-#define MT_TEST   12
-#define MT_EOT    13
+#define MT_MEM2   12
+#define MT_IF2    13
+#define MT_TEST   14
+#define MT_EOT    15
 
 
 /*
 /*
  * Unpacking of incoming packets is done via a packedstream structure. This
  * Unpacking of incoming packets is done via a packedstream structure. This
@@ -176,7 +174,7 @@ struct packedstream {
             u_int64_t mtotal_transfers;
             u_int64_t mtotal_transfers;
             u_int64_t mtotal_seeks;
             u_int64_t mtotal_seeks;
             u_int64_t mtotal_bytes;
             u_int64_t mtotal_bytes;
-        }      ps_io;
+        }      ps_io1;
         struct {
         struct {
             u_int16_t muser;
             u_int16_t muser;
             u_int16_t mnice;
             u_int16_t mnice;
@@ -190,7 +188,7 @@ struct packedstream {
             u_int32_t mfree;
             u_int32_t mfree;
             u_int32_t mswap_used;
             u_int32_t mswap_used;
             u_int32_t mswap_total;
             u_int32_t mswap_total;
-        }      ps_mem;
+        }      ps_mem1;
         struct {
         struct {
             u_int32_t mipackets;
             u_int32_t mipackets;
             u_int32_t mopackets;
             u_int32_t mopackets;
@@ -202,7 +200,7 @@ struct packedstream {
             u_int32_t moerrors;
             u_int32_t moerrors;
             u_int32_t mcolls;
             u_int32_t mcolls;
             u_int32_t mdrops;
             u_int32_t mdrops;
-        }      ps_if;
+        }      ps_if1;
         struct {
         struct {
             u_int64_t bytes_v4_in;
             u_int64_t bytes_v4_in;
             u_int64_t bytes_v4_out;
             u_int64_t bytes_v4_out;
@@ -299,6 +297,25 @@ struct packedstream {
             u_int64_t syncwrites;
             u_int64_t syncwrites;
             u_int64_t asyncwrites;
             u_int64_t asyncwrites;
         }      ps_df;
         }      ps_df;
+        struct {
+            u_int64_t mreal_active;
+            u_int64_t mreal_total;
+            u_int64_t mfree;
+            u_int64_t mswap_used;
+            u_int64_t mswap_total;
+        }      ps_mem2;
+        struct {
+            u_int64_t mipackets;
+            u_int64_t mopackets;
+            u_int64_t mibytes;
+            u_int64_t mobytes;
+            u_int64_t mimcasts;
+            u_int64_t momcasts;
+            u_int64_t mierrors;
+            u_int64_t moerrors;
+            u_int64_t mcolls;
+            u_int64_t mdrops;
+        }      ps_if2;
     }     data;
     }     data;
 };
 };
 
 

+ 5 - 1
symon/lib/lex.c

@@ -1,4 +1,4 @@
-/* $Id: lex.c,v 1.28 2007/02/11 20:07:31 dijkstra Exp $ */
+/* $Id: lex.c,v 1.29 2007/12/11 14:17:59 dijkstra Exp $ */
 
 
 /*
 /*
  * Copyright (c) 2001-2007 Willem Dijkstra
  * Copyright (c) 2001-2007 Willem Dijkstra
@@ -76,12 +76,16 @@ static struct {
     { "every", LXT_EVERY },
     { "every", LXT_EVERY },
     { "from", LXT_FROM },
     { "from", LXT_FROM },
     { "if", LXT_IF },
     { "if", LXT_IF },
+    { "if1", LXT_IF1 },
+    { "if2", LXT_IF },
     { "in", LXT_IN },
     { "in", LXT_IN },
     { "io", LXT_IO },
     { "io", LXT_IO },
     { "io1", LXT_IO1 },
     { "io1", LXT_IO1 },
     { "io2", LXT_IO },
     { "io2", LXT_IO },
     { "mbuf", LXT_MBUF },
     { "mbuf", LXT_MBUF },
     { "mem", LXT_MEM },
     { "mem", LXT_MEM },
+    { "mem1", LXT_MEM1 },
+    { "mem2", LXT_MEM },
     { "monitor", LXT_MONITOR },
     { "monitor", LXT_MONITOR },
     { "mux", LXT_MUX },
     { "mux", LXT_MUX },
     { "pf", LXT_PF },
     { "pf", LXT_PF },

+ 22 - 20
symon/lib/lex.h

@@ -1,4 +1,4 @@
-/* $Id: lex.h,v 1.24 2007/02/11 20:07:31 dijkstra Exp $ */
+/* $Id: lex.h,v 1.25 2007/12/11 14:17:59 dijkstra Exp $ */
 
 
 /*
 /*
  * Copyright (c) 2001-2007 Willem Dijkstra
  * Copyright (c) 2001-2007 Willem Dijkstra
@@ -56,25 +56,27 @@
 #define LXT_EVERY     10
 #define LXT_EVERY     10
 #define LXT_FROM      11
 #define LXT_FROM      11
 #define LXT_IF        12
 #define LXT_IF        12
-#define LXT_IN        13
-#define LXT_IO        14
-#define LXT_IO1       15
-#define LXT_MBUF      16
-#define LXT_MEM       17
-#define LXT_MONITOR   18
-#define LXT_MUX       19
-#define LXT_OPEN      20
-#define LXT_PF        21
-#define LXT_PFQ       22
-#define LXT_PORT      23
-#define LXT_PROC      24
-#define LXT_SECOND    25
-#define LXT_SECONDS   26
-#define LXT_SENSOR    27
-#define LXT_SOURCE    28
-#define LXT_STREAM    29
-#define LXT_TO        30
-#define LXT_WRITE     31
+#define LXT_IF1       13
+#define LXT_IN        14
+#define LXT_IO        15
+#define LXT_IO1       16
+#define LXT_MBUF      17
+#define LXT_MEM       18
+#define LXT_MEM1      19
+#define LXT_MONITOR   20
+#define LXT_MUX       21
+#define LXT_OPEN      22
+#define LXT_PF        23
+#define LXT_PFQ       24
+#define LXT_PORT      25
+#define LXT_PROC      26
+#define LXT_SECOND    27
+#define LXT_SECONDS   28
+#define LXT_SENSOR    29
+#define LXT_SOURCE    30
+#define LXT_STREAM    31
+#define LXT_TO        32
+#define LXT_WRITE     33
 
 
 struct lex {
 struct lex {
     char *buffer;               /* current line(s) */
     char *buffer;               /* current line(s) */

+ 1 - 2
symon/lib/net.h

@@ -1,4 +1,4 @@
-/* $Id: net.h,v 1.16 2007/11/29 13:13:17 dijkstra Exp $ */
+/* $Id: net.h,v 1.17 2007/12/11 14:17:59 dijkstra Exp $ */
 
 
 /*
 /*
  * Copyright (c) 2001-2007 Willem Dijkstra
  * Copyright (c) 2001-2007 Willem Dijkstra
@@ -38,7 +38,6 @@
 #include <sys/types.h>
 #include <sys/types.h>
 
 
 #define SYMUX_PORT  "2100"      /* default symux port */
 #define SYMUX_PORT  "2100"      /* default symux port */
-#define SYMON_MAXPACKET 65515   /* udp packet max payload 65Kb - 20 byte header */
 extern char res_host[];
 extern char res_host[];
 extern char res_service[];
 extern char res_service[];
 extern struct sockaddr_storage res_addr;
 extern struct sockaddr_storage res_addr;

+ 3 - 2
symon/lib/sylimits.h

@@ -1,4 +1,4 @@
-/* $Id: sylimits.h,v 1.6 2007/02/11 20:07:31 dijkstra Exp $ */
+/* $Id: sylimits.h,v 1.8 2008/01/06 14:25:45 dijkstra Exp $ */
 
 
 #ifndef _LIB_LIMITS_H
 #ifndef _LIB_LIMITS_H
 #define _LIB_LIMITS_H
 #define _LIB_LIMITS_H
@@ -14,6 +14,7 @@
 #define SYMON_MAXDEBUGID       20       /* = CTL_DEBUG_MAXID; depends lib/data.h */
 #define SYMON_MAXDEBUGID       20       /* = CTL_DEBUG_MAXID; depends lib/data.h */
 #define SYMON_MAXCPUID         16       /* cpu0 - cpu15 */
 #define SYMON_MAXCPUID         16       /* cpu0 - cpu15 */
 #define SYMON_DFBLOCKSIZE      512
 #define SYMON_DFBLOCKSIZE      512
-#define SYMON_DFNAMESIZE       16
+#define SYMON_DFNAMESIZE       64
+#define SYMON_MAXPACKET        65515    /* udp packet max payload 65Kb - 20 byte header */
 
 
 #endif
 #endif

+ 13 - 13
symon/platform/FreeBSD/sm_if.c

@@ -1,8 +1,8 @@
-/* $Id: sm_if.c,v 1.4 2007/02/11 20:07:32 dijkstra Exp $ */
+/* $Id: sm_if.c,v 1.5 2007/12/11 14:17:59 dijkstra Exp $ */
 
 
 /*
 /*
  * Copyright (c) 2005 Fredrik Soderblom
  * Copyright (c) 2005 Fredrik Soderblom
- * Copyright (c) 2005 Willem Dijkstra
+ * Copyright (c) 2005-2007 Willem Dijkstra
  * All rights reserved.
  * All rights reserved.
  *
  *
  * Redistribution and use in source and binary forms, with or without
  * Redistribution and use in source and binary forms, with or without
@@ -128,17 +128,17 @@ get_if(char *symon_buf, int maxlen, struct stream *st)
     for (i = 1; i <= if_cur; i++) {
     for (i = 1; i <= if_cur; i++) {
         if (!strcmp(if_md[i - 1].ifmd_name, st->arg)) {
         if (!strcmp(if_md[i - 1].ifmd_name, st->arg)) {
             ifdata = if_md[i - 1].ifmd_data;
             ifdata = if_md[i - 1].ifmd_data;
-            return snpack(symon_buf, maxlen, st->arg, MT_IF,
-                          ifdata.ifi_ipackets,
-                          ifdata.ifi_opackets,
-                          ifdata.ifi_ibytes,
-                          ifdata.ifi_obytes,
-                          ifdata.ifi_imcasts,
-                          ifdata.ifi_omcasts,
-                          ifdata.ifi_ierrors,
-                          ifdata.ifi_oerrors,
-                          ifdata.ifi_collisions,
-                          ifdata.ifi_iqdrops);
+            return snpack(symon_buf, maxlen, st->arg, MT_IF2,
+                          (u_int64_t) ifdata.ifi_ipackets,
+                          (u_int64_t) ifdata.ifi_opackets,
+                          (u_int64_t) ifdata.ifi_ibytes,
+                          (u_int64_t) ifdata.ifi_obytes,
+                          (u_int64_t) ifdata.ifi_imcasts,
+                          (u_int64_t) ifdata.ifi_omcasts,
+                          (u_int64_t) ifdata.ifi_ierrors,
+                          (u_int64_t) ifdata.ifi_oerrors,
+                          (u_int64_t) ifdata.ifi_collisions,
+                          (u_int64_t) ifdata.ifi_iqdrops);
         }
         }
     }
     }
 
 

+ 10 - 12
symon/platform/FreeBSD/sm_mem.c

@@ -1,7 +1,7 @@
-/* $Id: sm_mem.c,v 1.10 2007/02/11 20:07:32 dijkstra Exp $ */
+/* $Id: sm_mem.c,v 1.11 2007/12/11 14:17:59 dijkstra Exp $ */
 
 
 /*
 /*
- * Copyright (c) 2004      Matthew Gream
+ * Copyright (c) 2004-2007      Matthew Gream
  * All rights reserved.
  * All rights reserved.
  *
  *
  * Redistribution and use in source and binary forms, with or without
  * Redistribution and use in source and binary forms, with or without
@@ -56,8 +56,8 @@
 #define pagetob(size) ((size) << me_pageshift)
 #define pagetob(size) ((size) << me_pageshift)
 
 
 /* Globals for this module all start with me_ */
 /* Globals for this module all start with me_ */
-static int me_pagesize;
-static int me_pageshift;
+static u_int64_t me_pagesize;
+static u_int64_t me_pageshift;
 
 
 static char me_vmnswp_mib_str[] = "vm.nswapdev";
 static char me_vmnswp_mib_str[] = "vm.nswapdev";
 static int me_vmnswp_mib_nam[CTL_MAXNAME];
 static int me_vmnswp_mib_nam[CTL_MAXNAME];
@@ -68,7 +68,7 @@ static int me_vmiswp_mib_nam[CTL_MAXNAME];
 static size_t me_vmiswp_mib_len = 0;
 static size_t me_vmiswp_mib_len = 0;
 
 
 static int me_vm_mib[] = {CTL_VM, VM_TOTAL};
 static int me_vm_mib[] = {CTL_VM, VM_TOTAL};
-static long me_stats[5];
+static u_int64_t me_stats[5];
 
 
 static struct vmtotal me_vmtotal;
 static struct vmtotal me_vmtotal;
 static size_t me_vmsize = sizeof(struct vmtotal);
 static size_t me_vmsize = sizeof(struct vmtotal);
@@ -100,12 +100,6 @@ init_mem(struct stream *st)
 
 
 void
 void
 gets_mem()
 gets_mem()
-{
-    /* EMPTY */
-}
-
-int
-get_mem(char *symon_buf, int maxlen, struct stream *st)
 {
 {
 #ifdef HAS_XSWDEV
 #ifdef HAS_XSWDEV
     int i;
     int i;
@@ -139,8 +133,12 @@ get_mem(char *symon_buf, int maxlen, struct stream *st)
         me_stats[4] += pagetob(vmiswp_dat.xsw_nblks);
         me_stats[4] += pagetob(vmiswp_dat.xsw_nblks);
     }
     }
 #endif
 #endif
+}
 
 
-    return snpack(symon_buf, maxlen, st->arg, MT_MEM,
+int
+get_mem(char *symon_buf, int maxlen, struct stream *st)
+{
+    return snpack(symon_buf, maxlen, st->arg, MT_MEM2,
                   me_stats[0], me_stats[1], me_stats[2],
                   me_stats[0], me_stats[1], me_stats[2],
                   me_stats[3], me_stats[4]);
                   me_stats[3], me_stats[4]);
 }
 }

+ 38 - 30
symon/platform/Linux/sm_if.c

@@ -1,7 +1,7 @@
-/* $Id: sm_if.c,v 1.7 2007/02/11 20:07:32 dijkstra Exp $ */
+/* $Id: sm_if.c,v 1.9 2007/12/11 18:31:37 dijkstra Exp $ */
 
 
 /*
 /*
- * Copyright (c) 2001-2005 Willem Dijkstra
+ * Copyright (c) 2001-2007 Willem Dijkstra
  * All rights reserved.
  * All rights reserved.
  *
  *
  * Redistribution and use in source and binary forms, with or without
  * Redistribution and use in source and binary forms, with or without
@@ -56,22 +56,26 @@ static int if_size = 0;
 static int if_maxsize = 0;
 static int if_maxsize = 0;
 struct if_device_stats
 struct if_device_stats
 {
 {
-    unsigned long   rx_packets;             /* total packets received       */
-    unsigned long   tx_packets;             /* total packets transmitted    */
-    unsigned long   rx_bytes;               /* total bytes received         */
-    unsigned long   tx_bytes;               /* total bytes transmitted      */
-    unsigned long   rx_errors;              /* bad packets received         */
-    unsigned long   tx_errors;              /* packet transmit problems     */
-    unsigned long   rx_dropped;             /* no space in linux buffers    */
-    unsigned long   tx_dropped;             /* no space available in linux  */
-    unsigned long   multicast;              /* multicast packets received   */
-    unsigned long   collisions;
-    unsigned long   rx_frame_errors;        /* recv'd frame alignment error */
-    unsigned long   rx_fifo_errors;         /* recv'r fifo overrun          */
-    unsigned long   tx_carrier_errors;
-    unsigned long   tx_fifo_errors;
-    unsigned long   rx_compressed;
-    unsigned long   tx_compressed;
+    u_int64_t rx_packets;             /* total packets received       */
+    u_int64_t tx_packets;             /* total packets transmitted    */
+    u_int64_t rx_bytes;               /* total bytes received         */
+    u_int64_t tx_bytes;               /* total bytes transmitted      */
+    u_int64_t rx_errors;              /* bad packets received         */
+    u_int64_t tx_errors;              /* packet transmit problems     */
+    u_int64_t rx_dropped;             /* no space in linux buffers    */
+    u_int64_t tx_dropped;             /* no space available in linux  */
+    u_int64_t multicast;              /* multicast packets received   */
+    u_int64_t collisions;
+    u_int64_t rx_frame_errors;        /* recv'd frame alignment error */
+    u_int64_t rx_fifo_errors;         /* recv'r fifo overrun          */
+    u_int64_t tx_carrier_errors;
+    u_int64_t tx_fifo_errors;
+    u_int64_t rx_compressed;
+    u_int64_t tx_compressed;
+    /* aggregates */
+    u_int64_t errors_in;
+    u_int64_t errors_out;
+    u_int64_t drops;
 };
 };
 
 
 void
 void
@@ -137,7 +141,7 @@ get_if(char *symon_buf, int maxlen, struct stream *st)
     /* Inter-|   Receive                                                |  Transmit
     /* Inter-|   Receive                                                |  Transmit
      *  face |bytes    packets errs drop fifo frame compressed multicast|bytes    packets errs drop fifo colls carrier compressed
      *  face |bytes    packets errs drop fifo frame compressed multicast|bytes    packets errs drop fifo colls carrier compressed
      */
      */
-    if (16 > sscanf(line, ":%lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu\n",
+    if (16 > sscanf(line, ":%Lu %Lu %Lu %Lu %Lu %Lu %Lu %Lu %Lu %Lu %Lu %Lu %Lu %Lu %Lu %Lu\n",
                     &stats.rx_bytes, &stats.rx_packets, &stats.rx_errors, &stats.rx_dropped, &stats.rx_fifo_errors,
                     &stats.rx_bytes, &stats.rx_packets, &stats.rx_errors, &stats.rx_dropped, &stats.rx_fifo_errors,
                     &stats.rx_frame_errors, &stats.rx_compressed, &stats.multicast,
                     &stats.rx_frame_errors, &stats.rx_compressed, &stats.multicast,
                     &stats.tx_bytes, &stats.tx_packets, &stats.tx_errors, &stats.tx_dropped, &stats.tx_fifo_errors,
                     &stats.tx_bytes, &stats.tx_packets, &stats.tx_errors, &stats.tx_dropped, &stats.tx_fifo_errors,
@@ -146,15 +150,19 @@ get_if(char *symon_buf, int maxlen, struct stream *st)
         return 0;
         return 0;
     }
     }
 
 
-    return snpack(symon_buf, maxlen, st->arg, MT_IF,
-                  stats.rx_packets,
-                  stats.tx_packets,
-                  stats.rx_bytes,
-                  stats.tx_bytes,
-                  stats.multicast,
-                  0,
-                  (stats.rx_errors + stats.rx_fifo_errors + stats.rx_frame_errors),
-                  (stats.tx_errors + stats.tx_fifo_errors + stats.tx_carrier_errors),
-                  stats.collisions,
-                  (stats.rx_dropped + stats.tx_dropped));
+    stats.errors_in = (stats.rx_errors + stats.rx_fifo_errors + stats.rx_frame_errors);
+    stats.errors_out = (stats.tx_errors + stats.tx_fifo_errors + stats.tx_carrier_errors);
+    stats.drops = (stats.rx_dropped + stats.tx_dropped);
+
+    return snpack(symon_buf, maxlen, st->arg, MT_IF2,
+                  (u_int64_t) stats.rx_packets,
+                  (u_int64_t) stats.tx_packets,
+                  (u_int64_t) stats.rx_bytes,
+                  (u_int64_t) stats.tx_bytes,
+                  (u_int64_t) stats.multicast,
+                  (u_int64_t) 0,
+                  (u_int64_t) stats.errors_in,
+                  (u_int64_t) stats.errors_out,
+                  (u_int64_t) stats.collisions,
+                  (u_int64_t) stats.drops);
 }
 }

+ 6 - 6
symon/platform/Linux/sm_mem.c

@@ -1,7 +1,7 @@
-/* $Id: sm_mem.c,v 1.5 2007/10/29 16:14:37 dijkstra Exp $ */
+/* $Id: sm_mem.c,v 1.6 2007/12/11 14:17:59 dijkstra Exp $ */
 
 
 /*
 /*
- * Copyright (c) 2005 Harm Schotanus
+ * Copyright (c) 2005-2007 Harm Schotanus
  * All rights reserved.
  * All rights reserved.
  *
  *
  * Redistribution and use in source and binary forms, with or without
  * Redistribution and use in source and binary forms, with or without
@@ -50,9 +50,9 @@
 
 
 /* Globals for this module all start with me_ */
 /* Globals for this module all start with me_ */
 static void *me_buf = NULL;
 static void *me_buf = NULL;
-static int me_size = 0;
-static int me_maxsize = 0;
-static long me_stats[5];
+static u_int64_t me_size = 0;
+static u_int64_t me_maxsize = 0;
+static u_int64_t me_stats[5];
 
 
 void
 void
 init_mem(struct stream *st)
 init_mem(struct stream *st)
@@ -130,7 +130,7 @@ get_mem(char *symon_buf, int maxlen, struct stream *st)
 
 
     me_stats[3] = me_stats[4] - me_stats[3];
     me_stats[3] = me_stats[4] - me_stats[3];
 
 
-    return snpack(symon_buf, maxlen, st->arg, MT_MEM,
+    return snpack(symon_buf, maxlen, st->arg, MT_MEM2,
                   me_stats[0], me_stats[1], me_stats[2],
                   me_stats[0], me_stats[1], me_stats[2],
                   me_stats[3], me_stats[4]);
                   me_stats[3], me_stats[4]);
 }
 }

+ 13 - 13
symon/platform/NetBSD/sm_if.c

@@ -1,7 +1,7 @@
-/* $Id: sm_if.c,v 1.5 2007/02/11 20:07:32 dijkstra Exp $ */
+/* $Id: sm_if.c,v 1.6 2007/12/11 14:17:59 dijkstra Exp $ */
 
 
 /*
 /*
- * Copyright (c) 2004      Matthew Gream
+ * Copyright (c) 2004-2007      Matthew Gream
  * All rights reserved.
  * All rights reserved.
  *
  *
  * Redistribution and use in source and binary forms, with or without
  * Redistribution and use in source and binary forms, with or without
@@ -89,15 +89,15 @@ get_if(char *symon_buf, int maxlen, struct stream *st)
     }
     }
     ifi = &st->parg.ifr.ifdr_data;
     ifi = &st->parg.ifr.ifdr_data;
 
 
-    return snpack(symon_buf, maxlen, st->arg, MT_IF,
-                  (u_int32_t) ifi->ifi_ipackets,
-                  (u_int32_t) ifi->ifi_opackets,
-                  (u_int32_t) ifi->ifi_ibytes,
-                  (u_int32_t) ifi->ifi_obytes,
-                  (u_int32_t) ifi->ifi_imcasts,
-                  (u_int32_t) ifi->ifi_omcasts,
-                  (u_int32_t) ifi->ifi_ierrors,
-                  (u_int32_t) ifi->ifi_oerrors,
-                  (u_int32_t) ifi->ifi_collisions,
-                  (u_int32_t) ifi->ifi_iqdrops);
+    return snpack(symon_buf, maxlen, st->arg, MT_IF2,
+                  (u_int64_t) ifi->ifi_ipackets,
+                  (u_int64_t) ifi->ifi_opackets,
+                  (u_int64_t) ifi->ifi_ibytes,
+                  (u_int64_t) ifi->ifi_obytes,
+                  (u_int64_t) ifi->ifi_imcasts,
+                  (u_int64_t) ifi->ifi_omcasts,
+                  (u_int64_t) ifi->ifi_ierrors,
+                  (u_int64_t) ifi->ifi_oerrors,
+                  (u_int64_t) ifi->ifi_collisions,
+                  (u_int64_t) ifi->ifi_iqdrops);
 }
 }

+ 7 - 7
symon/platform/NetBSD/sm_mem.c

@@ -1,7 +1,7 @@
-/* $Id: sm_mem.c,v 1.2 2007/02/11 20:07:32 dijkstra Exp $ */
+/* $Id: sm_mem.c,v 1.3 2007/12/11 14:17:59 dijkstra Exp $ */
 
 
 /*
 /*
- * Copyright (c) 2001-2004 Willem Dijkstra
+ * Copyright (c) 2001-2007 Willem Dijkstra
  * All rights reserved.
  * All rights reserved.
  *
  *
  * Redistribution and use in source and binary forms, with or without
  * Redistribution and use in source and binary forms, with or without
@@ -53,13 +53,13 @@
 #define pagetob(size) ((size) << me_pageshift)
 #define pagetob(size) ((size) << me_pageshift)
 
 
 /* Globals for this module all start with me_ */
 /* Globals for this module all start with me_ */
-static int me_pageshift;
-static long me_stats[5];
+static u_int64_t me_pageshift;
+static u_int64_t me_stats[5];
 static int me_vm_mib[] = {CTL_VM, VM_METER};
 static int me_vm_mib[] = {CTL_VM, VM_METER};
 static struct vmtotal me_vmtotal;
 static struct vmtotal me_vmtotal;
 static size_t me_vmsize;
 static size_t me_vmsize;
-static int me_pagesize;
-static int me_nswap;
+static u_int64_t me_pagesize;
+static u_int64_t me_nswap;
 struct swapent *me_swdev = NULL;
 struct swapent *me_swdev = NULL;
 
 
 void
 void
@@ -134,7 +134,7 @@ gets_mem()
 int
 int
 get_mem(char *symon_buf, int maxlen, struct stream *st)
 get_mem(char *symon_buf, int maxlen, struct stream *st)
 {
 {
-    return snpack(symon_buf, maxlen, st->arg, MT_MEM,
+    return snpack(symon_buf, maxlen, st->arg, MT_MEM2,
                   me_stats[0], me_stats[1], me_stats[2],
                   me_stats[0], me_stats[1], me_stats[2],
                   me_stats[3], me_stats[4]);
                   me_stats[3], me_stats[4]);
 }
 }

+ 14 - 12
symon/platform/OpenBSD/sm_if.c

@@ -1,4 +1,4 @@
-/* $Id: sm_if.c,v 1.17 2007/07/05 08:34:52 dijkstra Exp $ */
+/* $Id: sm_if.c,v 1.18 2007/12/11 14:17:59 dijkstra Exp $ */
 
 
 /*
 /*
  * Copyright (c) 2001-2007 Willem Dijkstra
  * Copyright (c) 2001-2007 Willem Dijkstra
@@ -77,7 +77,9 @@ init_if(struct stream *st)
 void
 void
 gets_if()
 gets_if()
 {
 {
+    /* EMPTY */
 }
 }
+
 int
 int
 get_if(char *symon_buf, int maxlen, struct stream *st)
 get_if(char *symon_buf, int maxlen, struct stream *st)
 {
 {
@@ -90,15 +92,15 @@ get_if(char *symon_buf, int maxlen, struct stream *st)
         return 0;
         return 0;
     }
     }
 
 
-    return snpack(symon_buf, maxlen, st->arg, MT_IF,
-                  ifdata.ifi_ipackets,
-                  ifdata.ifi_opackets,
-                  ifdata.ifi_ibytes,
-                  ifdata.ifi_obytes,
-                  ifdata.ifi_imcasts,
-                  ifdata.ifi_omcasts,
-                  ifdata.ifi_ierrors,
-                  ifdata.ifi_oerrors,
-                  ifdata.ifi_collisions,
-                  ifdata.ifi_iqdrops);
+    return snpack(symon_buf, maxlen, st->arg, MT_IF2,
+                  (u_int64_t) ifdata.ifi_ipackets,
+                  (u_int64_t) ifdata.ifi_opackets,
+                  (u_int64_t) ifdata.ifi_ibytes,
+                  (u_int64_t) ifdata.ifi_obytes,
+                  (u_int64_t) ifdata.ifi_imcasts,
+                  (u_int64_t) ifdata.ifi_omcasts,
+                  (u_int64_t) ifdata.ifi_ierrors,
+                  (u_int64_t) ifdata.ifi_oerrors,
+                  (u_int64_t) ifdata.ifi_collisions,
+                  (u_int64_t) ifdata.ifi_iqdrops);
 }
 }

+ 7 - 7
symon/platform/OpenBSD/sm_mem.c

@@ -1,7 +1,7 @@
-/* $Id: sm_mem.c,v 1.21 2007/02/11 20:07:32 dijkstra Exp $ */
+/* $Id: sm_mem.c,v 1.22 2007/12/11 14:17:59 dijkstra Exp $ */
 
 
 /*
 /*
- * Copyright (c) 2001-2004 Willem Dijkstra
+ * Copyright (c) 2001-2007 Willem Dijkstra
  * All rights reserved.
  * All rights reserved.
  *
  *
  * Redistribution and use in source and binary forms, with or without
  * Redistribution and use in source and binary forms, with or without
@@ -53,13 +53,13 @@
 #define pagetob(size) ((size) << me_pageshift)
 #define pagetob(size) ((size) << me_pageshift)
 
 
 /* Globals for this module all start with me_ */
 /* Globals for this module all start with me_ */
-static int me_pageshift;
-static long me_stats[5];
+static u_int64_t me_pageshift;
+static u_int64_t me_stats[5];
 static int me_vm_mib[] = {CTL_VM, VM_METER};
 static int me_vm_mib[] = {CTL_VM, VM_METER};
 static struct vmtotal me_vmtotal;
 static struct vmtotal me_vmtotal;
 static size_t me_vmsize;
 static size_t me_vmsize;
-static int me_pagesize;
-static int me_nswap;
+static u_int64_t me_pagesize;
+static u_int64_t me_nswap;
 struct swapent *me_swdev = NULL;
 struct swapent *me_swdev = NULL;
 
 
 void
 void
@@ -134,7 +134,7 @@ gets_mem()
 int
 int
 get_mem(char *symon_buf, int maxlen, struct stream *st)
 get_mem(char *symon_buf, int maxlen, struct stream *st)
 {
 {
-    return snpack(symon_buf, maxlen, st->arg, MT_MEM,
+    return snpack(symon_buf, maxlen, st->arg, MT_MEM2,
                   me_stats[0], me_stats[1], me_stats[2],
                   me_stats[0], me_stats[1], me_stats[2],
                   me_stats[3], me_stats[4]);
                   me_stats[3], me_stats[4]);
 }
 }

+ 4 - 2
symon/symon/readconf.c

@@ -1,4 +1,4 @@
-/* $Id: readconf.c,v 1.27 2007/07/09 11:43:13 dijkstra Exp $ */
+/* $Id: readconf.c,v 1.28 2007/12/11 14:17:59 dijkstra Exp $ */
 
 
 /*
 /*
  * Copyright (c) 2001-2005 Willem Dijkstra
  * Copyright (c) 2001-2005 Willem Dijkstra
@@ -103,9 +103,11 @@ read_symon_args(struct mux * mux, struct lex * l)
         case LXT_CPU:
         case LXT_CPU:
         case LXT_DF:
         case LXT_DF:
         case LXT_IF:
         case LXT_IF:
+        case LXT_IF1:
         case LXT_IO:
         case LXT_IO:
         case LXT_IO1:
         case LXT_IO1:
         case LXT_MEM:
         case LXT_MEM:
+        case LXT_MEM1:
         case LXT_PF:
         case LXT_PF:
         case LXT_PFQ:
         case LXT_PFQ:
         case LXT_MBUF:
         case LXT_MBUF:
@@ -150,7 +152,7 @@ read_symon_args(struct mux * mux, struct lex * l)
         case LXT_COMMA:
         case LXT_COMMA:
             break;
             break;
         default:
         default:
-            parse_error(l, "{cpu|df|if|io|io1|mem|pf|pfq|mbuf|debug|proc|sensor}");
+            parse_error(l, "{cpu|df|if|if1|io|io1|mem|mem1|pf|pfq|mbuf|debug|proc|sensor}");
             return 0;
             return 0;
             break;
             break;
         }
         }

+ 1 - 1
symon/symon/symon.8

@@ -27,7 +27,7 @@
 .\" ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 .\" ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 .\" POSSIBILITY OF SUCH DAMAGE.
 .\" POSSIBILITY OF SUCH DAMAGE.
 .\"
 .\"
-.Dd August 8, 2004
+.Dd December 11, 2007
 .Dt SYMON 8
 .Dt SYMON 8
 .Os
 .Os
 .Sh NAME
 .Sh NAME

+ 5 - 3
symon/symon/symon.c

@@ -1,4 +1,4 @@
-/* $Id: symon.c,v 1.49 2007/11/29 13:55:30 dijkstra Exp $ */
+/* $Id: symon.c,v 1.50 2007/12/11 14:17:59 dijkstra Exp $ */
 
 
 /*
 /*
  * Copyright (c) 2001-2007 Willem Dijkstra
  * Copyright (c) 2001-2007 Willem Dijkstra
@@ -72,8 +72,8 @@ int symon_interval = SYMON_DEFAULT_INTERVAL;
 struct funcmap streamfunc[] = {
 struct funcmap streamfunc[] = {
     {MT_IO1, 0, NULL, init_io, gets_io, get_io},
     {MT_IO1, 0, NULL, init_io, gets_io, get_io},
     {MT_CPU, 0, NULL, init_cpu, gets_cpu, get_cpu},
     {MT_CPU, 0, NULL, init_cpu, gets_cpu, get_cpu},
-    {MT_MEM, 0, NULL, init_mem, gets_mem, get_mem},
-    {MT_IF, 0, NULL, init_if, gets_if, get_if},
+    {MT_MEM1, 0, NULL, init_mem, gets_mem, get_mem},
+    {MT_IF1, 0, NULL, init_if, gets_if, get_if},
     {MT_PF, 0, privinit_pf, init_pf, gets_pf, get_pf},
     {MT_PF, 0, privinit_pf, init_pf, gets_pf, get_pf},
     {MT_DEBUG, 0, NULL, init_debug, NULL, get_debug},
     {MT_DEBUG, 0, NULL, init_debug, NULL, get_debug},
     {MT_PROC, 0, privinit_proc, init_proc, gets_proc, get_proc},
     {MT_PROC, 0, privinit_proc, init_proc, gets_proc, get_proc},
@@ -82,6 +82,8 @@ struct funcmap streamfunc[] = {
     {MT_IO2, 0, NULL, init_io, gets_io, get_io},
     {MT_IO2, 0, NULL, init_io, gets_io, get_io},
     {MT_PFQ, 0, privinit_pfq, init_pfq, gets_pfq, get_pfq},
     {MT_PFQ, 0, privinit_pfq, init_pfq, gets_pfq, get_pfq},
     {MT_DF, 0, NULL, init_df, gets_df, get_df},
     {MT_DF, 0, NULL, init_df, gets_df, get_df},
+    {MT_MEM2, 0, NULL, init_mem, gets_mem, get_mem},
+    {MT_IF2, 0, NULL, init_if, gets_if, get_if},
     {MT_EOT, 0, NULL, NULL, NULL}
     {MT_EOT, 0, NULL, NULL, NULL}
 };
 };
 
 

+ 2 - 2
symon/symux/c_smrrds.sh

@@ -1,5 +1,5 @@
 #!/bin/sh
 #!/bin/sh
-# $Id: c_smrrds.sh,v 1.37 2007/09/25 14:33:21 dijkstra Exp $
+# $Id: c_smrrds.sh,v 1.39 2007/12/12 12:16:16 dijkstra Exp $
 
 
 #
 #
 # Copyright (c) 2001-2006 Willem Dijkstra
 # Copyright (c) 2001-2006 Willem Dijkstra
@@ -123,7 +123,7 @@ EOF
     exit 1;
     exit 1;
 fi
 fi
 
 
-RRD_ARGS="--step=$INTERVAL --start=0"
+RRD_ARGS="--step=$INTERVAL --start=now-10"
 
 
 for i in $args
 for i in $args
 do
 do

+ 15 - 9
symon/symux/readconf.c

@@ -1,4 +1,4 @@
-/* $Id: readconf.c,v 1.33 2007/10/29 14:59:43 dijkstra Exp $ */
+/* $Id: readconf.c,v 1.34 2007/12/11 14:17:59 dijkstra Exp $ */
 
 
 /*
 /*
  * Copyright (c) 2001-2007 Willem Dijkstra
  * Copyright (c) 2001-2007 Willem Dijkstra
@@ -71,19 +71,21 @@ insert_filename(char *path, int maxlen, int type, char *args)
         ts = "df_";
         ts = "df_";
         ta = args;
         ta = args;
         break;
         break;
-    case MT_IF:
+    case MT_IF1:  /* rrd stores 64bits, if1 and if2 are equivalent */
+    case MT_IF2:
         ts = "if_";
         ts = "if_";
         ta = args;
         ta = args;
         break;
         break;
-    case MT_IO2:
-        ts = "io_";
-        ta = args;
-        break;
     case MT_IO1:
     case MT_IO1:
         ts = "io1_";
         ts = "io1_";
         ta = args;
         ta = args;
         break;
         break;
-    case MT_MEM:
+    case MT_IO2:
+        ts = "io_";
+        ta = args;
+        break;
+    case MT_MEM1: /* rrd stores 64bits, mem1 and mem2 are equivalent */
+    case MT_MEM2:
         ts = "mem";
         ts = "mem";
         ta = "";
         ta = "";
         break;
         break;
@@ -212,9 +214,11 @@ read_source(struct sourcelist * sol, struct lex * l, int filecheck)
                 case LXT_CPU:
                 case LXT_CPU:
                 case LXT_DF:
                 case LXT_DF:
                 case LXT_IF:
                 case LXT_IF:
+                case LXT_IF1:
                 case LXT_IO:
                 case LXT_IO:
                 case LXT_IO1:
                 case LXT_IO1:
                 case LXT_MEM:
                 case LXT_MEM:
+                case LXT_MEM1:
                 case LXT_PF:
                 case LXT_PF:
                 case LXT_PFQ:
                 case LXT_PFQ:
                 case LXT_MBUF:
                 case LXT_MBUF:
@@ -258,7 +262,7 @@ read_source(struct sourcelist * sol, struct lex * l, int filecheck)
                         return 0;
                         return 0;
                     }
                     }
 
 
-                    break;      /* LXT_CPU/IF/IO/IO1/MEM/PF/MBUF/DEBUG/PROC */
+                    break;      /* LXT_CPU/IF/IF1/IO/IO1/MEM/MEM1/PF/MBUF/DEBUG/PROC */
                 case LXT_COMMA:
                 case LXT_COMMA:
                     break;
                     break;
                 default:
                 default:
@@ -352,9 +356,11 @@ read_source(struct sourcelist * sol, struct lex * l, int filecheck)
             case LXT_CPU:
             case LXT_CPU:
             case LXT_DF:
             case LXT_DF:
             case LXT_IF:
             case LXT_IF:
+            case LXT_IF1:
             case LXT_IO:
             case LXT_IO:
             case LXT_IO1:
             case LXT_IO1:
             case LXT_MEM:
             case LXT_MEM:
+            case LXT_MEM1:
             case LXT_PF:
             case LXT_PF:
             case LXT_PFQ:
             case LXT_PFQ:
             case LXT_MBUF:
             case LXT_MBUF:
@@ -420,7 +426,7 @@ read_source(struct sourcelist * sol, struct lex * l, int filecheck)
                         stream->file = xstrdup(l->token);
                         stream->file = xstrdup(l->token);
                     }
                     }
                 }
                 }
-                break;          /* LXT_CPU/IF/IO/IO1/MEM/PF/PFQ/MBUF/DEBUG/PROC/SENSOR */
+                break;          /* LXT_CPU/IF/IF1/IO/IO1/MEM/MEM1/PF/PFQ/MBUF/DEBUG/PROC/SENSOR */
             default:
             default:
                 parse_error(l, "{cpu|if|io|mem|pf|mbuf|debug|proc|sensor}");
                 parse_error(l, "{cpu|if|io|mem|pf|mbuf|debug|proc|sensor}");
                 return 0;
                 return 0;

+ 28 - 31
symon/symux/symux.8

@@ -27,7 +27,7 @@
 .\" ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 .\" ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 .\" POSSIBILITY OF SUCH DAMAGE.
 .\" POSSIBILITY OF SUCH DAMAGE.
 .\"
 .\"
-.Dd August 8, 2004
+.Dd December 11, 2007
 .Dt SYMUX 8
 .Dt SYMUX 8
 .Os
 .Os
 .Sh NAME
 .Sh NAME
@@ -225,9 +225,15 @@ bit unsigned integers.
 Disk free statistics ( blocks : bfree : bavail : files :
 Disk free statistics ( blocks : bfree : bavail : files :
 ffree : synwrites : asyncwrites). Values are 64 bit unsigned integers.
 ffree : synwrites : asyncwrites). Values are 64 bit unsigned integers.
 .It if
 .It if
+Alias for if2. See below.
+.It if1
+Pre OpenBSD 4.3 interface counters ( packets_in, packets_out, bytes_in,
+bytes_out, multicasts_in, multicasts_out, errors_in, errors_out, collisions,
+drops ). Values are 32 bit unsigned integers.
+.It if2
 Interface counters ( packets_in, packets_out, bytes_in, bytes_out,
 Interface counters ( packets_in, packets_out, bytes_in, bytes_out,
 multicasts_in, multicasts_out, errors_in, errors_out, collisions, drops
 multicasts_in, multicasts_out, errors_in, errors_out, collisions, drops
-). Values are 32 bit unsigned integers.
+). Values are 64 bit unsigned integers.
 .It io
 .It io
 Alias for io2. See below.
 Alias for io2. See below.
 .It io1
 .It io1
@@ -241,8 +247,14 @@ Mbuf statistics ( totmbufs : mt_data : mt_oobdata : mt_control :
 mt_header : mt_ftable : mt_soname : mt_soopts : pgused : pgtotal :
 mt_header : mt_ftable : mt_soname : mt_soopts : pgused : pgtotal :
 totmem : totpct : m_drops : m_wait : m_drain ).
 totmem : totpct : m_drops : m_wait : m_drain ).
 .It mem
 .It mem
+Alias for mem2. See below.
+.It mem1
+Pre symon 2.78 memory counters ( real_active, real_total, free, swap_used,
+swap_total ). All values are in bytes rounded to page boundaries. Values are 32
+bit unsigned integers.
+.It mem2
 Memory in ( real_active, real_total, free, swap_used, swap_total ). All values
 Memory in ( real_active, real_total, free, swap_used, swap_total ). All values
-are in bytes rounded of to page boundaries. Values are 32 bit unsigned integers.
+are in bytes rounded to page boundaries. Values are 64 bit unsigned integers.
 .It pf
 .It pf
 Packet filter statistics ( bytes_v4_in : bytes_v4_out : bytes_v6_in :
 Packet filter statistics ( bytes_v4_in : bytes_v4_out : bytes_v6_in :
 bytes_v6_out : packets_v4_in_pass : packets_v4_in_drop : packets_v4_out_pass :
 bytes_v6_out : packets_v4_in_pass : packets_v4_in_drop : packets_v4_out_pass :
@@ -287,42 +299,27 @@ system wide configuration file.
 .El
 .El
 .Sh LEGACY FORMATS
 .Sh LEGACY FORMATS
 .Nm
 .Nm
-supports symon(8) clients that send pre OpenBSD 3.5 disk
-statistics. These streams should be identified as io1(<disk>) instead of
+supports symon(8) clients that send
+.Bl -tag -width Ds
+.It pre OpenBSD 3.5 disk statistics.
+These streams should be identified as io1(<disk>) instead of
 io(<disk>) in
 io(<disk>) in
 .Pa /etc/symux.conf.
 .Pa /etc/symux.conf.
-Note that symon(8) measures io1 or io2 depending on whether it was
-compiled on a host that supports version 1 or 2.
-.Pp
-Because the structure of the incoming data has changed, the rrd files
-concerning io need to change as well:
-.Bl -tag -width Ds
-.It Upgrading symux only
-Move all
-.Pa io_<disk>.rrd
-files to
-.Pa io1_<disk>.rrd.
-Change the
-.Nm
-configuration file to accept and write io1.
-.Pp
-.It Upgrading hosts to OpenBSD 3.5 and updating symon(8)
-create new
-.Pa io_<disk>.rrd
-files using c_smrrds.sh for the upgraded host. Both symon(8) and
-.Nm
-configuration files can be left untouched as their io statements will
-now default to io2.
+Also note that symon(8) measures io1 or io2 depending on whether it was
+compiled on a host that supports version 1 or 2. The rrd datastructures of
+these streams differ and there is no easy way to change an io1 rrd into an io2
+rrd.
+.It pre symon 2.78 mem/if statistics.
+These streams should be identified as if1(<interface>) and mem1() in
+.Pa /etc/symux.conf.
+symon versions 2.78 and up will always report if2 and mem2 statistics. The rrd
+files for the old and new probes are identical and need not be changed.
 .El
 .El
-.Pp
 .Nm
 .Nm
 will output what version of information it is offered by symon(8)s on
 will output what version of information it is offered by symon(8)s on
 the network when started with the
 the network when started with the
 .Va -d
 .Va -d
 flag.
 flag.
-.Pp
-Note that although an io1 can be translated into an io2 using rrdtool
-dump - vi dump - rrdtool restore, this is not recommended.
 .Sh BUGS
 .Sh BUGS
 .Nm
 .Nm
 writes incoming data to rrd files "in process". An rrdupdate on a somewhat
 writes incoming data to rrd files "in process". An rrdupdate on a somewhat