# 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: # # Makefile # distinfo # files # install.sh # pkg-descr # pkg-message # pkg-plist # echo x - Makefile sed 's/^X//' >Makefile << 'b67911656ef5d18c4ae36cb6741b7965' X# New ports collection makefile for: monitorix X# Date created: 19 May 2010 X# Whom: Michael Brune X# X# $FreeBSD$ X# X XPORTNAME= monitorix XPORTVERSION= 1.5.0 XCATEGORIES= sysutils XMASTER_SITES= http://monitorix.org/ X XMAINTAINER= admin@mjbrune.org XCOMMENT= A web based monitoring system X XLIB_DEPENDS= rrd:${PORTSDIR}/databases/rrdtool XRUN_DEPENDS= ${SITE_PERL}/LWP.pm:${PORTSDIR}/www/p5-libwww X XUSE_PERL5= yes XMAN5= monitorix.conf.5 XMANCOMPRESSED= yes XNO_BUILD= yes X XCGIDIR?= ${PREFIX}/www/cgi-bin XDATADIR?= /var/db/ XWWWDIR?= ${PREFIX}/www/ X Xpre-everything:: X @${ECHO_MSG} "" X @${ECHO_MSG} "You may set following options:" X @${ECHO_MSG} "" X @${ECHO_MSG} "DATADIR=${DATADIR} Where do you put RRD databases?" X @${ECHO_MSG} "CGIDIR=${CGIDIR} Where do you put cgi?" X @${ECHO_MSG} "WWWDIR=${WWWDIR} Where do you put httpd's document root?" X @${ECHO_MSG} "" X Xpost-patch: X @${REINPLACE_CMD} -e "s./usr/local/lib.${DATADIR}." ${WRKSRC}/install.sh X @${REINPLACE_CMD} -e "s./usr/local/lib.${DATADIR}." ${WRKSRC}/monitorix.conf X @${REINPLACE_CMD} -e "s./usr/local/www/apache22/data.${WWWDIR}." ${WRKSRC}/install.sh X @${REINPLACE_CMD} -e "s./usr/local/www/apache22/data.${WWWDIR}." ${WRKSRC}/monitorix.conf X @${REINPLACE_CMD} -e "s./usr/local/www/apache22/cgi-bin.${CGIDIR}." ${WRKSRC}/install.sh X @${REINPLACE_CMD} -e "s./usr/local.${PREFIX}." ${WRKSRC}/install.sh X @${REINPLACE_CMD} -e "s./usr/local.${PREFIX}." ${WRKSRC}/monitorix.conf X @${REINPLACE_CMD} -e "s./usr/local/lib/.${DATADIR}." ${WRKSRC}/ports/FreeBSD/monitorix.init X Xdo-install: X cd ${WRKSRC}; ./install.sh X X.include b67911656ef5d18c4ae36cb6741b7965 echo x - distinfo sed 's/^X//' >distinfo << '57677d168a5ec21bdf22c9501f075a8f' XMD5 (monitorix-1.5.0.tar.gz) = fecf3552771c23548df2f3d19a736a7c XSHA256 (monitorix-1.5.0.tar.gz) = c01893f397f783a701f4cf7920211f6633476b319eef26a6d00054cfd2db706b XSIZE (monitorix-1.5.0.tar.gz) = 140673 57677d168a5ec21bdf22c9501f075a8f echo c - files mkdir -p files > /dev/null 2>&1 echo x - install.sh sed 's/^X//' >install.sh << '3fbb47e318cd8802bd325e7da9aaabe8' X#!/bin/sh X# X# @(#) Fibranet NSP, SL X# Copyright (C) 2005-2010 by Jordi Sanfeliu X# - Debian contribution by Uwe Heidrich X# - Gentoo contribution by Markus Rennings X# - Gentoo contribution by Matej Povazaj X# - Slackware contribution by Bogdan X# X# Install shell-script for Monitorix X# X Xshow_paths() { X echo X echo "The following is a list of the default paths where the Monitorix components" X echo "will be installed:" X echo X echo " 1 - $SBIN" X echo " 2 - $ETC" X echo " 3 - $LIB" X echo " 4 - $DOC" X echo " 5 - $HTDOCS" X echo " 6 - $CGIBIN" X echo " 7 - $MAN" X} X XOS=`uname -s` X Xclear Xecho "Welcome to Monitorix v1.5.0 installation process." Xecho X Xcase $OS in X Linux) X OK=0 X while [ $OK -eq 0 ] ; do X echo "IMPORTANT NOTE" X echo "--------------" X echo "This is not the recommended method of installing Monitorix." X echo X echo "If your distribution doesn't appears in the below list it could be because there is already a package for download either from the Monitorix web site or directly using your distribution repositories." X echo X echo "Please, use this script as a last alternative for installing Monitorix." X echo X echo "This installation script supports only the following $OS distributions:" X echo X echo " 1 - Generic" X echo " 2 - Debian (Ubuntu)" X echo " 3 - Slackware" X echo X echo -n " Please select your option: " X read distro X case $distro in X 1) X SBIN="/usr/local/sbin" X ETC="/usr/local/etc" X INIT="/usr/local/etc/rc.d" X LIB="/usr/local/lib" X DOC="/usr/local/share" X HTDOCS="/usr/local/www/data" X CGIBIN="/usr/local/www/cgi-bin" X MAN="/usr/local/man/man5" X PORTS="${OS}-Generic" X show_paths X OK=1 X ;; X 2) X SBIN="/usr/bin" X ETC="/etc" X INIT="/etc/init.d" X LIB="/var/lib" X DOC="/usr/share/doc" X HTDOCS="/var/www" X CGIBIN="/usr/lib/cgi-bin" X MAN="/usr/share/man/man5" X PORTS="${OS}-Debian" X show_paths X OK=1 X ;; X 3) X SBIN="/usr/sbin" X ETC="/etc" X INIT="/etc/rc.d" X LIB="/var/lib" X DOC="/usr/share/doc" X HTDOCS="/var/www/htdocs" X CGIBIN="/var/www/cgi-bin" X MAN="/usr/share/man/man5" X PORTS="${OS}-Slack" X show_paths X OK=1 X ;; X *) X echo "Bad option!. Try again please." X echo X ;; X esac X done X ;; X X FreeBSD) X echo "The install script has detected that this is a $OS operating system." X SBIN="/usr/local/sbin" X ETC="/usr/local/etc" X LIB="/usr/local/lib" X DOC="/usr/local/share/doc" X HTDOCS="/usr/local/www/apache22/data" X CGIBIN="/usr/local/www/apache22/cgi-bin" X MAN="/usr/local/man/man5" X PORTS="$OS" X show_paths X ;; X X *) X echo X echo "Sorry. Your operating system \"$OS\" is not supported right now." X echo "Please contact to Jordi Sanfeliu if you are interested" X echo "to start the portability process together." X echo X exit 1 X ;; X Xesac X Xecho Xecho "Last chance to stop the installation." Xif [ $OS = "FreeBSD" ] ; then X echo X echo "IMPORTANT NOTE:" X echo "Monitorix is a crond-based application and must be executed by root. This means" X echo "that every time it is started or stopped it will overwrite or remove its own" X echo "crontab file in the /var/cron/tabs directory." X echo "This may create a conflict if another application is using the same method." X echo "You have been warned." X echo Xfi X XOK=0 Xwhile [ $OK -eq 0 ] ; do Xecho -n "Are you sure to install Monitorix on the paths shown? [y/n]: " Xread sure Xcase $sure in X [nN]) X echo X echo "Aborting installation." X exit 1 X ;; X X [yY]) X echo X echo "Starting installation." X OK=1 X ;; X X *) X ;; Xesac Xdone X Xecho "Copying core script to $SBIN directory" Xecho "monitorix.pl" Xif [ $OS = "Linux" ] ; then X install -D -m 755 monitorix.pl $SBIN/monitorix.pl Xelif [ $OS = "FreeBSD" ] ; then X install -d -m 755 $SBIN X install -c -m 755 monitorix.pl $SBIN Xfi Xif [ $? -gt 0 ] ; then X echo X echo "You don't have enough permissions to install Monitorix." X echo "Please, execute this script as 'root' or use the command sudo:" X echo "sudo ./install.sh" X echo X exit 1 Xfi Xecho X Xecho "Copying configuration file to $ETC directory" Xecho "monitorix.conf" Xif [ -f $ETC/monitorix.conf ] ; then X echo "backing up the previous monitorix.conf file." X mv -f $ETC/monitorix.conf $ETC/monitorix.conf.bak Xfi Xif [ $OS = "Linux" ] ; then X install -D -m 644 monitorix.conf $ETC/monitorix.conf X sed -i 's/our \$OSTYPE = \"Linux-RHFC\"/our \$OSTYPE = \"'$PORTS'\"/' $ETC/monitorix.conf Xelif [ $OS = "FreeBSD" ] ; then X install -c -m 644 monitorix.conf $ETC X sed -i "" 's/our \$OSTYPE = \"Linux-RHFC\"/our \$OSTYPE = \"'$PORTS'\"/' $ETC/monitorix.conf Xfi Xecho X Xecho "Copying report files to $LIB directory" Xecho "reports/" Xif [ $OS = "Linux" ] ; then X install -m 755 -d reports $LIB/monitorix/reports X cp -r reports $LIB/monitorix/ X mkdir $LIB/monitorix/usage Xelif [ $OS = "FreeBSD" ] ; then X install -d -m 755 $LIB/monitorix/reports X install -d -m 755 $LIB/monitorix/usage X cp -r reports $LIB/monitorix/ Xfi Xecho X Xecho "Copying documentation files to $DOC directory" Xobjs="Changes COPYING monitorix-apache.conf monitorix-alert.sh monitorix.spec README README.nginx README.Slackware README.FreeBSD TODO" Xecho $objs Xfor file in $objs ; do X if [ $OS = "Linux" ] ; then X install -D -m 644 $file $DOC/monitorix/$file X elif [ $OS = "FreeBSD" ] ; then X install -d -m 755 $DOC/monitorix X install -c -m 644 $file $DOC/monitorix X fi Xdone Xecho X Xecho "Copying html files to $HTDOCS directory" Xobjs="logo_bot.png logo_top.png monitorixico.png" Xecho $objs Xfor file in $objs ; do X if [ $OS = "Linux" ] ; then X install -D -m 644 $file $HTDOCS/monitorix/$file X elif [ $OS = "FreeBSD" ] ; then X install -d -m 755 $HTDOCS/monitorix X install -c -m 644 $file $HTDOCS/monitorix X fi Xdone Xmkdir -p $HTDOCS/monitorix/imgs Xchmod 777 $HTDOCS/monitorix/imgs Xecho X Xecho "Copying cgi-bin files to $CGIBIN directory" Xecho "monitorix.cgi" Xif [ $OS = "Linux" ] ; then X install -D -m 755 monitorix.cgi $CGIBIN/monitorix.cgi Xelif [ $OS = "FreeBSD" ] ; then X install -d -m 755 $CGIBIN X install -c -m 755 monitorix.cgi $CGIBIN Xfi Xecho X Xecho "Copying man pages to $MAN directory" Xecho "monitorix.conf.5" Xgzip -9 man/man5/monitorix.conf.5 Xif [ $OS = "Linux" ] ; then X install -D -m 644 man/man5/monitorix.conf.5.gz $MAN/monitorix.conf.5.gz Xelif [ $OS = "FreeBSD" ] ; then X install -d -m 755 $MAN X install -c -m 644 man/man5/monitorix.conf.5.gz $MAN Xfi Xecho X Xif [ $OS = "Linux" ] ; then X # required for Slackware and maybe others X if [ $distro = "3" ] ; then X mkdir /etc/cron.d 2>/dev/null X mkdir /var/lib/monitorix 2>/dev/null X fi Xfi X Xecho "-----------------------------------------------------------------------" Xecho " INSTALLATION SUCCESFULLY FINISHED" Xecho "-----------------------------------------------------------------------" Xecho "Now make your last adjustments in the monitorix.conf file and finally," Xecho "start Monitorix executing the init script:" Xecho Xecho "service monitorix start" Xecho "or" Xecho "$INIT/monitorix start" Xecho Xecho "and go to http://localhost/monitorix/ to start seeing the results." Xecho "(don't forget to start the Apache webserver)" Xecho Xecho "NOTE: As a crond-based application, the root user will receive emails" Xecho "about Monitorix execution errors. Please check the root email.". Xecho Xexit 0 X 3fbb47e318cd8802bd325e7da9aaabe8 echo x - pkg-descr sed 's/^X//' >pkg-descr << '7f9555c3c1089940396b503dd37f3979' XMonitorix is a free, open source, lightweight system monitoring tool Xdesigned to monitorize as many services as possible. At this time it Xmonitors from the CPU load and temperatures to the users using the system. XNetwork devices activity, network services demand and even the devices' Xinterrupt activity are also monitored, and more. The current status of any Xcorporate server with Monitorix installed can be accessed via a web browser. X XWWW: http://www.monitorix.org/ 7f9555c3c1089940396b503dd37f3979 echo x - pkg-message sed 's/^X//' >pkg-message << '90c81c06929c43140502a9f17b449376' XHow to use: X XMonitorix is a cron based application, meaning it relies on cron to run a Xjob every minute, to set this up run: X X${PREFIX}/sbin/monitorix.pl create Xto setup the databases. X${PREFIX}/sbin/monitorix.pl init Xto write over roots crontab files. X XMonitorix is a crond-based application and must be executed by root. This Xmeans that every time it is started or stopped it will overwrite or remove its own Xcrontab file in the /var/cron/tabs directory. This may create a conflict if another application is using the same method. XYou have been warned. X 90c81c06929c43140502a9f17b449376 echo x - pkg-plist sed 's/^X//' >pkg-plist << '842cde48cf18b70a11b15515ca566742' Xsbin/monitorix.pl Xetc/rc.d/monitorix X%%PORTDOCS%%%%DOCSDIR%%/COPYING X%%PORTDOCS%%%%DOCSDIR%%/Changes X%%PORTDOCS%%%%DOCSDIR%%/README X%%PORTDOCS%%%%DOCSDIR%%/README.FreeBSD X%%PORTDOCS%%%%DOCSDIR%%/README.Slackware X%%PORTDOCS%%%%DOCSDIR%%/README.nginx X%%PORTDOCS%%%%DOCSDIR%%/TODO X%%PORTDOCS%%%%DOCSDIR%%/monitorix-alert.sh X%%PORTDOCS%%%%DOCSDIR%%/monitorix-apache.conf X%%PORTDOCS%%%%DOCSDIR%%/monitorix.spec X%%WWWDIR%%/monitorix/logo_bot.png X%%WWWDIR%%/monitorix/logo_top.png X%%WWWDIR%%/monitorix/monitorixico.png X%%WWWDIR%%/cgi-bin/monitorix.cgi X@dirrm %%PORTDOCS%%%%DOCSDIR%%/ 842cde48cf18b70a11b15515ca566742 exit