X-Original-To: alpine-devel@lists.alpinelinux.org Delivered-To: alpine-devel@mail.alpinelinux.org Received: from mail-pz0-f46.google.com (mail-pz0-f46.google.com [209.85.210.46]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client certificate requested) by mail.alpinelinux.org (Postfix) with ESMTPS id B73FBDC00D8 for ; Sun, 13 Nov 2011 14:35:19 +0000 (UTC) Received: by pzk2 with SMTP id 2so9491800pzk.5 for ; Sun, 13 Nov 2011 06:35:18 -0800 (PST) X-Mailinglist: alpine-devel Precedence: list List-Id: Alpine Development List-Unsubscribe: List-Post: List-Help: List-Subscribe: MIME-Version: 1.0 Received: by 10.68.24.234 with SMTP id x10mr41365793pbf.97.1321194918323; Sun, 13 Nov 2011 06:35:18 -0800 (PST) Sender: peter@dezoeten.org Received: by 10.142.77.6 with HTTP; Sun, 13 Nov 2011 06:35:18 -0800 (PST) In-Reply-To: <1321198221-23509-1-git-send-email-peter@dezoeten.mine.nu> References: <1321198221-23509-1-git-send-email-peter@dezoeten.mine.nu> Date: Sun, 13 Nov 2011 15:35:18 +0100 X-Google-Sender-Auth: k7vue1qiIOdGfmx4G7q-V1I2t3o Message-ID: Subject: [alpine-devel] [PATCH] PNP4Nagios Nagios Graphing Utility From: Peter de Zoeten To: alpine-devel@lists.alpinelinux.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable more info: http://www.pnp4nagios.org Remember to look at /etc/pnp4nagios/npcd.cfg to set the correct paths And look at /etc/lighttpd/pnp4nagios.conf.sample --- =A0testing/pnp4nagios/APKBUILD | =A0 76 +++++++++++++++++ =A0testing/pnp4nagios/npcd =A0 =A0 | =A0 21 +++++ =A0testing/pnp4nagios/npcd.cfg | =A0195 +++++++++++++++++++++++++++++++++++= ++++++++ =A03 files changed, 292 insertions(+), 0 deletions(-) =A0create mode 100644 testing/pnp4nagios/APKBUILD =A0create mode 100644 testing/pnp4nagios/npcd =A0create mode 100644 testing/pnp4nagios/npcd.cfg diff --git a/testing/pnp4nagios/APKBUILD b/testing/pnp4nagios/APKBUILD new file mode 100644 index 0000000..49be7f7 --- /dev/null +++ b/testing/pnp4nagios/APKBUILD @@ -0,0 +1,76 @@ +# Contributor: Peter de Zoeten +# Maintainer: =A0Peter de Zoeten +pkgname=3Dpnp4nagios +pkgver=3D0.6.15 +pkgrel=3D0 +pkgdesc=3D"PNP4Nagios" +url=3D"http://www.pnp4nagios.org" +arch=3D"all" +license=3D"GPL" +depends=3D"nagios rrdtool perl-time-hires perl-rrd php-zlib libgcc" +depends_dev=3D"" +makedepends=3D"$depends_dev" +install=3D"" +subpackages=3D"$pkgname-doc" +source=3D"http://sourceforge.net/projects/pnp4nagios/files/PNP-0.6/pnp4nag= ios-$pkgver.tar.gz" + +_builddir=3D"$srcdir"/$pkgname-$pkgver +prepare() { + =A0 =A0 =A0 local i + =A0 =A0 =A0 cd "$_builddir" + =A0 =A0 =A0 for i in $source; do + =A0 =A0 =A0 =A0 =A0 =A0 =A0 case $i in + =A0 =A0 =A0 =A0 =A0 =A0 =A0 *.patch) msg $i; patch -p1 -i "$srcdir"/$i ||= return 1;; + =A0 =A0 =A0 =A0 =A0 =A0 =A0 esac + =A0 =A0 =A0 done +} + +build() { + =A0 =A0 =A0 cd "$_builddir" + =A0 =A0 =A0 ./configure --prefix=3D/usr/share/webapps/pnp4nagios \ + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 --exec-prefix=3D/usr \ + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 --libexecdir=3D/usr/lib/pnp4n= agios \ + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 --sysconfdir=3D/etc/pnp4nagio= s \ + =A0 =A0 =A0 =A0 =A0 =A0 =A0 --mandir=3D/usr/share/man \ + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 --infodir=3D/usr/share/info \ + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 --localstatedir=3D/var/run \ + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 --datarootdir=3D/usr/share/we= bapps/pnp4nagios \ + --with-perfdata-logfile=3D/var/pnp4nagios/perfdata/process_perfdata.pl \ + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 --with-perfdata-dir=3D/var/pn= p4nagios/perfdata \ + --with-perfdata-spool-dir=3D/var/pnp4nagios/perfdata/spool \ + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 || return 1 + =A0 =A0 =A0 make all || return 1 +} +doc() { + =A0 =A0 =A0 =A0arch=3D"noarch" + =A0 =A0 =A0 =A0# Man pages + =A0 =A0 =A0 =A0mkdir -p "$subpkgdir"/usr/share/man || return 1 + =A0 =A0 =A0 =A0mv "$pkgdir"/usr/share/webapps/pnp4nagios/man/man* "$subpkgdir"/usr/share/man/ \ + =A0 =A0 =A0 =A0|| return 1 + + =A0 =A0 =A0 =A0# Doc files + =A0 =A0 =A0 =A0_docs=3D"INSTALL README" + =A0 =A0 =A0 =A0for _doc in $_docs; do + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0install -Dm644 "$srcdir"/$pkgname-$pkgver/= $_doc \ + =A0 =A0 =A0 =A0 =A0 =A0 =A0 "$subpkgdir"/usr/share/doc/$pkgname/$_doc || = return 1 + =A0 =A0 =A0 =A0done + =A0 =A0 =A0 rmdir "$pkgdir"/usr/share/webapps/pnp4nagios/man +} + +package() { + =A0 =A0 =A0 cd "$_builddir" + =A0 =A0 =A0 make fullinstall DESTDIR=3D"$pkgdir" || return 1 + =A0 =A0 =A0 mkdir -p "$pkgdir"/usr/share/nagios/htdocs/ssi + =A0 =A0 =A0 rm -f "$pkgdir"/usr/lib/*.la + =A0 =A0 =A0 cp "$_builddir"/contrib/ssi/status-header.ssi "$pkgdir"/usr/share/nagios/htdocs/ssi/status-header.ssi +# =A0 =A0 =A0 rm -rf "$pkgdir"/etc/httpd + =A0 =A0 =A0 mkdir -p "$pkgdir"/etc/lighttpd + =A0 =A0 =A0 cp "$_builddir"/sample-config/lighttpd.pnp4nagios.conf "$pkgdir"/etc/lighttpd/pnp4nagios.conf.sample + =A0 =A0 =A0 install -D -m644 ../../npcd.cfg "$pkgdir"/etc/pnp4nagios/npcd= .cfg + =A0 =A0 =A0 rm -f "$pkgdir"/etc/init.d/npcd + =A0 =A0 =A0 install -D -m755 ../../npcd "$pkgdir"/etc/init.d/npcd + =A0 =A0 =A0 chown nagios.nagios "$pkgdir"/var/pnp4nagios +} + + +md5sums=3D"27cdab96510e15cfa0f4b7c2bf15dd2b =A0pnp4nagios-0.6.15.tar.gz" diff --git a/testing/pnp4nagios/npcd b/testing/pnp4nagios/npcd new file mode 100644 index 0000000..2b17bea --- /dev/null +++ b/testing/pnp4nagios/npcd @@ -0,0 +1,21 @@ +#!/sbin/runscript + +depend() { + =A0 =A0 =A0 =A0use net + =A0 =A0 =A0 =A0need dbus + =A0 =A0 =A0 =A0before nfs + =A0 =A0 =A0 =A0after logger + =A0 =A0 =A0 } + +start() { + =A0 =A0 =A0 =A0ebegin "Starting npcd" + =A0 =A0 =A0 =A0start-stop-daemon --start --quiet --exec /usr/bin/npcd -- = -d -f /etc/pnp4nagios/npcd.cfg + =A0 =A0 =A0 =A0eend $? + =A0 =A0 =A0 } + +stop() { + =A0 =A0 =A0 ebegin "Stopping npcd" + =A0 =A0 =A0 start-stop-daemon --stop --quiet --exec /usr/bin/npcd + =A0 =A0 =A0 eend $? + =A0 =A0 =A0 } + diff --git a/testing/pnp4nagios/npcd.cfg b/testing/pnp4nagios/npcd.cfg new file mode 100644 index 0000000..43bf144 --- /dev/null +++ b/testing/pnp4nagios/npcd.cfg @@ -0,0 +1,195 @@ +# NPCD.cfg - sample configuration file for PNPs NPCD +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License version 2 as +# published by the Free Software Foundation; +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA =A002110-1301 = =A0USA + +# Privilege Options + +user =3D nagios +group =3D nagios + +######################### +# =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0# +# Logging Options =A0 =A0 =A0# +# =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0# +######################### + +# log_type - define if you want your logs to +# 'syslog' or to a 'file' +# +# log_type =3D +# + +log_type =3D file +#log_type =3D syslog + + +# log_file - define a path to your logfile +# needed if 'log_type'=3D'file' +# +# log_file =3D +# + +log_file =3D /var/pnp4nagios/npcd.log + + +# max_logfile_size - defines the maximum filesize (bytes) +# before the logfile will rotated. +# +# max_logfile_size =3D (default 10Mbyte) +# + +max_logfile_size =3D 10485760 + + +# log_level - how much should we log? +# +# log_level =3D +# +# =A00 =3D No logging - except errors +# =A01 =3D Small logging - some few more output +# =A02 =3D More Logging (actual ALL logs) +# -1 =3D DEBUG Mode - ALL Logging and slower processing +# + +log_level =3D 0 + +######################### +# =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0# +# NEEDED OPTIONS =A0 =A0 =A0 # +# =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0# +######################### + +# perfdata_spool_dir - where we can find the +# performance data files +# +# perfdata_spool_dir =3D +# + +perfdata_spool_dir =3D /var/pnp4nagios/perfdata/spool/ + + +# Execute following command for each found file +# in 'perfdata_spool_dir' +# +# perfdata_file_run_cmd =3D +# +# Must be executable by user/group from above +# +# perfdata_file_run_cmd =3D +# + +perfdata_file_run_cmd =3D /usr/lib/pnp4nagios/process_perfdata.pl + + +# perfdata_file_run_cmd_args (optional) +# +# If you wish, you can apply more arguments to the +# perfdata_file_run_cmd +# +# Hint: +# NPCD will create a command line like this: +# ' ' +# + +perfdata_file_run_cmd_args =3D -b + + +# identify_npcd (optional) +# +# If set to one (by default) npcd will append +# '-n' to the perfdata_file_run_cmd +# +# identify_npcd =3D 0|1 (default: 1) + +identify_npcd =3D 1 + + +# npcd_max_threads - define how many parallel threads we +# should start + +npcd_max_threads =3D 5 + +# sleep_time - how many seconds npcd should wait between dirscans +# +# sleep_time =3D 15 (default) + +sleep_time =3D 15 + + +# EXPERIMENTAL +# +# load_threshold - npcd won't start new threads +# if your system load is above this threshold +# +# load_threshold =3D (default: 0.0) +# +# Hint: Do not use "," as decimal delimiter +# +# 07/15/2008: Every value above 0.0 will +# =A0 =A0 =A0 =A0 =A0 =A0 enable this feature + +load_threshold =3D 0.0 + + +# location of your pid file + +pid_file=3D/var/run/npcd.pid + + +######################### +# =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 # +# NPCDMOD OPTIONS =A0 =A0 =A0 # +# =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 # +######################### + + +# perfdata_file - where should the npcdmod.o +# write the performance data +# +# must not be within the same directory as +# perfdata_spool_dir +# +# perfdata_file =3D +# + +perfdata_file =3D /var/pnp4nagios/perfdata.dump + + +# perfdata_spool_filename - declare the destination +# filename for the spooled files +# +# This option allows you a customized filename. +# Usefull if you own different nagios servers +# which write their data to a shared storage. +# +# perfdata_spool_filename =3D +# +# Hint: +# The final files will be moved to +# =A0'perfdata_spool_dir/perfdata_spool_filename-TIMESTAMP' +# +# Example: +# +# perfdata_spool_filename =3D perfdata-NY +# perfdata_spool_filename =3D perfdata-LA + +perfdata_spool_filename =3D perfdata + +# +# perfdata_file_processing_interval +# +perfdata_file_processing_interval =3D 15 + +# We have to end with a newline + -- 1.7.7.2 --- Unsubscribe: alpine-devel+unsubscribe@lists.alpinelinux.org Help: alpine-devel+help@lists.alpinelinux.org ---