Browse Source

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

Wictor Lund 3 years ago
parent
commit
433efffdb5

+ 9 - 1
symon/CHANGELOG

@@ -1,3 +1,11 @@
+22/02/2005 - 2.70
+
+   - Ulrich Spoerlein 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
+
 16/02/2005 - 2.69
 
    - inet6 support works again (Eric from Catastrophe.net)
@@ -380,4 +388,4 @@
 29/09/2001 - Lexer had trouble dealing with ip-addresses. Cleaned up the number
              parsing code and removed a second comment reader.
 
-$Id: CHANGELOG,v 1.39 2005/02/04 09:49:26 dijkstra Exp $
+$Id: CHANGELOG,v 1.41 2005/02/25 15:10:09 dijkstra Exp $

+ 2 - 1
symon/INSTALL

@@ -15,6 +15,7 @@ NetBSD:   - sysctl: cpu, debug, if, io, mbuf, proc
           - r on /dev/sysmon for sensor
 
 FreeBSD:  - sysctl: all
+          - non-chroot on FreeBSD 5.x for CPU ticks in proc
 
 Linux:    - r on /proc/net/dev: if
           - r on /proc/stat: cpu
@@ -102,5 +103,5 @@ rudimentary support for FreeBSD, NetBSD and Linux.
 
 Willem Dijkstra - wpd@xs4all.nl
 
-$Id: INSTALL,v 1.16 2005/01/14 16:15:21 dijkstra Exp $
+$Id: INSTALL,v 1.17 2005/02/25 15:10:09 dijkstra Exp $
 

+ 22 - 27
symon/Makefile.inc

@@ -1,38 +1,33 @@
-# $Id: Makefile.inc,v 1.28 2005/02/04 09:49:26 dijkstra Exp $
+# $Id: Makefile.inc,v 1.30 2005/02/25 15:10:09 dijkstra Exp $
 
-V=2.69
+V=2.70
 OS!=uname -s
 
-AR=	ar
-CC=	cc
+AR?=	ar
+CC?=	cc
 .ifdef DEBUG
 CFLAGS+=-g -Wall
 .else
 CFLAGS+=-Wall
 .endif
-INSTALL=install
-LORDER=	lorder
-TSORT=  tsort
-NROFF=	nroff
-RANLIB= ranlib
-STRIP=  strip
-POD2MAN= pod2man
-
-RRDDIR= /usr/local
-BINDIR= libexec
-MANDIR=	man
-SHRDIR= share/symon
-EXADIR= share/examples/symon
-WEBDIR= ${SHRDIR}/web
-CLIENTDIR= ${SHRDIR}/client
-
-.ifndef PREFIX
-PREFIX=/usr/local
-.endif
-
-.ifndef SYSCONDIR
-SYSCONFDIR=/etc
-.endif
+INSTALL?=install
+LORDER?=lorder
+TSORT?=tsort
+NROFF?=nroff
+RANLIB?=ranlib
+STRIP?=strip
+POD2MAN?=pod2man
+
+RRDDIR?=/usr/local
+BINDIR?=libexec
+MANDIR?=man
+SHRDIR?=share/symon
+EXADIR?=share/examples/symon
+WEBDIR?=${SHRDIR}/web
+CLIENTDIR?=${SHRDIR}/client
+
+PREFIX?=/usr/local
+SYSCONFDIR?=/etc
 
 .SUFFIXES: .c .o .8 .cat8 .pm .cat3p
 

+ 2 - 1
symon/platform/FreeBSD/Makefile.inc

@@ -1 +1,2 @@
-# $Id: Makefile.inc,v 1.1 2004/09/25 10:21:56 dijkstra Exp $
+# $Id: Makefile.inc,v 1.2 2005/02/25 15:10:09 dijkstra Exp $
+LIBS= -lkvm

+ 15 - 3
symon/platform/FreeBSD/conf.sh

@@ -1,13 +1,25 @@
-case `grep -c "m_drops" /usr/include/sys/mbuf.h` in
+case `grep -cq "m_drops" /usr/include/sys/mbuf.h` in
 1)	echo "#define HAS_MBUF_MDROPS	1" ;;
 0)	echo "#undef HAS_MBUF_MDROPS" ;;
 esac;
-case `grep -c "sf_allocfail" /usr/include/sys/mbuf.h` in
+case `grep -cq "sf_allocfail" /usr/include/sys/mbuf.h` in
 1)	echo "#define HAS_MBUF_SFALLOCFAIL	1" ;;
 0)	echo "#undef HAS_MBUF_SFALLOCFAIL" ;;
 esac;
+case `grep -cq "VM_TOTAL" /usr/include/vm/vm_param.h` in
+0)      echo "#define VM_TOTAL VM_METER" ;;
+esac;
+sysctl -N vm.nswapdev 1>/dev/null 2>&1
+case $? in
+1)      echo "#undef HAS_VM_NSWAPDEV" ;;
+0)      echo "#define HAS_VM_NSWAPDEV	1" ;;
+esac;
 if [ -f /usr/include/net/pfvar.h ]; then
     echo "#define HAS_PFVAR_H	1"
 else
     echo "#undef HAS_PFVAR_H"
-fi
+fi;
+case `grep -cq "ki_paddr" /usr/include/sys/user.h` in
+1)      echo "#define HAS_KI_PADDR	1" ;;
+0)      echo "#undef HAS_KI_PADDR" ;;
+esac;

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

@@ -1,4 +1,4 @@
-/* $Id: sm_mem.c,v 1.2 2005/01/15 17:31:11 dijkstra Exp $ */
+/* $Id: sm_mem.c,v 1.3 2005/02/25 15:10:09 dijkstra Exp $ */
 
 /*
  * Copyright (c) 2004      Matthew Gream
@@ -38,6 +38,8 @@
  * This code is not re-entrant.
  */
 
+#include "conf.h"
+
 #include <sys/param.h>
 #include <sys/sysctl.h>
 #include <sys/vmmeter.h>
@@ -68,7 +70,7 @@ static int me_vmiswp_mib_nam[CTL_MAXNAME];
 static size_t me_vmiswp_mib_len = 0;
 
 static int me_vm_mib[] = {CTL_VM, VM_TOTAL};
-static long me_stats[4];
+static long me_stats[5];
 
 static struct vmtotal me_vmtotal;
 static size_t me_vmsize = sizeof(struct vmtotal);
@@ -92,7 +94,7 @@ init_mem(char *s)
 
     me_vmiswp_mib_len = CTL_MAXNAME;
     if (sysctlnametomib(me_vmiswp_mib_str, me_vmiswp_mib_nam, &me_vmiswp_mib_len) < 0) {
-	warning("sysctlnametomib for nswapdev failed");
+	warning("sysctlnametomib for swap_info failed");
 	me_vmiswp_mib_len = 0;
     }
 
@@ -102,8 +104,10 @@ init_mem(char *s)
 int
 get_mem(char *symon_buf, int maxlen, char *s)
 {
+#ifdef HAS_VM_NSWAPDEV
     int i;
     int vmnswp_dat, vmnswp_siz;
+#endif
 
     if (sysctl(me_vm_mib, 2, &me_vmtotal, &me_vmsize, NULL, 0) < 0) {
 	warning("%s:%d: sysctl failed", __FILE__, __LINE__);
@@ -115,14 +119,17 @@ get_mem(char *symon_buf, int maxlen, char *s)
     me_stats[1] = pagetob(me_vmtotal.t_rm);
     me_stats[2] = pagetob(me_vmtotal.t_free);
 
+#ifdef HAS_VM_NSWAPDEV
     vmnswp_siz = sizeof (int);
     if (sysctl(me_vmnswp_mib_nam, me_vmnswp_mib_len, &vmnswp_dat, (void *)&vmnswp_siz, NULL, 0) < 0) {
 	warning("%s:%d: sysctl nswapdev failed", __FILE__, __LINE__);
-	return 0;
+	vmnswp_dat = 0;
     }
+#endif
 
     me_stats[3] = me_stats[4] = 0;
 
+#ifdef HAS_VM_NSWAPDEV
     for (i = 0; i < vmnswp_dat; i++) {
 	struct xswdev vmiswp_dat;
 	int vmiswp_siz;
@@ -132,6 +139,7 @@ get_mem(char *symon_buf, int maxlen, char *s)
 	me_stats[3] += (vmiswp_dat.xsw_used * DEV_BSIZE);
 	me_stats[4] += (vmiswp_dat.xsw_nblks * DEV_BSIZE);
     }
+#endif
 
     return snpack(symon_buf, maxlen, s, MT_MEM,
 		  me_stats[0], me_stats[1], me_stats[2],

+ 49 - 8
symon/platform/FreeBSD/sm_proc.c

@@ -1,4 +1,4 @@
-/* $Id: sm_proc.c,v 1.2 2005/01/14 16:13:38 dijkstra Exp $ */
+/* $Id: sm_proc.c,v 1.3 2005/02/25 15:10:10 dijkstra Exp $ */
 
 /*
  * Copyright (c) 2004      Matthew Gream
@@ -39,9 +39,14 @@
  * Non re-entrant code: gets_proc messes with globals r/w without a semaphore.
  */
 
+#include "conf.h"
+
 #include <sys/param.h>
 #include <sys/sysctl.h>
 #include <sys/user.h>
+#include <sys/proc.h>
+#include <fcntl.h>
+#include <kvm.h>
 
 #include <limits.h>
 #include <string.h>
@@ -60,6 +65,9 @@ static int proc_cur = 0;
 static int proc_stathz = 0;
 static int proc_pageshift;
 static int proc_pagesize;
+#ifdef HAS_KI_PADDR
+static kvm_t *proc_kd = NULL;
+#endif
 
 /* get scale factor cpu percentage counter */
 #define FIXED_PCTCPU FSCALE
@@ -120,6 +128,9 @@ init_proc(char *s)
     int mib[2] = {CTL_KERN, KERN_CLOCKRATE};
     struct clockinfo cinf;
     size_t size = sizeof(cinf);
+#ifdef HAS_KI_PADDR
+    char errbuf[_POSIX2_LINE_MAX];
+#endif
 
     /* get clockrate */
     if (sysctl(mib, 2, &cinf, &size, NULL, 0) == -1)
@@ -135,6 +146,12 @@ init_proc(char *s)
 	proc_pagesize >>= 1;
     }
 
+#ifdef HAS_KI_PADDR
+    proc_kd = kvm_openfiles(NULL, NULL, NULL, O_RDONLY, errbuf);
+    if (proc_kd == NULL)
+      warning("while opening kvm (chrooted?): %s", errbuf);
+#endif
+
     info("started module proc(%.200s)", s);
 }
 /* Get new io statistics */
@@ -143,6 +160,9 @@ get_proc(char *symon_buf, int maxlen, char *process)
 {
     int i;
     struct kinfo_proc *pp;
+#ifdef HAS_KI_PADDR
+    struct proc pproc;
+#endif
     u_quad_t  cpu_ticks = 0;
     u_quad_t  cpu_uticks = 0;
     u_quad_t  cpu_iticks = 0;
@@ -155,14 +175,19 @@ get_proc(char *symon_buf, int maxlen, char *process)
     int n = 0;
 
     for (pp = proc_ps, i = 0; i < proc_cur; pp++, i++) {
+#ifdef HAS_KI_PADDR
 	 if (strncmp(process, pp->ki_comm, strlen(process)) == 0) {
-	     /* cpu time - accumulated */
-#if 0
-/*XXX fill in ticks */
-	     cpu_uticks += pp->kp_proc.p_uticks;  /* user */
-	     cpu_sticks += pp->kp_proc.p_sticks;  /* sys  */
-	     cpu_iticks += pp->kp_proc.p_iticks;  /* int  */
-#endif
+	      /* cpu time - accumulated */
+	      if (proc_kd) {
+		   if (kvm_read(proc_kd, (unsigned long)pp->ki_paddr, &pproc,
+				  sizeof(pproc)) == sizeof(pproc)) {
+			cpu_uticks += pproc.p_uticks;  /* user */
+			cpu_sticks += pproc.p_sticks;  /* sys  */
+			cpu_iticks += pproc.p_iticks;  /* int  */
+		   } else {
+			warning("while reading kvm: %s", kvm_geterr(proc_kd));
+		   }
+	      }
 	     /* cpu time - percentage since last measurement */
 	     cpu_pct = pctdouble(pp->ki_pctcpu) * 100.0;
 	     cpu_pcti += cpu_pct;
@@ -171,6 +196,22 @@ get_proc(char *symon_buf, int maxlen, char *process)
 				     pp->ki_dsize + /* data */
 				     pp->ki_ssize); /* stack */
 	     mem_rss += pagetob(pp->ki_rssize);     /* rss  */
+#else
+	 if (strncmp(process, pp->kp_proc.p_comm, strlen(process)) == 0) {
+	     /* cpu time - accumulated */
+	     cpu_uticks += pp->kp_proc.p_uticks;  /* user */
+	     cpu_sticks += pp->kp_proc.p_sticks;  /* sys  */
+	     cpu_iticks += pp->kp_proc.p_iticks;  /* int  */
+
+	     /* cpu time - percentage since last measurement */
+	     cpu_pct = pctdouble(pp->kp_proc.p_pctcpu) * 100.0;
+	     cpu_pcti += cpu_pct;
+	     /* memory size - shared pages are counted multiple times */
+	     mem_procsize += pagetob(pp->kp_eproc.e_vm.vm_tsize + /* text pages */
+				     pp->kp_eproc.e_vm.vm_dsize + /* data */
+				     pp->kp_eproc.e_vm.vm_ssize); /* stack */
+	     mem_rss += pagetob(pp->kp_eproc.e_vm.vm_rssize);     /* rss  */
+#endif
 	     n++;
 	 }
     }

+ 2 - 2
symon/platform/Linux/Makefile.inc

@@ -1,4 +1,4 @@
-# $Id: Makefile.inc,v 1.1 2004/09/25 10:21:56 dijkstra Exp $
+# $Id: Makefile.inc,v 1.2 2005/02/25 12:31:58 dijkstra Exp $
 
 LORDER=echo
-TSORT= echo
+TSORT= cat

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

@@ -1,4 +1,4 @@
-/* $Id: sm_mem.c,v 1.16 2004/02/26 22:48:08 dijkstra Exp $ */
+/* $Id: sm_mem.c,v 1.17 2005/02/25 15:10:10 dijkstra Exp $ */
 
 /*
  * Copyright (c) 2001-2004 Willem Dijkstra
@@ -56,7 +56,7 @@
 
 /* Globals for this module all start with me_ */
 static int me_pageshift;
-static long me_stats[4];
+static long me_stats[5];
 static int me_vm_mib[] = {CTL_VM, VM_METER};
 static struct vmtotal me_vmtotal;
 static size_t me_vmsize;

+ 3 - 2
symon/symon/Makefile

@@ -1,7 +1,8 @@
-# $Id: Makefile,v 1.37 2004/08/07 14:49:00 dijkstra Exp $
+# $Id: Makefile,v 1.38 2005/02/25 15:10:10 dijkstra Exp $
 .include "../Makefile.inc"
+.include "../platform/${OS}/Makefile.inc"
 
-LIBS=	-L../lib -lsymon
+LIBS+=	-L../lib -lsymon
 MODS!=	( for g in ../platform/stub/sm_*.c; do \
 		f=../platform/${OS}/`basename $$g`; \
 		if [ -f $$f ]; then echo $$f; \

+ 16 - 5
symon/symon/c_config.sh

@@ -1,5 +1,5 @@
 #!/bin/sh
-# $Id: c_config.sh,v 1.6 2004/02/26 22:48:08 dijkstra Exp $
+# $Id: c_config.sh,v 1.7 2005/02/25 15:10:10 dijkstra Exp $
 #
 # Create an example configuration file for symon on a host and print to stdout
 
@@ -7,15 +7,27 @@
 #
 set -e
 PATH=/bin:/usr/bin:/sbin:/usr/sbin
-
+OS=`uname -s`
 # verify proper execution
 #
 if [ $# -ge 3 ]; then
     echo "usage: $0 [host] [port]" >&2
     exit 1
 fi
-
-interfaces=`netstat -ni | sed '1,1d;s/^\([a-z]*[0-9]\).*$/\1/g' | uniq`
+case "${OS}" in
+OpenBSD)
+	interfaces=`netstat -ni | sed '1,1d;s/^\([a-z]*[0-9]\).*$/\1/g' | uniq`
+	io=`mount | sed -n '/^\/dev/ s@/dev/\([a-z]*[0-9]\).*@io(\1), @p' | sort -u | tr -d \\\n`
+	;;
+FreeBSD|NetBSD)
+	interfaces=`ifconfig -l`
+	io=`mount | sed -n '/^\/dev/ s@/dev/\([a-z]*[0-9]\).*@io(\1), @p' | sort -u | tr -d \\\n`
+	;;
+Linux)
+	interfaces=`ifconfig -a| sed -n '/^[a-z]/ s,\([a-z]*[0-9]\).*,\1,p' | sort -u`
+	io=`mount | sed -n '/^\/dev/ s@/dev/\([a-z]*[0-9]\).*@io(\1), @p' | sort -u | tr -d \\\n`
+	;;
+esac;
 for i in $interfaces; do
 case $i in
 bridge*|carp*|enc*|gif*|gre*|lo*|pflog*|pfsync*|ppp*|sl*|tun*|vlan*)
@@ -26,7 +38,6 @@ bridge*|carp*|enc*|gif*|gre*|lo*|pflog*|pfsync*|ppp*|sl*|tun*|vlan*)
 	;;
 esac
 done
-io=`mount | egrep -v ' type mfs | type nfs ' | sed '1,1d;s/^\/dev\/\([a-z]*[0-9]\).*$/io(\1), /g' | uniq | tr -d \\\n`
 host=${1:-127.0.0.1}
 port=${2:-2100}
 cat <<EOF

+ 2 - 2
symon/symux/Makefile

@@ -1,9 +1,9 @@
-# $Id: Makefile,v 1.21 2004/08/07 14:49:32 dijkstra Exp $
+# $Id: Makefile,v 1.22 2005/02/25 15:10:10 dijkstra Exp $
 .include "../Makefile.inc"
 
 SRCS=	symux.c readconf.c symuxnet.c share.c
 OBJS+=	${SRCS:R:S/$/.o/g}
-LIBS=  -L../lib -L$(RRDDIR)/lib -lsymon -lrrd
+LIBS+=  -L../lib -L$(RRDDIR)/lib -lsymon -lrrd
 CFLAGS+=-I../lib -I$(RRDDIR)/include -I../platform/${OS} -I.
 
 all: symux symux.cat8

+ 38 - 12
symon/symux/c_smrrds.sh

@@ -1,8 +1,8 @@
 #!/bin/sh
-# $Id: c_smrrds.sh,v 1.28 2005/02/04 09:49:26 dijkstra Exp $
+# $Id: c_smrrds.sh,v 1.29 2005/02/25 15:10:10 dijkstra Exp $
 
 #
-# Copyright (c) 2001-2004 Willem Dijkstra
+# Copyright (c) 2001-2005 Willem Dijkstra
 # All rights reserved.
 #
 # Redistribution and use in source and binary forms, with or without
@@ -32,7 +32,7 @@
 # --- user configuration starts here
 INTERVAL=${INTERVAL:-5}
 # --- user configuration ends here
-
+OS=`uname -s`
 # addsuffix adds a suffix to each entry of a list (item|item|...)
 addsuffix() {
     list=$1'|'
@@ -73,7 +73,7 @@ oneday)
     RRA_SETUP=" RRA:AVERAGE:0.5:1:17280
 	    RRA:MAX:0.5:1:17280
 	    RRA:MIN:0.5:1:17280"
-    if [ X"$child" == "X" ]; then
+    if [ X"$child" = "X" ]; then
 	echo "RRDs will only contain a single day of data"
     fi
     ;;
@@ -88,7 +88,7 @@ oneday)
 esac
 done
 
-if [ X"$RRA_SETUP" == "X" ]; then
+if [ X"$RRA_SETUP" = "X" ]; then
 # default RRA setup:
 # - 2   days of  5 second  samples = 34560 x 5 second samples
 # - 14  days of 30 minutes samples = 672 x 360 x 5 second samples
@@ -109,16 +109,42 @@ RRA_SETUP=" RRA:AVERAGE:0.5:1:34560
 fi
 
 # All interfaces and disks
-INTERFACES="an|awi|be|bge|bm|cnw|dc|de|ec|ef|eg|el|em|ep|ex|fea|fpa|fxp|gem|gm|gre|hme|ie|kue|lc|le|lge|lmc|lo|ne|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|carp|enc|faith|gif|ppp|sppp|strip|tun|vlan";
-DISKS="sd|cd|ch|rd|raid|ss|uk|vnc|wd"
-
+case ${OS} in
+FreeBSD)
+	DISKS="ad|acd|afd|ast|sa|da|ar|cd|ch|md"
+	INTERFACES="an|ar|ath|aue|awi|axe|bfe|bge|cm|cnw|cs|cue|dc|de|ed|el|em|ep|ex|fe|fwe|fxp|gem|gx|hme|ie|kue|lge|lnc|my|nge|pcn|ray|re|rl|rue|sf|sis|sk|sn|snc|ste|ti|tl|tx|txp|vge|vr|vx|wb|wi|xe|xl";
+	VIRTUALINTERFACES="bridge|carp|enc|faith|gif|ppp|sl|sppp|strip|tun|vlan";
+	diskcmd="mount | sed -n '/^\/dev/ s,/dev/\([a-z]*[0-9]\).*,\1,p' | sort -u"
+	interfacecmd="ifconfig -l | sed 's/lo0//'"
+	;;
+Linux)
+	DISKS="hda|hdb|hdc|hdd|sda|sdb|sdc|sdd"
+	INTERFACES="eth"
+	VIRTUALINTERFACES="sit"
+	diskcmd="mount | sed -n '/^\/dev/ s,/dev/\([a-z]*[0-9]\).*,\1,p' | sort -u"
+	interfacecmd="ifconfig -a| egrep -e \"^(\$INTERFACES) \" | cut -f1 -d\  | sort -u"
+	;;
+OpenBSD)
+	DISKS="sd|cd|ch|rd|raid|ss|uk|vnc|wd"
+	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|carp|enc|faith|gif|ppp|sppp|strip|tun|vlan";
+	diskcmd="mount | sed -n '/^\/dev/ s,/dev/\([a-z]*[0-9]\).*,\1,p' | sort -u"
+	interfacecmd="ifconfig -a| egrep -e \"^(\$INTERFACES):\" | cut -f1 -d\:  | sort -u"
+	;;
+NetBSD)
+	DISKS="sd|cd|ch|rd|raid|ss|uk|vnc|wd"
+	INTERFACES="ai|an|ate|ath|atw|awi|bce|bge|bicc|cnw|com|cs|depca|ec|ef|eg|el|elmc|en|ep|epic|esh|ex|fea|fmv|fpa|fxp|gsip|hme|ipw|iwi|ix|iy|lc|le|lmc|mbe|mhzc|mtd|ne|nele|ntwoc|pcn|ray|re|rtk|sf|sip|sk|skc|sm|ste|stge|ti|tl|tlp|tr|vge|vr|we|wi|wm|xi|xirc"
+	VIRTUALINTERFACES="bridge|carp|enc|faith|gif|ppp|sppp|sl|strip|tun|vlan";
+	diskcmd="mount | sed -n '/^\/dev/ s,/dev/\([a-z]*[0-9]\).*,\1,p' | sort -u"
+	interfacecmd="ifconfig -l | sed 's/lo0//'"
+	;;
+esac
 DISKS=`addsuffix $DISKS [0-9]`
 INTERFACES=`addsuffix $INTERFACES [0-9]`
 VIRTUALINTERFACES=`addsuffix $VIRTUALINTERFACES \\.\\*`
 
 this=$0
-if [ X"$1$2$3$4$5$6$7$8$9" == "X" ]; then
+if [ X"$1$2$3$4$5$6$7$8$9" = "X" ]; then
     cat <<EOF
 Create rrd files for symux.
 
@@ -186,12 +212,12 @@ all)
 
 if|interfaces)
     # obtain all network cards
-    sh $this child $config `ifconfig -a| egrep -e "^($INTERFACES):" | cut -f1 -d\:  | sort -u`
+    sh $this child $config `eval $interfacecmd`
     ;;
 
 io|disks)
     # obtain all disks
-    sh $this child $config `df | grep dev | sed 's/^\/dev\/\(.*\)[a-z] .*$/\1/' | sort -u`
+    sh $this child $config `eval $diskcmd`
     ;;
 
 cpu[0-9].rrd)