ports/126576: New port: net-mgmt/pnp, modern graphing tool for Nagios
Eygene Ryabinkin
rea-fbsd at codelabs.ru
Sat Aug 16 22:00:17 UTC 2008
>Number: 126576
>Category: ports
>Synopsis: New port: net-mgmt/pnp, modern graphing tool for Nagios
>Confidential: no
>Severity: non-critical
>Priority: medium
>Responsible: freebsd-ports-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: change-request
>Submitter-Id: current-users
>Arrival-Date: Sat Aug 16 22:00:10 UTC 2008
>Closed-Date:
>Last-Modified:
>Originator: Eygene Ryabinkin
>Release: FreeBSD 7.0-STABLE amd64
>Organization:
Code Labs
>Environment:
System: FreeBSD XXX 7.0-STABLE FreeBSD 7.0-STABLE #9: Fri Aug 8 21:35:31 MSD 2008 root at XXX:/usr/obj/usr/src/sys/XXX amd64
>Description:
After evaluation of net-mgmt/nagiosgraph I decided to search for
something more useful -- Nagios Graph was too hackish and unpretty for
my taste. Digging through Nagios sites I had found PNP and was pleased
by its simplicity and power.
WWW: http://www.pnp4nagios.org/pnp/start
>How-To-Repeat:
$ cut -f 1 -d '|' /usr/ports/INDEX-7 | grep pnp
upnp-1.6.0,1
miniupnpd-1.0_11
>Fix:
The following is the shar(1) archive for the new port. I had tested
this port mainly in the Bulk + NPCD mode with my Nagios 3.0.3, PHP 5.x
and Apache 2.2.x -- it showed no problems yet. However, more testing is
desirable, so all who see this new port are welcome to test and report
back the found issues.
--- pnp.shar begins here ---
# 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:
#
# pnp
# pnp/Makefile
# pnp/distinfo
# pnp/pkg-descr
# pnp/pkg-plist
# pnp/files
# pnp/files/npcd.sh.in
# pnp/files/patch-sample-config::Makefile.in
# pnp/files/extra-patch-share::pnp::include::function.inc.php
# pnp/files/pkg-install.in
# pnp/files/pkg-message.in
# pnp/files/pkg-deinstall.in
# pnp/files/patch-scripts::Makefile.in
#
echo c - pnp
mkdir -p pnp > /dev/null 2>&1
echo x - pnp/Makefile
sed 's/^X//' >pnp/Makefile << '31cff5925a314125fad9b188d5d57e06'
X# New ports collection makefile for: pnp
X# Date created: unknown
X# Whom: rea-fbsd at codelabs.ru
X#
X# $FreeBSD$
X#
X
XPORTNAME= pnp
XPORTVERSION= 0.4.10
XCATEGORIES= net-mgmt
XMASTER_SITES= ${MASTER_SITE_SOURCEFORGE}
XMASTER_SITE_SUBDIR= pnp4nagios
X
XMAINTAINER= rea-fbsd at codelabs.ru
XCOMMENT= Nagios performance data collector and grapher
X
XRUN_DEPENDS= ${LOCALBASE}/bin/rrdtool:${PORTSDIR}/databases/rrdtool \
X nagios:${PORTSDIR}/net-mgmt/nagios
X
XOPTIONS= PDF "Use built-in fpdf library to produce PDF views" ON
X
XUSE_PHP= yes
XWANT_PHP_WEB= yes
XUSE_RC_SUBR= npcd.sh
X
XNAGIOSDIR?= /var/spool/nagios
XNAGIOSHTMURL?= /nagios
XNAGIOSUSER?= nagios
XNAGIOSGROUP?= nagios
XPNP_STATE= ${NAGIOSDIR}/pnp
XPNP_RRDS= ${PNP_STATE}/rrd
XPNP_SPOOL= ${PNP_STATE}/perfspool
XFPDF_DIR?= share/fpdf
X
X.if defined(WITH_PDF)
XUSE_PHP= zlib
X.else
XEXTRA_PATCHES+= ${FILESDIR}/extra-patch-share::pnp::include::function.inc.php
X.endif
X
XGNU_CONFIGURE= yes
XCONFIGURE_ARGS+= \
X --prefix=${LOCALBASE} \
X --datadir=${WWWDIR} \
X --localstatedir=/var/log \
X --with-rrdtool=${LOCALBASE}/bin/rrdtool \
X --with-perfdata-dir=${PNP_RRDS} \
X --with-perfdata-spool-dir=${PNP_SPOOL} \
X --with-nagios-user=${NAGIOSUSER} \
X --with-nagios-group=${NAGIOSGROUP}
X# Get rid of INSTALL_OPTS that are set by configure --
X# we want the things to be installed with root:wheel and
X# NAGIOSUSER:NAGIOSGROUP are going to the configuration files.
XMAKE_ARGS= INSTALL_OPTS=
XINSTALL_TARGET= install install-config
X
XSUB_FILES= pkg-install \
X pkg-deinstall \
X pkg-message
XSUB_LIST= PNP_STATE=${PNP_STATE} \
X PNP_RRDS=${PNP_RRDS} \
X PNP_SPOOL=${PNP_SPOOL} \
X NAGIOSUSER=${NAGIOSUSER} \
X NAGIOSGROUP=${NAGIOSGROUP}
X
X# All files in share/pnp/include/ are installed, so if we patched something
X# in that directory, we must clean the '.orig' files -- they shouldn't be
X# installed.
XPNP_CLEAN_PATCHED= share/pnp/include/function.inc.php.orig
X
X.if defined(WITH_PDF)
XPNP_USE_FPDF= 1
X.else
XPNP_USE_FPDF= 0
X.endif
Xpost-patch:
X @${REINPLACE_CMD} \
X -e's|^\$$conf\['\''use_fpdf'\''\] = [[:digit:]];|$$conf['\''use_fpdf'\''] = ${PNP_USE_FPDF};|' \
X -e's|^\$$conf\['\''nagios_base'\''\] = "/nagios/cgi-bin";|$$conf\['\''nagios_base'\''\] = "${NAGIOSHTMURL}/cgi-bin";|' \
X "${WRKSRC}/sample-config/pnp/config.php.in"
X.for pch in ${PNP_CLEAN_PATCHED}
X @${RM} -f "${WRKSRC}/${pch}"
X.endfor
X
Xpost-install:
X @PKG_PREFIX=${PREFIX} ${SH} ${PKGINSTALL} ${PKGNAME} POST-INSTALL
X @${CAT} ${PKGMESSAGE}
X
X.include <bsd.port.mk>
31cff5925a314125fad9b188d5d57e06
echo x - pnp/distinfo
sed 's/^X//' >pnp/distinfo << '5a090563e492b9585a46ec0b9d2dfd56'
XSIZE (pnp-0.4.10.tar.gz) = 301021
XMD5 (pnp-0.4.10.tar.gz) = 5e57d50e2d895878b626497fd7b217b7
XSHA256 (pnp-0.4.10.tar.gz) = 35392c83fc9468eba38187e17b773090dff923f7b74c86c3c11e2574b99c214d
5a090563e492b9585a46ec0b9d2dfd56
echo x - pnp/pkg-descr
sed 's/^X//' >pnp/pkg-descr << 'e006a2a9924ffd403fdb6b7dd0280af8'
XPNP is an addon to nagios which analyzes performance data provided
Xby plugins and stores them automatically into RRD-databases (Round
XRobin Databases, see RRD Tool).
X
XDuring development of PNP we set value on easy installation and
Xlittle maintenance while running it. An administrator should do
Xother things than configure graphing tools.
X
XWWW: http://www.pnp4nagios.org/pnp/start
e006a2a9924ffd403fdb6b7dd0280af8
echo x - pnp/pkg-plist
sed 's/^X//' >pnp/pkg-plist << '8f7c59efba9b7de4b19f46d0466003c4'
Xbin/npcd
Xetc/pnp/config.php-sample
Xetc/pnp/background.pdf-sample
Xetc/pnp/check_commands/check_nwstat.cfg-sample
Xetc/pnp/pages/web_traffic.cfg-sample
Xetc/pnp/process_perfdata.cfg-sample
Xetc/pnp/rra.cfg-sample
Xetc/pnp/npcd.cfg-sample
Xlibexec/process_perfdata.pl
X%%WWWDIR%%/images/ack.png
X%%WWWDIR%%/images/calendar.png
X%%WWWDIR%%/images/critical.png
X%%WWWDIR%%/images/eps.png
X%%WWWDIR%%/images/int.gif
X%%WWWDIR%%/images/int2.gif
X%%WWWDIR%%/images/link.png
X%%WWWDIR%%/images/noack.png
X%%WWWDIR%%/images/notify.gif
X%%WWWDIR%%/images/ok.png
X%%WWWDIR%%/images/pages.png
X%%WWWDIR%%/images/pdf.png
X%%WWWDIR%%/images/pnp.png
X%%WWWDIR%%/images/recovery.png
X%%WWWDIR%%/images/rrdtool.png
X%%WWWDIR%%/images/svg.png
X%%WWWDIR%%/images/trends.gif
X%%WWWDIR%%/images/warning.png
X%%WWWDIR%%/images/xml.png
X%%WWWDIR%%/images/zoom.png
X%%WWWDIR%%/include/font/makefont/cp1250.map
X%%WWWDIR%%/include/font/makefont/cp1251.map
X%%WWWDIR%%/include/font/makefont/cp1252.map
X%%WWWDIR%%/include/font/makefont/cp1253.map
X%%WWWDIR%%/include/font/makefont/cp1254.map
X%%WWWDIR%%/include/font/makefont/cp1255.map
X%%WWWDIR%%/include/font/makefont/cp1257.map
X%%WWWDIR%%/include/font/makefont/cp1258.map
X%%WWWDIR%%/include/font/makefont/cp874.map
X%%WWWDIR%%/include/font/makefont/iso-8859-1.map
X%%WWWDIR%%/include/font/makefont/iso-8859-11.map
X%%WWWDIR%%/include/font/makefont/iso-8859-15.map
X%%WWWDIR%%/include/font/makefont/iso-8859-16.map
X%%WWWDIR%%/include/font/makefont/iso-8859-2.map
X%%WWWDIR%%/include/font/makefont/iso-8859-4.map
X%%WWWDIR%%/include/font/makefont/iso-8859-5.map
X%%WWWDIR%%/include/font/makefont/iso-8859-7.map
X%%WWWDIR%%/include/font/makefont/iso-8859-9.map
X%%WWWDIR%%/include/font/makefont/koi8-r.map
X%%WWWDIR%%/include/font/makefont/koi8-u.map
X%%WWWDIR%%/include/font/makefont/makefont.php
X%%WWWDIR%%/include/font/courier.php
X%%WWWDIR%%/include/font/helvetica.php
X%%WWWDIR%%/include/font/helveticab.php
X%%WWWDIR%%/include/font/helveticabi.php
X%%WWWDIR%%/include/font/helveticai.php
X%%WWWDIR%%/include/font/symbol.php
X%%WWWDIR%%/include/font/times.php
X%%WWWDIR%%/include/font/timesb.php
X%%WWWDIR%%/include/font/timesbi.php
X%%WWWDIR%%/include/font/timesi.php
X%%WWWDIR%%/include/font/zapfdingbats.php
X%%WWWDIR%%/include/js/builder.js
X%%WWWDIR%%/include/js/calendar-blue.css
X%%WWWDIR%%/include/js/calendar-de.js
X%%WWWDIR%%/include/js/calendar-en.js
X%%WWWDIR%%/include/js/calendar-setup.js
X%%WWWDIR%%/include/js/calendar.js
X%%WWWDIR%%/include/js/controls.js
X%%WWWDIR%%/include/js/dragdrop.js
X%%WWWDIR%%/include/js/effects.js
X%%WWWDIR%%/include/js/menuarrow.gif
X%%WWWDIR%%/include/js/overlib.js
X%%WWWDIR%%/include/js/overlib_shadow.js
X%%WWWDIR%%/include/js/prototype.js
X%%WWWDIR%%/include/js/scriptaculous.js
X%%WWWDIR%%/include/js/slider.js
X%%WWWDIR%%/include/js/unittest.js
X%%WWWDIR%%/include/js/zoom.js
X%%WWWDIR%%/include/debug.php
X%%WWWDIR%%/include/fpdf.php
X%%WWWDIR%%/include/fpdf_tpl.php
X%%WWWDIR%%/include/fpdi.php
X%%WWWDIR%%/include/fpdi_pdf_parser.php
X%%WWWDIR%%/include/function.inc.php
X%%WWWDIR%%/include/pdf_context.php
X%%WWWDIR%%/include/pdf_parser.php
X%%WWWDIR%%/include/site.php
X%%WWWDIR%%/include/style.css
X%%WWWDIR%%/include/wrapper_functions.php
X%%WWWDIR%%/lang/lang_de.php
X%%WWWDIR%%/lang/lang_en.php
X%%WWWDIR%%/lang/lang_fr.php
X%%WWWDIR%%/lang/lang_nl.php
X%%WWWDIR%%/lang/lang_se.php
X%%WWWDIR%%/templates.dist/check-host-alive.php
X%%WWWDIR%%/templates.dist/check_disk.php
X%%WWWDIR%%/templates.dist/check_dns.php
X%%WWWDIR%%/templates.dist/check_http.php
X%%WWWDIR%%/templates.dist/check_http_url.php
X%%WWWDIR%%/templates.dist/check_iftraffic_counter.php
X%%WWWDIR%%/templates.dist/check_iftraffic_pct.php
X%%WWWDIR%%/templates.dist/check_load.php
X%%WWWDIR%%/templates.dist/check_messpc_temp.php
X%%WWWDIR%%/templates.dist/check_multi.php
X%%WWWDIR%%/templates.dist/check_nt_cpu.php
X%%WWWDIR%%/templates.dist/check_nt_disk.php
X%%WWWDIR%%/templates.dist/check_nt_mem.php
X%%WWWDIR%%/templates.dist/check_nwstat_CONNS.php
X%%WWWDIR%%/templates.dist/check_nwstat_LOAD.php
X%%WWWDIR%%/templates.dist/check_nwstat_LOAD1.php
X%%WWWDIR%%/templates.dist/check_ping.php
X%%WWWDIR%%/templates.dist/check_nwstat_LOAD15.php
X%%WWWDIR%%/templates.dist/check_nwstat_LOAD5.php
X%%WWWDIR%%/templates.dist/check_nwstat_ofiles.php
X%%WWWDIR%%/templates.dist/check_smtp.php
X%%WWWDIR%%/templates.dist/check_snmp_int-bits.php
X%%WWWDIR%%/templates.dist/check_snmp_int.php
X%%WWWDIR%%/templates.dist/check_swap.php
X%%WWWDIR%%/templates.dist/check_tcp.php
X%%WWWDIR%%/templates.dist/check_users.php
X%%WWWDIR%%/templates.dist/default.php
X%%WWWDIR%%/templates.dist/response.php
X%%WWWDIR%%/ajax.php
X%%WWWDIR%%/index.php
X%%WWWDIR%%/zoom.php
X
X at dirrmtry %%WWWDIR%%/templates.dist
X at dirrmtry %%WWWDIR%%/templates
X at dirrmtry %%WWWDIR%%/lang
X at dirrmtry %%WWWDIR%%/include/js
X at dirrmtry %%WWWDIR%%/include/font/makefont
X at dirrmtry %%WWWDIR%%/include/font
X at dirrmtry %%WWWDIR%%/include
X at dirrmtry %%WWWDIR%%/images
X at dirrmtry %%WWWDIR%%
X at dirrmtry etc/pnp/pages
X at dirrmtry etc/pnp/check_commands
X at dirrmtry etc/pnp
8f7c59efba9b7de4b19f46d0466003c4
echo c - pnp/files
mkdir -p pnp/files > /dev/null 2>&1
echo x - pnp/files/npcd.sh.in
sed 's/^X//' >pnp/files/npcd.sh.in << '5d2a96cba685a5e8e44649bfd55d0a95'
X#!/bin/sh
X#
X# $FreeBSD$
X#
X
X# PROVIDE: npcd
X# REQUIRE: DAEMON
X# BEFORE: LOGIN
X# KEYWORD: shutdown
X
X#
X# Add the following lines to /etc/rc.conf to enable/tune npcd:
X# npcd_enable (bool): Set to "NO" by default.
X# Set it to "YES" to enable npcd.
X# npcd_flags (str): Set to "" by default.
X# npcd_configfile (str): Set to "%%PREFIX%%/etc/pnp/npcd.cfg" by default.
X#
X
X. %%RC_SUBR%%
X
Xname="npcd"
Xrcvar=`set_rcvar`
X
Xcommand="%%PREFIX%%/bin/npcd"
Xcommand_args="-d"
Xpidfile=/var/run/${name}.pid
X
X: ${npcd_enable="NO"}
X: ${npcd_flags=""}
X: ${npcd_configfile:="%%PREFIX%%/etc/pnp/npcd.cfg"}
X
Xload_rc_config "${name}"
X
Xrequired_files="${npcd_configfile}"
Xcommand_args="${command_args} -f ${npcd_configfile}"
X
Xrun_rc_command "$1"
5d2a96cba685a5e8e44649bfd55d0a95
echo x - pnp/files/patch-sample-config::Makefile.in
sed 's/^X//' >pnp/files/patch-sample-config::Makefile.in << 'a879e28424ef284031f21cbff10fc9c4'
X--- sample-config/Makefile.in.orig 2008-08-16 23:03:08.000000000 +0400
X+++ sample-config/Makefile.in 2008-08-16 23:04:53.000000000 +0400
X@@ -28,22 +28,18 @@
X devclean: distclean
X
X install:
X- -rm -f $(HTMLDIR)/conf/config.php
X-
X $(INSTALL) -m 775 $(INSTALL_OPTS) -d $(DESTDIR)$(CFGDIR)
X $(INSTALL) -m 775 $(INSTALL_OPTS) -d $(DESTDIR)$(CFGDIR)/check_commands
X $(INSTALL) -m 775 $(INSTALL_OPTS) -d $(DESTDIR)$(CFGDIR)/pages
X- $(INSTALL) -m 664 $(INSTALL_OPTS) pnp/config.php $(DESTDIR)$(CFGDIR)
X- $(INSTALL) -m 664 $(INSTALL_OPTS) pnp/background.pdf $(DESTDIR)$(CFGDIR)
X+ $(INSTALL) -m 664 $(INSTALL_OPTS) pnp/config.php $(DESTDIR)$(CFGDIR)/config.php-sample
X+ $(INSTALL) -m 664 $(INSTALL_OPTS) pnp/background.pdf $(DESTDIR)$(CFGDIR)/background.pdf-sample
X
X install-config:
X- -rm -f $(DESTDIR)$(HTMLDIR)/conf/config.php
X-
X $(INSTALL) -m 775 $(INSTALL_OPTS) -d $(DESTDIR)$(CFGDIR)
X $(INSTALL) -m 775 $(INSTALL_OPTS) -d $(DESTDIR)$(CFGDIR)/check_commands
X $(INSTALL) -m 775 $(INSTALL_OPTS) -d $(DESTDIR)$(CFGDIR)/pages
X
X- $(INSTALL) -m 664 $(INSTALL_OPTS) pnp/config.php $(DESTDIR)$(CFGDIR)
X+ $(INSTALL) -m 664 $(INSTALL_OPTS) pnp/config.php $(DESTDIR)$(CFGDIR)/config.php-sample
X $(INSTALL) -m 664 $(INSTALL_OPTS) pnp/process_perfdata.cfg-sample $(DESTDIR)$(CFGDIR)
X $(INSTALL) -m 664 $(INSTALL_OPTS) pnp/rra.cfg-sample $(DESTDIR)$(CFGDIR)
X $(INSTALL) -m 664 $(INSTALL_OPTS) pnp/check_commands/check_nwstat.cfg-sample $(DESTDIR)$(CFGDIR)/check_commands
a879e28424ef284031f21cbff10fc9c4
echo x - pnp/files/extra-patch-share::pnp::include::function.inc.php
sed 's/^X//' >pnp/files/extra-patch-share::pnp::include::function.inc.php << '774300dfc069a5f2168354efaae7c7e5'
X--- share/pnp/include/function.inc.php.orig 2008-06-18 12:02:41.000000000 +0400
X+++ share/pnp/include/function.inc.php 2008-08-16 23:35:30.000000000 +0400
X@@ -819,114 +819,15 @@
X }
X
X function doPDF($display,$data) {
X- require ('fpdi.php');
X- global $NAGIOS;
X- global $conf;
X- if(file_exists($conf['background_pdf'])){
X- $use_bg=1;
X- }
X- class PDF extends FPDI {
X- //Page header
X- function Header() {
X- //Arial bold 10
X- $this->SetFont('Arial', 'B', 10);
X- //Move to the right
X- $this->Cell(80);
X- //Title
X- $this->Cell(30, 10, _PDFTITLE, 0, 1, 'C');
X- //Line break
X- #$this->Ln(20);
X- }
X-
X- //Page footer
X- function Footer() {
X- //Position at 1.5 cm from bottom
X- $this->SetY(-20);
X- //Arial italic 8
X- $this->SetFont('Arial', 'I', 8);
X- //Page number
X- $this->Cell(0, 10, _PDFPAGE . $this->PageNo() . '/{nb}', 0, 0, 'C');
X- }
X- }
X-
X- $pdf =& new PDF('P', 'mm', 'A4');
X- $pdf->AliasNbPages();
X- $pdf->SetAutoPageBreak('off');
X- $pdf->SetMargins(12.5,25,10);
X- $pdf->AddPage();
X- if($use_bg){
X- $pdf->setSourceFile($conf['background_pdf']);
X- $tplIdx = $pdf->importPage(1,'/MediaBox');
X- $pdf->useTemplate($tplIdx);
X- }
X- $pdf->SetCreator('Created with PNP');
X- $pdf->SetAuthor($_PHP['REMOTE_USER']);
X- $pdf->SetFont('Arial', '', 10);
X- $pdf->Cell(120, 4, '', 0, 1, 'L');
X- if($display == "service"){
X- foreach($data as $d) {
X- if ($pdf->GetY() > 220) {
X- $pdf->AddPage();
X- if($use_bg){$pdf->useTemplate($tplIdx);}
X- }
X-
X- $pdf->SetFont('Arial', '', 10);
X- $pdf->CELL(120, 5, $d["n_hostname"]." / ".$d["n_servicedesc"] , 0, 1);
X- $pdf->SetFont('Arial', '', 8);
X- $pdf->CELL(120, 5, $d["view_title"]. " (" . $d["f_start"]." - ".$d["f_end"].")", 0, 1);
X-
X- $img = saveImage($d['rrd_opts']);
X- $Y = $pdf->GetY();
X- $cell_height = ($img['height'] * 0.23);
X- $cell_width = ($img['width'] * 0.23);
X- $pdf->Image($img['name'], 12.5, $Y, $cell_width, $cell_height, 'PNG');
X- $pdf->CELL(120, $cell_height, '', 0, 1);
X- unlink($img['name']);
X- }
X- }
X- if($display == "page"){
X- foreach($data as $d) {
X- if ($pdf->GetY() > 220) {
X- $pdf->AddPage();
X- if($use_bg){$pdf->useTemplate($tplIdx);}
X- }
X-
X- $pdf->SetFont('Arial', '', 10);
X- $pdf->CELL(120, 5, $d["hostname"]." / ".$d["servicedesc"] , 0, 1);
X- $pdf->SetFont('Arial', '', 8);
X- $pdf->CELL(120, 5, $d["f_start"]." - ".$d["f_end"], 0, 1);
X-
X- $img = saveImage($d['rrd_opts']);
X- $Y = $pdf->GetY();
X- $cell_height = ($img['height'] * 0.23);
X- $cell_width = ($img['width'] * 0.23);
X- $pdf->Image($img['name'], 12.5, $Y, $cell_width, $cell_height, 'PNG');
X- $pdf->CELL(120, $cell_height, '', 0, 1);
X- unlink($img['name']);
X- }
X- }
X- if($display == "host_list"){
X- foreach($data as $d) {
X- if ($pdf->GetY() > 220) {
X- $pdf->AddPage();
X- if($use_bg){$pdf->useTemplate($tplIdx);}
X- }
X- $pdf->SetFont('Arial', '', 10);
X- $pdf->CELL(120, 7, $d["hostname"]." / ".$d["servicedesc"] , 0, 1);
X- $pdf->SetFont('Arial', '', 8);
X- $pdf->CELL(120, 5, $d["f_start"]." - ".$d["f_end"], 0, 1);
X-
X- $img = saveImage($d['rrd_opts']);
X- $Y = $pdf->GetY();
X- $cell_height = ($img['height'] * 0.23);
X- $cell_width = ($img['width'] * 0.23);
X- $pdf->Image($img['name'], 12.5, $Y, $cell_width, $cell_height, 'PNG');
X- $pdf->CELL(120, $cell_height, '', 0, 1);
X- unlink($img['name']);
X- }
X- }
X-
X- $pdf->Output();
X+ print "<html>\n";
X+ print "<head>\n";
X+ print "<title>Failed</title>\n";
X+ print "</head>\n";
X+ print "<body>\n";
X+ print "<h1>Failed</h1>\n";
X+ print "</body>\n";
X+ print "<html>\n";
X+ exit(0);
X }
X
X function doStrip($string) {
X@@ -1173,23 +1074,6 @@
X }
X
X function doPDFIcon($type){
X- global $hostname;
X- global $servicedesc;
X- global $start;
X- global $end;
X- global $source;
X- global $view;
X- global $display;
X- global $page;
X-
X- switch($type){
X- case "PAGE":
X- print "<a href=\"index.php?page=$page&display=$display&view=$view&do=pdf\"><img src=\"images/pdf.png\" HEIGHT=\"32px\" WIDTH=\"32px\" title=\"Display PDF\" ></a>\n";
X- break;
X- default:
X- print "<a href=\"index.php?host=$hostname&srv=$servicedesc&display=$display&view=$view&source=$source&end=$end&start=$start&do=pdf\"><img src=\"images/pdf.png\" HEIGHT=\"32px\" WIDTH=\"32px\" title=\"Display PDF\" ></a>\n";
X- break;
X- }
X }
X
X function doXMLIcon(){
774300dfc069a5f2168354efaae7c7e5
echo x - pnp/files/pkg-install.in
sed 's/^X//' >pnp/files/pkg-install.in << '44d805bc6a6a8b765a0cb158ca92f670'
X#!/bin/sh
X#
X# $FreeBSD$
X#
X
XPNP_RRDS=%%PNP_RRDS%%
XPNP_SPOOL=%%PNP_SPOOL%%
XNAGIOSUSER=%%NAGIOSUSER%%
XNAGIOSGROUP=%%NAGIOSGROUP%%
X
Xdirs () {
X for i in "$PNP_RRDS" "$PNP_SPOOL"; do
X if ! [ -d "$i" ]; then
X mkdir -p "$i"
X chmod 750 "$i"
X chown "$NAGIOSUSER":"$NAGIOSGROUP" "$i"
X fi
X done
X}
X
Xcheck_sanity () {
X if ! pw group show "$NAGIOSGROUP" 2>&1 > /dev/null; then
X echo "No group '$NAGIOSGROUP'. Create it and try again."
X exit 1
X fi
X if ! pw user show "$NAGIOSUSER" 2>&1 > /dev/null; then
X echo "No user '$NAGIOSUSER'. Create it and try again."
X exit 1
X fi
X}
X
Xif [ "x$2" = "xPOST-INSTALL" ]; then
X check_sanity
X dirs
Xfi
44d805bc6a6a8b765a0cb158ca92f670
echo x - pnp/files/pkg-message.in
sed 's/^X//' >pnp/files/pkg-message.in << 'e001a9987dca98ebe1b3392e959836ce'
X========================================================================
X
XYou just installed/upgraded PNP graphing tool for Nagios.
X
XFor tool configuration tasks read
X http://www.pnp4nagios.org/pnp/config
X
XFor Web-frontend configuration tasks read
X http://www.pnp4nagios.org/pnp/webfe
X
XWe recommend to start with the following restrictive Apache
Xconfiguration for the PNP area:
X
X<Directory "%%WWWDIR%%/">
X Order deny,allow
X Allow from all
X Deny from all
X DirectoryIndex index.php
X AddHandler application/x-httpd-php .php
X</Directory>
X
X<Directory "%%WWWDIR%%/include/">
X Options None
X Order allow,deny
X Deny from all
X <FilesMatch ".css$">
X Order deny,allow
X Allow from all
X Deny from all
X </FilesMatch>
X</Directory>
X
X<Directory "%%WWWDIR%%/include/js/">
X Order deny,allow
X Allow from all
X Deny from all
X</Directory>
X<Directory "%%WWWDIR%%/lang/">
X Order allow,deny
X Deny from all
X</Directory>
X<Directory "%%WWWDIR%%/templates/">
X Order allow,deny
X Deny from all
X</Directory>
X<Directory "%%WWWDIR%%/templates.dist/">
X Order allow,deny
X Deny from all
X</Directory>
X
X
XRemember to restart NPCD service after upgrade if you're using
X'bulk' mode with NPCD.
X
X========================================================================
e001a9987dca98ebe1b3392e959836ce
echo x - pnp/files/pkg-deinstall.in
sed 's/^X//' >pnp/files/pkg-deinstall.in << 'e49446b59f2a6e4ce2e7180080d843c1'
X#!/bin/sh
X#
X# $FreeBSD$
X#
X
XPNP_RRDS=%%PNP_RRDS%%
XPNP_SPOOL=%%PNP_SPOOL%%
XPNP_STATE=%%PNP_STATE%%
XNAGIOSUSER=%%NAGIOSUSER%%
XNAGIOSGROUP=%%NAGIOSGROUP%%
X
Xdirs () {
X local notempty
X
X for i in "$PNP_RRDS" "$PNP_SPOOL" "$PNP_STATE"; do
X if ! rmdir "$i" > /dev/null 2>&1; then
X notempty="$notempty $i"
X fi
X done
X
X if [ -n "$notempty" ]; then
X echo
X echo "The following directories were not removed:"
X for i in $notempty; do
X echo " $i"
X done
X echo
X echo "Unless you're upgrading, remove them manually."
X echo
X fi
X}
X
Xif [ "x$2" = "xPOST-DEINSTALL" ]; then
X dirs
Xfi
e49446b59f2a6e4ce2e7180080d843c1
echo x - pnp/files/patch-scripts::Makefile.in
sed 's/^X//' >pnp/files/patch-scripts::Makefile.in << 'cdd9d4ce404ec07bf083719dc9e4ff65'
X--- scripts/Makefile.in.orig 2008-08-17 00:52:43.000000000 +0400
X+++ scripts/Makefile.in 2008-08-17 00:52:47.000000000 +0400
X@@ -37,7 +37,6 @@
X $(INSTALL) -m 774 $(INSTALL_OPTS) net2pnp.pl $(DESTDIR)$(BINDIR)
X
X install:
X- $(INSTALL) -m 775 $(INSTALL_OPTS) -d $(DESTDIR)$(PERFDATADIR)
X $(INSTALL) -m 775 $(INSTALL_OPTS) -d $(DESTDIR)$(LIBEXECDIR)
X $(MAKE) install-processperfdata
X
cdd9d4ce404ec07bf083719dc9e4ff65
exit
--- pnp.shar ends here ---
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the freebsd-ports-bugs
mailing list