Explorar o código

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

Wictor Lund %!s(int64=3) %!d(string=hai) anos
pai
achega
745bdfdd4c
Modificáronse 53 ficheiros con 428 adicións e 289 borrados
  1. 18 2
      symon/CHANGELOG
  2. 6 2
      symon/INSTALL
  3. 2 2
      symon/Makefile.inc
  4. 0 0
      symon/client/Makefile
  5. 34 32
      symon/client/SymuxClient.pm
  6. 0 0
      symon/client/getsymonitem.pl
  7. 7 5
      symon/lib/data.c
  8. 13 5
      symon/lib/data.h
  9. 2 2
      symon/lib/error.c
  10. 2 2
      symon/lib/error.h
  11. 5 3
      symon/lib/lex.c
  12. 18 17
      symon/lib/lex.h
  13. 2 2
      symon/lib/net.c
  14. 2 2
      symon/lib/net.h
  15. 2 7
      symon/ports/symon/Makefile
  16. 14 14
      symon/ports/symon/pkg/DEINSTALL
  17. 14 14
      symon/ports/symon/pkg/DEINSTALL-mon
  18. 1 1
      symon/ports/symon/pkg/INSTALL
  19. 2 2
      symon/ports/symon/pkg/INSTALL-mon
  20. 3 0
      symon/ports/symon/pkg/MESSAGE
  21. 3 0
      symon/ports/symon/pkg/MESSAGE-mux
  22. 4 1
      symon/ports/symon/pkg/PLIST
  23. 3 1
      symon/ports/symon/pkg/PLIST-mon
  24. 2 1
      symon/ports/symon/pkg/PLIST-mux
  25. 9 3
      symon/symon/Makefile
  26. 2 2
      symon/symon/c_config.sh
  27. 4 3
      symon/symon/readconf.c
  28. 2 2
      symon/symon/readconf.h
  29. 4 4
      symon/symon/sm_cpu.c
  30. 2 2
      symon/symon/sm_debug.c
  31. 2 2
      symon/symon/sm_if.c
  32. 14 4
      symon/symon/sm_io.c
  33. 3 3
      symon/symon/sm_mem.c
  34. 2 2
      symon/symon/sm_proc.c
  35. 4 3
      symon/symon/sm_sensor.c
  36. 9 4
      symon/symon/symon.8
  37. 22 17
      symon/symon/symon.c
  38. 6 6
      symon/symon/symon.conf
  39. 2 2
      symon/symon/symon.h
  40. 2 2
      symon/symon/symonnet.c
  41. 2 2
      symon/symon/symonnet.h
  42. 0 0
      symon/symux/Makefile
  43. 57 53
      symon/symux/c_smrrds.sh
  44. 11 5
      symon/symux/readconf.c
  45. 2 2
      symon/symux/readconf.h
  46. 2 2
      symon/symux/share.c
  47. 2 2
      symon/symux/share.h
  48. 85 30
      symon/symux/symux.8
  49. 8 4
      symon/symux/symux.c
  50. 5 5
      symon/symux/symux.conf
  51. 2 2
      symon/symux/symux.h
  52. 2 2
      symon/symux/symuxnet.c
  53. 2 2
      symon/symux/symuxnet.h

+ 18 - 2
symon/CHANGELOG

@@ -1,4 +1,20 @@
-20/10/2003 - 2.63
+02/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.
+
+   - c_smrrds.sh complains if files cannot be built. (Daniel Polak)
+
+   - symon no longer attempts reloading the configuration file when
+     privsep.
+
+   - Textual: INSTALL (Jan Sipke van der Veen), error texts in code
+     (Stephen Tesch)
+
+
+20/12/2003 - 2.63
 
 
    - removed large char arrays on the stack that broke name resolution
    - removed large char arrays on the stack that broke name resolution
 
 
@@ -312,4 +328,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.25 2003/12/21 13:01:05 dijkstra Exp $
+$Id: CHANGELOG,v 1.28 2004/02/26 22:48:08 dijkstra Exp $

+ 6 - 2
symon/INSTALL

@@ -63,7 +63,11 @@ Less quick, but more verbose
   stored. $PREFIX/$SHRDIR/c_smrrds.sh is your friend. Note that syweb expects
   stored. $PREFIX/$SHRDIR/c_smrrds.sh is your friend. Note that syweb expects
   an '.../machine/*.rrd' style directory structure somewhere under /var/www.
   an '.../machine/*.rrd' style directory structure somewhere under /var/www.
 
 
-- Fire up symon, symux. Check system logs for any failures.
+- Fire up symux and symon:
+
+  /usr/local/libexec/symux && /usr/local/libexec/symon
+
+  Check system logs for any failures.
 
 
 - Only if you need the webinterface: download and install syweb.
 - Only if you need the webinterface: download and install syweb.
 
 
@@ -90,5 +94,5 @@ syweb run on POSIX compliant unixes, but the monitoring application itself
 
 
 Willem Dijkstra - wpd@xs4all.nl
 Willem Dijkstra - wpd@xs4all.nl
 
 
-$Id: INSTALL,v 1.12 2003/12/20 16:30:44 dijkstra Exp $
+$Id: INSTALL,v 1.13 2004/02/24 22:13:20 dijkstra Exp $
 
 

+ 2 - 2
symon/Makefile.inc

@@ -1,6 +1,6 @@
-# $Id: Makefile.inc,v 1.20 2003/12/21 13:01:05 dijkstra Exp $
+# $Id: Makefile.inc,v 1.21 2004/02/24 22:13:20 dijkstra Exp $
 
 
-V=2.63
+V=2.64
 
 
 AR=	ar
 AR=	ar
 CC=	cc
 CC=	cc

+ 0 - 0
symon/client/Makefile


+ 34 - 32
symon/client/SymuxClient.pm

@@ -1,6 +1,6 @@
-# $Id: SymuxClient.pm,v 1.7 2003/12/20 16:30:44 dijkstra Exp $
+# $Id: SymuxClient.pm,v 1.9 2004/02/26 22:48:08 dijkstra Exp $
 #
 #
-# Copyright (c) 2001-2003 Willem Dijkstra
+# Copyright (c) 2001-2004 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
@@ -34,36 +34,38 @@ use Carp;
 use IO::Socket;
 use IO::Socket;
 
 
 my $streamitem =
 my $streamitem =
-    {cpu   => {user => 1, nice => 2, system => 3, interrupt => 4, idle => 5},
-     mem   => {real_active => 1, real_total => 2, free => 3, swap_used => 4,
-	       swap_total =>5},
-     if    => {packets_in => 1, packets_out => 2, bytes_in => 3, bytes_out => 4,
-	       multicasts_in => 5, multicasts_out => 6, errors_in => 7,
-	       errors_out => 8, collisions => 9, drops => 10},
-     io    => {total_transfers => 1, total_seeks => 2, total_bytes => 3},
-     pf    => {bytes_v4_in => 1, bytes_v4_out => 2, bytes_v6_in => 3,
-	       bytes_v6_out => 4, packets_v4_in_pass => 5,
-	       packets_v4_in_drop => 6, packets_v4_out_pass => 7,
-	       packets_v4_out_drop => 8, packets_v6_in_pass => 9,
-	       packets_v6_in_drop => 10, packets_v6_out_pass => 11,
-	       packets_v6_out_drop => 12, states_entries => 13,
-	       states_searches => 14, states_inserts => 15,
-	       states_removals => 16, counters_match => 17,
-	       counters_badoffset => 18, counters_fragment => 19,
-	       counters_short => 20, counters_normalize => 21,
-	       counters_memory => 22},
-     debug => {debug0 => 1, debug1 => 2, debug3 => 3, debug4 => 4, debug5 => 5,
-	       debug6 => 6, debug7 => 7, debug8 => 8, debug9 => 9,
-	       debug10 => 10, debug11 => 11, debug12 => 12, debug13 => 13,
-	       debug14 => 14, debug15 => 15, debug16 => 16, debug17 => 17,
-	       debug18 => 18, debug19 => 19},
-     proc  => {number => 1, uticks => 2, sticks => 3, iticks => 4, cpusec => 5,
-	       cpupct => 6, procsz => 7, rsssz => 8},
-     mbuf => {totmbufs => 1, mt_data => 2, mt_oobdata => 3, mt_control => 4,
-	      mt_header => 5, mt_ftable => 6, mt_soname => 7, mt_soopts => 8,
-	      pgused => 9, pgtotal => 10, totmem => 11, totpct => 12,
-	      m_drops => 13, m_wait => 14, m_drain => 15 },
-     sensor => {value => 1}};
+    {cpu    => {user => 1, nice => 2, system => 3, interrupt => 4, idle => 5},
+     mem    => {real_active => 1, real_total => 2, free => 3, swap_used => 4,
+	        swap_total =>5},
+     if     => {packets_in => 1, packets_out => 2, bytes_in => 3, bytes_out => 4,
+	        multicasts_in => 5, multicasts_out => 6, errors_in => 7,
+	        errors_out => 8, collisions => 9, drops => 10},
+     io1    => {total_transfers => 1, total_seeks => 2, total_bytes => 3},
+     pf     => {bytes_v4_in => 1, bytes_v4_out => 2, bytes_v6_in => 3,
+	        bytes_v6_out => 4, packets_v4_in_pass => 5,
+	        packets_v4_in_drop => 6, packets_v4_out_pass => 7,
+	        packets_v4_out_drop => 8, packets_v6_in_pass => 9,
+	        packets_v6_in_drop => 10, packets_v6_out_pass => 11,
+	        packets_v6_out_drop => 12, states_entries => 13,
+	        states_searches => 14, states_inserts => 15,
+	        states_removals => 16, counters_match => 17,
+	        counters_badoffset => 18, counters_fragment => 19,
+	        counters_short => 20, counters_normalize => 21,
+	        counters_memory => 22},
+     debug  => {debug0 => 1, debug1 => 2, debug3 => 3, debug4 => 4, debug5 => 5,
+	        debug6 => 6, debug7 => 7, debug8 => 8, debug9 => 9,
+	        debug10 => 10, debug11 => 11, debug12 => 12, debug13 => 13,
+	        debug14 => 14, debug15 => 15, debug16 => 16, debug17 => 17,
+	        debug18 => 18, debug19 => 19},
+     proc   => {number => 1, uticks => 2, sticks => 3, iticks => 4, cpusec => 5,
+	        cpupct => 6, procsz => 7, rsssz => 8},
+     mbuf   => {totmbufs => 1, mt_data => 2, mt_oobdata => 3, mt_control => 4,
+	        mt_header => 5, mt_ftable => 6, mt_soname => 7, mt_soopts => 8,
+	        pgused => 9, pgtotal => 10, totmem => 11, totpct => 12,
+	        m_drops => 13, m_wait => 14, m_drain => 15 },
+     sensor => {value => 1},
+     io     => {total_rxfers => 1, total_wxfers => 2, total_seeks => 3,
+		total_rbytes => 4, total_rbytes => 5 }};
 sub new {
 sub new {
     my ($class, %arg) = @_;
     my ($class, %arg) = @_;
     my $self;
     my $self;

+ 0 - 0
symon/client/getsymonitem.pl


+ 7 - 5
symon/lib/data.c

@@ -1,10 +1,10 @@
-/* $Id: data.c,v 1.22 2003/12/20 16:30:44 dijkstra Exp $ */
+/* $Id: data.c,v 1.24 2004/02/26 22:48:08 dijkstra Exp $ */
 
 
 /*
 /*
- * Copyright (c) 2001-2003 Willem Dijkstra
+ * Copyright (c) 2001-2004 Willem Dijkstra
  * All rights reserved.
  * All rights reserved.
  *
  *
- * The crc routine is from Rob Warnock <rpw3@sgi.com>, from the
+ * The crc routine is by Rob Warnock <rpw3@sgi.com>, from the
  * comp.compression FAQ.
  * comp.compression FAQ.
  *
  *
  * Redistribution and use in source and binary forms, with or without
  * Redistribution and use in source and binary forms, with or without
@@ -95,7 +95,7 @@ struct {
     int type;
     int type;
     char *form;
     char *form;
 }      streamform[] = {
 }      streamform[] = {
-    { MT_IO, "LLL" },
+    { MT_IO1, "LLL" },
     { MT_CPU, "ccccc" },
     { MT_CPU, "ccccc" },
     { MT_MEM, "lllll" },
     { MT_MEM, "lllll" },
     { MT_IF, "llllllllll" },
     { MT_IF, "llllllllll" },
@@ -104,6 +104,7 @@ struct {
     { MT_PROC, "lLLLlcll" },
     { MT_PROC, "lLLLlcll" },
     { MT_MBUF, "lllllllllllllll" },
     { MT_MBUF, "lllllllllllllll" },
     { MT_SENSOR, "D" },
     { MT_SENSOR, "D" },
+    { MT_IO2, "LLLLL" },
     { MT_TEST, "LLLLDDDDllllssssccccbbbb" },
     { MT_TEST, "LLLLDDDDllllssssccccbbbb" },
     { MT_EOT, "" }
     { MT_EOT, "" }
 };
 };
@@ -112,7 +113,7 @@ struct {
     int type;
     int type;
     int token;
     int token;
 }      streamtoken[] = {
 }      streamtoken[] = {
-    { MT_IO, LXT_IO },
+    { MT_IO1, LXT_IO1 },
     { MT_CPU, LXT_CPU },
     { MT_CPU, LXT_CPU },
     { MT_MEM, LXT_MEM },
     { MT_MEM, LXT_MEM },
     { MT_IF, LXT_IF },
     { MT_IF, LXT_IF },
@@ -121,6 +122,7 @@ struct {
     { MT_PROC, LXT_PROC },
     { MT_PROC, LXT_PROC },
     { MT_MBUF, LXT_MBUF },
     { MT_MBUF, LXT_MBUF },
     { MT_SENSOR, LXT_SENSOR },
     { MT_SENSOR, LXT_SENSOR },
+    { MT_IO2, LXT_IO },
     { MT_EOT, LXT_BADTOKEN }
     { MT_EOT, LXT_BADTOKEN }
 };
 };
 /* parallel crc32 table */
 /* parallel crc32 table */

+ 13 - 5
symon/lib/data.h

@@ -1,7 +1,7 @@
-/* $Id: data.h,v 1.22 2003/12/20 16:30:44 dijkstra Exp $ */
+/* $Id: data.h,v 1.24 2004/02/26 22:48:08 dijkstra Exp $ */
 
 
 /*
 /*
- * Copyright (c) 2001-2003 Willem Dijkstra
+ * Copyright (c) 2001-2004 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
@@ -141,7 +141,7 @@ SLIST_HEAD(muxlist, mux);
 #define PS2STR_RRD    1
 #define PS2STR_RRD    1
 
 
 /* Stream types */
 /* Stream types */
-#define MT_IO     0
+#define MT_IO1    0
 #define MT_CPU    1
 #define MT_CPU    1
 #define MT_MEM    2
 #define MT_MEM    2
 #define MT_IF     3
 #define MT_IF     3
@@ -150,8 +150,9 @@ SLIST_HEAD(muxlist, mux);
 #define MT_PROC   6
 #define MT_PROC   6
 #define MT_MBUF   7
 #define MT_MBUF   7
 #define MT_SENSOR 8
 #define MT_SENSOR 8
-#define MT_TEST   9
-#define MT_EOT    10
+#define MT_IO2    9
+#define MT_TEST   10
+#define MT_EOT    11
 
 
 /*
 /*
  * Unpacking of incoming packets is done via a packedstream structure. This
  * Unpacking of incoming packets is done via a packedstream structure. This
@@ -265,6 +266,13 @@ struct packedstream {
 	struct {
 	struct {
 	    int64_t value;
 	    int64_t value;
 	}      ps_sensor;
 	}      ps_sensor;
+	struct {
+	    u_int64_t mtotal_rtransfers;
+	    u_int64_t mtotal_wtransfers;
+	    u_int64_t mtotal_seeks2;
+	    u_int64_t mtotal_rbytes;
+	    u_int64_t mtotal_wbytes;
+	}      ps_io2;
 	struct {
 	struct {
 	    u_int64_t L[4];
 	    u_int64_t L[4];
 	    int64_t D[4];
 	    int64_t D[4];

+ 2 - 2
symon/lib/error.c

@@ -1,7 +1,7 @@
-/* $Id: error.c,v 1.11 2003/12/20 16:30:44 dijkstra Exp $ */
+/* $Id: error.c,v 1.12 2004/02/26 22:48:08 dijkstra Exp $ */
 
 
 /*
 /*
- * Copyright (c) 2001-2003 Willem Dijkstra
+ * Copyright (c) 2001-2004 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

+ 2 - 2
symon/lib/error.h

@@ -1,7 +1,7 @@
-/* $Id: error.h,v 1.8 2003/12/20 16:30:44 dijkstra Exp $ */
+/* $Id: error.h,v 1.9 2004/02/26 22:48:08 dijkstra Exp $ */
 
 
 /*
 /*
- * Copyright (c) 2001-2003 Willem Dijkstra
+ * Copyright (c) 2001-2004 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

+ 5 - 3
symon/lib/lex.c

@@ -1,7 +1,7 @@
-/* $Id: lex.c,v 1.18 2003/12/20 16:30:44 dijkstra Exp $ */
+/* $Id: lex.c,v 1.21 2004/02/27 09:50:18 dijkstra Exp $ */
 
 
 /*
 /*
- * Copyright (c) 2001-2003 Willem Dijkstra
+ * Copyright (c) 2001-2004 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
@@ -76,6 +76,8 @@ static struct {
     { "if", LXT_IF },
     { "if", LXT_IF },
     { "in", LXT_IN },
     { "in", LXT_IN },
     { "io", LXT_IO },
     { "io", LXT_IO },
+    { "io1", LXT_IO1 },
+    { "io2", LXT_IO },
     { "mbuf", LXT_MBUF },
     { "mbuf", LXT_MBUF },
     { "mem", LXT_MEM },
     { "mem", LXT_MEM },
     { "monitor", LXT_MONITOR },
     { "monitor", LXT_MONITOR },
@@ -357,6 +359,6 @@ close_lex(struct lex *l)
 void
 void
 parse_error(struct lex *l, const char *s)
 parse_error(struct lex *l, const char *s)
 {
 {
-    warning("%.200s:%d: expected '%.200s' found '%.8s')",
+    warning("%.200s:%d: expected '%.200s' found '%.8s'",
 	    l->filename, l->cline, s, l->token);
 	    l->filename, l->cline, s, l->token);
 }
 }

+ 18 - 17
symon/lib/lex.h

@@ -1,7 +1,7 @@
-/* $Id: lex.h,v 1.18 2003/12/20 16:30:44 dijkstra Exp $ */
+/* $Id: lex.h,v 1.20 2004/02/26 22:48:08 dijkstra Exp $ */
 
 
 /*
 /*
- * Copyright (c) 2001-2003 Willem Dijkstra
+ * Copyright (c) 2001-2004 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,21 +56,22 @@
 #define LXT_IF        10
 #define LXT_IF        10
 #define LXT_IN        11
 #define LXT_IN        11
 #define LXT_IO        12
 #define LXT_IO        12
-#define LXT_MEM       13
-#define LXT_MONITOR   14
-#define LXT_MUX       15
-#define LXT_OPEN      16
-#define LXT_PF        17
-#define LXT_PORT      18
-#define LXT_PROC      19
-#define LXT_SECOND    20
-#define LXT_SECONDS   21
-#define LXT_SENSOR    22
-#define LXT_SOURCE    23
-#define LXT_STREAM    24
-#define LXT_TO        25
-#define LXT_WRITE     26
-#define LXT_MBUF      27
+#define LXT_IO1       13
+#define LXT_MEM       14
+#define LXT_MONITOR   15
+#define LXT_MUX       16
+#define LXT_OPEN      17
+#define LXT_PF        18
+#define LXT_PORT      19
+#define LXT_PROC      20
+#define LXT_SECOND    21
+#define LXT_SECONDS   22
+#define LXT_SENSOR    23
+#define LXT_SOURCE    24
+#define LXT_STREAM    25
+#define LXT_TO        26
+#define LXT_WRITE     27
+#define LXT_MBUF      28
 
 
 struct lex {
 struct lex {
     char *buffer;		/* current line(s) */
     char *buffer;		/* current line(s) */

+ 2 - 2
symon/lib/net.c

@@ -1,7 +1,7 @@
-/* $Id: net.c,v 1.9 2003/12/21 13:01:05 dijkstra Exp $ */
+/* $Id: net.c,v 1.10 2004/02/26 22:48:08 dijkstra Exp $ */
 
 
 /*
 /*
- * Copyright (c) 2001-2003 Willem Dijkstra
+ * Copyright (c) 2001-2004 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

+ 2 - 2
symon/lib/net.h

@@ -1,7 +1,7 @@
-/* $Id: net.h,v 1.11 2003/12/21 13:01:05 dijkstra Exp $ */
+/* $Id: net.h,v 1.12 2004/02/26 22:48:08 dijkstra Exp $ */
 
 
 /*
 /*
- * Copyright (c) 2001-2003 Willem Dijkstra
+ * Copyright (c) 2001-2004 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

+ 2 - 7
symon/ports/symon/Makefile

@@ -1,7 +1,7 @@
-# $OpenBSD: Makefile,v 1.7 2003/03/31 22:13:51 dhartmei Exp $
+# $OpenBSD: Makefile,v 1.10 2004/02/16 20:09:03 sturm Exp $
 
 
 COMMENT=		"active monitoring tool"
 COMMENT=		"active monitoring tool"
-V=			2.63
+V=			2.64
 DISTNAME=		symon-${V}
 DISTNAME=		symon-${V}
 CATEGORIES=		sysutils net
 CATEGORIES=		sysutils net
 
 
@@ -22,12 +22,10 @@ SUBPACKAGE?=
 MULTI_PACKAGES+=	-mon
 MULTI_PACKAGES+=	-mon
 COMMENT-mon=		"active host monitor"
 COMMENT-mon=		"active host monitor"
 MON_LIBDEPENDS=
 MON_LIBDEPENDS=
-MON_RUNDEPENDS=
 # gatherer only package
 # gatherer only package
 MULTI_PACKAGES+=	-mux
 MULTI_PACKAGES+=	-mux
 COMMENT-mux=		"symon data gatherer"
 COMMENT-mux=		"symon data gatherer"
 MUX_LIBDEPENDS=		rrd:rrdtool-*:net/rrdtool
 MUX_LIBDEPENDS=		rrd:rrdtool-*:net/rrdtool
-MUX_RUNDEPENDS=		rrd:rrdtool-*:net/rrdtool
 
 
 .for i in ${MULTI_PACKAGES}
 .for i in ${MULTI_PACKAGES}
 FULLPKGNAME${i}=        symon${i}-${V}
 FULLPKGNAME${i}=        symon${i}-${V}
@@ -36,11 +34,8 @@ FULLPKGNAME${i}=        symon${i}-${V}
 .if defined(PACKAGING) && !empty(SUBPACKAGE)
 .if defined(PACKAGING) && !empty(SUBPACKAGE)
 MODULE_NAME=            ${SUBPACKAGE:S/-//g}
 MODULE_NAME=            ${SUBPACKAGE:S/-//g}
 LIB_DEPENDS=            ${${MODULE_NAME:U}_LIBDEPENDS}
 LIB_DEPENDS=            ${${MODULE_NAME:U}_LIBDEPENDS}
-RUN_DEPENDS=		${${MODULE_NAME:U}_RUNDEPENDS}
 MESSAGE=                ${PKGDIR}/MESSAGE${SUBPACKAGE}
 MESSAGE=                ${PKGDIR}/MESSAGE${SUBPACKAGE}
 .else
 .else
-BUILD_DEPENDS=		rrd:rrdtool-*:net/rrdtool
-RUN_DEPENDS=		rrd:rrdtool-*:net/rrdtool
 LIB_DEPENDS=		rrd:rrdtool-*:net/rrdtool
 LIB_DEPENDS=		rrd:rrdtool-*:net/rrdtool
 .endif
 .endif
 
 

+ 14 - 14
symon/ports/symon/pkg/DEINSTALL

@@ -1,5 +1,5 @@
 #!/bin/sh
 #!/bin/sh
-# $OpenBSD: DEINSTALL,v 1.2 2003/02/04 22:59:48 naddy Exp $
+# $OpenBSD: DEINSTALL,v 1.3 2004/02/16 20:09:04 sturm Exp $
 #
 #
 # symon de-installation
 # symon de-installation
 
 
@@ -10,20 +10,20 @@ CONFIG_FILE=${SYSCONFDIR}/symon.conf
 SYMONUSER=_symon
 SYMONUSER=_symon
 SYMONGROUP=_symon
 SYMONGROUP=_symon
 
 
-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 "|           userdel $SYMONUSER"
-    echo "|           groupdel $SYMONGROUP"
+echo
+echo "+---------------"
+echo "| To completely deinstall the $1 package you need to perform"
+echo "| this step as root:"
+echo "|"
+echo "|           userdel $SYMONUSER"
+echo "|           groupdel $SYMONGROUP"
+if [ "$PKG_DELETE_EXTRA" != Yes -a -f ${CONFIG_FILE} ]; then
     echo "|           rm -f $CONFIG_FILE"
     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
 fi
+echo "|"
+echo "| Do not do this if you plan on re-installing $1"
+echo "| at some future time."
+echo "+---------------"
+echo
 
 
 exit 0
 exit 0

+ 14 - 14
symon/ports/symon/pkg/DEINSTALL-mon

@@ -1,5 +1,5 @@
 #!/bin/sh
 #!/bin/sh
-# $OpenBSD: DEINSTALL-mon,v 1.2 2003/02/17 23:54:49 naddy Exp $
+# $OpenBSD: DEINSTALL-mon,v 1.3 2004/02/16 20:09:04 sturm Exp $
 #
 #
 # symon de-installation
 # symon de-installation
 
 
@@ -10,20 +10,20 @@ CONFIG_FILE=${SYSCONFDIR}/symon.conf
 SYMONUSER=_symon
 SYMONUSER=_symon
 SYMONGROUP=_symon
 SYMONGROUP=_symon
 
 
-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 "|           userdel $SYMONUSER"
-    echo "|           groupdel $SYMONGROUP"
+echo
+echo "+---------------"
+echo "| To completely deinstall the $1 package you need to perform"
+echo "| this step as root:"
+echo "|"
+echo "|           userdel $SYMONUSER"
+echo "|           groupdel $SYMONGROUP"
+if [ "$PKG_DELETE_EXTRA" != Yes -a -f ${CONFIG_FILE} ]; then
     echo "|           rm -f $CONFIG_FILE"
     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
 fi
+echo "|"
+echo "| Do not do this if you plan on re-installing $1"
+echo "| at some future time."
+echo "+---------------"
+echo
 
 
 exit 0
 exit 0

+ 1 - 1
symon/ports/symon/pkg/INSTALL

@@ -1,5 +1,5 @@
 #!/bin/sh
 #!/bin/sh
-# $OpenBSD: INSTALL,v 1.2 2003/02/04 22:59:48 naddy Exp $
+# $OpenBSD: INSTALL,v 1.4 2004/02/16 20:09:04 sturm Exp $
 #
 #
 # Pre/post-installation setup of symon monitor
 # Pre/post-installation setup of symon monitor
 
 

+ 2 - 2
symon/ports/symon/pkg/INSTALL-mon

@@ -1,5 +1,5 @@
 #!/bin/sh
 #!/bin/sh
-# $OpenBSD: INSTALL-mon,v 1.2 2003/02/17 23:54:49 naddy Exp $
+# $OpenBSD: INSTALL-mon,v 1.4 2004/02/16 20:09:04 sturm Exp $
 #
 #
 # Pre/post-installation setup of symon monitor
 # Pre/post-installation setup of symon monitor
 
 
@@ -84,4 +84,4 @@ case $2 in
 esac
 esac
 
 
 exit 0
 exit 0
-set -e
+

+ 3 - 0
symon/ports/symon/pkg/MESSAGE

@@ -4,4 +4,7 @@
 |
 |
 | RRD files can be obtained by running
 | RRD files can be obtained by running
 | ${PREFIX}/share/symon/c_smrrds.sh
 | ${PREFIX}/share/symon/c_smrrds.sh
+|
+| Read the LEGACY section of symux(8) for information about
+| migrating RRDs from a previous symux version.
 +---------------
 +---------------

+ 3 - 0
symon/ports/symon/pkg/MESSAGE-mux

@@ -4,4 +4,7 @@
 |
 |
 | RRD files can be obtained by running
 | RRD files can be obtained by running
 | ${PREFIX}/share/symon/c_smrrds.sh
 | ${PREFIX}/share/symon/c_smrrds.sh
+|
+| Read the LEGACY section of symux(8) for information about
+| migrating RRDs from a previous symux version.
 +---------------
 +---------------

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

@@ -1,4 +1,4 @@
-@comment $OpenBSD: PLIST,v 1.5 2003/03/31 22:13:51 dhartmei Exp $
+@comment $OpenBSD: PLIST,v 1.9 2004/02/17 20:50:35 sturm Exp $
 @pkgcfl symon-*
 @pkgcfl symon-*
 libexec/symon
 libexec/symon
 libexec/symux
 libexec/symux
@@ -14,3 +14,6 @@ share/symon/client/SymuxClient.0
 @dirrm share/examples/symon
 @dirrm share/examples/symon
 @dirrm share/symon/client
 @dirrm share/symon/client
 @dirrm share/symon
 @dirrm share/symon
+@cwd ${SYSCONFDIR}
+@extra symon.conf
+@extraunexec rm -f ${SYSCONFDIR}/symux.conf

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

@@ -1,4 +1,4 @@
-@comment $OpenBSD: PLIST-mon,v 1.5 2003/03/31 22:13:51 dhartmei Exp $
+@comment $OpenBSD: PLIST-mon,v 1.6 2004/02/16 20:09:04 sturm Exp $
 @pkgcfl symon-[0-9]*
 @pkgcfl symon-[0-9]*
 libexec/symon
 libexec/symon
 man/cat8/symon.0
 man/cat8/symon.0
@@ -6,3 +6,5 @@ share/examples/symon/symon.conf
 share/symon/c_config.sh
 share/symon/c_config.sh
 @dirrm share/examples/symon
 @dirrm share/examples/symon
 @dirrm share/symon
 @dirrm share/symon
+@cwd ${SYSCONFDIR}
+@extra symon.conf

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

@@ -1,4 +1,4 @@
-@comment $OpenBSD: PLIST-mux,v 1.4 2003/03/31 22:13:51 dhartmei Exp $
+@comment $OpenBSD: PLIST-mux,v 1.6 2004/02/17 20:50:35 sturm Exp $
 @pkgcfl symon-[0-9]*
 @pkgcfl symon-[0-9]*
 libexec/symux
 libexec/symux
 man/cat8/symux.0
 man/cat8/symux.0
@@ -10,3 +10,4 @@ share/symon/client/SymuxClient.0
 @dirrm share/examples/symon
 @dirrm share/examples/symon
 @dirrm share/symon/client
 @dirrm share/symon/client
 @dirrm share/symon
 @dirrm share/symon
+@extraunexec rm -f ${SYSCONFDIR}/symux.conf

+ 9 - 3
symon/symon/Makefile

@@ -1,4 +1,4 @@
-# $Id: Makefile,v 1.34 2003/12/21 13:01:05 dijkstra Exp $
+# $Id: Makefile,v 1.35 2004/02/24 22:13:20 dijkstra Exp $
 .include "../Makefile.inc"
 .include "../Makefile.inc"
 
 
 LIBS=	-L../lib -lsymon
 LIBS=	-L../lib -lsymon
@@ -8,6 +8,8 @@ CFLAGS+=-I../lib -I.
 
 
 all: symon symon.cat8
 all: symon symon.cat8
 
 
+${OBJS}: conf.h
+
 symon: ${OBJS}
 symon: ${OBJS}
 	${CC} -o $@ ${OBJS} ${LIBS}
 	${CC} -o $@ ${OBJS} ${LIBS}
 .ifndef DEBUG
 .ifndef DEBUG
@@ -32,11 +34,15 @@ conf.h:  Makefile
 	@echo "#define SYMON_VERSION \"$(V)\"" >> $@
 	@echo "#define SYMON_VERSION \"$(V)\"" >> $@
 	@case `grep -csq KERN_MBSTAT /usr/include/sys/sysctl.h` in	\
 	@case `grep -csq KERN_MBSTAT /usr/include/sys/sysctl.h` in	\
 	1)	echo "#define HAS_KERN_MBSTAT	1" >> $@;;		\
 	1)	echo "#define HAS_KERN_MBSTAT	1" >> $@;;		\
-	*)	echo "#undef HAS_KERN_MBSTAT" >> $@;;			\
+	0)	echo "#undef HAS_KERN_MBSTAT" >> $@;;			\
 	esac;
 	esac;
 	@case `grep -csq "struct sensor" /usr/include/sys/sensors.h` in \
 	@case `grep -csq "struct sensor" /usr/include/sys/sensors.h` in \
 	1)	echo "#define HAS_SENSORS_H	1" >> $@;;		\
 	1)	echo "#define HAS_SENSORS_H	1" >> $@;;		\
-	*)	echo "#undef HAS_SENSORS_H" >> $@;;			\
+	0)	echo "#undef HAS_SENSORS_H" >> $@;;			\
+	esac;
+	@case `grep -csq "ds_rxfer" /usr/include/sys/disk.h` in         \
+	1)	echo "#define HAS_IO2	1" >> $@;;                      \
+	0)	echo "#undef HAS_IO2" >> $@;;                           \
 	esac
 	esac
 
 
 symon.h: conf.h
 symon.h: conf.h

+ 2 - 2
symon/symon/c_config.sh

@@ -1,5 +1,5 @@
 #!/bin/sh
 #!/bin/sh
-# $Id: c_config.sh,v 1.5 2003/12/20 16:30:44 dijkstra Exp $
+# $Id: c_config.sh,v 1.6 2004/02/26 22:48:08 dijkstra Exp $
 #
 #
 # Create an example configuration file for symon on a host and print to stdout
 # Create an example configuration file for symon on a host and print to stdout
 
 
@@ -18,7 +18,7 @@ fi
 interfaces=`netstat -ni | sed '1,1d;s/^\([a-z]*[0-9]\).*$/\1/g' | uniq`
 interfaces=`netstat -ni | sed '1,1d;s/^\([a-z]*[0-9]\).*$/\1/g' | uniq`
 for i in $interfaces; do
 for i in $interfaces; do
 case $i in
 case $i in
-bridge*|enc*|gif*|gre*|lo*|pflog*|pfsync*|ppp*|sl*|tun*|vlan*)
+bridge*|carp*|enc*|gif*|gre*|lo*|pflog*|pfsync*|ppp*|sl*|tun*|vlan*)
 	# ignore this interface
 	# ignore this interface
 	;;
 	;;
 *)
 *)

+ 4 - 3
symon/symon/readconf.c

@@ -1,7 +1,7 @@
-/* $Id: readconf.c,v 1.17 2003/12/21 13:01:05 dijkstra Exp $ */
+/* $Id: readconf.c,v 1.19 2004/02/26 22:48:08 dijkstra Exp $ */
 
 
 /*
 /*
- * Copyright (c) 2001-2003 Willem Dijkstra
+ * Copyright (c) 2001-2004 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
@@ -102,6 +102,7 @@ read_symon_args(struct mux * mux, struct lex * l)
 	case LXT_CPU:
 	case LXT_CPU:
 	case LXT_IF:
 	case LXT_IF:
 	case LXT_IO:
 	case LXT_IO:
+	case LXT_IO1:
 	case LXT_MEM:
 	case LXT_MEM:
 	case LXT_PF:
 	case LXT_PF:
 	case LXT_MBUF:
 	case LXT_MBUF:
@@ -136,7 +137,7 @@ read_symon_args(struct mux * mux, struct lex * l)
 		return 0;
 		return 0;
 	    }
 	    }
 
 
-	    break;		/* LXT_CPU/IF/IO/MEM/PF/MBUF/DEBUG/PROC/SENSOR */
+	    break;		/* LXT_CPU/IF/IO/IO1/MEM/PF/MBUF/DEBUG/PROC/SENSOR */
 	case LXT_COMMA:
 	case LXT_COMMA:
 	    break;
 	    break;
 	default:
 	default:

+ 2 - 2
symon/symon/readconf.h

@@ -1,7 +1,7 @@
-/* $Id: readconf.h,v 1.6 2003/12/20 16:30:44 dijkstra Exp $ */
+/* $Id: readconf.h,v 1.7 2004/02/26 22:48:08 dijkstra Exp $ */
 
 
 /*
 /*
- * Copyright (c) 2001-2003 Willem Dijkstra
+ * Copyright (c) 2001-2004 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

+ 4 - 4
symon/symon/sm_cpu.c

@@ -1,11 +1,11 @@
-/* $Id: sm_cpu.c,v 1.16 2003/12/20 16:30:44 dijkstra Exp $ */
+/* $Id: sm_cpu.c,v 1.17 2004/02/26 22:48:08 dijkstra Exp $ */
 
 
 /* The author of this code is Willem Dijkstra (wpd@xs4all.nl).
 /* The author of this code is Willem Dijkstra (wpd@xs4all.nl).
  *
  *
- * The percentages function was written by William LeFebvre and is part of the
- * 'top' utility. His copyright statement is below.
+ * The percentages function was written by William LeFebvre and is part
+ * of the 'top' utility. His copyright statement is below.
  *
  *
- * Copyright (c) 2001-2003 Willem Dijkstra
+ * Copyright (c) 2001-2004 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

+ 2 - 2
symon/symon/sm_debug.c

@@ -1,7 +1,7 @@
-/* $Id: sm_debug.c,v 1.3 2003/12/20 16:30:44 dijkstra Exp $ */
+/* $Id: sm_debug.c,v 1.4 2004/02/26 22:48:08 dijkstra Exp $ */
 
 
 /*
 /*
- * Copyright (c) 2001-2003 Willem Dijkstra
+ * Copyright (c) 2001-2004 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

+ 2 - 2
symon/symon/sm_if.c

@@ -1,7 +1,7 @@
-/* $Id: sm_if.c,v 1.9 2003/12/20 16:30:44 dijkstra Exp $ */
+/* $Id: sm_if.c,v 1.10 2004/02/26 22:48:08 dijkstra Exp $ */
 
 
 /*
 /*
- * Copyright (c) 2001-2003 Willem Dijkstra
+ * Copyright (c) 2001-2004 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

+ 14 - 4
symon/symon/sm_io.c

@@ -1,7 +1,7 @@
-/* $Id: sm_io.c,v 1.13 2003/12/20 16:30:44 dijkstra Exp $ */
+/* $Id: sm_io.c,v 1.15 2004/02/26 22:48:08 dijkstra Exp $ */
 
 
 /*
 /*
- * Copyright (c) 2001-2003 Willem Dijkstra
+ * Copyright (c) 2001-2004 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
@@ -31,7 +31,8 @@
  */
  */
 
 
 /*
 /*
- * Get current disk transfer statistics from kernel and return them in symon_buf as
+ * Get current disk transfer statistics from kernel and return them in
+ * symon_buf as
  *
  *
  * total nr of transfers : total seeks : total bytes transferred
  * total nr of transfers : total seeks : total bytes transferred
  *
  *
@@ -150,10 +151,19 @@ get_io(char *symon_buf, int maxlen, char *disk)
     for (i = 0; i <= io_dks; i++) {
     for (i = 0; i <= io_dks; i++) {
 	if (strncmp(io_dknames[i], disk,
 	if (strncmp(io_dknames[i], disk,
 		    (io_dkstr + io_maxstr - io_dknames[i])) == 0)
 		    (io_dkstr + io_maxstr - io_dknames[i])) == 0)
-	    return snpack(symon_buf, maxlen, disk, MT_IO,
+#ifdef HAS_IO2
+	    return snpack(symon_buf, maxlen, disk, MT_IO2,
+			  io_dkstats[i].ds_rxfer,
+			  io_dkstats[i].ds_wxfer,
+			  io_dkstats[i].ds_seek,
+			  io_dkstats[i].ds_rbytes,
+			  io_dkstats[i].ds_wbytes);
+#else
+	    return snpack(symon_buf, maxlen, disk, MT_IO1,
 			  io_dkstats[i].ds_xfer,
 			  io_dkstats[i].ds_xfer,
 			  io_dkstats[i].ds_seek,
 			  io_dkstats[i].ds_seek,
 			  io_dkstats[i].ds_bytes);
 			  io_dkstats[i].ds_bytes);
+#endif
     }
     }
 
 
     return 0;
     return 0;

+ 3 - 3
symon/symon/sm_mem.c

@@ -1,7 +1,7 @@
-/* $Id: sm_mem.c,v 1.14 2003/12/20 16:30:44 dijkstra Exp $ */
+/* $Id: sm_mem.c,v 1.16 2004/02/26 22:48:08 dijkstra Exp $ */
 
 
 /*
 /*
- * Copyright (c) 2001-2003 Willem Dijkstra
+ * Copyright (c) 2001-2004 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
@@ -117,7 +117,7 @@ get_mem(char *symon_buf, int maxlen, char *s)
     }
     }
 
 
     me_stats[3] = me_stats[4] = 0;
     me_stats[3] = me_stats[4] = 0;
-    if (rnswap == me_nswap) {	/* Read swap succesfully */
+    if (rnswap == me_nswap) {	/* Read swap successfully */
 	/* Total things up */
 	/* Total things up */
 	for (i = 0; i < me_nswap; i++) {
 	for (i = 0; i < me_nswap; i++) {
 	    if (me_swdev[i].se_flags & SWF_ENABLE) {
 	    if (me_swdev[i].se_flags & SWF_ENABLE) {

+ 2 - 2
symon/symon/sm_proc.c

@@ -1,7 +1,7 @@
-/* $Id: sm_proc.c,v 1.3 2003/12/20 16:30:44 dijkstra Exp $ */
+/* $Id: sm_proc.c,v 1.4 2004/02/26 22:48:08 dijkstra Exp $ */
 
 
 /*
 /*
- * Copyright (c) 2001-2003 Willem Dijkstra
+ * Copyright (c) 2001-2004 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

+ 4 - 3
symon/symon/sm_sensor.c

@@ -1,7 +1,7 @@
-/* $Id: sm_sensor.c,v 1.3 2003/12/21 13:01:05 dijkstra Exp $ */
+/* $Id: sm_sensor.c,v 1.4 2004/02/26 22:48:08 dijkstra Exp $ */
 
 
 /*
 /*
- * Copyright (c) 2001-2003 Willem Dijkstra
+ * Copyright (c) 2001-2004 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
@@ -35,7 +35,8 @@
  *
  *
  * num : value
  * num : value
  *
  *
- * This code is not re-entrant. It uses sysctl and can be run as any user.
+ * This code is not re-entrant. It uses sysctl and can be run as any
+ * user.
  */
  */
 #include <conf.h>
 #include <conf.h>
 
 

+ 9 - 4
symon/symon/symon.8

@@ -1,6 +1,6 @@
 .\"  -*- nroff -*-
 .\"  -*- nroff -*-
 .\"
 .\"
-.\" Copyright (c) 2001-2003 Willem Dijkstra
+.\" Copyright (c) 2001-2004 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
@@ -103,12 +103,13 @@ newlines and text behind '#' are ignored. The format in BNF:
 .Pp
 .Pp
 .nf
 .nf
 monitor-rule = "monitor" "{" resources "}" [every]
 monitor-rule = "monitor" "{" resources "}" [every]
-	       "stream" ["to"] host [ port ]
+               "stream" ["to"] host [ port ]
 resources    = resource ["(" argument ")"] [ ","|" " resources ]
 resources    = resource ["(" argument ")"] [ ","|" " resources ]
 argument     = number | interfacename | diskname
 argument     = number | interfacename | diskname
 resource     = "cpu" | "mem" | "if" | "io" | "pf" | "debug" |
 resource     = "cpu" | "mem" | "if" | "io" | "pf" | "debug" |
-	       "proc" | "mbuf" | "sensor"
-every        = "every" "second" | number "seconds"
+               "proc" | "mbuf" | "sensor"
+every        = "every" time
+time         = "second" | number "seconds"
 host         = ip4addr | ip6addr | hostname
 host         = ip4addr | ip6addr | hostname
 port         = [ "port" | "," ] portnumber
 port         = [ "port" | "," ] portnumber
 .fi
 .fi
@@ -116,6 +117,10 @@ port         = [ "port" | "," ] portnumber
 Note that symux(8) data files default to receiving data every 5
 Note that symux(8) data files default to receiving data every 5
 seconds. Adjusting the monitoring interval will also require adjusting every
 seconds. Adjusting the monitoring interval will also require adjusting every
 symux(8) datafile.
 symux(8) datafile.
+.Pp
+The pf probe will return data that is collected for the
+.Pa loginterface
+set in /etc/pf.conf(5).
 .Sh EXAMPLE
 .Sh EXAMPLE
 Here is an example
 Here is an example
 .Ar symon.conf
 .Ar symon.conf

+ 22 - 17
symon/symon/symon.c

@@ -1,7 +1,7 @@
-/* $Id: symon.c,v 1.31 2003/12/20 16:30:44 dijkstra Exp $ */
+/* $Id: symon.c,v 1.34 2004/02/26 22:48:08 dijkstra Exp $ */
 
 
 /*
 /*
- * Copyright (c) 2001-2003 Willem Dijkstra
+ * Copyright (c) 2001-2004 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
@@ -65,7 +65,7 @@ int symon_interval = SYMON_DEFAULT_INTERVAL;
 
 
 /* map stream types to inits and getters */
 /* map stream types to inits and getters */
 struct funcmap streamfunc[] = {
 struct funcmap streamfunc[] = {
-    {MT_IO, 0, NULL, init_io, gets_io, get_io},
+    {MT_IO1, 0, NULL, init_io, gets_io, get_io},
     {MT_CPU, 0, NULL, init_cpu, NULL, get_cpu},
     {MT_CPU, 0, NULL, init_cpu, NULL, get_cpu},
     {MT_MEM, 0, NULL, init_mem, NULL, get_mem},
     {MT_MEM, 0, NULL, init_mem, NULL, get_mem},
     {MT_IF, 0, NULL, init_if, NULL, get_if},
     {MT_IF, 0, NULL, init_if, NULL, get_if},
@@ -74,6 +74,7 @@ struct funcmap streamfunc[] = {
     {MT_PROC, 0, NULL, init_proc, gets_proc, get_proc},
     {MT_PROC, 0, NULL, init_proc, gets_proc, get_proc},
     {MT_MBUF, 0, NULL, init_mbuf, NULL, get_mbuf},
     {MT_MBUF, 0, NULL, init_mbuf, NULL, get_mbuf},
     {MT_SENSOR, 0, NULL, init_sensor, NULL, get_sensor},
     {MT_SENSOR, 0, NULL, init_sensor, NULL, get_sensor},
+    {MT_IO2, 0, NULL, init_io, gets_io, get_io},
     {MT_EOT, 0, NULL, NULL, NULL}
     {MT_EOT, 0, NULL, NULL, NULL}
 };
 };
 
 
@@ -261,22 +262,26 @@ main(int argc, char *argv[])
 
 
 	    SLIST_INIT(&newmul);
 	    SLIST_INIT(&newmul);
 
 
-	    if (!read_config_file(&newmul, cfgpath)) {
-		info("new configuration contains errors; keeping old configuration");
-		free_muxlist(&newmul);
-	    } else {
-		free_muxlist(&mul);
-		mul = newmul;
-		info("read configuration file '%.200s' succesfully", cfgpath);
-
-		/* init modules */
-		SLIST_FOREACH(mux, &mul, muxes) {
-		    connect2mux(mux);
-		    SLIST_FOREACH(stream, &mux->sl, streams) {
-			(streamfunc[stream->type].init) (stream->args);
+	    if (flag_unsecure) {
+		if (!read_config_file(&newmul, cfgpath)) {
+		    info("new configuration contains errors; keeping old configuration");
+		    free_muxlist(&newmul);
+		} else {
+		    free_muxlist(&mul);
+		    mul = newmul;
+		    info("read configuration file '%.200s' successfully", cfgpath);
+
+		    /* init modules */
+		    SLIST_FOREACH(mux, &mul, muxes) {
+			connect2mux(mux);
+			SLIST_FOREACH(stream, &mux->sl, streams) {
+			    (streamfunc[stream->type].init) (stream->args);
+			}
 		    }
 		    }
+		    set_stream_use(&mul);
 		}
 		}
-		set_stream_use(&mul);
+	    } else {
+		info("configuration unreachable because of privsep; keeping old configuration");
 	    }
 	    }
 	} else {
 	} else {
 	    /* populate for modules that get all their measurements in one go */
 	    /* populate for modules that get all their measurements in one go */

+ 6 - 6
symon/symon/symon.conf

@@ -1,15 +1,15 @@
 #
 #
-# $Id: symon.conf,v 1.11 2003/12/20 16:30:44 dijkstra Exp $
+# $Id: symon.conf,v 1.12 2004/02/26 22:48:08 dijkstra Exp $
 #
 #
 # Demo configuration for symon. See symon(8) for BNF.
 # Demo configuration for symon. See symon(8) for BNF.
 
 
-monitor { cpu(0),  mem, 
-	  if(lo0), 
-#	  pf, 
+monitor { cpu(0),  mem,
+	  if(lo0),
+#	  pf,
 #         mbuf,
 #         mbuf,
 #         sensor(0),
 #         sensor(0),
 #         proc(httpd),
 #         proc(httpd),
-#         if(xl0), if(de0), if(wi0), 
+#         if(xl0), if(de0), if(wi0),
 #	  io(wd1), io(wd2), io(wd3), io(cd0)
 #	  io(wd1), io(wd2), io(wd3), io(cd0)
-	  io(wd0), 
+	  io(wd0)
 } stream to 127.0.0.1 2100
 } stream to 127.0.0.1 2100

+ 2 - 2
symon/symon/symon.h

@@ -1,7 +1,7 @@
-/* $Id: symon.h,v 1.27 2003/12/20 16:30:44 dijkstra Exp $ */
+/* $Id: symon.h,v 1.28 2004/02/26 22:48:08 dijkstra Exp $ */
 
 
 /*
 /*
- * Copyright (c) 2001-2003 Willem Dijkstra
+ * Copyright (c) 2001-2004 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

+ 2 - 2
symon/symon/symonnet.c

@@ -1,7 +1,7 @@
-/* $Id: symonnet.c,v 1.12 2003/12/20 16:30:44 dijkstra Exp $ */
+/* $Id: symonnet.c,v 1.13 2004/02/26 22:48:08 dijkstra Exp $ */
 
 
 /*
 /*
- * Copyright (c) 2001-2003 Willem Dijkstra
+ * Copyright (c) 2001-2004 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

+ 2 - 2
symon/symon/symonnet.h

@@ -1,7 +1,7 @@
-/* $Id: symonnet.h,v 1.6 2003/12/20 16:30:44 dijkstra Exp $ */
+/* $Id: symonnet.h,v 1.7 2004/02/26 22:48:08 dijkstra Exp $ */
 
 
 /*
 /*
- * Copyright (c) 2001-2003 Willem Dijkstra
+ * Copyright (c) 2001-2004 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

+ 0 - 0
symon/symux/Makefile


+ 57 - 53
symon/symux/c_smrrds.sh

@@ -1,8 +1,8 @@
 #!/bin/sh
 #!/bin/sh
-# $Id: c_smrrds.sh,v 1.24 2003/12/21 13:23:15 dijkstra Exp $
+# $Id: c_smrrds.sh,v 1.26 2004/02/26 22:48:08 dijkstra Exp $
 
 
 #
 #
-# Copyright (c) 2001-2003 Willem Dijkstra
+# Copyright (c) 2001-2004 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
@@ -33,6 +33,28 @@
 INTERVAL=${INTERVAL:-5}
 INTERVAL=${INTERVAL:-5}
 # --- user configuration ends here
 # --- user configuration ends here
 
 
+# addsuffix adds a suffix to each entry of a list (item|item|...)
+addsuffix() {
+    list=$1'|'
+    suffix=$2
+    while [ `echo $list | grep '|'` ]; do
+	newlist=$newlist'|'`echo $list | cut -f1 -d\|`$suffix
+	list=`echo $list | cut -f2- -d\|`
+    done
+    echo $newlist | cut -b2-
+}
+
+create_rrd() {
+    file=$1
+    shift
+    rrdtool create $file $RRD_ARGS $* $RRA_SETUP
+    if [ "$?" = "0" -a -f $file ]; then
+	echo "$file created"
+    else
+	echo "could not create $file"
+    fi
+}
+
 # get arguments
 # get arguments
 select_interval=""
 select_interval=""
 for i
 for i
@@ -88,20 +110,9 @@ fi
 
 
 # All interfaces and disks
 # 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|nge|ray|rl|qe|sf|sis|sk|sl|sm|ste|stge|ti|tl|tr|tx|txp|vme|vr|wb|we|wi|wx|xe|xl"
 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|nge|ray|rl|qe|sf|sis|sk|sl|sm|ste|stge|ti|tl|tr|tx|txp|vme|vr|wb|we|wi|wx|xe|xl"
-VIRTUALINTERFACES="bridge|enc|faith|gif|ppp|sppp|strip|tun|vlan";
+VIRTUALINTERFACES="bridge|carp|enc|faith|gif|ppp|sppp|strip|tun|vlan";
 DISKS="sd|cd|ch|rd|raid|ss|uk|vnc|wd"
 DISKS="sd|cd|ch|rd|raid|ss|uk|vnc|wd"
 
 
-# addsuffix adds a suffix to each entry of a list (item|item|...)
-addsuffix() {
-    list=$1'|'
-    suffix=$2
-    while [ `echo $list | grep '|'` ]; do
-	newlist=$newlist'|'`echo $list | cut -f1 -d\|`$suffix
-	list=`echo $list | cut -f2- -d\|`
-    done
-    echo $newlist | cut -b2-
-}
-
 DISKS=`addsuffix $DISKS [0-9]`
 DISKS=`addsuffix $DISKS [0-9]`
 INTERFACES=`addsuffix $INTERFACES [0-9]`
 INTERFACES=`addsuffix $INTERFACES [0-9]`
 VIRTUALINTERFACES=`addsuffix $VIRTUALINTERFACES \\.\\*`
 VIRTUALINTERFACES=`addsuffix $VIRTUALINTERFACES \\.\\*`
@@ -140,6 +151,7 @@ io=	`echo $DISKS|
 		}
 		}
 		print " ";}'`
 		print " ";}'`
 
 
+Pre 3.5 disk statistics are available via the io1_<disk> argument.
 EOF
 EOF
     exit 1;
     exit 1;
 fi
 fi
@@ -152,7 +164,7 @@ if [ `echo $i | egrep -e "^($VIRTUALINTERFACES)$"` ]; then i=if_$i.rrd; fi
 # add io_*.rrd if it is a disk
 # add io_*.rrd if it is a disk
 if [ `echo $i | egrep -e "^($DISKS)$"` ]; then i=io_$i.rrd; fi
 if [ `echo $i | egrep -e "^($DISKS)$"` ]; then i=io_$i.rrd; fi
 # add .rrd if it is a cpu, etc.
 # add .rrd if it is a cpu, etc.
-if [ `echo $i | egrep -e "^(cpu[0-9]$|mem$|pf$|mbuf$|debug$|proc_|sensor[0-9]$|sensor[0-9][0-9]$)"` ]; then i=$i.rrd; fi
+if [ `echo $i | egrep -e "^(cpu[0-9]$|mem$|pf$|mbuf$|debug$|proc_|sensor[0-9]$|sensor[0-9][0-9]$|io1_)"` ]; then i=$i.rrd; fi
 
 
 if [ -f $i ]; then
 if [ -f $i ]; then
     echo "$i exists - ignoring"
     echo "$i exists - ignoring"
@@ -184,51 +196,43 @@ io|disks)
 
 
 cpu[0-9].rrd)
 cpu[0-9].rrd)
     # Build cpu file
     # Build cpu file
-    rrdtool create $i $RRD_ARGS \
+    create_rrd $i \
 	DS:user:GAUGE:$INTERVAL:0:100 \
 	DS:user:GAUGE:$INTERVAL:0:100 \
 	DS:nice:GAUGE:$INTERVAL:0:100 \
 	DS:nice:GAUGE:$INTERVAL:0:100 \
 	DS:system:GAUGE:$INTERVAL:0:100 \
 	DS:system:GAUGE:$INTERVAL:0:100 \
 	DS:interrupt:GAUGE:$INTERVAL:0:100 \
 	DS:interrupt:GAUGE:$INTERVAL:0:100 \
-	DS:idle:GAUGE:$INTERVAL:0:100 \
-	$RRA_SETUP
-    echo "$i created"
+	DS:idle:GAUGE:$INTERVAL:0:100
     ;;
     ;;
 
 
 sensor*.rrd)
 sensor*.rrd)
     # Build sensor file
     # Build sensor file
-    rrdtool create $i $RRD_ARGS \
-	DS:value:GAUGE:$INTERVAL:-U:U \
-	$RRA_SETUP
-    echo "$i created"
+    create_rrd $i \
+	DS:value:GAUGE:$INTERVAL:-U:U
     ;;
     ;;
 
 
 mem.rrd)
 mem.rrd)
     # Build memory file
     # Build memory file
-    rrdtool create $i $RRD_ARGS \
+    create_rrd $i \
 	DS:real_active:GAUGE:$INTERVAL:0:U \
 	DS:real_active:GAUGE:$INTERVAL:0:U \
 	DS:real_total:GAUGE:$INTERVAL:0:U \
 	DS:real_total:GAUGE:$INTERVAL:0:U \
 	DS:free:GAUGE:$INTERVAL:0:U \
 	DS:free:GAUGE:$INTERVAL:0:U \
 	DS:swap_used:GAUGE:$INTERVAL:0:U \
 	DS:swap_used:GAUGE:$INTERVAL:0:U \
-	DS:swap_total:GAUGE:$INTERVAL:0:U \
-	$RRA_SETUP
-    echo "$i created"
+	DS:swap_total:GAUGE:$INTERVAL:0:U
     ;;
     ;;
 
 
 if_*.rrd)
 if_*.rrd)
     # Build interface files
     # Build interface files
-    rrdtool create $i $RRD_ARGS \
+    create_rrd $i \
 	DS:ipackets:COUNTER:$INTERVAL:U:U DS:opackets:COUNTER:$INTERVAL:U:U \
 	DS:ipackets:COUNTER:$INTERVAL:U:U DS:opackets:COUNTER:$INTERVAL:U:U \
 	DS:ibytes:COUNTER:$INTERVAL:U:U DS:obytes:COUNTER:$INTERVAL:U:U \
 	DS:ibytes:COUNTER:$INTERVAL:U:U DS:obytes:COUNTER:$INTERVAL:U:U \
 	DS:imcasts:COUNTER:$INTERVAL:U:U DS:omcasts:COUNTER:$INTERVAL:U:U \
 	DS:imcasts:COUNTER:$INTERVAL:U:U DS:omcasts:COUNTER:$INTERVAL:U:U \
 	DS:ierrors:COUNTER:$INTERVAL:U:U DS:oerrors:COUNTER:$INTERVAL:U:U \
 	DS:ierrors:COUNTER:$INTERVAL:U:U DS:oerrors:COUNTER:$INTERVAL:U:U \
-	DS:collisions:COUNTER:$INTERVAL:U:U DS:drops:COUNTER:$INTERVAL:U:U \
-	$RRA_SETUP
-    echo "$i created"
+	DS:collisions:COUNTER:$INTERVAL:U:U DS:drops:COUNTER:$INTERVAL:U:U
     ;;
     ;;
 
 
 debug.rrd)
 debug.rrd)
     # Build debug file
     # Build debug file
-    rrdtool create $i $RRD_ARGS \
+    create_rrd $i \
 	DS:debug0:GAUGE:$INTERVAL:U:U DS:debug1:GAUGE:$INTERVAL:U:U \
 	DS:debug0:GAUGE:$INTERVAL:U:U DS:debug1:GAUGE:$INTERVAL:U:U \
 	DS:debug2:GAUGE:$INTERVAL:U:U DS:debug3:GAUGE:$INTERVAL:U:U \
 	DS:debug2:GAUGE:$INTERVAL:U:U DS:debug3:GAUGE:$INTERVAL:U:U \
 	DS:debug4:GAUGE:$INTERVAL:U:U DS:debug5:GAUGE:$INTERVAL:U:U \
 	DS:debug4:GAUGE:$INTERVAL:U:U DS:debug5:GAUGE:$INTERVAL:U:U \
@@ -238,24 +242,20 @@ debug.rrd)
 	DS:debug12:GAUGE:$INTERVAL:U:U DS:debug13:GAUGE:$INTERVAL:U:U \
 	DS:debug12:GAUGE:$INTERVAL:U:U DS:debug13:GAUGE:$INTERVAL:U:U \
 	DS:debug14:GAUGE:$INTERVAL:U:U DS:debug15:GAUGE:$INTERVAL:U:U \
 	DS:debug14:GAUGE:$INTERVAL:U:U DS:debug15:GAUGE:$INTERVAL:U:U \
 	DS:debug16:GAUGE:$INTERVAL:U:U DS:debug17:GAUGE:$INTERVAL:U:U \
 	DS:debug16:GAUGE:$INTERVAL:U:U DS:debug17:GAUGE:$INTERVAL:U:U \
-	DS:debug18:GAUGE:$INTERVAL:U:U DS:debug19:GAUGE:$INTERVAL:U:U \
-	$RRA_SETUP
-    echo "$i created"
+	DS:debug18:GAUGE:$INTERVAL:U:U DS:debug19:GAUGE:$INTERVAL:U:U
     ;;
     ;;
 proc_*.rrd)
 proc_*.rrd)
     # Build proc file
     # Build proc file
-    rrdtool create $i $RRD_ARGS \
-	DS:number:GAUGE:$INTERVAL:0:U DS:uticks:GAUGE:$INTERVAL:0:U \
-	DS:sticks:GAUGE:$INTERVAL:0:U DS:iticks:GAUGE:$INTERVAL:0:U \
+    create_rrd $i \
+	DS:number:GAUGE:$INTERVAL:0:U DS:uticks:COUNTER:$INTERVAL:0:U \
+	DS:sticks:COUNTER:$INTERVAL:0:U DS:iticks:COUNTER:$INTERVAL:0:U \
 	DS:cpusec:GAUGE:$INTERVAL:0:U DS:cpupct:GAUGE:$INTERVAL:0:100 \
 	DS:cpusec:GAUGE:$INTERVAL:0:U DS:cpupct:GAUGE:$INTERVAL:0:100 \
-	DS:procsz:GAUGE:$INTERVAL:0:U DS:rsssz:GAUGE:$INTERVAL:0:U \
-	$RRA_SETUP
-    echo "$i created"
+	DS:procsz:GAUGE:$INTERVAL:0:U DS:rsssz:GAUGE:$INTERVAL:0:U
     ;;
     ;;
 
 
 pf.rrd)
 pf.rrd)
     # Build pf file
     # Build pf file
-    rrdtool create $i $RRD_ARGS \
+    create_rrd $i \
 	DS:bytes_v4_in:DERIVE:$INTERVAL:0:U DS:bytes_v4_out:DERIVE:$INTERVAL:0:U \
 	DS:bytes_v4_in:DERIVE:$INTERVAL:0:U DS:bytes_v4_out:DERIVE:$INTERVAL:0:U \
 	DS:bytes_v6_in:DERIVE:$INTERVAL:0:U DS:bytes_v6_out:DERIVE:$INTERVAL:0:U \
 	DS:bytes_v6_in:DERIVE:$INTERVAL:0:U DS:bytes_v6_out:DERIVE:$INTERVAL:0:U \
 	DS:packets_v4_in_pass:DERIVE:$INTERVAL:0:U DS:packets_v4_in_drop:DERIVE:$INTERVAL:0:U \
 	DS:packets_v4_in_pass:DERIVE:$INTERVAL:0:U DS:packets_v4_in_drop:DERIVE:$INTERVAL:0:U \
@@ -271,14 +271,12 @@ pf.rrd)
 	DS:counters_fragment:DERIVE:$INTERVAL:0:U \
 	DS:counters_fragment:DERIVE:$INTERVAL:0:U \
 	DS:counters_short:DERIVE:$INTERVAL:0:U \
 	DS:counters_short:DERIVE:$INTERVAL:0:U \
 	DS:counters_normalize:DERIVE:$INTERVAL:0:U \
 	DS:counters_normalize:DERIVE:$INTERVAL:0:U \
-	DS:counters_memory:DERIVE:$INTERVAL:0:U \
-	$RRA_SETUP
-    echo "$i created"
+	DS:counters_memory:DERIVE:$INTERVAL:0:U
     ;;
     ;;
 
 
 mbuf.rrd)
 mbuf.rrd)
     # Build mbuf file
     # Build mbuf file
-    rrdtool create $i $RRD_ARGS \
+    create_rrd $i \
 	DS:totmbufs:GAUGE:$INTERVAL:0:U DS:mt_data:GAUGE:$INTERVAL:0:U \
 	DS:totmbufs:GAUGE:$INTERVAL:0:U DS:mt_data:GAUGE:$INTERVAL:0:U \
 	DS:mt_oobdata:GAUGE:$INTERVAL:0:U DS:mt_control:GAUGE:$INTERVAL:0:U \
 	DS:mt_oobdata:GAUGE:$INTERVAL:0:U DS:mt_control:GAUGE:$INTERVAL:0:U \
 	DS:mt_header:GAUGE:$INTERVAL:0:U DS:mt_ftable:GAUGE:$INTERVAL:0:U \
 	DS:mt_header:GAUGE:$INTERVAL:0:U DS:mt_ftable:GAUGE:$INTERVAL:0:U \
@@ -286,19 +284,25 @@ mbuf.rrd)
 	DS:pgused:GAUGE:$INTERVAL:0:U DS:pgtotal:GAUGE:$INTERVAL:0:U \
 	DS:pgused:GAUGE:$INTERVAL:0:U DS:pgtotal:GAUGE:$INTERVAL:0:U \
 	DS:totmem:GAUGE:$INTERVAL:0:U DS:totpct:GAUGE:$INTERVAL:0:100 \
 	DS:totmem:GAUGE:$INTERVAL:0:U DS:totpct:GAUGE:$INTERVAL:0:100 \
 	DS:m_drops:COUNTER:$INTERVAL:0:U DS:m_wait:COUNTER:$INTERVAL:0:U \
 	DS:m_drops:COUNTER:$INTERVAL:0:U DS:m_wait:COUNTER:$INTERVAL:0:U \
-	DS:m_drain:COUNTER:$INTERVAL:0:U \
-	$RRA_SETUP
-    echo "$i created"
+	DS:m_drain:COUNTER:$INTERVAL:0:U
     ;;
     ;;
 
 
 io_*.rrd)
 io_*.rrd)
     # Build disk files
     # Build disk files
-    rrdtool create $i $RRD_ARGS \
+    create_rrd $i \
+	DS:rxfer:COUNTER:$INTERVAL:U:U \
+	DS:wxfer:COUNTER:$INTERVAL:U:U \
+	DS:seeks:COUNTER:$INTERVAL:U:U \
+	DS:rbytes:COUNTER:$INTERVAL:U:U \
+	DS:wbytes:COUNTER:$INTERVAL:U:U
+    ;;
+
+io1_*.rrd)
+    # Build disk files
+    create_rrd $i \
 	DS:transfers:COUNTER:$INTERVAL:U:U \
 	DS:transfers:COUNTER:$INTERVAL:U:U \
 	DS:seeks:COUNTER:$INTERVAL:U:U \
 	DS:seeks:COUNTER:$INTERVAL:U:U \
-	DS:bytes:COUNTER:$INTERVAL:U:U \
-	$RRA_SETUP
-    echo "$i created"
+	DS:bytes:COUNTER:$INTERVAL:U:U
     ;;
     ;;
 
 
 "done")
 "done")

+ 11 - 5
symon/symux/readconf.c

@@ -1,7 +1,7 @@
-/* $Id: readconf.c,v 1.21 2003/12/20 16:30:44 dijkstra Exp $ */
+/* $Id: readconf.c,v 1.23 2004/02/26 22:48:08 dijkstra Exp $ */
 
 
 /*
 /*
- * Copyright (c) 2001-2003 Willem Dijkstra
+ * Copyright (c) 2001-2004 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
@@ -69,10 +69,14 @@ insert_filename(char *path, int maxlen, int type, char *args)
 	ts = "if_";
 	ts = "if_";
 	ta = args;
 	ta = args;
 	break;
 	break;
-    case MT_IO:
+    case MT_IO2:
 	ts = "io_";
 	ts = "io_";
 	ta = args;
 	ta = args;
 	break;
 	break;
+    case MT_IO1:
+	ts = "io1_";
+	ta = args;
+	break;
     case MT_MEM:
     case MT_MEM:
 	ts = "mem";
 	ts = "mem";
 	ta = "";
 	ta = "";
@@ -188,6 +192,7 @@ read_source(struct sourcelist * sol, struct lex * l)
 		case LXT_CPU:
 		case LXT_CPU:
 		case LXT_IF:
 		case LXT_IF:
 		case LXT_IO:
 		case LXT_IO:
+		case LXT_IO1:
 		case LXT_MEM:
 		case LXT_MEM:
 		case LXT_PF:
 		case LXT_PF:
 		case LXT_MBUF:
 		case LXT_MBUF:
@@ -224,7 +229,7 @@ read_source(struct sourcelist * sol, struct lex * l)
 			return 0;
 			return 0;
 		    }
 		    }
 
 
-		    break;	/* LXT_CPU/IF/IO/MEM/PF/MBUF/DEBUG/PROC */
+		    break;	/* LXT_CPU/IF/IO/IO1/MEM/PF/MBUF/DEBUG/PROC */
 		case LXT_COMMA:
 		case LXT_COMMA:
 		    break;
 		    break;
 		default:
 		default:
@@ -312,6 +317,7 @@ read_source(struct sourcelist * sol, struct lex * l)
 	    case LXT_CPU:
 	    case LXT_CPU:
 	    case LXT_IF:
 	    case LXT_IF:
 	    case LXT_IO:
 	    case LXT_IO:
+	    case LXT_IO1:
 	    case LXT_MEM:
 	    case LXT_MEM:
 	    case LXT_PF:
 	    case LXT_PF:
 	    case LXT_MBUF:
 	    case LXT_MBUF:
@@ -373,7 +379,7 @@ read_source(struct sourcelist * sol, struct lex * l)
 			stream->file = xstrdup(l->token);
 			stream->file = xstrdup(l->token);
 		    }
 		    }
 		}
 		}
-		break;		/* LXT_CPU/IF/IO/MEM/PF/MBUF/DEBUG/PROC/SENSOR */
+		break;		/* LXT_CPU/IF/IO/IO1/MEM/PF/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;

+ 2 - 2
symon/symux/readconf.h

@@ -1,7 +1,7 @@
-/* $Id: readconf.h,v 1.7 2003/12/20 16:30:44 dijkstra Exp $ */
+/* $Id: readconf.h,v 1.8 2004/02/26 22:48:08 dijkstra Exp $ */
 
 
 /*
 /*
- * Copyright (c) 2001-2003 Willem Dijkstra
+ * Copyright (c) 2001-2004 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

+ 2 - 2
symon/symux/share.c

@@ -1,7 +1,7 @@
-/* $Id: share.c,v 1.14 2003/12/21 13:01:05 dijkstra Exp $ */
+/* $Id: share.c,v 1.15 2004/02/26 22:48:08 dijkstra Exp $ */
 
 
 /*
 /*
- * Copyright (c) 2001-2003 Willem Dijkstra
+ * Copyright (c) 2001-2004 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

+ 2 - 2
symon/symux/share.h

@@ -1,7 +1,7 @@
-/* $Id: share.h,v 1.7 2003/12/20 16:30:44 dijkstra Exp $ */
+/* $Id: share.h,v 1.8 2004/02/26 22:48:08 dijkstra Exp $ */
 
 
 /*
 /*
- * Copyright (c) 2001-2003 Willem Dijkstra
+ * Copyright (c) 2001-2004 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

+ 85 - 30
symon/symux/symux.8

@@ -1,6 +1,6 @@
 .\"  -*- nroff -*-
 .\"  -*- nroff -*-
 .\"
 .\"
-.\" Copyright (c) 2001-2003 Willem Dijkstra
+.\" Copyright (c) 2001-2004 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
@@ -72,11 +72,13 @@ the rrd files. It should be run as
 The options:
 The options:
 .Bl -tag -width Ds
 .Bl -tag -width Ds
 .It Fl v
 .It Fl v
-Show version information.
+Show version.
 .It Fl d
 .It Fl d
 Stop
 Stop
 .Nm
 .Nm
-from becoming a daemon and show debug information on stdout.
+from becoming a daemon and show debug information on stdout. Use this setting
+to find hosts or specific statistics that do get sent, but are ignored due to
+configuration.
 .It Fl f Ar filename
 .It Fl f Ar filename
 Read configuration from
 Read configuration from
 .Ar filename
 .Ar filename
@@ -102,12 +104,17 @@ stmt         = mux-stmt | source-stmt
 mux-stmt     = "mux" host [ port ]
 mux-stmt     = "mux" host [ port ]
 host         = ip4addr | ip6addr | hostname
 host         = ip4addr | ip6addr | hostname
 port         = [ "port" | "," ] portnumber
 port         = [ "port" | "," ] portnumber
-source-stmt  = "source" host "{" accept-stmts write-stmts [ datadir-stmt ] "}"
+source-stmt  = "source" host "{"
+               accept-stmts
+               write-stmts
+               [ datadir-stmt ] "}"
 accept-stmts = accept-stmt [accept-stmts]
 accept-stmts = accept-stmt [accept-stmts]
 accept-stmt  = "accept" "{" resources "}"
 accept-stmt  = "accept" "{" resources "}"
-resources    = resource ["(" argument ")"] [ ","|" " resources ]
+resources    = resource version ["(" argument ")"]
+               [ ","|" " resources ]
 resource     = "cpu" | "mem" | "if" | "io" | "pf" | "debug" |
 resource     = "cpu" | "mem" | "if" | "io" | "pf" | "debug" |
-	       "proc" | "mbuf" | "sensor"
+               "proc" | "mbuf" | "sensor"
+version      = "" | number
 argument     = number | interfacename | diskname
 argument     = number | interfacename | diskname
 datadir-stmt = "datadir" dirname
 datadir-stmt = "datadir" dirname
 write-stmts  = write-stmt [write-stmts]
 write-stmts  = write-stmt [write-stmts]
@@ -122,9 +129,13 @@ in the
 specifies the port-number for both the udp port (incoming
 specifies the port-number for both the udp port (incoming
 .Xr symon 8
 .Xr symon 8
 traffic) and the tcp port for incoming listeners.
 traffic) and the tcp port for incoming listeners.
+.It Va version
+is needed to distinguish between the same type of information (i.e.
+.Va io
+) coming from different versions of OpenBSD. If no version number is
+supplied, the latest will be assumed.
 .It Va datadir
 .It Va datadir
-will guess filenames for all
-accepted streams.
+will guess filenames for all accepted streams.
 .Va write
 .Va write
 statements always take precendence over a
 statements always take precendence over a
 .Va datadir
 .Va datadir
@@ -148,7 +159,7 @@ source 127.0.0.1 {
 	     io(wd0), io(wd1), io(wd2),
 	     io(wd0), io(wd1), io(wd2),
 	     io(wd3), io(cd0), io(cd1) }
 	     io(wd3), io(cd0), io(cd1) }
 
 
-    datadir "/export/symon/localhost"
+    datadir "/var/www/symon/rrds/localhost"
 }
 }
 .fi
 .fi
 .Sh LISTENERS
 .Sh LISTENERS
@@ -158,23 +169,25 @@ offers received
 data to other programs via tcp. An example of a listener session:
 data to other programs via tcp. An example of a listener session:
 .Pp
 .Pp
 .nf
 .nf
-hoard:~/project/symon$ telnet 127.0.0.1 2100
-Trying 127.0.0.1...
-Connected to 127.0.0.1.
+nexus:~/project/symon$ telnet 10.0.0.1 2100
+Trying 10.0.0.1...
+Connected to 10.0.0.1.
 Escape character is '^]'.
 Escape character is '^]'.
 
 
-127.0.0.1;io:cd1:1027452867:262:308:536576;io:cd0:1027452867
-:0:0:0;io:wd3:1027452867:249140:249140:11797277696;io:wd2:10
-27452867:4074001:4074001:64923271168;io:wd1:1027452867:43183
-9:431839:11880622080;io:wd0:1027452867:10890717:10890717:125
-382360064;if:lo0:1027452867:86952111:86952111:1164079422:116
-4079422:0:0:0:0:0:0;if:de0:1027452867:117562055:90333984:405
-8603563:1844391820:2588654:1:0:0:4013757:0;if:xl0:1027452867
-:149845272:187785769:2494862812:739916810:43291:1:3:0:318440
-7:0;mem::1027452867:26566656:68579328:323141632:3571712:1047
-67488;cpu:0:1027452867:0.00:0.00:0.00:0.00:99.00;
-^]
+10.0.0.1;mem::1077662160:7630848:53850112:469417984:0:25600;cpu:0:
+1077662160:0.00:0.00:0.30:0.20:99.50;io:wd0:1077662160:2074:12759:
+0:30736384:131780608;
+10.0.0.2;mbuf::1077658247:138:74:0:0:41:0:23:0:90:360:868352:25:0:
+0:0;pf::1077658247:700930123:535398451:0:352:1107229:706391:119833
+9:4:0:0:2:3:29:4109383:83291:83262:980325:0:1:6:0:0;mem::107765824
+7:79155200:131956736:391430144:0:536739840;cpu:0:1077658247:0.50:0
+.00:0.00:0.90:98.60;proc:httpd:1077658247:9:216:172:8:3:0.00:14999
+552:0;if:lo0:1077658247:147104:147104:45868177:45868177:0:0:0:0:0:
+0;if:xl0:1077658247:284267:452077:150620236:273265863:372:89478:0:
+0:0:0;if:de0:1077658247:1813721:1197722:729054136:568900227:101:2:
+0:0:198:0;
 
 
+^]
 telnet> close
 telnet> close
 Connection closed.
 Connection closed.
 .fi
 .fi
@@ -184,7 +197,7 @@ The format is
 :
 :
 .Va symon-host-ip
 .Va symon-host-ip
 :
 :
-.Va io|if|cpu|mem|pf|mbuf|proc|debug
+.Va stream-name
 :
 :
 .Va stream-argument
 .Va stream-argument
 :
 :
@@ -199,15 +212,19 @@ Time spent in ( user, nice, system, interrupt, idle ). Total time is 100, data
 is offered with precision 2.
 is offered with precision 2.
 .It mem
 .It mem
 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
-internally.
+are in bytes rounded of to page boundaries. Values are 32 bit unsigned integers.
 .It if
 .It if
 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 internally.
+). Values are 32 bit unsigned integers.
 .It io
 .It io
-Io/disk counters ( total_transfers, total_seeks, total_bytes ). Values are 64
-bit unsigned integers internally.
+Alias for io2. See below.
+.It io1
+Pre OpenBSD 3.5 io/disk counters ( total_transfers, total_seeks, total_bytes
+). Values are 64 bit unsigned integers.
+.It io2
+Io/disk counters ( total_rxfers, total_wxfers, total_seeks, total_rbytes,
+total_wbytes). 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 :
@@ -215,7 +232,7 @@ packets_v4_out_drop : packets_v6_in_pass : packets_v6_in_drop :
 packets_v6_out_pass : packets_v6_out_drop : states_entries : states_searches :
 packets_v6_out_pass : packets_v6_out_drop : states_entries : states_searches :
 states_inserts : states_removals : counters_match : counters_badoffset :
 states_inserts : states_removals : counters_match : counters_badoffset :
 counters_fragment : counters_short : counters_normalize : counters_memory
 counters_fragment : counters_short : counters_normalize : counters_memory
-). Values are 64 bit unsigned integers internally.
+). Values are 64 bit unsigned integers.
 .It debug
 .It debug
 Kernel variables debug0 to debug19. ( debug0 : ... : debug19 ). Values are 32
 Kernel variables debug0 to debug19. ( debug0 : ... : debug19 ). Values are 32
 bit unsigned integers.
 bit unsigned integers.
@@ -254,6 +271,44 @@ daemon.
 .Nm
 .Nm
 system wide configuration file.
 system wide configuration file.
 .El
 .El
+.Sh LEGACY FORMATS
+.Nm
+supports symon(8) clients that send pre OpenBSD 3.5 disk
+statistics. These streams should be identified as io1(<disk>) instead of
+io(<disk>) in
+.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.
+.El
+.Pp
+.Nm
+will output what version of information it is offered by symon(8)s on
+the network when started with the
+.Va -d
+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

+ 8 - 4
symon/symux/symux.c

@@ -1,7 +1,7 @@
-/* $Id: symux.c,v 1.27 2003/12/20 16:30:44 dijkstra Exp $ */
+/* $Id: symux.c,v 1.30 2004/02/26 22:48:08 dijkstra Exp $ */
 
 
 /*
 /*
- * Copyright (c) 2001-2003 Willem Dijkstra
+ * Copyright (c) 2001-2004 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,7 +128,8 @@ main(int argc, char *argv[])
 	case 'f':
 	case 'f':
 	    if (optarg && optarg[0] != '/') {
 	    if (optarg && optarg[0] != '/') {
 		/* cfg path needs to be absolute, we will be a daemon soon */
 		/* cfg path needs to be absolute, we will be a daemon soon */
-		if ((cfgpath = getwd(NULL)) == NULL)
+		cfgpath = xmalloc(MAXPATHLEN);
+		if ((cfgpath = getcwd(cfgpath, MAXPATHLEN)) == NULL)
 		    fatal("could not get working directory");
 		    fatal("could not get working directory");
 
 
 		maxstringlen = strlen(cfgpath) + strlen(optarg) + 1;
 		maxstringlen = strlen(cfgpath) + strlen(optarg) + 1;
@@ -214,7 +215,7 @@ main(int argc, char *argv[])
 		info("new configuration contains errors; keeping old configuration");
 		info("new configuration contains errors; keeping old configuration");
 		free_muxlist(&newmul);
 		free_muxlist(&newmul);
 	    } else {
 	    } else {
-		info("read configuration file '%.100s' succesfully", cfgfile);
+		info("read configuration file '%.100s' successfully", cfgfile);
 		free_muxlist(&mul);
 		free_muxlist(&mul);
 		mul = newmul;
 		mul = newmul;
 		mux = SLIST_FIRST(&mul);
 		mux = SLIST_FIRST(&mul);
@@ -300,6 +301,9 @@ main(int argc, char *argv[])
 		    snprintf(stringptr, maxstringlen, ";");
 		    snprintf(stringptr, maxstringlen, ";");
 		    maxstringlen -= strlen(stringptr);
 		    maxstringlen -= strlen(stringptr);
 		    stringptr += strlen(stringptr);
 		    stringptr += strlen(stringptr);
+		} else {
+		    debug("ignored unaccepted stream %.16s(%.16s) from %.20s", type2str(ps.type),
+			  ((ps.args == NULL) ? "0" : ps.args), source->addr);
 		}
 		}
 	    }
 	    }
 	    /*
 	    /*

+ 5 - 5
symon/symux/symux.conf

@@ -1,18 +1,18 @@
 #
 #
-# $Id: symux.conf,v 1.21 2003/12/20 16:30:44 dijkstra Exp $
+# $Id: symux.conf,v 1.22 2004/02/26 22:48:08 dijkstra Exp $
 #
 #
 # Demo symux configuration. See symux(8) for BNF.
 # Demo symux configuration. See symux(8) for BNF.
 
 
 mux 127.0.0.1 2100
 mux 127.0.0.1 2100
 
 
 source 127.0.0.1 {
 source 127.0.0.1 {
-	accept { cpu(0),  mem, 
-	  	 if(lo0), 
-#	  	 pf, 
+	accept { cpu(0),  mem,
+	  	 if(lo0),
+#	  	 pf,
 #         	 mbuf,
 #         	 mbuf,
 #         	 sensor(0),
 #         	 sensor(0),
 #         	 proc(httpd),
 #         	 proc(httpd),
-#         	 if(xl0), if(de0), if(wi0), 
+#         	 if(xl0), if(de0), if(wi0),
 #	  	 io(wd1), io(wd2), io(wd3), io(cd0)
 #	  	 io(wd1), io(wd2), io(wd3), io(cd0)
 	  	 io(wd0)
 	  	 io(wd0)
 	}
 	}

+ 2 - 2
symon/symux/symux.h

@@ -1,7 +1,7 @@
-/* $Id: symux.h,v 1.18 2003/12/20 16:30:44 dijkstra Exp $ */
+/* $Id: symux.h,v 1.19 2004/02/26 22:48:08 dijkstra Exp $ */
 
 
 /*
 /*
- * Copyright (c) 2001-2003 Willem Dijkstra
+ * Copyright (c) 2001-2004 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

+ 2 - 2
symon/symux/symuxnet.c

@@ -1,7 +1,7 @@
-/* $Id: symuxnet.c,v 1.14 2003/12/21 13:01:05 dijkstra Exp $ */
+/* $Id: symuxnet.c,v 1.15 2004/02/26 22:48:08 dijkstra Exp $ */
 
 
 /*
 /*
- * Copyright (c) 2001-2003 Willem Dijkstra
+ * Copyright (c) 2001-2004 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

+ 2 - 2
symon/symux/symuxnet.h

@@ -1,7 +1,7 @@
-/* $Id: symuxnet.h,v 1.10 2003/12/21 13:01:05 dijkstra Exp $ */
+/* $Id: symuxnet.h,v 1.11 2004/02/26 22:48:08 dijkstra Exp $ */
 
 
 /*
 /*
- * Copyright (c) 2001-2003 Willem Dijkstra
+ * Copyright (c) 2001-2004 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