diff options
Diffstat (limited to 'net-mgmt')
-rw-r--r-- | net-mgmt/pnp/Makefile | 42 | ||||
-rw-r--r-- | net-mgmt/pnp/distinfo | 4 | ||||
-rw-r--r-- | net-mgmt/pnp/files/patch-sample-config__Makefile.in | 6 | ||||
-rw-r--r-- | net-mgmt/pnp/files/pkg-deinstall.in | 57 | ||||
-rw-r--r-- | net-mgmt/pnp/files/pkg-install.in | 73 | ||||
-rw-r--r-- | net-mgmt/pnp/files/pkg-message.in | 54 | ||||
-rw-r--r-- | net-mgmt/pnp/pkg-plist | 7 |
7 files changed, 87 insertions, 156 deletions
diff --git a/net-mgmt/pnp/Makefile b/net-mgmt/pnp/Makefile index 1578de904415..36dd82ab4558 100644 --- a/net-mgmt/pnp/Makefile +++ b/net-mgmt/pnp/Makefile @@ -2,15 +2,14 @@ # $FreeBSD$ PORTNAME= pnp -PORTVERSION= 0.6.21 -PORTREVISION= 1 +PORTVERSION= 0.6.25 CATEGORIES= net-mgmt MASTER_SITES= SF MASTER_SITE_SUBDIR=pnp4nagios/PNP-0.6 DISTNAME= pnp4nagios-${DISTVERSIONPREFIX}${DISTVERSION}${DISTVERSIONSUFFIX} -MAINTAINER?= rea@FreeBSD.org -COMMENT?= Nagios performance data collector and grapher +MAINTAINER?= lme@FreeBSD.org +COMMENT?= Nagios / Icinga performance data collector and grapher LICENSE= GPLv2 @@ -27,10 +26,11 @@ PDF_DESC= Use built-in fpdf library to produce PDF views .include <bsd.port.options.mk> -USE_PHP= gd iconv json pcre simplexml sockets xml zlib - +USE_PHP= gd iconv json pcre session simplexml sockets xml zlib WANT_PHP_WEB= yes + USE_RC_SUBR= npcd + DOS2UNIX_REGEX= '.*\.\(php\|js\|txt\)$$' NAGIOSDIR?= /var/spool/nagios @@ -42,11 +42,8 @@ PNP_RRDS= ${PNP_STATE}/rrd PNP_SPOOL= ${PNP_STATE}/perfspool PNP_URL?= ${NAGIOSHTMURL}/pnp FPDF_DIR?= share/fpdf -SPOOL_DIRS= ${PNP_STATE}:${NAGIOSUSER}:${NAGIOSGROUP}:0750%${PNP_RRDS}:${NAGIOSUSER}:${NAGIOSGROUP}:0750%${PNP_SPOOL}:${NAGIOSUSER}:${NAGIOSGROUP}:0750 -.if ! ${PORT_OPTIONS:MPDF} -EXTRA_PATCHES+= ${FILESDIR}/extra-patch-disable-pdf -.endif +PDF_EXTRA_PATCHES_OFF+= ${FILESDIR}/extra-patch-disable-pdf GNU_CONFIGURE= yes CONFIGURE_ARGS+= \ @@ -65,16 +62,20 @@ CONFIGURE_ARGS+= \ MAKE_ARGS= INSTALL_OPTS= INSTALL_TARGET= install install-config -PLIST_SUB+= NAGIOSDIR=${NAGIOSDIR} -SUB_FILES= pkg-install \ - pkg-deinstall \ - pkg-message -SUB_LIST= SPOOL_DIRS=${SPOOL_DIRS} \ - PNP_RRDS=${PNP_RRDS} \ +PLIST_SUB+= NAGIOSDIR=${NAGIOSDIR} \ + NAGIOSUSER=${NAGIOSUSER} \ + NAGIOSGROUP=${NAGIOSGROUP} \ + WWWOWN=${WWWOWN} \ + WWWGRP=${WWWGRP} + +SUB_FILES= pkg-message +SUB_LIST= PNP_RRDS=${PNP_RRDS} \ PNP_URL=${PNP_URL} \ NAGIOSUSER=${NAGIOSUSER} \ NAGIOSGROUP=${NAGIOSGROUP} +SAMPLE_CONFIGS= lighttpd.pnp4nagios.conf nginx.pnp4nagios.conf httpd.conf + .if ${PORT_OPTIONS:MPDF} PNP_USE_FPDF= 1 .else @@ -88,9 +89,18 @@ post-patch: -e's|/usr/local/check_mk/|/usr/local/share/check_mk/|g' \ -e's|/usr/local/nagios/var/rw/live|/${NAGIOSDIR}/rw/live|' \ "${WRKSRC}/sample-config/pnp/config.php.in" +.for f in ${SAMPLE_CONFIGS} + @${REINPLACE_CMD} -e 's|@BASE_URL@|${PNP_URL}|g' -e 's|@datarootdir@|${WWWDIR}|g' \ + -e 's|/usr/local/nagios/etc|${PREFIX}/etc/${NAGIOSUSER}|' -e 's|Nagios|${NAGIOSUSER}|' \ + "${WRKSRC}/sample-config/${f}.in" +.endfor @${LN} -fs ../en_US/dwnld.html ${WRKSRC}/share/pnp/documents/de_DE/dwnld.html post-install: + @${MKDIR} ${STAGEDIR}${EXAMPLESDIR} +.for f in ${SAMPLE_CONFIGS} + ${INSTALL_DATA} ${WRKSRC}/sample-config/${f} ${STAGEDIR}${EXAMPLESDIR} +.endfor ${INSTALL_MAN} ${WRKSRC}/man/npcd.8 ${STAGEDIR}${MAN8PREFIX}/man/man8 .include <bsd.port.mk> diff --git a/net-mgmt/pnp/distinfo b/net-mgmt/pnp/distinfo index c75a4e5b9b4c..317cbc500979 100644 --- a/net-mgmt/pnp/distinfo +++ b/net-mgmt/pnp/distinfo @@ -1,2 +1,2 @@ -SHA256 (pnp4nagios-0.6.21.tar.gz) = bb5d36a7cc49dcbcfcb424d437dc3739baa647816cffc610fb621216c4f5992a -SIZE (pnp4nagios-0.6.21.tar.gz) = 2917588 +SHA256 (pnp4nagios-0.6.25.tar.gz) = 62d9cdcb132326753373b18fafebd716ec27dc5cbe1ef42204440fca21ca7a0c +SIZE (pnp4nagios-0.6.25.tar.gz) = 2921068 diff --git a/net-mgmt/pnp/files/patch-sample-config__Makefile.in b/net-mgmt/pnp/files/patch-sample-config__Makefile.in index 68e185303c2e..2c60bdd2d8c6 100644 --- a/net-mgmt/pnp/files/patch-sample-config__Makefile.in +++ b/net-mgmt/pnp/files/patch-sample-config__Makefile.in @@ -1,6 +1,6 @@ ---- ./sample-config/Makefile.in.orig 2013-03-24 17:25:56.000000000 +0100 -+++ ./sample-config/Makefile.in 2014-05-02 09:00:07.000000000 +0200 -@@ -40,35 +40,18 @@ +--- sample-config/Makefile.in.orig 2015-01-03 14:09:06.000000000 +0100 ++++ sample-config/Makefile.in 2015-04-22 21:47:23.294933000 +0200 +@@ -40,35 +40,18 @@ install: $(INSTALL) -m 755 $(INSTALL_OPTS) -d $(DESTDIR)$(SYSCONFDIR)/check_commands $(INSTALL) -m 755 $(INSTALL_OPTS) -d $(DESTDIR)$(SYSCONFDIR)/pages $(INSTALL) -m 644 $(INSTALL_OPTS) pnp/pnp4nagios_release $(DESTDIR)$(SYSCONFDIR) diff --git a/net-mgmt/pnp/files/pkg-deinstall.in b/net-mgmt/pnp/files/pkg-deinstall.in deleted file mode 100644 index fcc162f57890..000000000000 --- a/net-mgmt/pnp/files/pkg-deinstall.in +++ /dev/null @@ -1,57 +0,0 @@ -#!/bin/sh -# -# $FreeBSD$ -# - -SPOOL_DIRS=%%SPOOL_DIRS%% -NAGIOSUSER=%%NAGIOSUSER%% -NAGIOSGROUP=%%NAGIOSGROUP%% - -dirs () { - local kept spool_dirs_rev - - IFS=% - for i in $SPOOL_DIRS; do - if [ -z "$spool_dirs_rev" ]; then - spool_dirs_rev="$i" - else - spool_dirs_rev="$i$IFS$spool_dirs_rev" - fi - done - for i in $spool_dirs_rev; do - d="${i%%:*}" - if ! [ -d "$d" ]; then - continue - fi - gom_std="${i#*:}" - go_cur=`stat -f %Su:%Sg "$d"` - m_cur=`stat -f %Op "$d" | sed -e's/^.*\(....\)$/\1/'` - if [ "$gom_std" != "$go_cur:$m_cur" ]; then - kept="$kept $d" - continue - fi - if ! rmdir "$d" > /dev/null 2>&1; then - kept="$kept $d" - continue - fi - done - - if [ -n "$kept" ]; then - echo - cat << EOF -The following directories were not removed, because they are either -have non-default permissions or not empty: -EOF - IFS=" " - for i in $kept; do - echo " $i" - done - echo - echo "Unless you're upgrading, remove them manually." - echo - fi -} - -if [ "x$2" = "xPOST-DEINSTALL" ]; then - dirs -fi diff --git a/net-mgmt/pnp/files/pkg-install.in b/net-mgmt/pnp/files/pkg-install.in deleted file mode 100644 index 5e1def932e80..000000000000 --- a/net-mgmt/pnp/files/pkg-install.in +++ /dev/null @@ -1,73 +0,0 @@ -#!/bin/sh -# -# $FreeBSD$ -# - -SPOOL_DIRS=%%SPOOL_DIRS%% -NAGIOSUSER=%%NAGIOSUSER%% -NAGIOSGROUP=%%NAGIOSGROUP%% - -# Create directories with mode and ownership specified in SPOOL_DIRS -# as strings separated by '%' of format DIR:OWNER:GROUP:MODE -dirs () { - IFS=% - for i in $SPOOL_DIRS; do - d="${i%%:*}" - if ! [ -d "$d" ]; then - go=`echo "$i" | cut -f 2-3 -d :` - m="${i##*:}" - mkdir -p "$d" - chown "$go" "$d" - chmod "$m" "$d" - fi - done -} - -check_sanity () { - if ! pw group show "$NAGIOSGROUP" 2>&1 > /dev/null; then - echo "No group '$NAGIOSGROUP'. Create it and try again." - exit 1 - fi - if ! pw user show "$NAGIOSUSER" 2>&1 > /dev/null; then - echo "No user '$NAGIOSUSER'. Create it and try again." - exit 1 - fi -} - -# I messed the proper way to create the configuration for PNP: -# config_local.php should be used for overrides and config.php -# will come modified at each upgrade. -# -# I was installing config.php as config.php-sample and hoping -# that people will use it as the base for original config.php. -# -# So, if we now have config.php at the installtion phase, then -# it means that config.php may be customized. We save it as -# config.php.orig and informing the user about it. -fixup_config_local () { - if [ -e "%%ETCDIR%%"/config.php ]; then - cp "%%ETCDIR%%"/config.php "%%ETCDIR%%"/config.php.orig - cat << "EOF" -====================================================================== -WARNING: - -You have config.php for PNP; this means that you are probably -upgrading from an old port version, where config.php-sample was -installed instead of config.php and it was meant that you will -cope with config.php yourself. - -PNP's way to do the things is to let config.php be overwritten at each -upgrade and local overrides to it should go to config_local.php. - -Your existing config.php was saved as config.php.orig, please, review -your modifications and put them to config_local.php. -====================================================================== -EOF - fi -} - -if [ "x$2" = "xPRE-INSTALL" ]; then - check_sanity - dirs - fixup_config_local -fi diff --git a/net-mgmt/pnp/files/pkg-message.in b/net-mgmt/pnp/files/pkg-message.in index 88e5ecd44d27..0e2ed563fe30 100644 --- a/net-mgmt/pnp/files/pkg-message.in +++ b/net-mgmt/pnp/files/pkg-message.in @@ -1,15 +1,15 @@ ======================================================================== -You just installed/upgraded PNP graphing tool for Nagios. +You just installed/upgraded PNP graphing tool for %%NAGIOSUSER%%. You will need to read the documentation at http://docs.pnp4nagios.org/pnp-0.6/doc_complete both for new installations and upgrades from 0.4, since you will -need to tweak your Nagios and PNP configuration according to the +need to tweak your %%NAGIOSUSER%% and PNP configuration according to the 0.6.x recipes. -We recommend to start with the following restrictive Apache -configuration for the PNP area: +We recommend to start with the following restrictive Apache configuration for +the PNP area: {{{ # PNP graphing tool Alias %%PNP_URL%% %%WWWDIR%% @@ -22,7 +22,46 @@ Alias %%PNP_URL%% %%WWWDIR%% DirectoryIndex index.php RewriteEngine on - RewriteBase /nagios/pnp/ + RewriteBase %%PNP_URL%%/ + # Protect application and system files from being viewed + RewriteRule ^(application|modules|system) - [F,L] + # Allow any files or directories that exist to be displayed directly + RewriteCond %{REQUEST_FILENAME} !-f + RewriteCond %{REQUEST_FILENAME} !-d + # Rewrite all other URLs to index.php/URL + RewriteRule .* index.php/$0 [PT,L] +</Directory> +# PNP graphing tool +Alias %%PNP_URL%% %%WWWDIR%% + +<Directory %%WWWDIR%%> + <IfModule mod_authz_core.c> + # Apache 2.4 + <RequireAll> + Require all granted + # Require local + Require valid-user + </RequireAll> + </IfModule> + <IfModule !mod_authz_core.c> + # Apache 2.2 + Order allow,deny + Allow from all + # Order deny,allow + # Deny from all + # Allow from 127.0.0.1 + Require valid-user + </IfModule> + + AuthName "PNP Access" + AuthType Basic + AuthUserFile %%PREFIX%%/etc%%NAGIOSHTMURL%%/htpasswd.users + + AddHandler application/x-httpd-php .php + DirectoryIndex index.php + + RewriteEngine on + RewriteBase %%PNP_URL%%/ # Protect application and system files from being viewed RewriteRule ^(application|modules|system) - [F,L] # Allow any files or directories that exist to be displayed directly @@ -33,6 +72,11 @@ Alias %%PNP_URL%% %%WWWDIR%% </Directory> }}} +Don't forget to install and enable www/mod_php5 as well as mod_rewrite. + +If you use another web server like nginx or lighttpd, take a look at +%%EXAMPLESDIR%% + Create %%WWWDIR%%/install.ignore to disable sanity check and start using PNP. diff --git a/net-mgmt/pnp/pkg-plist b/net-mgmt/pnp/pkg-plist index b220b9c98951..bf4d21da7c59 100644 --- a/net-mgmt/pnp/pkg-plist +++ b/net-mgmt/pnp/pkg-plist @@ -272,6 +272,9 @@ libexec/process_perfdata.pl libexec/rrd_convert.pl libexec/rrd_modify.pl man/man8/npcd.8.gz +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/httpd.conf +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/lighttpd.pnp4nagios.conf +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/nginx.pnp4nagios.conf %%WWWDIR%%/application/config/config.php %%WWWDIR%%/application/config/locale.php %%WWWDIR%%/application/config/routes.php @@ -320,6 +323,9 @@ man/man8/npcd.8.gz %%WWWDIR%%/application/vendor/fpdf/filters/FilterLZW.php %%WWWDIR%%/application/vendor/fpdf/filters/FilterLZW_FPDI.php %%WWWDIR%%/application/vendor/fpdf/font/courier.php +%%WWWDIR%%/application/vendor/fpdf/font/courierb.php +%%WWWDIR%%/application/vendor/fpdf/font/courierbi.php +%%WWWDIR%%/application/vendor/fpdf/font/courieri.php %%WWWDIR%%/application/vendor/fpdf/font/helvetica.php %%WWWDIR%%/application/vendor/fpdf/font/helveticab.php %%WWWDIR%%/application/vendor/fpdf/font/helveticabi.php @@ -346,6 +352,7 @@ man/man8/npcd.8.gz %%WWWDIR%%/application/views/graph.php %%WWWDIR%%/application/views/graph_content.php %%WWWDIR%%/application/views/graph_content_special.php +%%WWWDIR%%/application/views/graph_tiny.php %%WWWDIR%%/application/views/header.php %%WWWDIR%%/application/views/host_box.php %%WWWDIR%%/application/views/icon_box.php |