Bug 78416 - [NEW PORT] sysutils/symon: Performance and information monitoring tool
Summary: [NEW PORT] sysutils/symon: Performance and information monitoring tool
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: Pav Lucistnik
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-03-04 16:00 UTC by Ulrich Spoerlein
Modified: 2005-03-16 20:41 UTC (History)
0 users

See Also:


Attachments
symon-2.70.shar (7.77 KB, text/plain)
2005-03-04 16:00 UTC, Ulrich Spoerlein
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Ulrich Spoerlein 2005-03-04 16:00:37 UTC
The symon project consists of three parts; a data monitor, a data consolidator
and a data displayer. 

symon is a is a lightweight system monitor that measures cpu, memory, pf,
interface and disk statistics every 5 seconds. It sends this data on to symux
for further processing. symon has been designed to inflict minimal performance
and security impact -- it can be run as nobody on the system it monitors. 

symux is a non-priviledged daemon that listens to incoming symon traffic. symux
can write the incoming symon streams into rrd files. Clients interested in
monitoring machine state can also log into symux and receive data as ascii as
it arrives. 

symon2web is a php script that can show the data stored in the rrd files.

WWW: http://www.xs4all.nl/~wpd/symon

Generated with FreeBSD Port Tools 0.63
Comment 1 Pav Lucistnik freebsd_committer freebsd_triage 2005-03-06 23:50:15 UTC
State Changed
From-To: open->feedback

Does not compile on FreeBSD 4.x: 

cc -O -pipe   -Wall -I../lib -I../platform/FreeBSD -I. -o ../platform/FreeBSD/sm_mem.o -c ../platform/FreeBSD/sm_mem.c 
../platform/FreeBSD/sm_mem.c: In function `get_mem': 
../platform/FreeBSD/sm_mem.c:134: storage size of `vmiswp_dat' isn't known 
../platform/FreeBSD/sm_mem.c:134: warning: unused variable `vmiswp_dat' 
*** Error code 1 

Stop in /tmp/a/ports/sysutils/symon/work/symon/symon. 

Are you able to fix this, or do you want this port marked BROKEN on FreeBSD 4? 


Comment 2 Pav Lucistnik freebsd_committer freebsd_triage 2005-03-06 23:50:15 UTC
Responsible Changed
From-To: freebsd-ports-bugs->pav

Watch
Comment 3 Ulrich Spoerlein 2005-03-16 16:41:33 UTC
The port won't build in jail (it's calling sysctl) nor on 6.x, as there
has been some header-shuffling.

Please use this new shar instead.

Ulrich Spoerlein


# This is a shell archive.  Save it in a file, remove anything before
# this line, and then unpack it by entering "sh file".  Note, it may
# create directories; files and directories will be owned by you and
# have default permissions.
#
# This archive contains:
#
#	symon
#	symon/Makefile
#	symon/pkg-message
#	symon/distinfo
#	symon/pkg-plist
#	symon/pkg-descr
#	symon/pkg-install
#	symon/files
#	symon/files/patch-conf.sh
#	symon/files/patch-symux-Makefile
#	symon/files/patch-symon-Makefile
#	symon/files/patch-sm_proc.c
#
echo c - symon
mkdir -p symon > /dev/null 2>&1
echo x - symon/Makefile
sed 's/^X//' >symon/Makefile << 'END-of-symon/Makefile'
X# New ports collection makefile for:	sysutils/symon
X# Date created:				17.02.2005
X# Whom:					Ulrich Spoerlein <q@uni.de>
X#
X# $FreeBSD$
X#
X
XPORTNAME=	symon
XPORTVERSION=	2.70
XCATEGORIES=	sysutils
XMASTER_SITES=	http://www.xs4all.nl/~wpd/symon/philes/
X
XMAINTAINER=	q@uni.de
XCOMMENT=	Performance and information monitoring tool
X
XLIB_DEPENDS=	rrd.0:${PORTSDIR}/net/rrdtool
X
XWRKSRC=		${WRKDIR}/${PORTNAME}
XMAKE_ARGS+=	SYSCONFDIR=${LOCALBASE}/etc BINDIR=bin
XPKGMESSAGE=	${WRKDIR}/.pkg-message
X
XMAN8=	symon.8 symux.8
X
X.include <bsd.port.pre.mk>
X
X.if ${OSVERSION} < 500000
Xpost-patch:
X	@${ECHO} "" > ${WRKSRC}/platform/FreeBSD/Makefile.inc
X.endif
X
Xpost-build:
X	@${SED} 's,%%LOCALBASE%%,${LOCALBASE},g' pkg-message > ${PKGMESSAGE}
X
Xpre-install:
X	@${SH} ${PKGINSTALL} ${PORTNAME} PRE-INSTALL
X
Xpost-install:
X	@${CAT} ${PKGMESSAGE}
X
X.include <bsd.port.post.mk>
END-of-symon/Makefile
echo x - symon/pkg-message
sed 's/^X//' >symon/pkg-message << 'END-of-symon/pkg-message'
XFor the system monitor symon, use the following steps
X
X  1. Copy %%LOCALBASE%%/share/examples/symon/symon.conf
X     to %%LOCALBASE%%/etc and edit.
X  2. Run symon
X
XFor the data collector symux, use the following steps
X
X  1. Copy %%LOCALBASE%%/share/examples/symon/symux.conf
X     to %%LOCALBASE%%/etc and edit.
X  2. Enter the directory, where symux should store its data
X     (e.g. /var/db/symux) and run
X	%%LOCALBASE%%/share/symon/c_smrrds.sh all
X     to create the RR database.
X  3. Run symux
END-of-symon/pkg-message
echo x - symon/distinfo
sed 's/^X//' >symon/distinfo << 'END-of-symon/distinfo'
XMD5 (symon-2.70.tar.gz) = 01b3cf975185418c85845bddf0ee22e6
XSIZE (symon-2.70.tar.gz) = 75322
END-of-symon/distinfo
echo x - symon/pkg-plist
sed 's/^X//' >symon/pkg-plist << 'END-of-symon/pkg-plist'
Xbin/symon
Xbin/symux
X%%EXAMPLESDIR%%/symon.conf
X%%EXAMPLESDIR%%/symux.conf
X%%DATADIR%%/c_config.sh
X%%DATADIR%%/c_smrrds.sh
X%%DATADIR%%/client/SymuxClient.0
X%%DATADIR%%/client/SymuxClient.pm
X%%DATADIR%%/client/getsymonitem.pl
X@dirrm share/symon/client
X@dirrm %%DATADIR%%
X@dirrm %%EXAMPLESDIR%%
X@unexec echo "Warning: If you will *NOT* use this package anymore, please remove the _symon user manually."
END-of-symon/pkg-plist
echo x - symon/pkg-descr
sed 's/^X//' >symon/pkg-descr << 'END-of-symon/pkg-descr'
XThe symon project consists of three parts; a data monitor, a data consolidator
Xand a data displayer. 
X
Xsymon is a is a lightweight system monitor that measures cpu, memory, pf,
Xinterface and disk statistics every 5 seconds. It sends this data on to symux
Xfor further processing. symon has been designed to inflict minimal performance
Xand security impact -- it can be run as nobody on the system it monitors. 
X
Xsymux is a non-priviledged daemon that listens to incoming symon traffic. symux
Xcan write the incoming symon streams into rrd files. Clients interested in
Xmonitoring machine state can also log into symux and receive data as ascii as
Xit arrives. 
X
Xsymon2web is a php script that can show the data stored in the rrd files.
X
XWWW: http://www.xs4all.nl/~wpd/symon
END-of-symon/pkg-descr
echo x - symon/pkg-install
sed 's/^X//' >symon/pkg-install << 'END-of-symon/pkg-install'
X#!/bin/sh
X
XPATH=/bin:/usr/sbin
X
XUSER=_symon
XGROUP=daemon
XUID=115
X
Xcase $2 in
X  PRE-INSTALL)
X  if pw user show "${USER}" 2>/dev/null; then
X    echo "You already have a user \"${USER}\", so I will use it."
X  else
X    if pw useradd ${USER} -u ${UID} -g ${GROUP} -h - \
X      -s /usr/sbin/nologin -L daemon -d /var/empty -c "Symon Account"
X    then
X      echo "Added user \"${USER}\"."
X    else
X      echo "Adding user \"${USER}\" failed..."
X      exit 1
X    fi
X  fi
X  ;;
Xesac
END-of-symon/pkg-install
echo c - symon/files
mkdir -p symon/files > /dev/null 2>&1
echo x - symon/files/patch-conf.sh
sed 's/^X//' >symon/files/patch-conf.sh << 'END-of-symon/files/patch-conf.sh'
X--- platform/FreeBSD/conf.sh.orig	Thu Mar 10 09:34:37 2005
X+++ platform/FreeBSD/conf.sh	Thu Mar 10 09:35:24 2005
X@@ -1,25 +1,34 @@
X-case `grep -cq "m_drops" /usr/include/sys/mbuf.h` in
X-1)	echo "#define HAS_MBUF_MDROPS	1" ;;
X-0)	echo "#undef HAS_MBUF_MDROPS" ;;
X-esac;
X-case `grep -cq "sf_allocfail" /usr/include/sys/mbuf.h` in
X-1)	echo "#define HAS_MBUF_SFALLOCFAIL	1" ;;
X-0)	echo "#undef HAS_MBUF_SFALLOCFAIL" ;;
X-esac;
X-case `grep -cq "VM_TOTAL" /usr/include/vm/vm_param.h` in
X-0)      echo "#define VM_TOTAL VM_METER" ;;
X-esac;
X-sysctl -N vm.nswapdev 1>/dev/null 2>&1
X-case $? in
X-1)      echo "#undef HAS_VM_NSWAPDEV" ;;
X-0)      echo "#define HAS_VM_NSWAPDEV	1" ;;
X-esac;
X+#!/bin/sh
X+if grep -q "m_drops" /usr/include/sys/mbuf.h; then
X+	echo "#define HAS_MBUF_MDROPS	1"
X+else
X+	echo "#undef HAS_MBUF_MDROPS"
X+fi
X+if grep -q "sf_allocfail" /usr/include/sys/mbuf.h; then
X+	echo "#define HAS_MBUF_SFALLOCFAIL	1"
X+else
X+	echo "#undef HAS_MBUF_SFALLOCFAIL"
X+fi
X+if ! grep -q "VM_TOTAL" /usr/include/vm/vm_param.h; then
X+	echo "#define VM_TOTAL VM_METER"
X+fi
X+if grep -q "struct xswdev" /usr/include/vm/vm_param.h; then
X+	echo "#define HAS_VM_NSWAPDEV	1"
X+else
X+	echo "#undef HAS_VM_NSWAPDEV"
X+fi
X if [ -f /usr/include/net/pfvar.h ]; then
X     echo "#define HAS_PFVAR_H	1"
X else
X     echo "#undef HAS_PFVAR_H"
X-fi;
X-case `grep -cq "ki_paddr" /usr/include/sys/user.h` in
X-1)      echo "#define HAS_KI_PADDR	1" ;;
X-0)      echo "#undef HAS_KI_PADDR" ;;
X-esac;
X\ No newline at end of file
X+fi
X+if grep -q "ki_paddr" /usr/include/sys/user.h; then
X+	echo "#define HAS_KI_PADDR	1"
X+else
X+	echo "#undef HAS_KI_PADDR"
X+fi
X+if grep -q "struct rusage_ext" /usr/include/sys/proc.h; then
X+	echo "#define HAS_RUSAGE_EXT	1"
X+else
X+	echo "#undef HAS_RUSAGE_EXT"
X+fi
END-of-symon/files/patch-conf.sh
echo x - symon/files/patch-symux-Makefile
sed 's/^X//' >symon/files/patch-symux-Makefile << 'END-of-symon/files/patch-symux-Makefile'
X--- symux/Makefile.orig	Fri Mar  4 10:43:43 2005
X+++ symux/Makefile	Fri Mar  4 10:44:01 2005
X@@ -17,9 +17,9 @@
X clean:
X 	rm -f conf.h symux symux.cat8 symux.core ${OBJS}
X 
X-install: symux symux.cat8 c_smrrds.sh symux.conf
X+install: symux symux.8 c_smrrds.sh symux.conf
X 	${INSTALL} -c -m 555 -g bin   -o root symux      ${PREFIX}/${BINDIR}
X-	${INSTALL} -c -m 444 -g wheel -o root symux.cat8 ${PREFIX}/${MANDIR}/cat8/symux.0
X+	${INSTALL} -c -m 444 -g wheel -o root symux.8 ${PREFIX}/${MANDIR}/man8/symux.8
X 	${INSTALL} -d -m 555 -g bin   -o root ${PREFIX}/${SHRDIR}
X 	${INSTALL} -c -m 544 -g bin   -o root c_smrrds.sh  ${PREFIX}/${SHRDIR}
X 	${INSTALL} -d -m 555 -g bin   -o root ${PREFIX}/${EXADIR}
END-of-symon/files/patch-symux-Makefile
echo x - symon/files/patch-symon-Makefile
sed 's/^X//' >symon/files/patch-symon-Makefile << 'END-of-symon/files/patch-symon-Makefile'
X--- symon/Makefile.orig	Fri Mar  4 10:39:20 2005
X+++ symon/Makefile	Fri Mar  4 10:43:13 2005
X@@ -26,9 +26,9 @@
X clean:
X 	rm -f conf.h symon symon.cat8 symon.core ${OBJS}
X 
X-install: symon symon.cat8 symon.conf
X+install: symon symon.8 symon.conf
X 	${INSTALL} -c -m 555  -g wheel -o root symon      ${PREFIX}/${BINDIR}
X-	${INSTALL} -c -m 444  -g wheel -o root symon.cat8 ${PREFIX}/${MANDIR}/cat8/symon.0
X+	${INSTALL} -c -m 444  -g wheel -o root symon.8 ${PREFIX}/${MANDIR}/man8/symon.8
X 	${INSTALL} -d -m 555  -g bin   -o root ${PREFIX}/${SHRDIR}
X 	${INSTALL} -c -m 555  -g wheel -o root c_config.sh ${PREFIX}/${SHRDIR}
X 	${INSTALL} -d -m 555  -g bin   -o root ${PREFIX}/${EXADIR}
END-of-symon/files/patch-symon-Makefile
echo x - symon/files/patch-sm_proc.c
sed 's/^X//' >symon/files/patch-sm_proc.c << 'END-of-symon/files/patch-sm_proc.c'
X--- platform/FreeBSD/sm_proc.c.orig	Thu Mar 10 09:29:00 2005
X+++ platform/FreeBSD/sm_proc.c	Thu Mar 10 09:27:52 2005
X@@ -181,9 +181,15 @@
X 	      if (proc_kd) {
X 		   if (kvm_read(proc_kd, (unsigned long)pp->ki_paddr, &pproc,
X 				  sizeof(pproc)) == sizeof(pproc)) {
X+#ifdef HAS_RUSAGE_EXT
X+			cpu_uticks += pproc.p_rux.p_uticks;  /* user */
X+			cpu_sticks += pproc.p_rux.p_sticks;  /* sys  */
X+			cpu_iticks += pproc.p_rux.p_iticks;  /* int  */
X+#else
X 			cpu_uticks += pproc.p_uticks;  /* user */
X 			cpu_sticks += pproc.p_sticks;  /* sys  */
X 			cpu_iticks += pproc.p_iticks;  /* int  */
X+#endif
X 		   } else {
X 			warning("while reading kvm: %s", kvm_geterr(proc_kd));
X 		   }
END-of-symon/files/patch-sm_proc.c
exit
Comment 4 Pav Lucistnik freebsd_committer freebsd_triage 2005-03-16 20:41:04 UTC
State Changed
From-To: feedback->closed

New port added, thank you!