Browse Source

Add ./tarball_archive/mon-2.2.tar.gz

Wictor Lund 3 years ago
parent
commit
2cf2eb1305

+ 1 - 1
mon/INSTALL

@@ -66,5 +66,5 @@ mon2web run on POSIX compliant unixes, but the monitoring application itself
 
 Willem Dijkstra <wpd@xs4all.nl>
 
-$Id: INSTALL,v 1.1 2002/08/16 13:55:42 dijkstra Exp $
+$Id: INSTALL,v 1.2 2002/08/29 19:37:38 dijkstra Exp $
 

+ 2 - 2
mon/Makefile

@@ -1,7 +1,7 @@
-# $Id: Makefile,v 1.4 2002/08/16 13:55:42 dijkstra Exp $
+# $Id: Makefile,v 1.5 2002/08/29 19:37:38 dijkstra Exp $
 
 SUBDIR=	lib mon monmux 
-V=2.1
+V=2.2
 
 .if make(clean)
 SUBDIR+= ports/mon

+ 14 - 7
mon/lib/data.c

@@ -1,4 +1,4 @@
-/* $Id: data.c,v 1.13 2002/08/29 05:59:34 dijkstra Exp $ */
+/* $Id: data.c,v 1.14 2002/08/29 19:38:52 dijkstra Exp $ */
 
 /*
  * Copyright (c) 2001-2002 Willem Dijkstra
@@ -92,6 +92,7 @@ struct {
     {MT_CPU, "ccccc"},
     {MT_MEM, "lllll"},
     {MT_IF,  "llllllllll"},
+    {MT_PF,  "LLLLLLLLLLLLLLLLLLLLLL"},
     {MT_EOT, ""}
 };
 
@@ -103,6 +104,7 @@ struct {
     {MT_CPU, LXT_CPU},
     {MT_MEM, LXT_MEM},
     {MT_IF,  LXT_IF},
+    {MT_PF,  LXT_PF},
     {MT_EOT, LXT_BADTOKEN}
 };
 /* parallel crc32 table */
@@ -272,7 +274,10 @@ snpack(char *buf, int maxlen, char *id, int type, ...)
 		     
 	switch (streamform[type].form[i]) {
 	case 'c':
-	    c = va_arg(ap, u_int16_t);
+	    c = va_arg(ap, int); /* int instead of u_int16_t to avoid just
+                                    getting the first 2 bytes if the compiler
+                                    generated an int on the stack -- cheers
+                                    dhartmei@ */
 	    c = htons(c);
 	    bcopy(&c, buf + offset, sizeof(u_int16_t));
 	    offset += sizeof(u_int16_t);
@@ -381,7 +386,8 @@ sunpack(char *buf, struct packedstream *ps)
 int 
 ps2strn(struct packedstream *ps, char *buf, const int maxlen, int pretty)
 {
-    float c;
+    float f;
+    u_int16_t c;
     u_int64_t q;
     u_int32_t l;
     int i=0;
@@ -411,19 +417,20 @@ ps2strn(struct packedstream *ps, char *buf, const int maxlen, int pretty)
 
 	switch (vartype) {
 	case 'c':
-	    c = (*((u_int16_t *)in) / 10);
-	    snprintf(out, strlenvar(vartype), formatstr, c); 
+	    bcopy(in, &c, sizeof(u_int16_t));
+	    f = (float)c / 10.0;
+	    snprintf(out, strlenvar(vartype), formatstr, f); 
 	    in  += sizeof(u_int16_t);
 	    break;
 
 	case 'l': 
-	    l = *((u_int32_t *)in);
+	    bcopy(in, &l, sizeof(u_int32_t));
 	    snprintf(out, strlenvar(vartype), formatstr, l); 
 	    in  += sizeof(u_int32_t);
 	    break;
 
 	case 'L': 
-	    q = *((u_int64_t *)in);
+	    bcopy(in, &q, sizeof(u_int64_t));
 	    snprintf(out, strlenvar(vartype), formatstr, q); 
 	    in  += sizeof(u_int64_t);
 	    break;

+ 36 - 39
mon/lib/data.h

@@ -1,4 +1,4 @@
-/* $Id: data.h,v 1.12 2002/08/11 20:02:53 dijkstra Exp $ */
+/* $Id: data.h,v 1.13 2002/08/29 19:38:52 dijkstra Exp $ */
 
 /*
  * Copyright (c) 2001-2002 Willem Dijkstra
@@ -51,21 +51,19 @@
 /* Polynominal to use for CRC generation */
 #define MON_CRCPOLY  0x04c11db7
 
-#ifdef WORDS_BIGENDIAN
+#if BYTE_ORDER == BIG_ENDIAN
 #define htonq(n) n
 #define ntohq(n) n
 #else
 static inline u_int64_t
 htonq (u_int64_t v)
 {
-   return htonl ((u_int32_t) (v >> 32))
-      | (u_int64_t) ntohl ((u_int32_t) v) << 32;
+    return (u_int64_t)htonl(v) << 32 | htonl(v >> 32);
 }
 static inline u_int64_t
 ntohq (u_int64_t v) 
 {
-   return ntohl ((u_int32_t) (v >>32))
-      | (u_int64_t) ntohl ((u_int32_t) v) << 32;
+    return (u_int64_t)ntohl(v) << 32 | ntohl(v >> 32);
 }
 #endif
 
@@ -80,10 +78,11 @@ ntohq (u_int64_t v)
 #define MON_PACKET_VER  1
 struct monpacket {
     struct {
-	u_int8_t mon_version;
 	u_int64_t timestamp;
-	u_int16_t length;
 	u_int32_t crc;
+	u_int16_t length;
+	u_int8_t mon_version;
+	u_int8_t reserved;
     } header;
     char data[_POSIX2_LINE_MAX];
 };  
@@ -135,17 +134,16 @@ SLIST_HEAD(muxlist, mux);
 #define MT_CPU    1
 #define MT_MEM    2
 #define MT_IF     3
-#define MT_EOT    4
+#define MT_PF     4
+#define MT_EOT    5
 
 /* NOTE: struct packetstream
  *
  * Unpacking of incoming packets is done via a packedstream structure. This
  * structure defines the maximum amount of data that can be contained in a
- * single network representation of a stream. 
- *
- * This sucks in the way of portability (e.g. adding multiple cpu types) and
- * maintainabilty. This code will need to be refactored when I port it to other
- * oses.  
+ * single network representation of a stream. It is used internally for sizing
+ * only. Although the union members are here, they could also read u_int64_t[4]
+ * with io, for instance.
  */
 #define MON_PS_ARGLEN    16
 struct packedstream {
@@ -184,34 +182,33 @@ struct packedstream {
 	    u_int32_t mcolls;
 	    u_int32_t mdrops;
 	} ps_if;
+	struct {
+	    u_int64_t bytes_v4_in;
+	    u_int64_t bytes_v4_out;
+	    u_int64_t bytes_v6_in;
+	    u_int64_t bytes_v6_out;
+	    u_int64_t packets_v4_in_pass;
+	    u_int64_t packets_v4_in_drop;
+	    u_int64_t packets_v4_out_pass;
+	    u_int64_t packets_v4_out_drop;
+	    u_int64_t packets_v6_in_pass;
+	    u_int64_t packets_v6_in_drop;
+	    u_int64_t packets_v6_out_pass;
+	    u_int64_t packets_v6_out_drop;
+	    u_int64_t states_entries;
+	    u_int64_t states_searches;
+	    u_int64_t states_inserts;
+	    u_int64_t states_removals;
+	    u_int64_t counters_match;
+	    u_int64_t counters_badoffset;
+	    u_int64_t counters_fragment;
+	    u_int64_t counters_short;
+	    u_int64_t counters_normalize;
+	    u_int64_t counters_memory;
+	} ps_pf;
     } data;
 };
 
-#define mio_total_transfers  data.ps_io.mtotal_transfers
-#define mio_total_seeks      data.ps_io.mtotal_seeks
-#define mio_total_bytes      data.ps_io.mtotal_bytes
-#define mcpm_user            data.ps_cpu.uuser
-#define mcpm_nice            data.ps_cpu.unice
-#define mcpm_system          data.ps_cpu.usystem
-#define mcpm_interrupt       data.ps_cpu.uinterrupt
-#define mcpm_idle            data.ps_cpu.uidle
-#define mmem_real_active     data.ps_mem.mreal_active
-#define mmem_real_total      data.ps_mem.mreal_total
-#define mmem_free            data.ps_mem.mfree
-#define mmem_swap_msed       data.ps_mem.uswap_used
-#define mmem_swap_total      data.ps_mem.mswap_total
-#define mif_ipackets         data.ps_if.mipackets
-#define mif_opackets         data.ps_if.mopackets
-#define mif_ibytes           data.ps_if.mibytes
-#define mif_obytes           data.ps_if.mobytes
-#define mif_imcasts          data.ps_if.mimcasts
-#define mif_omcasts          data.ps_if.momcasts
-#define mif_ierrors          data.ps_if.mierrors
-#define mif_oerrors          data.ps_if.moerrors
-#define mif_colls            data.ps_if.mcolls
-#define mif_drops            data.ps_if.mdrops
-
-
 /* prototypes */
 __BEGIN_DECLS
 const char    *type2str(const int);

+ 1 - 1
mon/lib/error.c

@@ -1,4 +1,4 @@
-/* $Id: error.c,v 1.7 2002/07/20 14:28:29 dijkstra Exp $ */
+/* $Id: error.c,v 1.8 2002/08/29 19:38:52 dijkstra Exp $ */
 
 /*
  * Copyright (c) 2001-2002 Willem Dijkstra

+ 2 - 1
mon/lib/lex.c

@@ -1,4 +1,4 @@
-/* $Id: lex.c,v 1.10 2002/07/25 09:51:42 dijkstra Exp $ */
+/* $Id: lex.c,v 1.11 2002/08/29 19:38:52 dijkstra Exp $ */
 
 /*
  * Copyright (c) 2001-2002 Willem Dijkstra
@@ -76,6 +76,7 @@ static struct {
     { "mem", LXT_MEM },
     { "monitor", LXT_MONITOR },
     { "mux", LXT_MUX },
+    { "pf", LXT_PF },
     { "port", LXT_PORT },
     { "source", LXT_SOURCE },
     { "stream", LXT_STREAM },

+ 7 - 6
mon/lib/lex.h

@@ -1,4 +1,4 @@
-/* $Id: lex.h,v 1.10 2002/07/25 09:51:42 dijkstra Exp $ */
+/* $Id: lex.h,v 1.11 2002/08/29 19:38:52 dijkstra Exp $ */
 
 /*
  * Copyright (c) 2001-2002 Willem Dijkstra
@@ -58,11 +58,12 @@
 #define LXT_MONITOR   12
 #define LXT_MUX       13
 #define LXT_OPEN      14
-#define LXT_PORT      15
-#define LXT_SOURCE    16
-#define LXT_STREAM    17
-#define LXT_TO        18
-#define LXT_WRITE     19
+#define LXT_PF        15
+#define LXT_PORT      16
+#define LXT_SOURCE    17
+#define LXT_STREAM    18
+#define LXT_TO        19
+#define LXT_WRITE     20
 
 struct lex {
     char *buffer;          /* current line(s) */

+ 1 - 1
mon/lib/net.c

@@ -1,4 +1,4 @@
-/* $Id: net.c,v 1.5 2002/03/31 14:27:46 dijkstra Exp $ */
+/* $Id: net.c,v 1.6 2002/08/29 19:38:52 dijkstra Exp $ */
 
 /*
  * Copyright (c) 2001-2002 Willem Dijkstra

+ 2 - 2
mon/mon/Makefile

@@ -1,7 +1,7 @@
-# $Id: Makefile,v 1.22 2002/07/25 14:25:29 dijkstra Exp $
+# $Id: Makefile,v 1.23 2002/08/29 19:38:53 dijkstra Exp $
 .include "../Makefile.inc"
 
-SRCS=	mon.c cpu.c mem.c if.c io.c readconf.c monnet.c
+SRCS=	mon.c cpu.c mem.c if.c io.c pf.c readconf.c monnet.c
 OBJS+=	${SRCS:R:S/$/.o/g}
 LIBS=  -lkvm -L../lib -lmon
 CFLAGS+=-DMON_KVM -DNET_INET6 -I../lib

+ 9 - 9
mon/mon/cpu.c

@@ -1,4 +1,4 @@
-/* $Id: cpu.c,v 1.11 2002/05/09 12:39:50 dijkstra Exp $ */
+/* $Id: cpu.c,v 1.12 2002/08/29 19:38:53 dijkstra Exp $ */
 
 /* The author of this code is Willem Dijkstra (wpd@xs4all.nl).
  * 
@@ -62,7 +62,7 @@
 #include "mon.h"
 
 __BEGIN_DECLS
-int percentages(int, float *, long *, long *, long *);
+int percentages(int, int *, long *, long *, long *);
 __END_DECLS
 
 /* Globals for this module all start with cp_ */
@@ -71,7 +71,7 @@ static size_t cp_size;
 static long cp_time[CPUSTATES];
 static long cp_old[CPUSTATES];
 static long cp_diff[CPUSTATES];
-static float cp_states[CPUSTATES];
+static int cp_states[CPUSTATES];
 /*
  *  percentages(cnt, out, new, old, diffs) - calculate percentage change
  *      between array "old" and "new", putting the percentages i "out".
@@ -81,7 +81,7 @@ static float cp_states[CPUSTATES];
  *      useful on BSD mchines for calculating cpu state percentages.
  */
 int 
-percentages(int cnt, float *out, register long *new, register long *old, long *diffs)
+percentages(int cnt, int *out, register long *new, register long *old, long *diffs)
 {
     register int i;
     register long change;
@@ -142,9 +142,9 @@ get_cpu(char *mon_buf, int maxlen, char *s)
     total = percentages(CPUSTATES, cp_states, cp_time, cp_old, cp_diff);
     
     return snpack(mon_buf, maxlen, s, MT_CPU,
-		  (u_int16_t) cp_states[CP_USER], 
-		  (u_int16_t) cp_states[CP_NICE], 
-		  (u_int16_t) cp_states[CP_SYS], 
-		  (u_int16_t) cp_states[CP_INTR], 
-		  (u_int16_t) cp_states[CP_IDLE]);
+		  cp_states[CP_USER], 
+		  cp_states[CP_NICE], 
+		  cp_states[CP_SYS], 
+		  cp_states[CP_INTR], 
+		  cp_states[CP_IDLE]);
 }

+ 2 - 1
mon/mon/mon.c

@@ -1,4 +1,4 @@
-/* $Id: mon.c,v 1.19 2002/08/11 19:52:16 dijkstra Exp $ */
+/* $Id: mon.c,v 1.20 2002/08/29 19:38:53 dijkstra Exp $ */
 
 /*
  * Copyright (c) 2001-2002 Willem Dijkstra
@@ -83,6 +83,7 @@ struct funcmap streamfunc[] = {
     {MT_CPU, init_cpu, get_cpu},
     {MT_MEM, init_mem, get_mem},
     {MT_IF,  init_if,  get_if},
+    {MT_PF,  init_pf,  get_pf},
     {MT_EOT, NULL, NULL}
 };
 

+ 1 - 1
mon/mon/mon.conf

@@ -1,5 +1,5 @@
 #
-# $Id: mon.conf,v 1.7 2002/07/25 14:23:04 dijkstra Exp $
+# $Id: mon.conf,v 1.8 2002/08/29 19:38:53 dijkstra Exp $
 #
 # Initial mon.conf demonstrates how I configure mon.
 

+ 5 - 1
mon/mon/mon.h

@@ -1,4 +1,4 @@
-/* $Id: mon.h,v 1.14 2002/04/04 20:48:56 dijkstra Exp $ */
+/* $Id: mon.h,v 1.15 2002/08/29 19:38:53 dijkstra Exp $ */
 
 /*
  * Copyright (c) 2001-2002 Willem Dijkstra
@@ -84,6 +84,10 @@ extern int  get_if(char *, int, char *);
 /* io.c */
 extern void init_io(char *);
 extern int  get_io(char *, int, char *);
+
+/* pf.c */
+extern void init_pf(char *);
+extern int  get_pf(char *, int, char *);
 __END_DECLS
 
 #endif /*_MON_MON_H*/

+ 99 - 0
mon/mon/pf.c

@@ -0,0 +1,99 @@
+/* $Id: pf.c,v 1.1 2002/08/29 19:42:32 dijkstra Exp $ */
+
+/*
+ * Copyright (c) 2002 Daniel Hartmeier
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ *    - Redistributions of source code must retain the above copyright
+ *      notice, this list of conditions and the following disclaimer.
+ *    - Redistributions in binary form must reproduce the above
+ *      copyright notice, this list of conditions and the following
+ *      disclaimer in the documentation and/or other materials provided
+ *      with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ */
+
+#include <sys/types.h>
+#include <sys/ioctl.h>
+#include <sys/socket.h>
+#include <netinet/in.h>
+#include <net/if.h>
+#include <net/pfvar.h>
+#include <fcntl.h>
+
+#include "error.h"
+#include "mon.h"
+
+static int dev = -1;
+
+void
+init_pf(char *s)
+{
+    dev = open("/dev/pf", O_RDWR);
+    if (dev == -1)
+	fatal("%s:%d: open(\"/dev/pf\") failed", __FILE__, __LINE__);
+    info("started module pf(%s)", s);
+}
+
+int
+get_pf(char *mon_buf, int maxlen, char *arg)
+{
+    struct pf_status s;
+    u_int64_t n;
+    
+    if (dev == -1) {
+	warning("pf(%s) failed (dev == -1)", arg);
+	return 0;
+    }
+    
+    if (ioctl(dev, DIOCGETSTATUS, &s)) {
+	warning("pf(%s) failed (ioctl error)", arg);
+	return 0;
+    }
+    
+    if (!s.running)
+	return 0;
+    
+    n = s.states;
+    return snpack(mon_buf, maxlen, arg, MT_PF,
+		  s.bcounters[0][PF_IN],
+		  s.bcounters[0][PF_OUT],
+		  s.bcounters[1][PF_IN],
+		  s.bcounters[1][PF_OUT],
+		  s.pcounters[0][PF_IN][PF_PASS],
+		  s.pcounters[0][PF_IN][PF_DROP],
+		  s.pcounters[0][PF_OUT][PF_PASS],
+		  s.pcounters[0][PF_OUT][PF_DROP],
+		  s.pcounters[1][PF_IN][PF_PASS],
+		  s.pcounters[1][PF_IN][PF_DROP],
+		  s.pcounters[1][PF_OUT][PF_PASS],
+		  s.pcounters[1][PF_OUT][PF_DROP],
+		  n,
+		  s.fcounters[0],
+		  s.fcounters[1],
+		  s.fcounters[2],
+		  s.counters[0],
+		  s.counters[1],
+		  s.counters[2],
+		  s.counters[3],
+		  s.counters[4],
+		  s.counters[5]
+	);
+}

+ 4 - 3
mon/mon/readconf.c

@@ -1,4 +1,4 @@
-/* $Id: readconf.c,v 1.8 2002/08/11 19:53:15 dijkstra Exp $ */
+/* $Id: readconf.c,v 1.9 2002/08/29 19:38:53 dijkstra Exp $ */
 
 /*
  * Copyright (c) 2001-2002 Willem Dijkstra
@@ -110,6 +110,7 @@ read_mon_args(struct mux *mux, struct lex *l)
 	case LXT_IF:
 	case LXT_IO:
 	case LXT_MEM:
+	case LXT_PF:
 	    st = token2type(l->op);
 	    strncpy(&sn[0], l->token, _POSIX2_LINE_MAX);
 
@@ -138,11 +139,11 @@ read_mon_args(struct mux *mux, struct lex *l)
 		return 0;
 	    }
 	    
-	    break; /* LXT_CPU/IF/IO/MEM */
+	    break; /* LXT_CPU/IF/IO/MEM/PF */
 	case LXT_COMMA:
 	    break;
 	default:
-	    parse_error(l, "cpu|mem|if|io|}");
+	    parse_error(l, "{cpu|mem|if|io|pf}");
 	    return 0;
 	    break;
 	}

+ 0 - 0
mon/mon2web/mon.png


+ 28 - 3
mon/monmux/c_monrrds.sh

@@ -1,5 +1,5 @@
 #!/bin/sh
-# $Id: c_monrrds.sh,v 1.8 2002/07/25 19:10:03 dijkstra Exp $
+# $Id: c_monrrds.sh,v 1.9 2002/08/29 19:38:56 dijkstra Exp $
 
 #
 # Copyright (c) 2001-2002 Willem Dijkstra
@@ -33,6 +33,7 @@
 #       all      Makes all files for active interfaces and disks
 #       mem      Make memory file
 #       cpu?     Make cpu file
+#       pf       Make pf file
 
 # --- user configuration starts here
 INTERVAL=`grep MON_INTERVAL ../mon/mon.h 2>/dev/null | cut -f3 -d\ `
@@ -87,7 +88,7 @@ if [ `echo $i | egrep -e "^($INTERFACES)$"` ]; then i=if_$i.rrd; fi
 # add io_*.rrd if it is a disk
 if [ `echo $i | egrep -e "^($DISKS)$"` ]; then i=io_$i.rrd; fi
 # add .rrd if it is a cpu or mem
-if [ `echo $i | egrep -e "^(cpu[0-9]|mem)$"` ]; then i=$i.rrd; fi
+if [ `echo $i | egrep -e "^(cpu[0-9]|mem|pf)$"` ]; then i=$i.rrd; fi
 
 if [ -f $i ]; then
     echo "$i exists - ignoring"
@@ -97,10 +98,11 @@ fi
 case $i in
 
 all)
-    echo "Creating rrd files for {cpu0|mem|disks|interfaces}"
+    echo "Creating rrd files for {cpu0|mem|disks|interfaces|pf}"
     sh $this cpu0 mem
     sh $this interfaces
     sh $this disks
+    sh $this pf
     ;;
 
 if|interfaces)
@@ -149,6 +151,29 @@ if_*.rrd)
     echo "$i created"
     ;;
 
+pf.rrd)
+    # Build pf file
+    rrdtool create $i --step=$INTERVAL \
+	DS:bytes_v4_in:DERIVE:5:0:U DS:bytes_v4_out:DERIVE:5:0:U \
+	DS:bytes_v6_in:DERIVE:5:0:U DS:bytes_v6_out:DERIVE:5:0:U \
+	DS:packets_v4_in_pass:DERIVE:5:0:U DS:packets_v4_in_drop:DERIVE:5:0:U \
+	DS:packets_v4_out_pass:DERIVE:5:0:U DS:packets_v4_out_drop:DERIVE:5:0:U \
+	DS:packets_v6_in_pass:DERIVE:5:0:U DS:packets_v6_in_drop:DERIVE:5:0:U \
+	DS:packets_v6_out_pass:DERIVE:5:0:U DS:packets_v6_out_drop:DERIVE:5:0:U \
+	DS:states_entries:ABSOLUTE:5:0:U \
+	DS:states_searches:DERIVE:5:0:U \
+	DS:states_inserts:DERIVE:5:0:U \
+	DS:states_removals:DERIVE:5:0:U \
+	DS:counters_match:DERIVE:5:0:U \
+	DS:counters_badoffset:DERIVE:5:0:U \
+	DS:counters_fragment:DERIVE:5:0:U \
+	DS:counters_short:DERIVE:5:0:U \
+	DS:counters_normalize:DERIVE:5:0:U \
+	DS:counters_memory:DERIVE:5:0:U \
+	$RRA_SETUP
+    echo "$i created"
+    ;;
+
 io_*.rrd)
     # Build disk files
     rrdtool create $i --step=$INTERVAL \

+ 7 - 5
mon/monmux/readconf.c

@@ -1,4 +1,4 @@
-/* $Id: readconf.c,v 1.11 2002/08/11 19:54:48 dijkstra Exp $ */
+/* $Id: readconf.c,v 1.12 2002/08/29 19:38:56 dijkstra Exp $ */
 
 /*
  * Copyright (c) 2001-2002 Willem Dijkstra
@@ -114,7 +114,7 @@ read_source(struct sourcelist *sol, struct lex *l)
 
     source = add_source(sol, lookup_address);
     source->ip = lookup_ip;
-
+    
     EXPECT(l, LXT_BEGIN);
     while (lex_nexttoken(l)) {
 	switch (l->op) {
@@ -127,6 +127,7 @@ read_source(struct sourcelist *sol, struct lex *l)
 		case LXT_IF:
 		case LXT_IO:
 		case LXT_MEM:
+		case LXT_PF:
 		    st = token2type(l->op);
 		    strncpy(&sn[0], l->token, _POSIX2_LINE_MAX);
 
@@ -157,11 +158,11 @@ read_source(struct sourcelist *sol, struct lex *l)
 			return 0;
 		    }
 
-		    break; /* LXT_CPU/LXT_IF/LXT_IO/LXT_MEM */
+		    break; /* LXT_CPU/LXT_IF/LXT_IO/LXT_MEM/LXT_PF */
 		case LXT_COMMA:
 		    break;
 		default:
-		    parse_error(l, "{cpu|mem|if|io}");
+		    parse_error(l, "{cpu|mem|if|io|pf}");
 		    return 0;
 
 		    break;
@@ -176,6 +177,7 @@ read_source(struct sourcelist *sol, struct lex *l)
 	    case LXT_IF:
 	    case LXT_IO:
 	    case LXT_MEM:
+	    case LXT_PF:
 		st = token2type(l->op);
 		strncpy(&sn[0], l->token, _POSIX2_LINE_MAX);
 		
@@ -225,7 +227,7 @@ read_source(struct sourcelist *sol, struct lex *l)
 			stream->file = xstrdup(l->token);
 		    }
 		}
-		break; /* LXT_CPU/LXT_IF/LXT_IO/LXT_MEM */
+		break; /* LXT_CPU/LXT_IF/LXT_IO/LXT_MEM/LXT_PF */
 	    default:
 		parse_error(l, "{cpu|mem|if|io}");
 		return 0;

+ 0 - 3
mon/ports/mon/pkg/DESCR

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

+ 0 - 7
mon/ports/mon/pkg/MESSAGE

@@ -1,7 +0,0 @@
-+---------------
-| Example configurations for both mon and monmux have been installed in
-| ${PREFIX}/share/mon.
-|
-| RRD files can be obtained by running
-| ${PREFIX}/share/mon/c_monrrds.sh
-+---------------

+ 0 - 9
mon/ports/mon/pkg/PLIST

@@ -1,9 +0,0 @@
-@comment $OpenBSD$
-libexec/mon
-libexec/monmux
-man/cat8/mon.0
-man/cat8/monmux.0
-share/mon/c_monrrds.sh
-share/mon/mon.conf
-share/mon/monmux.conf
-@dirrm share/mon