From d55df663ea208f78e13a7431855a88d5844cd02f Mon Sep 17 00:00:00 2001 From: winiger Date: Fri, 5 Oct 2007 13:32:32 +0000 Subject: [PATCH] syweb is a web interface that shows graphs for measurement data gathered by symon/symux. ok and additional patches by sthen@ --- www/syweb/Makefile | 36 +++++++++++++++++++ www/syweb/distinfo | 5 +++ .../patch-htdocs_syweb_class_graph_inc | 12 +++++++ .../patches/patch-htdocs_syweb_setup_inc | 31 ++++++++++++++++ .../patches/patch-htdocs_syweb_tools_inc | 12 +++++++ www/syweb/patches/patch-install_rrdtool_sh | 16 +++++++++ www/syweb/pkg/DESCR | 2 ++ www/syweb/pkg/MESSAGE | 10 ++++++ www/syweb/pkg/PLIST | 30 ++++++++++++++++ 9 files changed, 154 insertions(+) create mode 100644 www/syweb/Makefile create mode 100644 www/syweb/distinfo create mode 100644 www/syweb/patches/patch-htdocs_syweb_class_graph_inc create mode 100644 www/syweb/patches/patch-htdocs_syweb_setup_inc create mode 100644 www/syweb/patches/patch-htdocs_syweb_tools_inc create mode 100644 www/syweb/patches/patch-install_rrdtool_sh create mode 100644 www/syweb/pkg/DESCR create mode 100644 www/syweb/pkg/MESSAGE create mode 100644 www/syweb/pkg/PLIST diff --git a/www/syweb/Makefile b/www/syweb/Makefile new file mode 100644 index 00000000000..3701601847e --- /dev/null +++ b/www/syweb/Makefile @@ -0,0 +1,36 @@ +# $OpenBSD: Makefile,v 1.1.1.1 2007/10/05 13:32:32 winiger Exp $ + +COMMENT= web frontend to symon +DISTNAME= syweb-0.55 +CATEGORIES= www sysutils + +HOMEPAGE= http://www.xs4all.nl/~wpd/symon +MAINTAINER= Marc Winiger + +# BSD +PERMIT_PACKAGE_CDROM= Yes +PERMIT_PACKAGE_FTP= Yes +PERMIT_DISTFILES_CDROM= Yes +PERMIT_DISTFILES_FTP= Yes + +MASTER_SITES= ${HOMEPAGE}/philes/ + +NO_REGRESS= Yes +NO_BUILD= Yes + +PREFIX= /var/www + +RUN_DEPENDS= :rrdtool-*:net/rrdtool \ + :php5-core->=5.2:www/php5/core + +WRKDIST= ${WRKDIR}/syweb + +do-install: + find ${WRKDIR} -name \*.orig -exec rm {} \; + ${TAR} -C ${WRKDIST} -cf - htdocs symon | ${TAR} -C ${PREFIX} -xpf - + ${INSTALL_DATA_DIR} ${PREFIX}/symon + ${INSTALL_SCRIPT} ${WRKDIST}/install_rrdtool.sh ${PREFIX}/symon + mkdir ${PREFIX}/symon/rrds + mkdir ${PREFIX}/symon/cache + +.include diff --git a/www/syweb/distinfo b/www/syweb/distinfo new file mode 100644 index 00000000000..d119c7cd398 --- /dev/null +++ b/www/syweb/distinfo @@ -0,0 +1,5 @@ +MD5 (syweb-0.55.tar.gz) = FTFhXBTW1wqAq01TXUg2/g== +RMD160 (syweb-0.55.tar.gz) = ZM2KtPxFqQbHa7c0BeIihNmJJEE= +SHA1 (syweb-0.55.tar.gz) = gyAaxaRc2wBW7RncluycHjiXhs8= +SHA256 (syweb-0.55.tar.gz) = NN85yH44J0TrsJhcs98UL7xr4XIcHJde/I2eeYwKCc0= +SIZE (syweb-0.55.tar.gz) = 40960 diff --git a/www/syweb/patches/patch-htdocs_syweb_class_graph_inc b/www/syweb/patches/patch-htdocs_syweb_class_graph_inc new file mode 100644 index 00000000000..11ae4792e18 --- /dev/null +++ b/www/syweb/patches/patch-htdocs_syweb_class_graph_inc @@ -0,0 +1,12 @@ +$OpenBSD: patch-htdocs_syweb_class_graph_inc,v 1.1.1.1 2007/10/05 13:32:32 winiger Exp $ +--- htdocs/syweb/class_graph.inc.orig Fri Oct 5 10:22:24 2007 ++++ htdocs/syweb/class_graph.inc Fri Oct 5 10:23:47 2007 +@@ -109,7 +109,7 @@ class Graph { + } + + function _parse_filename($filename, $index='') { +- if (preg_match("/^(.*\/)?((cpu|if|io|mem|pf|pfq|proc|debug|mbuf|sensor|df)([0-9]{0,2}))(_([a-z\.]+))?([0-9]{0,4}[a-z]{0,1}[0-9]{0,1}[a-z]{0,1}).rrd$/", ++ if (preg_match("/^(.*\/)?((cpu|if|io|mem|pf|pfq|proc|debug|mbuf|sensor|df)([0-9]{0,2}))(_{0,1}([a-z0-9\.-]+))?([0-9]{0,4}[a-z]{0,1}[0-9]{0,1}[a-z]{0,1}).rrd$/", + $filename, $match)) { + $this->vars->def('rrdtype'. $index, $match[2]); + $this->vars->def('rrdwhat'. $index, $match[6]); diff --git a/www/syweb/patches/patch-htdocs_syweb_setup_inc b/www/syweb/patches/patch-htdocs_syweb_setup_inc new file mode 100644 index 00000000000..831b39f3015 --- /dev/null +++ b/www/syweb/patches/patch-htdocs_syweb_setup_inc @@ -0,0 +1,31 @@ +$OpenBSD: patch-htdocs_syweb_setup_inc,v 1.1.1.1 2007/10/05 13:32:32 winiger Exp $ +--- htdocs/syweb/setup.inc.orig Tue Oct 2 15:31:49 2007 ++++ htdocs/syweb/setup.inc Tue Oct 2 15:32:04 2007 +@@ -18,12 +18,11 @@ + * + */ + +-/* running OpenBSD, apache chrooted: ++/* running OpenBSD, apache chrooted: */ + $symon['rrdtool_path']='/bin/rrdtool'; + $symon['cache_dir']='/symon/cache'; + $symon['host_tree']='/symon/rrds'; + $symon['layout_dir']='/symon'; +-*/ + + /* running OpenBSD, apache not chrooted: + $symon['rrdtool_path']='/usr/local/bin/rrdtool'; +@@ -32,11 +31,12 @@ $symon['host_tree']='/var/www/symon/rrds'; + $symon['layout_dir']='/var/www/symon'; + */ + +-/* running FreeBSD, apache not chrooted: */ ++/* running FreeBSD, apache not chrooted: + $symon['rrdtool_path']='/usr/local/bin/rrdtool'; + $symon['cache_dir']='/usr/local/www/symon/cache'; + $symon['host_tree']='/usr/local/www/symon/rrds'; + $symon['layout_dir']='/usr/local/www/symon'; ++*/ + + $symon['cache_duration']=20; + $symon['isolate_hosts']=1; diff --git a/www/syweb/patches/patch-htdocs_syweb_tools_inc b/www/syweb/patches/patch-htdocs_syweb_tools_inc new file mode 100644 index 00000000000..4e561d97731 --- /dev/null +++ b/www/syweb/patches/patch-htdocs_syweb_tools_inc @@ -0,0 +1,12 @@ +$OpenBSD: patch-htdocs_syweb_tools_inc,v 1.1.1.1 2007/10/05 13:32:32 winiger Exp $ +--- htdocs/syweb/tools.inc.orig Fri Oct 5 10:10:05 2007 ++++ htdocs/syweb/tools.inc Fri Oct 5 10:10:36 2007 +@@ -60,7 +60,7 @@ function normalise_filename($filename) { + $filename = $match[1]; + } + /* remove all but lowercase and digits */ +- $filename = preg_replace("/[^a-z0-9_]/", '', $filename); ++ $filename = preg_replace("/[^a-z0-9_-]/", '', $filename); + + return $filename; + } diff --git a/www/syweb/patches/patch-install_rrdtool_sh b/www/syweb/patches/patch-install_rrdtool_sh new file mode 100644 index 00000000000..71cb82a078f --- /dev/null +++ b/www/syweb/patches/patch-install_rrdtool_sh @@ -0,0 +1,16 @@ +$OpenBSD: patch-install_rrdtool_sh,v 1.1.1.1 2007/10/05 13:32:32 winiger Exp $ +--- install_rrdtool.sh.orig Fri Oct 5 10:51:01 2007 ++++ install_rrdtool.sh Fri Oct 5 10:51:56 2007 +@@ -31,10 +31,11 @@ if [ "${LIBS}x" = x ]; then + fi + + cd ${PREFIX} +-mkdir -p bin usr/lib usr/libexec ++mkdir -p bin usr/lib usr/libexec usr/local/share/rrdtool/fonts + cp -f $LIBS usr/lib + cp -f ${RRD_CMD} bin + cp -f /usr/libexec/ld.so usr/libexec + cp -f /bin/sh bin/sh ++cp /usr/local/share/rrdtool/fonts/*.ttf usr/local/share/rrdtool/fonts/ + echo rrdtool and libs installed in apache root + exit 1 diff --git a/www/syweb/pkg/DESCR b/www/syweb/pkg/DESCR new file mode 100644 index 00000000000..4e3bc2dc7af --- /dev/null +++ b/www/syweb/pkg/DESCR @@ -0,0 +1,2 @@ +syweb is a web interface that shows graphs for measurement data +gathered by symon/symux. diff --git a/www/syweb/pkg/MESSAGE b/www/syweb/pkg/MESSAGE new file mode 100644 index 00000000000..09ebdfa8e7b --- /dev/null +++ b/www/syweb/pkg/MESSAGE @@ -0,0 +1,10 @@ +syweb's default install assumes that: + - apache is chrooted at ${PREFIX} + - rrdtool is installed in the chroot + - symux rrd files are kept in ${PREFIX}/symon/rrds//*.rrd + +rrdtool can be installed in the chroot using + ${PREFIX}/symon/install_rrdtool.sh + +Customise ${PREFIX}/htdocs/syweb/setup.inc if these assumptions are +incorrect. diff --git a/www/syweb/pkg/PLIST b/www/syweb/pkg/PLIST new file mode 100644 index 00000000000..a50de6da267 --- /dev/null +++ b/www/syweb/pkg/PLIST @@ -0,0 +1,30 @@ +@comment $OpenBSD: PLIST,v 1.1.1.1 2007/10/05 13:32:32 winiger Exp $ +@owner root +@group www +htdocs/syweb/ +htdocs/syweb/class_cache.inc +htdocs/syweb/class_graph.inc +htdocs/syweb/class_layout.inc +htdocs/syweb/class_lexer.inc +htdocs/syweb/class_rrdtool.inc +htdocs/syweb/class_session.inc +htdocs/syweb/class_text.inc +htdocs/syweb/class_vars.inc +htdocs/syweb/configtest.php +htdocs/syweb/graph.php +htdocs/syweb/graph_defaults.inc +htdocs/syweb/index.php +htdocs/syweb/setup.inc +htdocs/syweb/spacer.png +htdocs/syweb/symon.css +htdocs/syweb/symon.png +htdocs/syweb/tools.inc +symon/ +@mode 775 +symon/cache/ +@mode +symon/hifn_test.layout +symon/install_rrdtool.sh +symon/pf.layout +symon/rrds/ +symon/total_firewall.layout