Add ifgraph 0.4.9,
ifGraph is a set of Perl scripts created to help network administrators to visualize network flow on a daily, weekly, monthly, and yearly basis. The graphics are created with RRDTool, and it shows bytes (in/out) and errors for each interface. It also shows the current/average/max use and the respective link/interface usage in percentages. The program also outputs HTML files to make the visualization of the PNG/GIF/GD images more friendly and easy. PR: 57421 Submitted by: Lars Thegler <lars@thegler.dk>
This commit is contained in:
parent
e9a6149ae6
commit
d838e8fa85
Notes:
svn2git
2021-03-31 03:12:20 +00:00
svn path=/head/; revision=95418
79
net-mgmt/ifgraph/Makefile
Normal file
79
net-mgmt/ifgraph/Makefile
Normal file
@ -0,0 +1,79 @@
|
||||
# New ports collection makefile for: ifgraph
|
||||
# Date created: Sep 18 2003
|
||||
# Whom: Lars Thegler <lars@thegler.dk>
|
||||
#
|
||||
# $FreeBSD$
|
||||
#
|
||||
|
||||
PORTNAME= ifgraph
|
||||
PORTVERSION= 0.4.9
|
||||
CATEGORIES= net www
|
||||
MASTER_SITES= http://ifgraph.sourceforge.net/stable/
|
||||
|
||||
MAINTAINER= lars@thegler.dk
|
||||
COMMENT= Simple grapher of SNMP data with RRD
|
||||
|
||||
RUN_DEPENDS= rrdtool:${PORTSDIR}/net/rrdtool
|
||||
|
||||
USE_PERL5= yes
|
||||
NO_BUILD= yes
|
||||
|
||||
PKGMESSAGE= ${WRKDIR}/pkg-message
|
||||
PKGINSTALL= ${WRKDIR}/pkg-install
|
||||
PKGDEINSTALL= ${WRKDIR}/pkg-deinstall
|
||||
|
||||
IFGRAPH_USER= ifgraph
|
||||
IFGRAPH_GROUP= ifgraph
|
||||
|
||||
PLFILES= find-if.pl ifgraph.pl makegraph.pl
|
||||
DOCFILES= CHANGELOG INSTALACAO INSTALL TODO LICENSE.TXT MUDANCAS
|
||||
|
||||
FILES_SUB= USER=${IFGRAPH_USER} GROUP=${IFGRAPH_GROUP} \
|
||||
PREFIX=${PREFIX} DOCSDIR=${DOCSDIR}
|
||||
|
||||
pre-install:
|
||||
@ ${SED} ${FILES_SUB:S/$/!g/:S/^/ -e s!%%/:S/=/%%!/} \
|
||||
${PKGDIR}/pkg-install > ${PKGINSTALL}
|
||||
@ ${SH} ${PKGINSTALL} ${PKGNAME} PRE-INSTALL
|
||||
|
||||
do-install:
|
||||
@ ${SED} ${FILES_SUB:S/$/!g/:S/^/ -e s!%%/:S/=/%%!/} \
|
||||
${PKGDIR}/pkg-deinstall > ${PKGDEINSTALL}
|
||||
@ ${SED} ${FILES_SUB:S/$/!g/:S/^/ -e s!%%/:S/=/%%!/} \
|
||||
${PKGDIR}/pkg-message > ${PKGMESSAGE}
|
||||
.for plfile in ${PLFILES}
|
||||
@ ${INSTALL_SCRIPT} ${WRKSRC}/${plfile} ${PREFIX}/bin
|
||||
.endfor
|
||||
@ ${SED} ${FILES_SUB:S/$/!g/:S/^/ -e s!%%/:S/=/%%!/} \
|
||||
${WRKSRC}/ifgraph.conf > ${WRKSRC}/ifgraph.conf.sample
|
||||
@ ${INSTALL_DATA} ${WRKSRC}/ifgraph.conf.sample ${PREFIX}/etc
|
||||
@ ${MKDIR} ${PREFIX}/ifgraph
|
||||
@ ${MKDIR} ${PREFIX}/ifgraph/htdocs
|
||||
@ ${CP} -Rp ${WRKSRC}/templates ${PREFIX}/ifgraph
|
||||
@ ${SED} ${FILES_SUB:S/$/!g/:S/^/ -e s!%%/:S/=/%%!/} \
|
||||
${FILESDIR}/crontab.in > ${PREFIX}/ifgraph/crontab.in
|
||||
@ ${CHOWN} -R ifgraph:ifgraph ${PREFIX}/ifgraph
|
||||
@ ${MKDIR} ${PREFIX}/var/ifgraph
|
||||
@ ${CHOWN} ifgraph:ifgraph ${PREFIX}/var/ifgraph
|
||||
.if !defined(NOPORTDOCS)
|
||||
@ ${MKDIR} ${DOCSDIR}
|
||||
.for docfile in ${DOCFILES}
|
||||
@ ${INSTALL_DATA} ${WRKSRC}/${docfile} ${DOCSDIR}
|
||||
.endfor
|
||||
.endif
|
||||
|
||||
post-install:
|
||||
@ ${SH} ${PKGINSTALL} ${PKGNAME} POST-INSTALL
|
||||
.if !defined(BATCH)
|
||||
@ ${CAT} ${PKGMESSAGE}
|
||||
.endif
|
||||
|
||||
.include <bsd.port.pre.mk>
|
||||
|
||||
.if ${PERL_LEVEL} < 500600
|
||||
RUN_DEPENDS+= ${SITE_PERL}/Net/SNMP.pm:${PORTSDIR}/net/p5-Net-SNMP3
|
||||
.else
|
||||
RUN_DEPENDS+= ${SITE_PERL}/Net/SNMP.pm:${PORTSDIR}/net/p5-Net-SNMP
|
||||
.endif
|
||||
|
||||
.include <bsd.port.post.mk>
|
1
net-mgmt/ifgraph/distinfo
Normal file
1
net-mgmt/ifgraph/distinfo
Normal file
@ -0,0 +1 @@
|
||||
MD5 (ifgraph-0.4.9.tar.gz) = 9da25053e0aa376e5c7ba5c4e4c48dfa
|
3
net-mgmt/ifgraph/files/crontab.in
Normal file
3
net-mgmt/ifgraph/files/crontab.in
Normal file
@ -0,0 +1,3 @@
|
||||
# crontab file for ifGraph
|
||||
#*/5 * * * * %%PREFIX%%/bin/ifgraph.pl -c %%PREFIX%%/etc/ifgraph.conf > /dev/null
|
||||
#*/5 * * * * %%PREFIX%%/bin/makegraph.pl -c %%PREFIX%%/etc/ifgraph.conf > /dev/null
|
22
net-mgmt/ifgraph/files/patch-find-if.pl
Normal file
22
net-mgmt/ifgraph/files/patch-find-if.pl
Normal file
@ -0,0 +1,22 @@
|
||||
--- find-if.pl.orig Sat Sep 20 14:35:38 2003
|
||||
+++ find-if.pl Sat Sep 20 14:36:07 2003
|
||||
@@ -19,10 +19,6 @@
|
||||
#Sugestoes e criticas (sem flames!!) mailto:sartori@ifgraph.org
|
||||
#Visite: http://www.ifgraph.org
|
||||
|
||||
-# Let's find out where we are
|
||||
-use FindBin;
|
||||
-# # Found, now we add it to the @INC
|
||||
-use lib "$FindBin::Bin/lib";
|
||||
# # We are strict
|
||||
use strict;
|
||||
# # Get the command line options
|
||||
@@ -30,7 +26,7 @@
|
||||
getopts('adhims');
|
||||
|
||||
# We just nedd the basic features here
|
||||
-use Net::SNMP_365;
|
||||
+use Net::SNMP;
|
||||
|
||||
use vars qw($response $response2 $response3 $response4 $response5 $response6 $response7 $response8 $response9
|
||||
$response10 $response11 $response12 $opt_d @ips $ip $mac $opt_a $opt_h $opt_m $opt_i $opt_s $if $desc $stat $ocin
|
17
net-mgmt/ifgraph/files/patch-ifgraph.conf
Normal file
17
net-mgmt/ifgraph/files/patch-ifgraph.conf
Normal file
@ -0,0 +1,17 @@
|
||||
--- ifgraph.conf.orig Fri Sep 19 19:06:49 2003
|
||||
+++ ifgraph.conf Fri Sep 19 19:08:52 2003
|
||||
@@ -19,10 +19,10 @@
|
||||
# will not work as expected.
|
||||
|
||||
[global]
|
||||
-rrdtool = /usr/local/bin/rrdtool
|
||||
-rrddir = /home/someuser/rrdfiles
|
||||
-graphdir= /home/someuser/public_html/ifgraph-0.4.9
|
||||
-template=/home/someuser/ifgraph-0.4.9/templates/en
|
||||
+rrdtool = %%PREFIX%%/bin/rrdtool
|
||||
+rrddir = %%PREFIX%%/var/ifgraph
|
||||
+graphdir = %%PREFIX%%/ifgraph/htdocs
|
||||
+template = %%PREFIX%%/ifgraph/templates/en
|
||||
imgformat=PNG
|
||||
# those are the default configurations, should be
|
||||
# overriden in each target
|
29
net-mgmt/ifgraph/files/patch-ifgraph.pl
Normal file
29
net-mgmt/ifgraph/files/patch-ifgraph.pl
Normal file
@ -0,0 +1,29 @@
|
||||
--- ifgraph.pl.orig Sun Sep 28 22:29:51 2003
|
||||
+++ ifgraph.pl Sun Sep 28 22:30:19 2003
|
||||
@@ -19,10 +19,6 @@
|
||||
#Sugestoes e criticas (sem flames!!) mailto:sartori@ifgraph.org
|
||||
#Visite: http://www.ifgraph.org
|
||||
|
||||
-# Let's find out where we are
|
||||
-use FindBin;
|
||||
-# Found, now we add it to the @INC
|
||||
-use lib "$FindBin::Bin/lib";
|
||||
# We are strict
|
||||
use strict;
|
||||
# Get the command line options
|
||||
@@ -32,14 +28,7 @@
|
||||
getopt('cltF');
|
||||
getopts('dh');
|
||||
|
||||
-# If the perl is older, we have to fetch the older Net::SNMP library
|
||||
-if ($] < 5.006) {
|
||||
- &debug("Warning: Older perl version $], we will use Net::SNMP 3.65\n");
|
||||
- require Net::SNMP_365;
|
||||
-} else {
|
||||
- &debug("Starting ifgraph 0.4.9 with perl $], Net::SNMP 4.3\n");
|
||||
- require Net::SNMP;
|
||||
-}
|
||||
+use Net::SNMP;
|
||||
|
||||
# SIGINT call
|
||||
$SIG{INT}=\&sigint;
|
27
net-mgmt/ifgraph/files/patch-makegraph.pl
Normal file
27
net-mgmt/ifgraph/files/patch-makegraph.pl
Normal file
@ -0,0 +1,27 @@
|
||||
--- makegraph.pl.orig Sun Sep 21 12:30:49 2003
|
||||
+++ makegraph.pl Sun Sep 21 12:32:08 2003
|
||||
@@ -19,8 +19,6 @@
|
||||
#Sugestoes e criticas (sem flames!!) mailto:sartori@ifgraph.org
|
||||
#Visite: http://www.ifgraph.org
|
||||
|
||||
-use FindBin;
|
||||
-use lib "$FindBin::Bin/lib";
|
||||
use strict;
|
||||
use Getopt::Std;
|
||||
use vars qw($opt_d $opt_c $opt_B $opt_b $opt_h $opt_g $opt_t $opt_T $targetindex
|
||||
@@ -30,14 +28,7 @@
|
||||
getopt('ctT');
|
||||
getopts('Bbgdh');
|
||||
|
||||
-# If the perl is older, we have to fetch the older Net::SNMP library
|
||||
-if ($] < 5.006) {
|
||||
- &debug("Warning: Older perl version $], we will use Net::SNMP 3.65\n");
|
||||
- require Net::SNMP_365;
|
||||
-} else {
|
||||
- &debug("Starting ifgraph 0.4.9 with perl $[, Net::SNMP 4.3\n");
|
||||
- require Net::SNMP;
|
||||
-}
|
||||
+use Net::SNMP;
|
||||
|
||||
# HELP
|
||||
if (defined($opt_h)) {
|
38
net-mgmt/ifgraph/pkg-deinstall
Normal file
38
net-mgmt/ifgraph/pkg-deinstall
Normal file
@ -0,0 +1,38 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# $FreeBSD$
|
||||
#
|
||||
|
||||
PATH=/bin:/usr/bin:/usr/sbin
|
||||
|
||||
case $2 in
|
||||
|
||||
DEINSTALL)
|
||||
echo '---> Starting deinstall script:'
|
||||
|
||||
echo '---> Zeroing crontab(5) file belonging to user "%%USER%%"'
|
||||
/usr/bin/crontab -u %%USER%% /dev/null
|
||||
echo ' (The crontab(5) will be deleted completely when user "%%USER%%" is removed.)'
|
||||
|
||||
;;
|
||||
|
||||
POST-DEINSTALL)
|
||||
echo '---> Starting post-deinstall script:'
|
||||
|
||||
if [ -f %%PREFIX%%/etc/ifgraph.conf -o \
|
||||
-d %%PREFIX%%/ifgraph -o \
|
||||
-d %%PREFIX%%/var/ifgraph ]; then
|
||||
echo '---> You seem to have made some custom ifGraph configuration.'
|
||||
echo '---> - The "%%USER%%" user and "%%GROUP%%" group were therefore not deleted.'
|
||||
echo '---> - You may delete them with "pw groupdel %%GROUP%%; pw userdel %%USER%%".'
|
||||
|
||||
else
|
||||
echo '---> Removing group "%%GROUP%%"'
|
||||
/usr/sbin/pw groupdel -n %%GROUP%%
|
||||
echo '---> Removing user "%%USER%%"'
|
||||
echo 'y' | /usr/sbin/pw userdel -n %%USER%%
|
||||
fi
|
||||
|
||||
;;
|
||||
|
||||
esac
|
12
net-mgmt/ifgraph/pkg-descr
Normal file
12
net-mgmt/ifgraph/pkg-descr
Normal file
@ -0,0 +1,12 @@
|
||||
ifGraph is a set of Perl scripts created to help network administrators
|
||||
to visualize network flow on a daily, weekly, monthly, and yearly basis.
|
||||
The graphics are created with RRDTool, and it shows bytes (in/out) and
|
||||
errors for each interface. It also shows the current/average/max use and
|
||||
the respective link/interface usage in percentages. The program also
|
||||
outputs HTML files to make the visualization of the PNG/GIF/GD images
|
||||
more friendly and easy.
|
||||
|
||||
WWW: http://www.ifgraph.org
|
||||
|
||||
- Lars Thegler
|
||||
lars@thegler.dk
|
51
net-mgmt/ifgraph/pkg-install
Normal file
51
net-mgmt/ifgraph/pkg-install
Normal file
@ -0,0 +1,51 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# $FreeBSD$
|
||||
#
|
||||
|
||||
PATH=/bin:/usr/bin:/usr/sbin
|
||||
|
||||
case $2 in
|
||||
|
||||
PRE-INSTALL)
|
||||
echo "---> Starting pre-install script:"
|
||||
|
||||
if [ -z "%%USER%%" -o \
|
||||
-z "%%GROUP%%" ]; then
|
||||
echo "ERROR: A required pragma was empty"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if pw showgroup "%%GROUP%%" 2>/dev/null; then
|
||||
echo "---> Using existing group \"%%GROUP%%\""
|
||||
else
|
||||
echo "---> Adding group \"%%GROUP%%\""
|
||||
pw addgroup %%GROUP%% -h - || exit 1
|
||||
fi
|
||||
|
||||
# Create user if required
|
||||
if pw showuser "%%USER%%" 2>/dev/null; then
|
||||
echo "---> Using existing user \"%%USER%%\""
|
||||
else
|
||||
echo "---> Adding user \"%%USER%%\""
|
||||
pw adduser %%USER%% -g %%GROUP%% -h - \
|
||||
-s "/sbin/nologin" -c "ifGraph User" || exit 1
|
||||
fi
|
||||
|
||||
;;
|
||||
|
||||
POST-INSTALL)
|
||||
echo "---> Starting post-install script:"
|
||||
|
||||
if [ -z "%%USER%%" -o \
|
||||
-z "%%PREFIX%%" ]; then
|
||||
echo "ERROR: A required pragma was empty"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "---> Creating crontab(5) file for user \"%%USER%%\""
|
||||
crontab -u "%%USER%%" "%%PREFIX%%/ifgraph/crontab.in" || exit 1
|
||||
|
||||
;;
|
||||
|
||||
esac
|
32
net-mgmt/ifgraph/pkg-message
Normal file
32
net-mgmt/ifgraph/pkg-message
Normal file
@ -0,0 +1,32 @@
|
||||
=================================================================
|
||||
|
||||
ifGraph has now been installed in %%PREFIX%%/ifgraph/.
|
||||
|
||||
NOTE: A sample configuration files has been placed at:
|
||||
|
||||
%%PREFIX%%/etc/ifgraph.conf.sample
|
||||
|
||||
You need to copy this to
|
||||
|
||||
%%PREFIX%%/etc/ifgraph.conf
|
||||
|
||||
and edit it to suit your requirements.
|
||||
|
||||
A sample crontab(5) entry has been installed. You need to activate
|
||||
this to start measurements and graph generation. You can do this
|
||||
with
|
||||
|
||||
crontab -u ifgraph -e
|
||||
|
||||
Documentation is installed in
|
||||
|
||||
%%DOCSDIR%%/
|
||||
|
||||
To enable Apache web access, add the following to your
|
||||
%%PREFIX%%/etc/apache/httpd.conf:
|
||||
|
||||
Alias /ifgraph/ %%PREFIX%%/ifgraph/htdocs/
|
||||
|
||||
Enjoy!
|
||||
|
||||
=================================================================
|
33
net-mgmt/ifgraph/pkg-plist
Normal file
33
net-mgmt/ifgraph/pkg-plist
Normal file
@ -0,0 +1,33 @@
|
||||
@exec mkdir -p %D/ifgraph/htdocs
|
||||
@exec mkdir -p %D/var/ifgraph
|
||||
@exec chown ifgraph:ifgraph %D/var/ifgraph
|
||||
bin/find-if.pl
|
||||
bin/ifgraph.pl
|
||||
bin/makegraph.pl
|
||||
etc/ifgraph.conf.sample
|
||||
ifgraph/crontab.in
|
||||
ifgraph/templates/ifgraph-logo.jpg
|
||||
ifgraph/templates/en/main-header.html
|
||||
ifgraph/templates/en/if-data.html
|
||||
ifgraph/templates/en/if-header.html
|
||||
ifgraph/templates/en/if-trailer.html
|
||||
ifgraph/templates/en/main-data.html
|
||||
ifgraph/templates/en/main-trailer.html
|
||||
ifgraph/templates/pt-br/main-header.html
|
||||
ifgraph/templates/pt-br/if-data.html
|
||||
ifgraph/templates/pt-br/if-header.html
|
||||
ifgraph/templates/pt-br/if-trailer.html
|
||||
ifgraph/templates/pt-br/main-data.html
|
||||
ifgraph/templates/pt-br/main-trailer.html
|
||||
@dirrm ifgraph/templates/en/
|
||||
@dirrm ifgraph/templates/pt-br/
|
||||
@dirrm ifgraph/templates
|
||||
@unexec rmdir %D/ifgraph 2>/dev/null || true
|
||||
@unexec rmdir %D/var/ifgraph 2>/dev/null || true
|
||||
%%PORTDOCS%%%%DOCSDIR%%/CHANGELOG
|
||||
%%PORTDOCS%%%%DOCSDIR%%/INSTALACAO
|
||||
%%PORTDOCS%%%%DOCSDIR%%/INSTALL
|
||||
%%PORTDOCS%%%%DOCSDIR%%/TODO
|
||||
%%PORTDOCS%%%%DOCSDIR%%/LICENSE.TXT
|
||||
%%PORTDOCS%%%%DOCSDIR%%/MUDANCAS
|
||||
%%PORTDOCS%%@dirrm %%DOCSDIR%%
|
@ -218,6 +218,7 @@
|
||||
SUBDIR += icqlib
|
||||
SUBDIR += icqlib0
|
||||
SUBDIR += icqnix
|
||||
SUBDIR += ifgraph
|
||||
SUBDIR += ifstat
|
||||
SUBDIR += iftop
|
||||
SUBDIR += imapproxy
|
||||
|
79
net/ifgraph/Makefile
Normal file
79
net/ifgraph/Makefile
Normal file
@ -0,0 +1,79 @@
|
||||
# New ports collection makefile for: ifgraph
|
||||
# Date created: Sep 18 2003
|
||||
# Whom: Lars Thegler <lars@thegler.dk>
|
||||
#
|
||||
# $FreeBSD$
|
||||
#
|
||||
|
||||
PORTNAME= ifgraph
|
||||
PORTVERSION= 0.4.9
|
||||
CATEGORIES= net www
|
||||
MASTER_SITES= http://ifgraph.sourceforge.net/stable/
|
||||
|
||||
MAINTAINER= lars@thegler.dk
|
||||
COMMENT= Simple grapher of SNMP data with RRD
|
||||
|
||||
RUN_DEPENDS= rrdtool:${PORTSDIR}/net/rrdtool
|
||||
|
||||
USE_PERL5= yes
|
||||
NO_BUILD= yes
|
||||
|
||||
PKGMESSAGE= ${WRKDIR}/pkg-message
|
||||
PKGINSTALL= ${WRKDIR}/pkg-install
|
||||
PKGDEINSTALL= ${WRKDIR}/pkg-deinstall
|
||||
|
||||
IFGRAPH_USER= ifgraph
|
||||
IFGRAPH_GROUP= ifgraph
|
||||
|
||||
PLFILES= find-if.pl ifgraph.pl makegraph.pl
|
||||
DOCFILES= CHANGELOG INSTALACAO INSTALL TODO LICENSE.TXT MUDANCAS
|
||||
|
||||
FILES_SUB= USER=${IFGRAPH_USER} GROUP=${IFGRAPH_GROUP} \
|
||||
PREFIX=${PREFIX} DOCSDIR=${DOCSDIR}
|
||||
|
||||
pre-install:
|
||||
@ ${SED} ${FILES_SUB:S/$/!g/:S/^/ -e s!%%/:S/=/%%!/} \
|
||||
${PKGDIR}/pkg-install > ${PKGINSTALL}
|
||||
@ ${SH} ${PKGINSTALL} ${PKGNAME} PRE-INSTALL
|
||||
|
||||
do-install:
|
||||
@ ${SED} ${FILES_SUB:S/$/!g/:S/^/ -e s!%%/:S/=/%%!/} \
|
||||
${PKGDIR}/pkg-deinstall > ${PKGDEINSTALL}
|
||||
@ ${SED} ${FILES_SUB:S/$/!g/:S/^/ -e s!%%/:S/=/%%!/} \
|
||||
${PKGDIR}/pkg-message > ${PKGMESSAGE}
|
||||
.for plfile in ${PLFILES}
|
||||
@ ${INSTALL_SCRIPT} ${WRKSRC}/${plfile} ${PREFIX}/bin
|
||||
.endfor
|
||||
@ ${SED} ${FILES_SUB:S/$/!g/:S/^/ -e s!%%/:S/=/%%!/} \
|
||||
${WRKSRC}/ifgraph.conf > ${WRKSRC}/ifgraph.conf.sample
|
||||
@ ${INSTALL_DATA} ${WRKSRC}/ifgraph.conf.sample ${PREFIX}/etc
|
||||
@ ${MKDIR} ${PREFIX}/ifgraph
|
||||
@ ${MKDIR} ${PREFIX}/ifgraph/htdocs
|
||||
@ ${CP} -Rp ${WRKSRC}/templates ${PREFIX}/ifgraph
|
||||
@ ${SED} ${FILES_SUB:S/$/!g/:S/^/ -e s!%%/:S/=/%%!/} \
|
||||
${FILESDIR}/crontab.in > ${PREFIX}/ifgraph/crontab.in
|
||||
@ ${CHOWN} -R ifgraph:ifgraph ${PREFIX}/ifgraph
|
||||
@ ${MKDIR} ${PREFIX}/var/ifgraph
|
||||
@ ${CHOWN} ifgraph:ifgraph ${PREFIX}/var/ifgraph
|
||||
.if !defined(NOPORTDOCS)
|
||||
@ ${MKDIR} ${DOCSDIR}
|
||||
.for docfile in ${DOCFILES}
|
||||
@ ${INSTALL_DATA} ${WRKSRC}/${docfile} ${DOCSDIR}
|
||||
.endfor
|
||||
.endif
|
||||
|
||||
post-install:
|
||||
@ ${SH} ${PKGINSTALL} ${PKGNAME} POST-INSTALL
|
||||
.if !defined(BATCH)
|
||||
@ ${CAT} ${PKGMESSAGE}
|
||||
.endif
|
||||
|
||||
.include <bsd.port.pre.mk>
|
||||
|
||||
.if ${PERL_LEVEL} < 500600
|
||||
RUN_DEPENDS+= ${SITE_PERL}/Net/SNMP.pm:${PORTSDIR}/net/p5-Net-SNMP3
|
||||
.else
|
||||
RUN_DEPENDS+= ${SITE_PERL}/Net/SNMP.pm:${PORTSDIR}/net/p5-Net-SNMP
|
||||
.endif
|
||||
|
||||
.include <bsd.port.post.mk>
|
1
net/ifgraph/distinfo
Normal file
1
net/ifgraph/distinfo
Normal file
@ -0,0 +1 @@
|
||||
MD5 (ifgraph-0.4.9.tar.gz) = 9da25053e0aa376e5c7ba5c4e4c48dfa
|
3
net/ifgraph/files/crontab.in
Normal file
3
net/ifgraph/files/crontab.in
Normal file
@ -0,0 +1,3 @@
|
||||
# crontab file for ifGraph
|
||||
#*/5 * * * * %%PREFIX%%/bin/ifgraph.pl -c %%PREFIX%%/etc/ifgraph.conf > /dev/null
|
||||
#*/5 * * * * %%PREFIX%%/bin/makegraph.pl -c %%PREFIX%%/etc/ifgraph.conf > /dev/null
|
22
net/ifgraph/files/patch-find-if.pl
Normal file
22
net/ifgraph/files/patch-find-if.pl
Normal file
@ -0,0 +1,22 @@
|
||||
--- find-if.pl.orig Sat Sep 20 14:35:38 2003
|
||||
+++ find-if.pl Sat Sep 20 14:36:07 2003
|
||||
@@ -19,10 +19,6 @@
|
||||
#Sugestoes e criticas (sem flames!!) mailto:sartori@ifgraph.org
|
||||
#Visite: http://www.ifgraph.org
|
||||
|
||||
-# Let's find out where we are
|
||||
-use FindBin;
|
||||
-# # Found, now we add it to the @INC
|
||||
-use lib "$FindBin::Bin/lib";
|
||||
# # We are strict
|
||||
use strict;
|
||||
# # Get the command line options
|
||||
@@ -30,7 +26,7 @@
|
||||
getopts('adhims');
|
||||
|
||||
# We just nedd the basic features here
|
||||
-use Net::SNMP_365;
|
||||
+use Net::SNMP;
|
||||
|
||||
use vars qw($response $response2 $response3 $response4 $response5 $response6 $response7 $response8 $response9
|
||||
$response10 $response11 $response12 $opt_d @ips $ip $mac $opt_a $opt_h $opt_m $opt_i $opt_s $if $desc $stat $ocin
|
17
net/ifgraph/files/patch-ifgraph.conf
Normal file
17
net/ifgraph/files/patch-ifgraph.conf
Normal file
@ -0,0 +1,17 @@
|
||||
--- ifgraph.conf.orig Fri Sep 19 19:06:49 2003
|
||||
+++ ifgraph.conf Fri Sep 19 19:08:52 2003
|
||||
@@ -19,10 +19,10 @@
|
||||
# will not work as expected.
|
||||
|
||||
[global]
|
||||
-rrdtool = /usr/local/bin/rrdtool
|
||||
-rrddir = /home/someuser/rrdfiles
|
||||
-graphdir= /home/someuser/public_html/ifgraph-0.4.9
|
||||
-template=/home/someuser/ifgraph-0.4.9/templates/en
|
||||
+rrdtool = %%PREFIX%%/bin/rrdtool
|
||||
+rrddir = %%PREFIX%%/var/ifgraph
|
||||
+graphdir = %%PREFIX%%/ifgraph/htdocs
|
||||
+template = %%PREFIX%%/ifgraph/templates/en
|
||||
imgformat=PNG
|
||||
# those are the default configurations, should be
|
||||
# overriden in each target
|
29
net/ifgraph/files/patch-ifgraph.pl
Normal file
29
net/ifgraph/files/patch-ifgraph.pl
Normal file
@ -0,0 +1,29 @@
|
||||
--- ifgraph.pl.orig Sun Sep 28 22:29:51 2003
|
||||
+++ ifgraph.pl Sun Sep 28 22:30:19 2003
|
||||
@@ -19,10 +19,6 @@
|
||||
#Sugestoes e criticas (sem flames!!) mailto:sartori@ifgraph.org
|
||||
#Visite: http://www.ifgraph.org
|
||||
|
||||
-# Let's find out where we are
|
||||
-use FindBin;
|
||||
-# Found, now we add it to the @INC
|
||||
-use lib "$FindBin::Bin/lib";
|
||||
# We are strict
|
||||
use strict;
|
||||
# Get the command line options
|
||||
@@ -32,14 +28,7 @@
|
||||
getopt('cltF');
|
||||
getopts('dh');
|
||||
|
||||
-# If the perl is older, we have to fetch the older Net::SNMP library
|
||||
-if ($] < 5.006) {
|
||||
- &debug("Warning: Older perl version $], we will use Net::SNMP 3.65\n");
|
||||
- require Net::SNMP_365;
|
||||
-} else {
|
||||
- &debug("Starting ifgraph 0.4.9 with perl $], Net::SNMP 4.3\n");
|
||||
- require Net::SNMP;
|
||||
-}
|
||||
+use Net::SNMP;
|
||||
|
||||
# SIGINT call
|
||||
$SIG{INT}=\&sigint;
|
27
net/ifgraph/files/patch-makegraph.pl
Normal file
27
net/ifgraph/files/patch-makegraph.pl
Normal file
@ -0,0 +1,27 @@
|
||||
--- makegraph.pl.orig Sun Sep 21 12:30:49 2003
|
||||
+++ makegraph.pl Sun Sep 21 12:32:08 2003
|
||||
@@ -19,8 +19,6 @@
|
||||
#Sugestoes e criticas (sem flames!!) mailto:sartori@ifgraph.org
|
||||
#Visite: http://www.ifgraph.org
|
||||
|
||||
-use FindBin;
|
||||
-use lib "$FindBin::Bin/lib";
|
||||
use strict;
|
||||
use Getopt::Std;
|
||||
use vars qw($opt_d $opt_c $opt_B $opt_b $opt_h $opt_g $opt_t $opt_T $targetindex
|
||||
@@ -30,14 +28,7 @@
|
||||
getopt('ctT');
|
||||
getopts('Bbgdh');
|
||||
|
||||
-# If the perl is older, we have to fetch the older Net::SNMP library
|
||||
-if ($] < 5.006) {
|
||||
- &debug("Warning: Older perl version $], we will use Net::SNMP 3.65\n");
|
||||
- require Net::SNMP_365;
|
||||
-} else {
|
||||
- &debug("Starting ifgraph 0.4.9 with perl $[, Net::SNMP 4.3\n");
|
||||
- require Net::SNMP;
|
||||
-}
|
||||
+use Net::SNMP;
|
||||
|
||||
# HELP
|
||||
if (defined($opt_h)) {
|
38
net/ifgraph/pkg-deinstall
Normal file
38
net/ifgraph/pkg-deinstall
Normal file
@ -0,0 +1,38 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# $FreeBSD$
|
||||
#
|
||||
|
||||
PATH=/bin:/usr/bin:/usr/sbin
|
||||
|
||||
case $2 in
|
||||
|
||||
DEINSTALL)
|
||||
echo '---> Starting deinstall script:'
|
||||
|
||||
echo '---> Zeroing crontab(5) file belonging to user "%%USER%%"'
|
||||
/usr/bin/crontab -u %%USER%% /dev/null
|
||||
echo ' (The crontab(5) will be deleted completely when user "%%USER%%" is removed.)'
|
||||
|
||||
;;
|
||||
|
||||
POST-DEINSTALL)
|
||||
echo '---> Starting post-deinstall script:'
|
||||
|
||||
if [ -f %%PREFIX%%/etc/ifgraph.conf -o \
|
||||
-d %%PREFIX%%/ifgraph -o \
|
||||
-d %%PREFIX%%/var/ifgraph ]; then
|
||||
echo '---> You seem to have made some custom ifGraph configuration.'
|
||||
echo '---> - The "%%USER%%" user and "%%GROUP%%" group were therefore not deleted.'
|
||||
echo '---> - You may delete them with "pw groupdel %%GROUP%%; pw userdel %%USER%%".'
|
||||
|
||||
else
|
||||
echo '---> Removing group "%%GROUP%%"'
|
||||
/usr/sbin/pw groupdel -n %%GROUP%%
|
||||
echo '---> Removing user "%%USER%%"'
|
||||
echo 'y' | /usr/sbin/pw userdel -n %%USER%%
|
||||
fi
|
||||
|
||||
;;
|
||||
|
||||
esac
|
12
net/ifgraph/pkg-descr
Normal file
12
net/ifgraph/pkg-descr
Normal file
@ -0,0 +1,12 @@
|
||||
ifGraph is a set of Perl scripts created to help network administrators
|
||||
to visualize network flow on a daily, weekly, monthly, and yearly basis.
|
||||
The graphics are created with RRDTool, and it shows bytes (in/out) and
|
||||
errors for each interface. It also shows the current/average/max use and
|
||||
the respective link/interface usage in percentages. The program also
|
||||
outputs HTML files to make the visualization of the PNG/GIF/GD images
|
||||
more friendly and easy.
|
||||
|
||||
WWW: http://www.ifgraph.org
|
||||
|
||||
- Lars Thegler
|
||||
lars@thegler.dk
|
51
net/ifgraph/pkg-install
Normal file
51
net/ifgraph/pkg-install
Normal file
@ -0,0 +1,51 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# $FreeBSD$
|
||||
#
|
||||
|
||||
PATH=/bin:/usr/bin:/usr/sbin
|
||||
|
||||
case $2 in
|
||||
|
||||
PRE-INSTALL)
|
||||
echo "---> Starting pre-install script:"
|
||||
|
||||
if [ -z "%%USER%%" -o \
|
||||
-z "%%GROUP%%" ]; then
|
||||
echo "ERROR: A required pragma was empty"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if pw showgroup "%%GROUP%%" 2>/dev/null; then
|
||||
echo "---> Using existing group \"%%GROUP%%\""
|
||||
else
|
||||
echo "---> Adding group \"%%GROUP%%\""
|
||||
pw addgroup %%GROUP%% -h - || exit 1
|
||||
fi
|
||||
|
||||
# Create user if required
|
||||
if pw showuser "%%USER%%" 2>/dev/null; then
|
||||
echo "---> Using existing user \"%%USER%%\""
|
||||
else
|
||||
echo "---> Adding user \"%%USER%%\""
|
||||
pw adduser %%USER%% -g %%GROUP%% -h - \
|
||||
-s "/sbin/nologin" -c "ifGraph User" || exit 1
|
||||
fi
|
||||
|
||||
;;
|
||||
|
||||
POST-INSTALL)
|
||||
echo "---> Starting post-install script:"
|
||||
|
||||
if [ -z "%%USER%%" -o \
|
||||
-z "%%PREFIX%%" ]; then
|
||||
echo "ERROR: A required pragma was empty"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "---> Creating crontab(5) file for user \"%%USER%%\""
|
||||
crontab -u "%%USER%%" "%%PREFIX%%/ifgraph/crontab.in" || exit 1
|
||||
|
||||
;;
|
||||
|
||||
esac
|
32
net/ifgraph/pkg-message
Normal file
32
net/ifgraph/pkg-message
Normal file
@ -0,0 +1,32 @@
|
||||
=================================================================
|
||||
|
||||
ifGraph has now been installed in %%PREFIX%%/ifgraph/.
|
||||
|
||||
NOTE: A sample configuration files has been placed at:
|
||||
|
||||
%%PREFIX%%/etc/ifgraph.conf.sample
|
||||
|
||||
You need to copy this to
|
||||
|
||||
%%PREFIX%%/etc/ifgraph.conf
|
||||
|
||||
and edit it to suit your requirements.
|
||||
|
||||
A sample crontab(5) entry has been installed. You need to activate
|
||||
this to start measurements and graph generation. You can do this
|
||||
with
|
||||
|
||||
crontab -u ifgraph -e
|
||||
|
||||
Documentation is installed in
|
||||
|
||||
%%DOCSDIR%%/
|
||||
|
||||
To enable Apache web access, add the following to your
|
||||
%%PREFIX%%/etc/apache/httpd.conf:
|
||||
|
||||
Alias /ifgraph/ %%PREFIX%%/ifgraph/htdocs/
|
||||
|
||||
Enjoy!
|
||||
|
||||
=================================================================
|
33
net/ifgraph/pkg-plist
Normal file
33
net/ifgraph/pkg-plist
Normal file
@ -0,0 +1,33 @@
|
||||
@exec mkdir -p %D/ifgraph/htdocs
|
||||
@exec mkdir -p %D/var/ifgraph
|
||||
@exec chown ifgraph:ifgraph %D/var/ifgraph
|
||||
bin/find-if.pl
|
||||
bin/ifgraph.pl
|
||||
bin/makegraph.pl
|
||||
etc/ifgraph.conf.sample
|
||||
ifgraph/crontab.in
|
||||
ifgraph/templates/ifgraph-logo.jpg
|
||||
ifgraph/templates/en/main-header.html
|
||||
ifgraph/templates/en/if-data.html
|
||||
ifgraph/templates/en/if-header.html
|
||||
ifgraph/templates/en/if-trailer.html
|
||||
ifgraph/templates/en/main-data.html
|
||||
ifgraph/templates/en/main-trailer.html
|
||||
ifgraph/templates/pt-br/main-header.html
|
||||
ifgraph/templates/pt-br/if-data.html
|
||||
ifgraph/templates/pt-br/if-header.html
|
||||
ifgraph/templates/pt-br/if-trailer.html
|
||||
ifgraph/templates/pt-br/main-data.html
|
||||
ifgraph/templates/pt-br/main-trailer.html
|
||||
@dirrm ifgraph/templates/en/
|
||||
@dirrm ifgraph/templates/pt-br/
|
||||
@dirrm ifgraph/templates
|
||||
@unexec rmdir %D/ifgraph 2>/dev/null || true
|
||||
@unexec rmdir %D/var/ifgraph 2>/dev/null || true
|
||||
%%PORTDOCS%%%%DOCSDIR%%/CHANGELOG
|
||||
%%PORTDOCS%%%%DOCSDIR%%/INSTALACAO
|
||||
%%PORTDOCS%%%%DOCSDIR%%/INSTALL
|
||||
%%PORTDOCS%%%%DOCSDIR%%/TODO
|
||||
%%PORTDOCS%%%%DOCSDIR%%/LICENSE.TXT
|
||||
%%PORTDOCS%%%%DOCSDIR%%/MUDANCAS
|
||||
%%PORTDOCS%%@dirrm %%DOCSDIR%%
|
Loading…
Reference in New Issue
Block a user