OpenPKG CVS Repository
http://cvs.openpkg.org/
____________________________________________________________________________
Server: cvs.openpkg.org Name: Ralf S. Engelschall
Root: /e/openpkg/cvs Email: [EMAIL PROTECTED]
Module: openpkg-src openpkg-web openpkg$ Date: 19-Aug-2003 16:45:36
Branch: HEAD Handle: 2003081915453203
Added files:
openpkg-re/vcheck vc.cacti
openpkg-src/cacti cacti-apache.conf cacti-setup.sh cacti.spec
rc.cacti
Modified files:
openpkg-web news.txt
Log:
new package: cacti 0.8.2a (Network Monitoring and Graphing Frontend)
Summary:
Revision Changes Path
1.1 +9 -0 openpkg-re/vcheck/vc.cacti
1.1 +97 -0 openpkg-src/cacti/cacti-apache.conf
1.1 +21 -0 openpkg-src/cacti/cacti-setup.sh
1.1 +207 -0 openpkg-src/cacti/cacti.spec
1.1 +46 -0 openpkg-src/cacti/rc.cacti
1.6233 +1 -0 openpkg-web/news.txt
____________________________________________________________________________
patch -p0 <<'@@ .'
Index: openpkg-re/vcheck/vc.cacti
============================================================================
$ cvs diff -u -r0 -r1.1 vc.cacti
--- /dev/null 2003-08-19 16:45:32.000000000 +0200
+++ vc.cacti 2003-08-19 16:45:33.000000000 +0200
@@ -0,0 +1,9 @@
+config = {
+}
+
+prog cacti = {
+ version = 0.8.2a
+ url = http://www.raxnet.net/products/cacti/download_cacti.php
+ regex = cacti-(__VER__)\.tar\.gz
+}
+
@@ .
patch -p0 <<'@@ .'
Index: openpkg-src/cacti/cacti-apache.conf
============================================================================
$ cvs diff -u -r0 -r1.1 cacti-apache.conf
--- /dev/null 2003-08-19 16:45:36.000000000 +0200
+++ cacti-apache.conf 2003-08-19 16:45:36.000000000 +0200
@@ -0,0 +1,97 @@
+##
+## cacti-apache.conf -- Cacti Apache Custom Configuration
+##
+
+ServerType standalone
+ServerRoot @l_prefix@
+ServerAdmin root@@[EMAIL PROTECTED]@l_domainname@
+ServerName @[EMAIL PROTECTED]@l_domainname@
+ServerTokens Prod
+User @l_rusr@
+Group @l_rgrp@
+Port 8080
+Listen 127.0.0.1:8080
+
+# runtime files
+PidFile @l_prefix@/var/cacti/run/apache.pid
+ScoreBoardFile @l_prefix@/var/cacti/run/apache.sb
+LockFile @l_prefix@/var/cacti/run/apache.lck
+
+# server behaviour
+Timeout 300
+KeepAlive on
+MaxKeepAliveRequests 100
+KeepAliveTimeout 15
+MinSpareServers 5
+MaxSpareServers 10
+StartServers 5
+MaxClients 15
+MaxRequestsPerChild 500
+HostnameLookups off
+UseCanonicalName on
+
+# access logging
+LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\"
\"%{User-Agent}i\"" combined
+LogFormat "%h %l %u %t \"%r\" %>s %b" common
+LogFormat "%{Referer}i -> %U" referer
+LogFormat "%{User-agent}i" agent
+CustomLog @l_prefix@/var/cacti/log/apache.access.log common
+
+# error logging
+LogLevel warn
+ErrorLog @l_prefix@/var/cacti/log/apache.error.log
+ServerSignature on
+
+# secure root directory
+<Directory />
+ Options FollowSymLinks
+ AllowOverride None
+</Directory>
+
+# browser specifics
+BrowserMatch "Mozilla/2" nokeepalive
+BrowserMatch "MSIE 4\.0b2;" nokeepalive downgrade-1.0 force-response-1.0
+BrowserMatch "RealPlayer 4\.0" force-response-1.0
+BrowserMatch "Java/1\.0" force-response-1.0
+BrowserMatch "JDK/1\.0" force-response-1.0
+
+# SSL/TLS support
+<IfModule mod_ssl.c>
+ SSLRandomSeed startup builtin
+ SSLRandomSeed connect builtin
+ SSLMutex sem
+ SSLSessionCache shmcb:@l_prefix@/var/cacti/run/apache.scache(512000)
+ SSLSessionCacheTimeout 300
+ SSLLog @l_prefix@/var/cacti/log/apache.ssl.log
+ SSLLogLevel warn
+ SSLCipherSuite
ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP:+eNULL
+ SetEnvIf User-Agent ".*MSIE.*" \
+ nokeepalive ssl-unclean-shutdown \
+ downgrade-1.0 force-response-1.0
+ <Files ~ "\.(cgi|shtml|phtml|php?)$">
+ SSLOptions +StdEnvVars
+ </Files>
+ <Directory "@l_prefix@/cgi">
+ SSLOptions +StdEnvVars
+ </Directory>
+</IfModule>
+
+# configure PHP
+AddType application/x-httpd-php .php
+php_admin_flag register_globals on
+php_admin_flag register_argc_argv on
+php_admin_flag safe_mode on
+
+# configure Cacti
+RewriteEngine on
+RewriteRule ^/$ /cacti/ [R,L]
+Alias /cacti @l_prefix@/share/cacti
+DocumentRoot @l_prefix@/share/cacti
+DirectoryIndex index.php index.html
+<Directory "@l_prefix@/share/cacti">
+ Options FollowSymLinks
+ AllowOverride None
+ Order allow,deny
+ Allow from all
+</Directory>
+
@@ .
patch -p0 <<'@@ .'
Index: openpkg-src/cacti/cacti-setup.sh
============================================================================
$ cvs diff -u -r0 -r1.1 cacti-setup.sh
--- /dev/null 2003-08-19 16:45:36.000000000 +0200
+++ cacti-setup.sh 2003-08-19 16:45:36.000000000 +0200
@@ -0,0 +1,21 @@
+#!/bin/sh
+##
+## cacti-setup
+##
+
+# determine MySQL root password
+password=`grep "^password" @l_prefix@/etc/mysql/my.pwd |\
+ sed -e 's;^password[^=]*= *;;' -e 's; *$;;'`
+
+# create the MySQL database for Cacti
[EMAIL PROTECTED]@/bin/mysqladmin --user=root --password=$password create cacti
+
+# create the default Cacti database schema
[EMAIL PROTECTED]@/bin/mysql --user=root --password=$password cacti
<@l_prefix@/share/cacti/cacti.sql
+
+# create a MySQL username/password for Cacti
[EMAIL PROTECTED]@/bin/mysql --user=root --password=$password mysql <<EOF
+GRANT ALL ON cacti.* TO [EMAIL PROTECTED] IDENTIFIED BY 'cacti';
+FLUSH PRIVILEGES;
+EOF
+
@@ .
patch -p0 <<'@@ .'
Index: openpkg-src/cacti/cacti.spec
============================================================================
$ cvs diff -u -r0 -r1.1 cacti.spec
--- /dev/null 2003-08-19 16:45:36.000000000 +0200
+++ cacti.spec 2003-08-19 16:45:36.000000000 +0200
@@ -0,0 +1,207 @@
+##
+## cacti.spec -- OpenPKG RPM Specification
+## Copyright (c) 2000-2003 The OpenPKG Project <http://www.openpkg.org/>
+## Copyright (c) 2000-2003 Ralf S. Engelschall <[EMAIL PROTECTED]>
+## Copyright (c) 2000-2003 Cable & Wireless <http://www.cw.com/>
+##
+## Permission to use, copy, modify, and distribute this software for
+## any purpose with or without fee is hereby granted, provided that
+## the above copyright notice and this permission notice appear in all
+## copies.
+##
+## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
+## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+## SUCH DAMAGE.
+##
+
+# package information
+Name: cacti
+Summary: Network Monitoring and Graphing Frontend
+URL: http://www.raxnet.net/products/cacti/
+Vendor: raXnet
+Packager: The OpenPKG Project
+Distribution: OpenPKG [EVAL]
+Group: Database
+License: GPL
+Version: 0.8.2a
+Release: 20030819
+
+# list of sources
+Source0: http://www.raxnet.net/downloads/cacti-%{version}.tar.gz
+Source1: cacti-setup.sh
+Source2: cacti-cron.sh
+Source3: cacti-apache.conf
+Source4: rc.cacti
+
+# build information
+Prefix: %{l_prefix}
+BuildRoot: %{l_buildroot}
+BuildPreReq: OpenPKG, openpkg >= 20030103
+PreReq: OpenPKG, openpkg >= 20030103
+PreReq: rrdtool, mysql, snmp, perl, php, wget
+PreReq: apache
+PreReq: apache::with_mod_php = yes
+PreReq: apache::with_mod_php_mysql = yes
+AutoReq: no
+AutoReqProv: no
+
+%description
+ Cacti is a complete frontend to RRDTool, it stores all of the
+ necessary information to create graphs and populate them with data
+ in a MySQL database. The frontend is completely PHP driven. Along
+ with being able to maintain Graphs, Data Sources, and Round Robin
+ Archives in a database, Cacti handles the data gathering. There is
+ also SNMP support for those used to creating traffic graphs with
+ MRTG.
+
+%prep
+ %setup -q
+
+%build
+
+%install
+ rm -rf $RPM_BUILD_ROOT
+
+ # create installation hierarchy
+ %{l_shtool} mkdir -f -p -m 755 \
+ $RPM_BUILD_ROOT%{l_prefix}/sbin \
+ $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d \
+ $RPM_BUILD_ROOT%{l_prefix}/etc/cacti \
+ $RPM_BUILD_ROOT%{l_prefix}/share/cacti \
+ $RPM_BUILD_ROOT%{l_prefix}/var/cacti/run
+
+ # adjust configuration
+ %{l_shtool} subst \
+ -e 's;"cactiuser";"cacti";g' \
+ include/config.php
+ %{l_shtool} subst \
+ -e 's;perl <path_cacti>;%{l_prefix}/bin/perl %{l_prefix}/share/cacti;' \
+ -e 's;\(path_php_binary.*\)<DEFAULT>;\1%{l_prefix}/bin/php;' \
+ -e 's;\(path_snmpwalk.*\)<DEFAULT>;\1%{l_prefix}/bin/snmpwalk;' \
+ -e 's;\(path_snmpget.*\)<DEFAULT>;\1%{l_prefix}/bin/snmpget;' \
+ -e 's;\(path_rrdtool.*\)<DEFAULT>;\1%{l_prefix}/bin/rrdtool;' \
+ -e 's;\(path_webroot.*\)<DEFAULT>;\1%{l_prefix}/share/cacti;' \
+ -e 's;\(path_webcacti.*\)<DEFAULT>;\1/cacti/;' \
+ -e 's;\(smnp_version.*\)ucd-snmp;\1net-snmp;' \
+ cacti.sql
+ %{l_shtool} subst \
+ -e 's;docs/;../docs/;g' \
+ install/index.php
+
+ # install all files and strip down installation afterwards
+ cp -rp * $RPM_BUILD_ROOT%{l_prefix}/share/cacti/
+ ( cd $RPM_BUILD_ROOT%{l_prefix}/share/cacti
+ rm -f LICENSE README
+ rm -rf cactid
+ ( mv include/adodb/drivers/adodb-mysql* .
+ rm -rf include/adodb/drivers/*
+ mv adodb-mysql* include/adodb/drivers/
+ mv include/adodb/datadict/datadict-mssql* .
+ rm -rf include/adodb/datadict/*
+ mv datadict-mssql* include/adodb/datadict/
+ ) || exit $?
+ rm -f rra/.placeholder
+ rm -f log/rrd.log
+ ) || exit $?
+
+ # move variable data into separate locations
+ mv $RPM_BUILD_ROOT%{l_prefix}/share/cacti/log \
+ $RPM_BUILD_ROOT%{l_prefix}/var/cacti/log
+ %{l_shtool} mkln -s \
+ $RPM_BUILD_ROOT%{l_prefix}/var/cacti/log \
+ $RPM_BUILD_ROOT%{l_prefix}/share/cacti/log
+ mv $RPM_BUILD_ROOT%{l_prefix}/share/cacti/rra \
+ $RPM_BUILD_ROOT%{l_prefix}/var/cacti/rra
+ %{l_shtool} mkln -s \
+ $RPM_BUILD_ROOT%{l_prefix}/var/cacti/rra \
+ $RPM_BUILD_ROOT%{l_prefix}/share/cacti/rra
+
+ # internally Cacti appends the webroot to its directory
+ # but we don't want to do this, so use a self-ref link.
+ ( cd $RPM_BUILD_ROOT%{l_prefix}/share/cacti
+ ln -s . cacti
+ ) || exit $?
+
+ # install run-command script
+ %{l_shtool} install -c -m 644 %{l_value -s -a} \
+ %{SOURCE rc.cacti} $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/
+
+ # install MySQL database setup script
+ %{l_shtool} install -c -m 755 %{l_value -s -a} \
+ %{SOURCE cacti-setup.sh} \
+ $RPM_BUILD_ROOT%{l_prefix}/sbin/cacti-setup
+
+ # install Cron job script
+ %{l_shtool} install -c -m 755 %{l_value -s -a} \
+ %{SOURCE cacti-cron.sh} \
+ $RPM_BUILD_ROOT%{l_prefix}/sbin/cacti-cron
+
+ # install custom Apache configuration
+ l_hostname=`%{l_shtool} echo -e %h`
+ l_domainname=`%{l_shtool} echo -e %d | cut -c2-`
+ %{l_shtool} install -c -m 644 %{l_value -s -a} \
+ -e "s;@l_hostname@;$l_hostname;g" \
+ -e "s;@l_domainname@;$l_domainname;g" \
+ %{SOURCE cacti-apache.conf} \
+ $RPM_BUILD_ROOT%{l_prefix}/etc/cacti/
+
+ # determine installation files
+ %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
+ %{l_files_std} \
+ '%config %{l_prefix}/etc/cacti/*' \
+ '%attr(-,%{l_rusr},%{l_rgrp}) %{l_prefix}/var/cacti'
+
+%files -f files
+
+%clean
+ rm -rf $RPM_BUILD_ROOT
+
+%post
+ if [ $1 -eq 1 ]; then
+ # display final hints on initial installation
+ ( echo "1. To complete installation of the Cacti package please you have"
+ echo " start MySQL and setup the initial Cacti database. For this run"
+ echo " the following commands:"
+ echo " \$ $RPM_INSTALL_PREFIX/etc/rc mysql start"
+ echo " \$ $RPM_INSTALL_PREFIX/sbin/cacti-setup"
+ echo " \$ $RPM_INSTALL_PREFIX/etc/rc mysql stop"
+ echo ""
+ echo "2. Cacti by default is run by the OpenPKG cron jobs every 15"
+ echo " minutes only. Usually Cacti wants to run every 5 minutes for"
+ echo " more granular data gathering. For this set:"
+ echo " # $RPM_INSTALL_PREFIX/etc/rc.conf:"
+ echo " cacti_cron=\"no\""
+ echo " and setup a cronjob for user %{l_rusr}"
+ echo " # system crontab:"
+ echo " */5 * * * * %{l_rusr} $RPM_INSTALL_PREFIX/sbin/cacti-cron"
+ echo ""
+ echo "3. Cacti by default is running with an own Apache server on"
+ echo " IPv4 address 127.0.0.1, TCP port 8080. Please change this"
+ echo " by editing the \"Port 8080\" and \"Listen 127.0.0.1:8080\""
+ echo " directives in $RPM_INSTALL_PREFIX/etc/cacti/cacti-apache.conf"
+ echo ""
+ echo "4. After this post-installation steps, startup Cacti by running"
+ echo " \$ $RPM_INSTALL_PREFIX/etc/rc cacti start"
+ echo " and connecting with your browser to:"
+ echo " http://127.0.0.1:8080/"
+ echo " Then proceed Cacti's initial configuration dialog. Then login"
+ echo " as 'admin' (with initial password 'admin') and change the"
+ echo " password to a custom one."
+ ) | %{l_rpmtool} msg -b -t notice
+ fi
+
+%preun
+ if [ $1 -eq 0 ]; then
+ # remove generated logfiles
+ rm -f $RPM_INSTALL_PREFIX/var/cacti/log/*
+ fi
+
@@ .
patch -p0 <<'@@ .'
Index: openpkg-src/cacti/rc.cacti
============================================================================
$ cvs diff -u -r0 -r1.1 rc.cacti
--- /dev/null 2003-08-19 16:45:36.000000000 +0200
+++ rc.cacti 2003-08-19 16:45:36.000000000 +0200
@@ -0,0 +1,46 @@
[EMAIL PROTECTED]@/lib/openpkg/bash @l_prefix@/etc/rc
+##
+## rc.cacti -- Run-Commands
+##
+
+%config
+ cacti_enable="$openpkg_rc_def"
+ cacti_cron="yes"
+
+%status -u @l_susr@ -o
+ cacti_usable="no"
+ cacti_active="no"
+ @l_prefix@/sbin/apache -t \
+ -f @l_prefix@/etc/cacti/cacti-apache.conf 2>/dev/null && \
+ cacti_usable="yes"
+ [ -f @l_prefix@/var/cacti/run/apache.pid ] && \
+ kill -0 `cat @l_prefix@/var/cacti/run/apache.pid` && \
+ cacti_active="yes"
+ echo "cacti_enable=\"$cacti_enable\""
+ echo "cacti_usable=\"$cacti_usable\""
+ echo "cacti_active=\"$cacti_active\""
+
+%start -u @l_susr@
+ rcService cacti enable yes || exit 0
+ rcService cacti active yes && exit 0
+ @l_prefix@/sbin/apache \
+ -f @l_prefix@/etc/cacti/cacti-apache.conf
+
+%stop -u @l_susr@
+ rcService cacti enable yes || exit 0
+ rcService cacti active no && exit 0
+ [ -f @l_prefix@/var/cacti/run/apache.pid ] && \
+ kill -TERM `cat @l_prefix@/var/cacti/run/apache.pid`
+ sleep 2
+
+%restart -u @l_susr@
+ rcService cacti enable yes || exit 0
+ rcService cacti active no && exit 0
+ rc cacti stop start
+
+%quarterly -u @l_rusr@
+ rcService cacti enable yes || exit 0
+ if [ ".$cacti_cron" = .yes ]; then
+ @l_prefix@/sbin/cacti-cron
+ fi
+
@@ .
patch -p0 <<'@@ .'
Index: openpkg-web/news.txt
============================================================================
$ cvs diff -u -r1.6232 -r1.6233 news.txt
--- openpkg-web/news.txt 19 Aug 2003 11:22:31 -0000 1.6232
+++ openpkg-web/news.txt 19 Aug 2003 14:45:33 -0000 1.6233
@@ -1,3 +1,4 @@
+19-Aug-2003: New package: P<cacti-0.8.2a-20030819>
19-Aug-2003: Upgraded package: P<myodbc-3.51.06-20030819>
19-Aug-2003: Upgraded package: P<snmp-5.0.8-20030819>
19-Aug-2003: Upgraded package: P<perl-ssl-20030819-20030819>
@@ .
______________________________________________________________________
The OpenPKG Project www.openpkg.org
CVS Repository Commit List [EMAIL PROTECTED]