From f42f9284f330cd15b88e907ca296c4e5013f0cc5 Mon Sep 17 00:00:00 2001 From: Clement Laforet Date: Fri, 9 Jan 2004 13:28:50 +0000 Subject: [PATCH] Add mod_watch4 4.3, an Apache2 module to monitor bandwidth usage, for use with MRTG etc. PR: 57865 Submitted by: Toshiya SAITOH Approved by: erwin (mentor) (implicitly) --- www/Makefile | 1 + www/mod_watch4/Makefile | 58 ++++++++++++++++++++++++++++++++++++++ www/mod_watch4/distinfo | 1 + www/mod_watch4/pkg-descr | 8 ++++++ www/mod_watch4/pkg-install | 14 +++++++++ www/mod_watch4/pkg-message | 20 +++++++++++++ www/mod_watch4/pkg-plist | 21 ++++++++++++++ 7 files changed, 123 insertions(+) create mode 100644 www/mod_watch4/Makefile create mode 100644 www/mod_watch4/distinfo create mode 100644 www/mod_watch4/pkg-descr create mode 100644 www/mod_watch4/pkg-install create mode 100644 www/mod_watch4/pkg-message create mode 100644 www/mod_watch4/pkg-plist diff --git a/www/Makefile b/www/Makefile index fbf711dff6a7..176b9a6532ad 100644 --- a/www/Makefile +++ b/www/Makefile @@ -273,6 +273,7 @@ SUBDIR += mod_v2h SUBDIR += mod_vdbh SUBDIR += mod_watch + SUBDIR += mod_watch4 SUBDIR += mod_webapp SUBDIR += mod_zap SUBDIR += moinmoin diff --git a/www/mod_watch4/Makefile b/www/mod_watch4/Makefile new file mode 100644 index 000000000000..08f710e33211 --- /dev/null +++ b/www/mod_watch4/Makefile @@ -0,0 +1,58 @@ +# New ports collection makefile for: mod_watch4 +# Date created: 11 Octber 2003 +# Whom: Toshiya SAITOH +# +# $FreeBSD$ +# + +PORTNAME= mod_watch +PORTVERSION= 4.3 +CATEGORIES= www +MASTER_SITES= http://www.snert.com/Software/download/ +DISTNAME= ${PORTNAME}${PORTVERSION:S/./0/g} +EXTRACT_SUFX= .tgz +DIST_SUBDIR= apache2 + +MAINTAINER= toshiya@saitoh.nu +COMMENT= An Apache2 module to monitor bandwidth usage, for use with MRTG etc + +RUN_DEPENDS= mrtg:${PORTSDIR}/net/mrtg + +NO_PACKAGE= "Binary package distribution is prohibited by license" +NO_CDROM= "Commercial distfile distribution is prohibited by license" + +USE_PERL5_RUN= yes +USE_APACHE= yes +WITH_APACHE2= yes + +WRKSRC= ${WRKDIR}/${PORTNAME}-${PORTVERSION} +MAKEFILE= Makefile.dso + +MAKE_ARGS+= APXS="${APXS}" + +ALL_TARGET= build + +DOCS= apache2mrtg.shtml index.shtml mailto.js mod_watch.shtml style.css +DOCS_HTMLIMAGES= apache-header-476-62.png mrpixel.gif mrtg-bar.png \ + sun-logo.jpg wave1.jpg + +do-install: + ${APXS} -i -a -n watch ${WRKSRC}/mod_watch.la + ${INSTALL_SCRIPT} ${WRKSRC}/apache2mrtg.pl ${PREFIX}/sbin + ${INSTALL_SCRIPT} ${WRKSRC}/mod_watch.pl ${PREFIX}/sbin + ${INSTALL_SCRIPT} ${WRKSRC}/nfields.pl ${PREFIX}/sbin +.if !defined(NOPORTDOCS) + @${INSTALL} -d -m 0755 ${DOCSDIR}/html/Img + ${INSTALL_DATA} ${WRKSRC}/CHANGES.TXT ${DOCSDIR}/ + ${INSTALL_DATA} ${WRKSRC}/LICENSE.TXT ${DOCSDIR}/ +.for f in ${DOCS} + ${INSTALL_DATA} ${WRKSRC}/${f} ${DOCSDIR}/html/ +.endfor +.for f in ${DOCS_HTMLIMAGES} + ${INSTALL_DATA} ${WRKSRC}/Img/${f} ${DOCSDIR}/html/Img/ +.endfor +.endif + @${SH} ${PKGINSTALL} ${PKGNAME} POST-INSTALL + @${CAT} ${PKGMESSAGE} + +.include diff --git a/www/mod_watch4/distinfo b/www/mod_watch4/distinfo new file mode 100644 index 000000000000..16687bcf261c --- /dev/null +++ b/www/mod_watch4/distinfo @@ -0,0 +1 @@ +MD5 (apache2/mod_watch403.tgz) = 06d57713adb935f16596d22256bca913 diff --git a/www/mod_watch4/pkg-descr b/www/mod_watch4/pkg-descr new file mode 100644 index 000000000000..0d516920b8a7 --- /dev/null +++ b/www/mod_watch4/pkg-descr @@ -0,0 +1,8 @@ +This Apache module will watch and collect the bytes in & out per virtual host, +per file owner, and the web server as a whole. It was designed for use with +MRTG, which will make nice graphical representations of the data, but is +general enough that it can be applied to other purposes. + +WWW: http://www.snert.com/Software/mod_watch/ + +- Toshiya Saitoh diff --git a/www/mod_watch4/pkg-install b/www/mod_watch4/pkg-install new file mode 100644 index 000000000000..97ac46175592 --- /dev/null +++ b/www/mod_watch4/pkg-install @@ -0,0 +1,14 @@ +#!/bin/sh + +case $2 in + PRE-INSTALL) + ;; + POST-INSTALL) + install -d -o www -g www -m 0755 /var/spool/mod_watch + ;; + *) + echo "Unexpected Argument $2." + exit 1 + ;; +esac +exit 0 diff --git a/www/mod_watch4/pkg-message b/www/mod_watch4/pkg-message new file mode 100644 index 000000000000..e24a59f37b94 --- /dev/null +++ b/www/mod_watch4/pkg-message @@ -0,0 +1,20 @@ +************************************************************ +You've installed mod_watch, a module to monitor bandwidth +usage. + +/var/spool/mod_watch has been created. It's owned by user +www and group www. For mod_watch to work, the Apache +user/group must be able to create and update files in this +directory. + +Edit your apache.conf or httpd.conf to enable and setup this +module. Have a look at the files in +${PREFIX}/share/doc/mod_watch/html for information on how to +configure it etc. + +Then do this to make it work effective: + +# apachectl configtest (see if there are any config errors) +# apachectl restart + +************************************************************ diff --git a/www/mod_watch4/pkg-plist b/www/mod_watch4/pkg-plist new file mode 100644 index 000000000000..6ee5da0f0cf7 --- /dev/null +++ b/www/mod_watch4/pkg-plist @@ -0,0 +1,21 @@ +sbin/apache2mrtg.pl +sbin/mod_watch.pl +sbin/nfields.pl +libexec/apache2/mod_watch.so +@exec %D/sbin/apxs -e -A -n watch %D/%F +@unexec %D/sbin/apxs -e -A -n watch %D/%F +%%PORTDOCS%%%%DOCSDIR%%/html/Img/apache-header-476-62.png +%%PORTDOCS%%%%DOCSDIR%%/html/Img/mrpixel.gif +%%PORTDOCS%%%%DOCSDIR%%/html/Img/mrtg-bar.png +%%PORTDOCS%%%%DOCSDIR%%/html/Img/sun-logo.jpg +%%PORTDOCS%%%%DOCSDIR%%/html/Img/wave1.jpg +%%PORTDOCS%%%%DOCSDIR%%/html/apache2mrtg.shtml +%%PORTDOCS%%%%DOCSDIR%%/html/index.shtml +%%PORTDOCS%%%%DOCSDIR%%/html/mailto.js +%%PORTDOCS%%%%DOCSDIR%%/html/mod_watch.shtml +%%PORTDOCS%%%%DOCSDIR%%/html/style.css +%%PORTDOCS%%%%DOCSDIR%%/CHANGES.TXT +%%PORTDOCS%%%%DOCSDIR%%/LICENSE.TXT +%%PORTDOCS%%@dirrm %%DOCSDIR%%/html/Img +%%PORTDOCS%%@dirrm %%DOCSDIR%%/html +%%PORTDOCS%%@dirrm %%DOCSDIR%%