diff options
author | Ying-Chieh Liao <ijliao@FreeBSD.org> | 2004-07-22 01:48:42 +0000 |
---|---|---|
committer | Ying-Chieh Liao <ijliao@FreeBSD.org> | 2004-07-22 01:48:42 +0000 |
commit | ac47e376bcd341604648e044f405c837c6f0c106 (patch) | |
tree | 84639941c8f041587f2e77bfbda61ff090750d21 /net-mgmt/nagiostat | |
parent | aff387dcb567b34383a43b1e493d9ba83c20f20e (diff) |
Notes
Diffstat (limited to 'net-mgmt/nagiostat')
-rw-r--r-- | net-mgmt/nagiostat/Makefile | 55 | ||||
-rw-r--r-- | net-mgmt/nagiostat/distinfo | 2 | ||||
-rw-r--r-- | net-mgmt/nagiostat/files/patch-README | 112 | ||||
-rw-r--r-- | net-mgmt/nagiostat/files/patch-nagiostat | 16 | ||||
-rw-r--r-- | net-mgmt/nagiostat/files/patch-nagiostat.conf | 27 | ||||
-rw-r--r-- | net-mgmt/nagiostat/pkg-descr | 6 | ||||
-rw-r--r-- | net-mgmt/nagiostat/pkg-plist | 15 |
7 files changed, 233 insertions, 0 deletions
diff --git a/net-mgmt/nagiostat/Makefile b/net-mgmt/nagiostat/Makefile new file mode 100644 index 000000000000..f1c53c103a4c --- /dev/null +++ b/net-mgmt/nagiostat/Makefile @@ -0,0 +1,55 @@ +# New ports collection makefile for: nagiostat +# Date created: 20 July 2004 +# Whom: Janos.Mohacsi@bsd.hu +# +# $FreeBSD$ +# + +PORTNAME= nagiostat +PORTVERSION= 1.0.0 +CATEGORIES= net-mgmt +MASTER_SITES= ${MASTER_SITE_SOURCEFORGE} +MASTER_SITE_SUBDIR= ${PORTNAME} +EXTRACT_SUFX= .tgz + +MAINTAINER= janos.mohacsi@bsd.hu +COMMENT= Nagiostat parses performance-data from Nagios and generates graphs + +RUN_DEPENDS= rrdtool:${PORTSDIR}/net/rrdtool \ + nagios:${PORTSDIR}/net-mgmt/nagios \ + ${SITE_PERL}/CGI.pm:${PORTSDIR}/www/p5-CGI.pm + +USE_PERL5= yes +NO_BUILD= yes +USE_REINPLACE= yes +NO_WRKSUBDIR= yes +NAGIOSDIR?= /var/spool/nagios +DOC_FILES= README GPL.txt + +post-patch: + @${REINPLACE_CMD} \ + -e 's|%%NAGIOSTATCONFDIR%%|${PREFIX}/etc/|' \ + -e 's|%%NAGIOSTATDIR%%|${PREFIX}/libexec/${PORTNAME}/|' \ + -e 's|%%NAGIOSTATRRD%%|${NAGIOSDIR}/${PORTNAME}rrd/|' \ + -e 's|%%PREFIX%%|${PREFIX}|' \ + ${WRKSRC}/nagiostat ${WRKSRC}/nagiostat.conf ${WRKSRC}/README +do-install: + @${MKDIR} ${PREFIX}/libexec/${PORTNAME} + @${MKDIR} ${NAGIOSDIR}/${PORTNAME}rrd + @${INSTALL_SCRIPT} ${WRKSRC}/nagiostat ${PREFIX}/libexec/${PORTNAME}/ + @${LN} -fs ${PREFIX}/libexec/${PORTNAME}/nagiostat ${PREFIX}/share/nagios/cgi-bin/nagiostat.cgi + @${INSTALL_DATA} ${WRKSRC}/nagiostat.conf ${PREFIX}/etc/nagiostat.conf-sample + @${INSTALL_DATA} ${WRKSRC}/graph.gif ${PREFIX}/share/nagios/images/logos + @${MKDIR} ${PREFIX}/libexec/${PORTNAME}/html-templates/ + @${INSTALL_DATA} ${WRKSRC}/html-templates/default.html ${PREFIX}/libexec/${PORTNAME}/html-templates/ + @${INSTALL_DATA} ${WRKSRC}/html-templates/graphindex.html ${PREFIX}/libexec/${PORTNAME}/html-templates/ + +post-install: +.if !defined(NOPORTDOCS) + @${MKDIR} ${DOCSDIR} +.for file in ${DOC_FILES} + @${INSTALL_DATA} ${WRKSRC}/${file} ${DOCSDIR} +.endfor +.endif + +.include <bsd.port.mk> diff --git a/net-mgmt/nagiostat/distinfo b/net-mgmt/nagiostat/distinfo new file mode 100644 index 000000000000..9e7439e52fd8 --- /dev/null +++ b/net-mgmt/nagiostat/distinfo @@ -0,0 +1,2 @@ +MD5 (nagiostat-1.0.0.tgz) = 10ecfebe9430b2daf6a0e87b71dc739c +SIZE (nagiostat-1.0.0.tgz) = 18883 diff --git a/net-mgmt/nagiostat/files/patch-README b/net-mgmt/nagiostat/files/patch-README new file mode 100644 index 000000000000..6ab15f5331e5 --- /dev/null +++ b/net-mgmt/nagiostat/files/patch-README @@ -0,0 +1,112 @@ + +$FreeBSD$ + +--- README.orig Wed Jul 21 10:07:51 2004 ++++ README Wed Jul 21 10:12:10 2004 +@@ -27,24 +27,28 @@ + + + **INSTALLING +-1. Unpack the tar-file to a directory, for example '/usr/local/nagios/nagiostat'. +-The nagiostat-base-dir does not have to be within the nagios-installation directory. + +-2. Start by editing the $BASE_DIR parameter in the file called "nagiostat", which is +-the main script. Set the value to the directory where you unpacked the files. +-Create a file called "debug.log" ('$ touch debug.log') in this dir and change permissions so that the +-nagios-user may write to it. This is the logfile for nagiostat which can be +-very helpful when debugging the regular-expression thing. ++1. Unpack the tar-file to a directory, for example '%%NAGIOSTATDIR%%'. ++The nagiostat-base-dir does not have to be within the nagios-installation ++directory. + +-If things are installed in the directory specified in step 1, you can also run "make install" to +-create debug.log, archives-directory and set permissions on them. "make install" is under development. +-It also assumes that the nagios-user is called 'nagios'. ++2. Start by editing the $BASE_DIR parameter in the file called ++"nagiostat", which is the main script. Set the value to the directory ++where you unpacked the files. Create a file called "debug.log" ('$ touch ++debug.log') in this dir and change permissions so that the nagios-user may ++write to it. This is the logfile for nagiostat which can be very helpful ++when debugging the regular-expression thing. + +-3. Then read the nagios.conf-file where also most of the documentation is located and change the +-parameters to your liking. ++If things are installed in the directory specified in step 1, you can also ++run "make install" to create debug.log, archives-directory and set ++permissions on them. "make install" is under development. It also assumes ++that the nagios-user is called 'nagios'. + +-4. Then set up your webserver so that you can access the nagiostat.cgi (symbolic-link +-to 'nagiostat') from some URL. Example for apache: ++3. Then read the nagios.conf-file where also most of the documentation is ++located and change the parameters to your liking. ++ ++4. Then set up your webserver so that you can access the nagiostat.cgi ++(symbolic-link to 'nagiostat') from some URL. Example for apache: + --- + Alias /nagiostat/ /usr/local/nagios/nagiostat/ + <Directory /usr/local/nagios/nagiostat> +@@ -53,41 +57,47 @@ + Allow from all + </Directory> + --- +-You also have to make sure that the apache-user has read-rights to the RRDArchivePath +-and the config-file nagios.conf. You also would probably add additional security to +-this, password protecting for instance. + +-5. Set up nagios to enable performance-data handling and that it should send the perfdata +-to nagiostat. +-In nagios.cfg, set the parameter 'process_performance_data=1'. This enables processing of +-performance data. +-Then add the parameter 'service_perfdata_command=service-perf-data-handler' also to nagios.cfg. This +-tells nagios to run the "service-perf-data-handler" command to process the performance data after +-each plugin has been executed. +-Then add the following to the checkcommands.cfg-file (or whatever nagios-config-file you find suitable): ++You also have to make sure that the apache-user has read-rights to the ++RRDArchivePath and the config-file nagios.conf. You also would probably ++add additional security to this, password protecting for instance. ++ ++5. Set up nagios to enable performance-data handling and that it should ++send the perfdata to nagiostat. In nagios.cfg, set the parameter ++'process_performance_data=1'. This enables processing of performance data. ++Then add the parameter ++'service_perfdata_command=service-perf-data-handler' also to nagios.cfg. ++This tells nagios to run the "service-perf-data-handler" command to ++process the performance data after each plugin has been executed. Then add ++the following to the checkcommands.cfg-file (or whatever ++nagios-config-file you find suitable): ++ + --- + ## + ## PERF-DATA-HANDLER + ## + define command { + command_name service-perf-data-handler +- command_line /usr/local/nagios/nagiostat/nagiostat -p "$LASTCHECK$|!!|$HOSTNAME$|!!|$SERVICEDESC$|!!|$SERVICESTATE$|!!|$OUTPUT$|!!|$PERFDATA$" ++ command_line /%%NAGIOSTATDIR%%/nagiostat -p "$LASTCHECK$|!!|$HOSTNAME$|!!|$SERVICEDESC$|!!|$SERVICESTATE$|!!|$OUTPUT$|!!|$PERFDATA$" + } + --- + Alter the path to nagiostat to reflect where you installed the files in step 1. + +-6. To add a nifty icon to click on in the "service detail"-page in the nagios web interface, you +-can add something like the following to the serviceextinfo.cfg-file: ++6. To add a nifty icon to click on in the "service detail"-page in the ++nagios web interface, you can add something like the following to the ++serviceextinfo.cfg-file: ++ + --- + define serviceextinfo { + host_name purjo.dacom.se + service_description PING +- notes_url /nagiostat/nagiostat.cgi?graph_name=purjo-ping ++ notes_url /nagiostat.cgi?graph_name=purjo-ping + icon_image graph.gif + icon_image_alt View graphs + } + --- +-Copy graph.gif to /usr/local/nagios/share/images/logos (or whichever directory your nagios-installation is in) ++Copy graph.gif to /%%PREFIX%%/nagios/share/images/logos (or whichever ++directory your nagios-installation is in) + to get the little ugly graph-icon in the right place. + + diff --git a/net-mgmt/nagiostat/files/patch-nagiostat b/net-mgmt/nagiostat/files/patch-nagiostat new file mode 100644 index 000000000000..7809eeb52e1b --- /dev/null +++ b/net-mgmt/nagiostat/files/patch-nagiostat @@ -0,0 +1,16 @@ + +$FreeBSD$ + +--- nagiostat.orig Tue Jul 20 17:30:18 2004 ++++ nagiostat Tue Jul 20 18:01:53 2004 +@@ -21,8 +21,8 @@ + use strict; + + ## Basic configuration options +-my $BASE_DIR = "/usr/local/nagios/nagiostat"; +-my $CONFIG_FILE = $BASE_DIR."/nagiostat.conf"; ## Config-file location ++my $BASE_DIR = "%%NAGIOSTATDIR%%"; ++my $CONFIG_FILE = "%%NAGIOSTATCONFDIR%%/nagiostat.conf"; ## Config-file location + my $DEBUG_LOG_FILE = $BASE_DIR."/debug.log"; ## Specify where to create log-file and what filename (must be writable by nagios-user!) + my $DEBUGLEVEL = 3; ## 0=Nothing, 1=Errors, 2=Warnings, 3=Debug + my $DEBUGOUTPUT = 0; ## 0=file, 1=STDERR, 2=STDOUT (for cgi) diff --git a/net-mgmt/nagiostat/files/patch-nagiostat.conf b/net-mgmt/nagiostat/files/patch-nagiostat.conf new file mode 100644 index 000000000000..4ad54a38d260 --- /dev/null +++ b/net-mgmt/nagiostat/files/patch-nagiostat.conf @@ -0,0 +1,27 @@ + +$FreeBSD$ + +--- nagiostat.conf.orig Tue Jul 20 18:02:15 2004 ++++ nagiostat.conf Tue Jul 20 18:09:40 2004 +@@ -13,10 +13,10 @@ + ## quote-marks are written in pairs EVEN IN COMMENTS. This is a known bug. + + # Pointer to where the rrd-tool binary is located +-RRDToolPath /usr/local/bin/rrdtool ++RRDToolPath %%PREFIX%%/bin/rrdtool + + # Pointer to where HTML-templates are stored +-HTMLTemplatePath /usr/local/nagios/nagiostat/html-templates ++HTMLTemplatePath %%NAGIOSTATDIR%%/html-templates + + # Pointer to HTML-template for the index-page (relative to HTMLTemplatePath) + GraphIndexTemplate graphindex.html +@@ -25,7 +25,7 @@ + # nagiostat automatically creates RRD-archives if they dont exist. + # IMPORTANT: the whole directory RRDArchivePath must be writable by the nagios user (that calls the + # nagiostat-script) +-RRDArchivePath /usr/local/nagios/nagiostat/archives ++RRDArchivePath %%NAGIOSTATRRD%%/ + + ## How many graphs per HTML-page and which time-periods they should represent + ## TemplateName Definitions (format=<starttime>:<endtime>:<description>) diff --git a/net-mgmt/nagiostat/pkg-descr b/net-mgmt/nagiostat/pkg-descr new file mode 100644 index 000000000000..6614e2aa04d5 --- /dev/null +++ b/net-mgmt/nagiostat/pkg-descr @@ -0,0 +1,6 @@ +Nagiostat parses performance-data from Nagios and generates graphs of +trends over time. Nagiostat makes use of RRD-tool. It then generates +graphs on-the-fly through a CGI-script and HTML-templates. Nagiostat is +written in perl. + +WWW: http://nagiostat.sourceforge.net diff --git a/net-mgmt/nagiostat/pkg-plist b/net-mgmt/nagiostat/pkg-plist new file mode 100644 index 000000000000..0cbe3ad484d9 --- /dev/null +++ b/net-mgmt/nagiostat/pkg-plist @@ -0,0 +1,15 @@ +@exec mkdir -p /var/spool/nagios/nagiostatrrd +@exec chmod 775 /var/spool/nagios/nagiostatrrd +@exec chown nagios:nagios /var/spool/nagios/nagiostatrrd +@unexec rmdir /var/spool/nagios/nagiostatrrd 2>/dev/null || true +etc/nagiostat.conf-sample +share/nagios/cgi-bin/nagiostat.cgi +libexec/nagiostat/nagiostat +libexec/nagiostat/html-templates/default.html +libexec/nagiostat/html-templates/graphindex.html +share/nagios/images/logos/graph.gif +%%PORTDOCS%%%%DOCSDIR%%/README +%%PORTDOCS%%%%DOCSDIR%%/GPL.txt +@dirrm libexec/nagiostat/html-templates +@dirrm libexec/nagiostat +%%PORTDOCS%%@dirrm %%DOCSDIR%% |