From 4dc9b98150ef254b8f0ea339aa8bebdbb9fc6283 Mon Sep 17 00:00:00 2001 From: Parag Nemade Date: Jul 30 2016 09:07:28 +0000 Subject: Retire packages without systemd support, See FESCo ticket 1605 --- diff --git a/.gitignore b/.gitignore deleted file mode 100644 index a756e10..0000000 --- a/.gitignore +++ /dev/null @@ -1,9 +0,0 @@ -pnp-0.4.14.tar.gz -/pnp4nagios-0.6.1.tar.gz -/pnp4nagios-0.6.15.tar.gz -/pnp4nagios-0.6.16.tar.gz -/pnp4nagios-0.6.19.tar.gz -/pnp4nagios-0.6.20.tar.gz -/pnp4nagios-0.6.21.tar.gz -/pnp4nagios-0.6.22.tar.gz -/pnp4nagios-0.6.25.tar.gz diff --git a/dead.package b/dead.package new file mode 100644 index 0000000..1186b4b --- /dev/null +++ b/dead.package @@ -0,0 +1 @@ +Retire packages without systemd support, See FESCo ticket 1605 diff --git a/pnp4nagios-0.4.14-change_broker_install_location.patch b/pnp4nagios-0.4.14-change_broker_install_location.patch deleted file mode 100644 index f3b59a2..0000000 --- a/pnp4nagios-0.4.14-change_broker_install_location.patch +++ /dev/null @@ -1,31 +0,0 @@ ---- src/Makefile.in.orig 2009-05-02 11:25:23.000000000 +0200 -+++ src/Makefile.in 2009-08-27 20:57:47.000000000 +0200 -@@ -33,6 +33,7 @@ - LOGDIR=@localstatedir@ - CFGDIR=@sysconfdir@ - BINDIR=@bindir@ -+LIBDIR=@libdir@ - LIBEXECDIR=@libexecdir@ - CGIDIR=@sbindir@ - INSTALL=@INSTALL@ -@@ -115,17 +116,17 @@ - - install: - $(MAKE) install-basic -- $(MAKE) strip-post-install - - install-unstripped: - $(MAKE) install-basic - - install-basic: - $(INSTALL) -m 755 $(INSTALL_OPTS) -d $(DESTDIR)$(BINDIR) -+ $(INSTALL) -m 755 $(INSTALL_OPTS) -d $(DESTDIR)$(LIBDIR)/nagios/brokers - $(INSTALL) -m 755 $(INSTALL_OPTS) -d $(DESTDIR)$(PERFDATA_SPOOL_DIR) - $(INSTALL) -m 754 $(INSTALL_OPTS) @npcd_name@ $(DESTDIR)$(BINDIR) -- $(INSTALL) -m 754 $(INSTALL_OPTS) npcdmod.o $(DESTDIR)$(BINDIR) -+ $(INSTALL) -m 754 $(INSTALL_OPTS) npcdmod.o $(DESTDIR)$(LIBDIR)/nagios/brokers - - strip-post-install: - $(STRIP) $(DESTDIR)$(BINDIR)/@npcd_name@ -- $(STRIP) $(DESTDIR)$(BINDIR)/npcdmod.o -+ $(STRIP) $(DESTDIR)$(LIBDIR)/nagios/brokers/npcdmod.o diff --git a/pnp4nagios-0.4.14-verify_pnp_config.in_rev654.patch b/pnp4nagios-0.4.14-verify_pnp_config.in_rev654.patch deleted file mode 100644 index 28c2913..0000000 --- a/pnp4nagios-0.4.14-verify_pnp_config.in_rev654.patch +++ /dev/null @@ -1,901 +0,0 @@ ---- trunk/contrib/verify_pnp_config.in 2009/05/02 09:17:40 632 -+++ trunk/contrib/verify_pnp_config.in 2009/08/26 22:12:22 654 -@@ -1,7 +1,9 @@ --#!@PERL@ -w -+#!/usr/bin/perl -w - # - # (C) 2008-2009 pnp4nagios.org / Wolfgang Nieder - # -+# $Id$ -+# - # check Nagios/PNP integration settings - # 2008.09.21: 0.1 initial version - # 2008.09.23: 0.1.1 precheck / logfile -@@ -16,24 +18,39 @@ - # 2009.02.23: 0.1.10 check perfdata directory / bugfixes - # 2009.03.06: 0.1.11 check for multiple entries / bugfixes - # 2009.04.21: 0.1.12 check for Time::HiRes -+# 2009.07.08: 0.1.13 Icinga support / bugfix (templates) -+# 2009.08.05: 0.1.14 bugfixes (Icinga support / non-standard paths) -+# 2009.08.11: 0.1.15 changed Doc-paths -+# 2009.08.18: 0.1.16 added layout option / package detection - - use strict; - use Getopt::Long; - use File::Find; - --my $program = "Check Nagios/PNP integration"; --my $version = "0.1.12"; -+my $program = "Check Nagios/Icinga/PNP integration"; -+my $version = "0.1.16"; - my $help = 0; - my $debug = 0; - my $quiet = 0; -+my $time = 0; - my $wc = 0; - my $err = 0; -+my $warn = 0; -+my $crit = 0; -+my $product = lc("nagios"); -+my $pnp_version = '@PKG_VERSION@'; -+my $install_opts = '@INSTALL_OPTS@'; -+my $doc_version = '0.4'; -+# -+# please remove the hash sign (#) on the following line if you're using Icinga -+# or specify "-M icinga" -+# $product = lc("icinga"); -+my $prod_name = ucfirst($product); - my $basedir = '@prefix@'; --$basedir = "/usr/local/nagios" unless (-d "$basedir"); --my $NagiosBase = $basedir if (-d "$basedir"); --my $NagiosBin = "nagios" if (-f "$basedir/bin/nagios"); -+my $NagiosBase = ""; -+my $NagiosBin = "$product" if (-f "$basedir/bin/$product"); - my $mode = ""; --my $NagiosCfg = "$NagiosBase/etc/nagios.cfg" if (-f "$NagiosBase/etc/nagios.cfg"); -+my $NagiosCfg = ""; - my %NagiosCfg = (); - my $rrdtool = '@RRDTOOL@'; - $rrdtool = "/usr/bin/rrdtool" unless ((-f "$rrdtool") and (-x "$rrdtool")); -@@ -46,6 +63,8 @@ - my %PPcfg = (); - my $CPcfg = ""; # config.php - my %CPcfg = (); -+my $RFcfg = ""; # resource.cfg -+my %RFcfg = (); - my $nFile = ""; - my @CfgFiles = (); - my %commands = (); -@@ -60,10 +79,12 @@ - my $gid = ""; - my $user = ""; - my $group = ""; --my $language = ""; -+my $layout = ""; -+my $pkg_mgr = ""; -+my $language = "en"; - my $english = ""; - if (exists $ENV{LANG}) { -- $language = "/de" if ($ENV{LANG} =~ /de/i); -+ $language = "de" if ($ENV{LANG} =~ /de/i); - } - my %msg = (); - -@@ -83,16 +104,25 @@ - "q|quiet" => \$quiet, - "r|rrdtool=s" => \$rrdtool, - "R|RRDpath=s" => \$RRDpath, -+ "U|resource=s" => \$RFcfg, - "u|user=s" => \$user, - "g|group=s" => \$group, - "l|logfile=s" => \$LogFile, - "o|object=s" => \$Object, -+ "M|monitor=s" => \$product, -+ "L|layout=s" => \$layout, -+ "t|time" => \$time, - ); - -+if ($pnp_version =~ /^(\d+\.\d+)/) { -+ $doc_version = "$1"; -+} -+$product = lc($product); -+$prod_name = ucfirst($product); - info ("\n\n$program, v$version\n"); - if ($english) { - info ("[I] option -e"); -- $language = ""; -+ $language = "en"; - } - message(); - -@@ -115,7 +145,62 @@ - info ("info","OS","$line"); - } - info ("info","Perl","$]"); -+if ($mode) { -+ $pkg_mgr = eval "`whereis yum`"; -+ if ($pkg_mgr =~/:\s+$/) { -+ $pkg_mgr = eval "`whereis dpkg`"; -+ if ($pkg_mgr =~/:\s+$/) { -+ $pkg_mgr = eval "`whereis rpm`"; -+ } -+ } -+ ($pkg_mgr) = $pkg_mgr =~ /:\s*(\S+)/; -+ if ($pkg_mgr) { -+ info ("info","Package Manager","$pkg_mgr"); -+ chk_pkg ("nagios",0,1); -+ chk_pkg ("icinga",0,1); -+ chk_pkg ("pnp4nagios",0,1); -+ chk_pkg ("mod-php5,mod_php5",1,0); -+ chk_pkg ("php,php5",1,1); -+ chk_pkg ("dejavu",1,0); -+ if ($crit) { -+ info ("LinkReqSW"); -+ exit 30; -+ } -+ } -+ info ("install_opts","$install_opts") unless ($install_opts =~ /\@INSTALL_OPTS\@/i); -+ info ("PNP-version","$pnp_version") unless ($pnp_version =~ /\@PKG_VERSION\@/i); -+} -+ -+if ($layout) { -+ info ("info","Layout","$layout"); -+ if ($layout =~ /fedora/i) { -+ $basedir = "/usr/share" unless ($NagiosBase); -+ $NagiosCfg = "/etc/nagios/nagios.cfg" unless ($NagiosCfg); -+ $NagiosBin = "/usr/sbin/nagios" unless ($NagiosBin); -+ $RRDpath = "/var/lib/pnp4nagios" unless ($RRDpath); -+ } -+ elsif ($layout =~ /suse/i) { -+ $basedir = "/usr/share" unless ($NagiosBase); -+ $NagiosCfg = "/etc/nagios/nagios.cfg" unless ($NagiosCfg); -+ $NagiosBin = "/usr/sbin/nagios" unless ($NagiosBin); -+ $RRDpath = "/var/spool/nagios-pnp" unless ($RRDpath); -+ } -+ elsif ($layout =~ /nagios2/i) { -+ $basedir = "/etc/nagios2" unless ($NagiosBase); -+ $NagiosCfg = "/etc/nagios2/nagios.cfg" unless ($NagiosCfg); -+ $NagiosBin = "/usr/sbin/nagios2" unless ($NagiosBin); -+ } -+ elsif ($layout =~ /nagios3/i) { -+ $basedir = "/etc/nagios3" unless ($NagiosBase); -+ $NagiosCfg = "/etc/nagios3/nagios.cfg" unless ($NagiosCfg); -+ $NagiosBin = "/usr/sbin/nagios3" unless ($NagiosBin); -+ } else { -+ info ("invOption","$layout"); -+ } -+} - -+$basedir = "/usr/local/$product" if ($basedir =~ /^\@prefix\@$/); -+$NagiosBase = $basedir unless ($NagiosBase); - if (! defined($NagiosBase)) { - info ("noBase"); - exit 3 -@@ -125,27 +210,45 @@ - exit 3 - } - info ("useBase", "$NagiosBase"); -+$NagiosCfg = "$NagiosBase/etc/$product.cfg" unless ($NagiosCfg); - if (! defined($NagiosCfg)) { -- info ("noCfg"); -- exit 4 -+ if (-f "$NagiosBase/etc/$product.cfg") { -+ $NagiosCfg = "$NagiosBase/etc/$product.cfg"; -+ } else { -+ info ("noCfg"); -+ exit 4 -+ } - } - if (! -f "$NagiosCfg") { - info ("noCfgFile","$NagiosCfg"); - exit 5 - } - info ("useCfg","$NagiosCfg"); -+if (! defined($NagiosBin)) { -+ if (-f "$NagiosBase/bin/$product") { -+ $NagiosBin = "$NagiosBase/bin/$product"; -+ } else { -+ info ("noBinary", "$product") && exit 6; -+ } -+} - if ($NagiosBin !~ /^\//) { - $NagiosBin = "$NagiosBase/bin/$NagiosBin"; - } --examine ("x;", "Nagios-Binary", "$NagiosBin") && exit 6; -+examine ("x;", "${prod_name}-Binary", "$NagiosBin") && exit 6; - info ("useBinary","$NagiosBin"); - - if ($mode) { -- if ($mode !~ /^default$|^Bulk$|^NPCD$/i) { -+ if ($mode !~ /^default$|^sync$|^Bulk$|^NPCD$/i) { - info ("invPNPmode"); - info ("LinkPNPconfig"); - exit 7 - } -+ if ($mode =~ /^default$/) { -+ $mode = "sync"; -+ if (($pnp_version =~ /^(\d+\.\d+)/) and ($1 >= 0.6)) { -+ $mode = "NPCD"; -+ } -+ } - info ("PNPmode","$mode"); - } - if (($LogFile ne "") and (! -f $LogFile)) { -@@ -156,10 +259,10 @@ - info ("useLog","$LogFile") if ($LogFile); - - # get Nagios version --my $NagiosVer = `$NagiosBin -V | grep "Nagios "`; -+my $NagiosVer = `$NagiosBin -V | grep "$prod_name " | head -1`; - chomp $NagiosVer; --info ("[I] Nagios info: $NagiosVer"); --($NagiosVer) = $NagiosVer =~ /Nagios (\d+)\./; -+info ("[I] $prod_name info: $NagiosVer"); -+($NagiosVer) = $NagiosVer =~ /$prod_name .*?(\d+)\./; - - # check Nagios Config - info ("verifyCfg"); -@@ -170,6 +273,7 @@ - info ("LinkNagiosChk"); - exit 9; - } -+process_nagios_cfg(); - - # check rrdtool - if ($mode) { -@@ -209,9 +313,29 @@ - if (! $erg) { - info ("noHiRes"); - } -+ -+ if ($RFcfg eq "") { -+# ($RFcfg) = $NagiosCfg =~ m#(^.*/)#; -+# $RFcfg .= "resource.cfg"; -+ $RFcfg = $NagiosCfg{"resource_file"}; -+ } -+ info ("procFile","$RFcfg"); -+ open (RFILE, "$RFcfg") || abort (29, "errOpen", "$RFcfg", "$!"); -+ while () { -+ chomp; -+ s/#.*//; -+ s/\s*$//; -+ next if (/^$/); -+ my ($par, $val) = /^(.*?)=(.*)/; # shortest string (broker module contains multiple equal signs) -+ if (($par eq "") or ($val eq "")) { -+ info ("oddLine", "$_"); -+ next; -+ } -+ $RFcfg{"$par"} .= $val; -+ } -+ close (RFILE); - } - --process_nagios_cfg(); - status_log(); - process_cfg_log(); - -@@ -237,8 +361,8 @@ - if ($NagiosCfg{"process_performance_data"} !~ /^1$/) { - info ("noPerfEna"); - info ("LinkEnaPerf"); -- if ($mode =~ /default/i) { -- info ("PNPdefault"); -+ if ($mode =~ /sync/i) { -+ info ("PNPsync"); - } elsif ($mode =~ /NPCD/i) { - info ("PNPnpcd"); - } else { -@@ -250,15 +374,15 @@ - info ("LinkEnaPerf"); - } - --# check default mode --if (($NagiosVer >= 3) and (uc($mode) =~ /default/i)) { -+# check sync mode -+if (($NagiosVer >= 3) and (uc($mode) =~ /sync/i)) { - if ((exists $NagiosCfg{"enable_environment_macros"}) and ($NagiosCfg{"enable_environment_macros"} !~ /^1$/)) { - info ("envMacrosDis"); - info ("LinkEnaEnv"); - } - } --chk_param ("service_perfdata_command", "default"); --chk_param ("host_perfdata_command", "default"); -+chk_param ("service_perfdata_command", "sync"); -+chk_param ("host_perfdata_command", "sync"); - - # check Bulk modes - chk_param ("service_perfdata_file", "Bulk|NPCD"); -@@ -290,6 +414,12 @@ - info ("invDir", "$RRDpath"); - } else { - info ("RRDpath", "$RRDpath"); -+ my $erg = eval "open (TST, \">$RRDpath/testfile\")"; -+ if (! $erg) { -+ info ("noWrite","$RRDpath","$NagiosCfg{\"${product}_user\"}"); -+ } else { -+ unlink ("$RRDpath/testfile"); -+ } - find(\&chk_perfdata, "$RRDpath"); - if ($RRDfile) { - info ("RRDcount", $RRDdir, $RRDfile); -@@ -301,11 +431,18 @@ - - if ($wc == 0) { - info ("noErrors"); --} else { -+ print "OK | Errors=0\n" if ($quiet); -+ exit 0 -+} elsif ($crit == 0) { -+ info ("Warnings"); -+ print "WARNING | Warnings=$warn; Errors=$crit\n" if ($quiet); -+ exit 1 -+} else { - info ("Errors"); -+ print "CRITICAL | Warnings=$warn; Errors=$crit\n" if ($quiet); -+ exit 2 - } --print "\n"; --exit $wc; -+exit 3; - - # - # subroutines -@@ -315,7 +452,7 @@ - return if ($quiet); - if ($language =~ /de/i) { - print < ] - [ -N ] - [ -P ] -+ [ -r ] - [ -R |no ] -+ [ -U ] -+ [ -u ] -+ [ -g ] -+ [ -M ] -+ [ -L ] -+ [ -t ] - [ -e ] - [ -d | -q ] - - parameters: - -h, --help print these lines -- -b, --basedir=s Nagios Base directory (default: $basedir) -- -B, --binary=s Nagios binary (default: nagios) -- -c, --config=s Nagios main config file (default: $basedir/etc/nagios.cfg) -- -m, --mode=s PNP mode ("default", "bulk", "NPCD") -+ -b, --basedir=s $prod_name Base directory (default: $basedir) -+ -B, --binary=s $prod_name binary (default: $product) -+ -c, --config=s $prod_name main config file (default: $basedir/etc/product.cfg) -+ -m, --mode=s PNP mode ("default", "sync", "bulk", "NPCD") - -l, --logfile=s check configure log file - -N, --npcdcfg=s PNP config file for NPCD mode (default: $basedir/etc/pnp/npcd.cfg) - -P, --ppcfg=s process_perfdata config file (default: $basedir/etc/pnp/process_perfdata.cfg) - -p, --precheck use config files instead of objects cache - -r, --rrdtool=s specify the location of the RRDtool binary - -R, --RRDpath=s specify the perfdata directory (default: $basedir/share/perfdata) or "no" for no check -+ -U, --resource=s specify the location of the resource.cfg (default: $basedir/etc/resource.cfg) -+ -M, --monitor=s specify the monitoring product (default: nagios) -+ -L, --layout=s specify a layout (Nagios2, Nagios3, SuSE, Fedora) - -u, --user=s user of the perfdata directory - -g, --group=s group of the perfdata directory - -q, --quiet quiet mode, non-zero return code will indicate errors -- -o, --object=s Nagios object (host name/service description) -+ -o, --object=s $prod_name object (host name/service description) - "Name" : search for matching host name or service desc - "Name;": search for matching host name - ";Name": search for service description -+ -t, --time show warnings if RRDfiles are too old - -e, --english show english messages/links - -d, --debug some debugging output - EOF3 -@@ -406,7 +554,7 @@ - info ("dupEntry","$key"); - } - } -- info ("[I] nagios_user=$NagiosCfg{nagios_user}"); -+ info ("[I] ${product}_user=$NagiosCfg{\"${product}_user\"}"); - if ($user) { - $uid = getpwnam ($user); - if (! $uid) { -@@ -415,10 +563,10 @@ - } - info ("[I] perfdata_user=$user"); - } else { -- $uid = getpwnam ($NagiosCfg{nagios_user}); -- $user = $NagiosCfg{nagios_user}; -+ $uid = getpwnam ($NagiosCfg{"${product}_user"}); -+ $user = $NagiosCfg{"${product}_user"}; - } -- info ("[I] nagios_group=$NagiosCfg{nagios_group}"); -+ info ("[I] ${product}_group=$NagiosCfg{\"${product}_group\"}"); - if ($group) { - $gid = getgrnam ($group); - if (! $gid) { -@@ -427,8 +575,8 @@ - } - info ("[I] perfdata_group=$group"); - } else { -- $gid = getgrnam ($NagiosCfg{nagios_group}); -- $group = $NagiosCfg{nagios_group}; -+ $gid = getgrnam ($NagiosCfg{"${product}_group"}); -+ $group = $NagiosCfg{"${product}_group"}; - } - } - -@@ -473,15 +621,21 @@ - $StatusLog{"$name"} = $zeile; - info ("[D] $zeile") if ($debug); - if ($hostname ne "") { -- next if ($zeile !~ /host_name=$hostname/i); -+ if ($zeile !~ /host_name=$hostname/i) { -+ $zeile = ""; -+ next; -+ } - } - if ($srvdesc ne "") { -- next if ($zeile !~ /service_description=$srvdesc/i); -+ if ($zeile !~ /service_description=$srvdesc/i) { -+ $zeile = ""; -+ next; -+ } - } - if (uc($name) =~ /$Object/i) { - $name =~ s/.*?;//; -- my ($perf_data) = /performance_data\s*=\s*(.*)?#/; -- if (defined($perf_data)) { -+ my ($perf_data) = $zeile =~ /#performance_data\s*=\s*(.*?)#/; -+ if ($perf_data ne "") { - info ("[I] Performance data ($name): $perf_data"); - $_= $perf_data." "; - # try to check for valid performance data according to -@@ -501,6 +655,7 @@ - } else { - info ("[D] Label:>$label<") if ($debug); - } -+ s/,/./g; # change decimal comma - s/^(.*?)[; ]//; - my ($value,$uom) = $1 =~ /([-]?[0-9.]+)(.*)/; - if (! defined($value)) { -@@ -570,8 +725,8 @@ - examine ("f;","RRDTOOL",$LogFile{"RRDTOOL"}); - examine ("f;","NPCD_LOG",$LogFile{"NPCD_LOG"}); - -- examine ("u;","nagios_user",$LogFile{"nagios_user"}); -- examine ("g;","nagios_grp",$LogFile{"nagios_grp"}); -+ examine ("u;","${product}_user",$LogFile{"${product}_user"}); -+ examine ("g;","${product}_grp",$LogFile{"${product}_grp"}); - } - - # check parameter from nagios.cfg -@@ -598,7 +753,7 @@ - $chk .= " -d HOSTPERFDATA" if ($param =~ /^host/); - if ( $cmd !~ /$chk$/i) { - info ("invValue2","$cmd","$param"); -- info ("PNPdefault"); -+ info ("PNPsync"); - } - } - if ($param =~ /perfdata_file_template/) { -@@ -619,12 +774,14 @@ - info ("LinkNagiosCfg","$param"); - return; - } -- if ($NagiosVer >= 3) { -- info ("noParCfgH","$param"); -- } else { -- info ("notAdv","$param"); -+ if ($prod_name eq "Icinga") { -+ if ($NagiosVer >= 3) { -+ info ("noParCfgH","$param"); -+ } else { -+ info ("notAdv","$param"); -+ } -+ info ("LinkNagiosCfg","$param"); - } -- info ("LinkNagiosCfg","$param"); - } - } - -@@ -645,6 +802,20 @@ - } - ($line) = /command_line\s*(.*)/ ; - $commands{"$cmd"} = "$line"; -+ next unless (/process_perfdata.pl/); -+ my @cmd = split (/\s+/,$line); -+ for my $i (0..$#cmd) { -+ if ($cmd[$i] =~ /(\$USER\d+\$)/) { -+ if (exists $RFcfg{"$1"}) { -+ my $val = $RFcfg{"$1"}; -+ $cmd[$i] =~ s/\$USER\d+\$/$val/; -+ } else { -+ info ("noRes", "$1"); -+ } -+ } -+ info ("noFile", "$cmd", "$cmd[$i]") unless (-f "$cmd[$i]"); -+ last if ($cmd[$i] =~ /perfdata.pl/); -+ } - } - close (CFILE); - if ($debug) { -@@ -685,8 +856,12 @@ - my $zeile = ""; - info ("[D] var:>$var<") if ($debug); - return if (/^$/); -- s/^(.*?)[; ]//; -+ s/^(.*?)([; ])//; - my $value = $1 || ""; -+ if (($value ne "") and ($2 eq " ")) { -+ $_ = " ".$_; -+ return; -+ } - $zeile .= "value:>$value< "; - if ($value) { - if ($value !~ /$pattern/) { -@@ -739,14 +914,10 @@ - # $template{"${type}STATE"} = 0; - $template{"HOSTSTATE"} = 0; - $template{"HOSTSTATETYPE"} = 0; -- if ($type eq "HOST") { -- $template{"HOSTOUTPUT"} = 0; -- } - if ($type eq "SERVICE") { - $template{"SERVICEDESC"} = 0; - $template{"SERVICESTATE"} = 0; - $template{"SERVICESTATETYPE"} = 0; -- $template{"SERVICEOUTPUT"} = 0; - } - info ("chkTemplate","$param"); - my $val = $NagiosCfg{"$param"}; -@@ -806,6 +977,7 @@ - $NPCDcfg{sleep_time} = 'n;^\d+$;439'; # new since 0.4.8 - $NPCDcfg{identify_npcd} = "v;0|1;497"; # new since 0.4.11 - $NPCDcfg{perfdata_file} = "d;;558"; -+ $NPCDcfg{perfdata_spool_filename} = "f;;643"; - $err = 0; - - # try to set a file name if variable is unset -@@ -899,7 +1071,7 @@ - $CPcfg{'$conf[\'allowed_for_host_overview\']'} = 'S;[\S,]+;'; - $CPcfg{'$conf[\'allowed_for_pages\']'} = 'S;[\S,]+;381'; - $CPcfg{'$conf[\'overview-range\']'} = 'v;0|1;'; -- $CPcfg{'$conf[\'lang\']'} = 'v;en|de|fr|se|nl;'; -+ $CPcfg{'$conf[\'lang\']'} = 'v;en|de|fr|se|nl|es;'; - $CPcfg{'$conf[\'date_fmt\']'} = "S;.*;279"; - $CPcfg{'$conf[\'rrd_daemon_opts\']'} = 'S;.*;520'; - $CPcfg{'$conf[\'enable_recursive_template_search\']'} = 'v;0|1;595'; -@@ -1048,7 +1220,6 @@ - sub info { - my @par = @_; - my $line = ""; -- return if ($quiet); - - if (exists ($msg{"$par[0]"})) { - $line = $msg{"$par[0]"}; -@@ -1060,21 +1231,25 @@ - } - if ($line =~ /\[E\]/) { - $wc++; -- $err++; -+ $crit++; -+ } -+ if ($line =~ /\[W\]/) { -+ $wc++; -+ $warn++; - } -- print "$line\n"; -+ print "$line\n" unless ($quiet); - } - - # abort script - sub abort { -- my ($rc, @par); -+ my ($rc, @par) = @_; - info (@par); - exit $rc; - } - - # check perfdata dir - sub chk_perfdata { -- -d && $RRDdir++; -+ -d && $_ ne "." && $RRDdir++; - my $f = "$File::Find::name"; - return unless (($f =~ /\/$/) or ($f =~ /rrd$|xml$/)); - if ($uid) { -@@ -1092,6 +1267,19 @@ - return unless ($f =~ /xml$/); - my $rc = 99; - my $txt = "no RC found in file"; -+ if ($time) { -+ my $max_age = $CPcfg{'$conf[\'max_age\']'}; -+ while ($max_age =~ /(\d+)\*(\d+)(\D.*)?/) { -+ if (defined($3)) { -+ $max_age = $1 * $2."$3"; -+ } else { -+ $max_age = $1 * $2; -+ } -+ } -+ my $old = time() - $max_age; -+ my $age = (stat ($f))[9]; -+ info ("RRDold","$f","$max_age") if ($age < $old); -+ } - open (F, "$f"); - while () { - if (/(\d)<\/RC>/) { -@@ -1105,23 +1293,70 @@ - info ("RRDrc","$f",$rc, "$txt") if ($rc); - } - -+sub chk_pkg { -+ my ($pkg_names,$req,$exactly) = @_; -+ my @pkg_names = split (/,/,$pkg_names); -+ my $pkg_name = ""; -+ my $pkg = ""; -+ -+ for my $idx (0..$#pkg_names) { -+ next if ($pkg); -+ $pkg_name = $pkg_names[$idx]; -+ if ($pkg_mgr =~ /yum/) { -+ if ($exactly) { -+ $pkg = `yum list installed $pkg_name 2>/dev/null | grep "installed"`; -+ } else { -+ $pkg = `yum list installed 2>/dev/null | grep "$pkg_name" | grep "installed"`; -+ } -+ $pkg =~ s/\s+/ /g; -+ $pkg =~ s/ installed//g; -+ } elsif ($pkg_mgr =~ /dpkg/) { -+ if ($exactly) { -+ $pkg = `dpkg -l "$pkg_name" 2>/dev/null | grep "ii"`; -+ } else { -+ $pkg = `dpkg -l 2>/dev/null | grep "$pkg_name" | grep "ii"`; -+ } -+ $pkg =~ s/ii\s+//gs; -+ $pkg =~ s/\s+/ /gs; -+ $pkg =~ s/(\S+ \S+).*/$1/gs; -+ } elsif ($pkg_mgr =~ /rpm/) { -+ if ($exactly) { -+ $pkg = `rpm -qa $pkg_name`; -+ } else { -+ $pkg = `rpm -qa | grep $pkg_name`; -+ } -+ } -+ } -+ $pkg =~ s/\s$//gs; -+ if ($pkg) { -+ info ("Package","$pkg"); -+ return 1 -+ } else { -+ info ("noPkg","$pkg_names") if ($req); -+ return 0 -+ } -+} -+ - # set different messages according to the language - sub message { - $msg{"qd"} = "[E] --quiet and --debug are mutually exclusive"; -- $msg{"noBase"} = "[E] Nagios basedir not found/not specified"; -- $msg{"noBaseDir"} = "[E] Nagios basedir \"%s\" does not exist"; -- $msg{"useBase"} = "[I] using Nagios basedir \"%s\""; -- $msg{"useBinary"} = "[I] using Nagios binary \"%s\""; -- $msg{"noCfg"} = "[E] nagios.cfg not specified"; -+ $msg{"noBase"} = "[E] $prod_name basedir not found/not specified"; -+ $msg{"noBaseDir"} = "[E] $prod_name basedir \"%s\" does not exist"; -+ $msg{"useBase"} = "[I] using $prod_name basedir \"%s\""; -+ $msg{"noBinary"} = "[E] binary \"%s\" not found/defined"; -+ $msg{"useBinary"} = "[I] using $prod_name binary \"%s\""; -+ $msg{"noCfg"} = "[E] $product.cfg not specified"; - $msg{"noCfgFile"} = "[E] config file \"%s\" not found"; -- $msg{"useCfg"} = "[I] using Nagios config \"%s\""; -+ $msg{"useCfg"} = "[I] using $prod_name config \"%s\""; - $msg{"binExec"} = "[E] File \"%s\" is not executable"; -- $msg{"verifyCfg"} = "[A] verifying Nagios config"; -- $msg{"invPNPmode"} = "[E] no valid mode specified (default, Bulk, NPCD)"; -+ $msg{"verifyCfg"} = "[A] verifying $prod_name config"; -+ $msg{"invPNPmode"} = "[E] no valid mode specified (sync, Bulk, NPCD, default)"; - $msg{"PNPmode"} = "[I] PNP mode: \"%s\""; -+ $msg{"Package"} = "[I] Package: \"%s\""; -+ $msg{"noPkg"} = "[E] Package \"%s\" not found"; - $msg{"useLog"} = "[I] LogFile \"%s\" specified"; -- $msg{"NagiosChkErr"} = "[E] Nagios check found errors"; -- $msg{"NagiosCfgErr"} = "[E] Nagios config contains errors"; -+ $msg{"NagiosChkErr"} = "[E] $prod_name check found errors"; -+ $msg{"NagiosCfgErr"} = "[E] $prod_name config contains errors"; - $msg{"verifyRRD"} = "[A] checking RRDtool (%s)"; - $msg{"info"} = "[I] %s: %s"; - $msg{"invFile"} = "[E] \"%s\" is not a (regular) file"; -@@ -1129,27 +1364,29 @@ - $msg{"useEntry"} = "[I] using cfg_dir/cfg_file entries"; - $msg{"useCache"} = "[I] using \"%s\" entries"; - $msg{"dupEntry"} = "[E] directive \"%s\" is duplicate"; -- $msg{"noPerfEna"} = "[E] no performance data enabled (process_performance_data=1 in nagios.cfg)"; -+ $msg{"noPerfEna"} = "[E] no performance data enabled (process_performance_data=1 in $product.cfg)"; - $msg{"envMacrosDis"} = "[E] environment macros disabled (enable_environment_macros=0)"; - $msg{"noFonts"} = "[H] dejavu fonts may be missing"; - $msg{"noErrors"} = "\nNo (obvious) errors found. Happy graphing with PNP"; -+ $msg{"Warnings"} = "\nWarnings found. Please check the settings."; - $msg{"Errors"} = "\nErrors found. Please check the settings and have a look at the documentation."; - $msg{"procFile"} = "[A] processing \"%s\""; - $msg{"searchObj"} = "[A] searching for \"%s\""; - $msg{"noLabel"} = "[E] no label defined"; - $msg{"invValue"} = "[E] no valid value"; - $msg{"invOption"} = "[E] \"%s\" is not a valid option"; -- $msg{"invUOM"} = "[E] \"%s\" doesn''t seem to be a valid UOM"; -+ $msg{"invUOM"} = "[E] \"%s\" doesn't seem to be a valid UOM"; - $msg{"minRev"} = "[W] option \"%s\" is valid starting with revision %s"; - $msg{"maxRev"} = "[W] option \"%s\" is only valid until revision %s"; - $msg{"noUser"} = "[E] (%s) user \"%s\" does not exist"; - $msg{"noGroup"} = "[E] (%s) group \"%s\" does not exist"; - $msg{"noPerf"} = "[E] There is NO performance data for \"%s\" !"; - $msg{"noRRDchk"} = "[I] perfdata directory will NOT be checked"; -- $msg{"RRDpath"} = "[A] checking of \"%s\""; -+ $msg{"RRDpath"} = "[A] checking of RRDpath \"%s\""; - $msg{"RRDuser"} = "[E] \"%s\": owner is \"%s\" instead of %s"; - $msg{"RRDgroup"} = "[E] \"%s\": group is \"%s\" instead of %s"; - $msg{"RRDrc"} = "[E] \"%s\"\n\tRRDtool RC: %s, %s"; -+ $msg{"RRDold"} = "[W] \"%s\" is older than %s seconds"; - $msg{"RRDcount"} = "[I] %s dir(s) with a total of %s rrd file(s)"; - $msg{"noRRDfiles"} = "[E] %s dir(s) but NO rrd files => NO graphs!"; - $msg{"useRRDs"} = "[I] RRDs perl module installed"; -@@ -1171,67 +1408,74 @@ - $msg{"missTempVar"} = "[E] variable \"%s\" in template is missing"; - $msg{"missinvTempVal"} = "[E] value \"%s\" in template is missing"; - $msg{"noCmd"} = "[E] command_name \"%s\" not found"; -- $msg{"noParCfg"} = "[E] \"%s\" not found in nagios.cfg"; -- $msg{"noParCfgH"} = "[H] \"%s\" not found in nagios.cfg"; -+ $msg{"noParCfg"} = "[E] \"%s\" not found in $product.cfg"; -+ $msg{"noParCfgH"} = "[H] \"%s\" not found in $product.cfg"; - $msg{"notAdv"} = "[H] \"%s\" not advisable in Nagios < 3.x"; - $msg{"invChar"} = "[E] \"%s\" (\"%s\") has invalid format/contains invalid characters"; - $msg{"undefVal"} = "[E] no (valid) value for \"%s\" defined"; - $msg{"noNumber"} = "[E] %s not a valid number"; - $msg{"startEnd"} = "[E] start (%s) is greater than end (%s)"; - $msg{"noFile"} = "[E] (%s) file \"%s\" is missing"; -- $msg{"noFileYet"} = "[I] (%s) file \"%s\" doesn''t exist (yet)"; -+ $msg{"noRes"} = "[E] resource \"%s\" is not defined"; -+ $msg{"noFileYet"} = "[I] (%s) file \"%s\" doesn't exist (yet)"; - $msg{"noDir"} = "[E] (%s) directory \"%s\" is missing"; - $msg{"noSock"} = "[E] \"%s\" is not a socket"; -+ $msg{"noWrite"} = "[E] \"%s\": no write permissions for \"%s\""; - $msg{"key"} = "[D] key:\"%s\""; - $msg{"keyValue"} = "[D] directive:\"%s\", value:\"%s\""; - $msg{"oddLine"} = "[W] \"%s\" looks odd"; - $msg{"errOpen"} = "[E] open of %s failed, RC=%s"; - - $msg{"LinkNagiosChk"} = "[H] http://nagios.sourceforge.net/docs/3_0/verify_config.html"; -- $msg{"LinkReqSW"} = "[H] http://www.pnp4nagios.org/pnp/about#required_software"; -- $msg{"LinkPNPreq"} = "[H] http://www.pnp4nagios.org/pnp/about#requirements"; -- $msg{"PNPdefault"} = "[H] http://www.pnp4nagios.org/pnp$language/config#default_mode"; -- $msg{"PNPbulk"} = "[H] http://www.pnp4nagios.org/pnp$language/config#bulk_mode"; -- $msg{"PNPnpcd"} = "[H] http://www.pnp4nagios.org/pnp$language/config#npcd"; -+ $msg{"LinkReqSW"} = "[H] http://docs.pnp4nagios.org/$language/pnp-${doc_version}/about#required_software"; -+ $msg{"LinkRRDtool"} = "[H] http://www.rrdtool.org"; -+ $msg{"LinkPNPreq"} = "[H] http://docs.pnp4nagios.org/$language/pnp-${doc_version}/about#requirements"; -+ $msg{"PNPsync"} = "[H] http://docs.pnp4nagios.org/$language/pnp-${doc_version}/config#default_mode"; -+ $msg{"PNPbulk"} = "[H] http://docs.pnp4nagios.org/$language/pnp-${doc_version}/config#bulk_mode"; -+ $msg{"PNPnpcd"} = "[H] http://docs.pnp4nagios.org/$language/pnp-${doc_version}/config#npcd"; - $msg{"NPCDcfgReq"} = "[E] NPCD config file required"; - $msg{"noNPCDreq"} = "[H] NPCD config file is not required"; - $msg{"LinkEnaEnv"} = "[H] http://nagios.sourceforge.net/docs/3_0/configmain.html#enable_environment_macros"; - $msg{"LinkEnaPerf"} = "[H] http://nagios.sourceforge.net/docs/3_0/configmain.html#process_performance_data"; - $msg{"LinkDevInfo"} = "[H] http://nagiosplug.sourceforge.net/developer-guidelines.html#AEN203"; -- $msg{"LinkPNPconfig"} = "[H] http://www.pnp4nagios.org/pnp$language/config"; -- $msg{"LinkPPcfg"} = "[H] http://www.pnp4nagios.org/pnp$language/config"; -- $msg{"LinkCPcfg"} = "[H] http://www.pnp4nagios.org/pnp$language/webfe"; -+ $msg{"LinkPNPconfig"} = "[H] http://docs.pnp4nagios.org/$language/pnp-${doc_version}/config"; -+ $msg{"LinkPPcfg"} = "[H] http://docs.pnp4nagios.org/$language/pnp-${doc_version}/config"; -+ $msg{"LinkCPcfg"} = "[H] http://docs.pnp4nagios.org/$language/pnp-${doc_version}/webfe"; - $msg{"LinkNagiosCfg"} = "[H] http://nagios.sourceforge.net/docs/3_0/configmain.html#%s"; - $msg{"LinkNagiosCfg2"} = "[H] http://nagios.sourceforge.net/docs/3_0/configmain.html#process_performance_data\n (and following options)"; - - if ($language =~ /de/i) { -- $msg{"qd"} = "[E]: --quiet und --debug schliessen sich gegenseitig aus"; -- $msg{"noBase"} = "[E]: Nagios-Basisverzeichnis nicht gefunden/angegeben"; -- $msg{"noBaseDir"} = "[E]: Nagios-Basisverzeichnis \"%s\" existiert nicht"; -- $msg{"useBase"} = "[I] benutze Nagios-Basisverzeichnis \"%s\""; -- $msg{"useBinary"} = "[I] benutze Nagios-Binary \"%s\""; -- $msg{"noCfg"} = "[E]: nagios.cfg nicht angegeben"; -- $msg{"noCfgFile"} = "[E]: Konfigurationsdatei \"%s\" nicht gefunden"; -- $msg{"useCfg"} = "[I] benutze Nagios-config \"%s\""; -- $msg{"binExec"} = "[E]: Datei \"%s\" ist nicht ausfuehrbar"; -- $msg{"verifyCfg"} = "[A] verifiziere Nagios-Konfiguration"; -- $msg{"invPNPmode"} = "[E]: kein gueltiger PNP-Modus angegeben (default, Bulk, NPCD)"; -+ $msg{"qd"} = "[E] --quiet und --debug schliessen sich gegenseitig aus"; -+ $msg{"noBase"} = "[E] ${prod_name}-Basisverzeichnis nicht gefunden/angegeben"; -+ $msg{"noBaseDir"} = "[E] ${prod_name}-Basisverzeichnis \"%s\" existiert nicht"; -+ $msg{"useBase"} = "[I] benutze ${prod_name}-Basisverzeichnis \"%s\""; -+ $msg{"noBinary"} = "[E] Binary \"%s\" nicht gefunden/definiert"; -+ $msg{"useBinary"} = "[I] benutze ${prod_name}-Binary \"%s\""; -+ $msg{"noCfg"} = "[E] $product.cfg nicht angegeben"; -+ $msg{"noCfgFile"} = "[E] Konfigurationsdatei \"%s\" nicht gefunden"; -+ $msg{"useCfg"} = "[I] benutze ${prod_name}-config \"%s\""; -+ $msg{"binExec"} = "[E] Datei \"%s\" ist nicht ausfuehrbar"; -+ $msg{"verifyCfg"} = "[A] verifiziere ${prod_name}-Konfiguration"; -+ $msg{"invPNPmode"} = "[E] kein gueltiger PNP-Modus angegeben (sync, Bulk, NPCD, default)"; - $msg{"PNPmode"} = "[I] PNP-Modus: \"%s\""; -+ $msg{"Package"} = "[I] Paket: \"%s\""; -+ $msg{"noPkg"} = "[E] Paket \"%s\" nicht gefunden"; - $msg{"NPCDcfgReq"} = "[E] NPCD-Konfigurationsdatei erforderlich"; - $msg{"noNPCDreq"} = "[H] NPCD-Konfigurationsdatei nicht erforderlich"; - $msg{"useLog"} = "[I] LogFile \"%s\" angegeben"; -- $msg{"NagiosChkErr"} = "[E] Nagios-Konfigurationspruefung findet Fehler"; -- $msg{"NagiosCfgErr"} = "[E] Nagios-Konfigurationsdatei enthaelt Fehler"; -+ $msg{"NagiosChkErr"} = "[E] ${prod_name}-Konfigurationspruefung findet Fehler"; -+ $msg{"NagiosCfgErr"} = "[E] ${prod_name}-Konfigurationsdatei enthaelt Fehler"; - $msg{"verifyRRD"} = "[A] pruefe RRDtool (%s)"; - $msg{"invFile"} = "[E]: \"%s\" ist keine (regulaere) Datei"; - $msg{"invDir"} = "[E] Verzeichnis \"%s\" existiert nicht"; - $msg{"useEntry"} = "[I] benutze cfg_dir/cfg_file-Eintraege"; - $msg{"useCache"} = "[I] benutze \"%s\"-Eintraege"; - $msg{"dupEntry"} = "[E] Direktive \"%s\" ist doppelt"; -- $msg{"noPerfEna"} = "[E] keine Performance-Daten aktiviert (process_performance_data=1 in nagios.cfg)"; -+ $msg{"noPerfEna"} = "[E] keine Performance-Daten aktiviert (process_performance_data=1 in $product.cfg)"; - $msg{"envMacrosDis"} = "[E] Environment-Makros deaktiviert (enable_environment_macros=0)"; - $msg{"noFonts"} = "[H] dejavu-Fonts sind ggf. nicht installiert"; - $msg{"noErrors"} = "\nKeine (offensichtlichen) Fehler gefunden. Viel Spass mit PNP"; -+ $msg{"Warnings"} = "\nWarnungen gefunden.\nBitte ueberpruefen Sie die Einstellungen."; - $msg{"Errors"} = "\nFehler gefunden.\nBitte ueberpruefen Sie die Einstellungen und lesen Sie die Dokumentation."; - $msg{"procFile"} = "[A] verarbeite \"%s\""; - $msg{"searchObj"} = "[A] suche nach \"%s\""; -@@ -1245,9 +1489,10 @@ - $msg{"noGroup"} = "[E] (%s) Gruppe \"%s\" existiert nicht"; - $msg{"noPerf"} = "[E] es gibt KEINE Performance-Daten fuer \"%s\""; - $msg{"noRRDchk"} = "[I] perfdata-Verzeichnis wird NICHT geprueft"; -- $msg{"RRDpath"} = "[A] pruefen von \"%s\""; -+ $msg{"RRDpath"} = "[A] pruefen von RRDpath \"%s\""; - $msg{"RRDuser"} = "[E] \"%s\": Owner ist \"%s\" anstatt %s"; - $msg{"RRDgroup"} = "[E] \"%s\": Group ist \"%s\" anstatt %s"; -+ $msg{"RRDold"} = "[W] \"%s\" ist aelter als %s Sekunden"; - $msg{"RRDcount"} = "[I] %s Verzeichnis(se) mit insgesamt %s rrd-Datei(en)"; - $msg{"noRRDfiles"} = "[E] %s Verzeichnis(se) aber KEINE rrd-Dateien => KEINE Graphen!"; - $msg{"useRRDs"} = "[I] RRDs Perl-Modul installiert"; -@@ -1269,27 +1514,29 @@ - $msg{"missTempVar"} = "[E] Variable \"%s\" im Template fehlt"; - $msg{"missinvTempVal"} = "[E] Wert \"%s\" im Template fehlt"; - $msg{"noCmd"} = "[E] command_name \"%s\" nicht gefunden"; -- $msg{"noParCfg"} = "[E] \"%s\" nicht in nagios.cfg gefunden"; -- $msg{"noParCfgH"} = "[H] \"%s\" nicht in nagios.cfg gefunden"; -+ $msg{"noParCfg"} = "[E] \"%s\" nicht in $product.cfg gefunden"; -+ $msg{"noParCfgH"} = "[H] \"%s\" nicht in $product.cfg gefunden"; - $msg{"notAdv"} = "[H] \"%s\" wird fuer Nagios < 3.x nicht empfohlen"; - $msg{"invChar"} = "[E] \"%s\" (%s) hat ein ungueltiges Format/enthaelt ungueltige Zeichen"; - $msg{"undefVal"} = "[E] kein (gueltiger) Wert fuer \"%s\" definiert"; - $msg{"noNumber"} = "[E] %s ist keine gueltige Zahl"; - $msg{"startEnd"} = "[E] Startwert (%s) ist groesser als Endwert (%s)"; - $msg{"noFile"} = "[E] (%s) Datei \"%s\" fehlt"; -+ $msg{"noRes"} = "[E] Ressource \"%s\" ist nicht definiert"; - $msg{"noFileYet"} = "[I] (%s) Datei \"%s\" existiert (noch) nicht"; - $msg{"noDir"} = "[E] (%s) Verzeichnis \"%s\" fehlt"; - $msg{"noSock"} = "[E] \"%s\" ist kein Socket"; -+ $msg{"noWrite"} = "[E] \"%s\": keine Schreibberechtigung fuer \"%s\""; - $msg{"key"} = "[D] key:\"%s\""; - $msg{"keyValue"} = "[D] Direktive:\"%s\", Wert:\"%s\""; - $msg{"oddLine"} = "[W] \"%s\" sieht komisch aus"; - $msg{"errOpen"} = "[E] oeffnen von %s fehlgeschlagen, RC=%s"; - - $msg{"LinkNagiosChk"} = "[H] http://www.nagios-wiki.de/nagios/doku3/verify_config"; -- $msg{"LinkReqSW"} = "[H] http://www.pnp4nagios.org/pnp$language/about#benoetigte_software"; -- $msg{"LinkPNPreq"} = "[H] http://www.pnp4nagios.org/pnp$language/about#anforderungen_an_plugins"; -- $msg{"LinkEnaEnv"} = "http://www.nagios-wiki.de/nagios/doku3/#enable_environment_macros"; -- $msg{"LinkEnaPerf"} = "http://www.nagios-wiki.de/nagios/doku3/#process_performance_data"; -+ $msg{"LinkReqSW"} = "[H] http://docs.pnp4nagios.org/$language/pnp-${doc_version}/about#benoetigte_software"; -+ $msg{"LinkPNPreq"} = "[H] http://docs.pnp4nagios.org/$language/pnp-${doc_version}/about#anforderungen_an_plugins"; -+ $msg{"LinkEnaEnv"} = "[H] http://www.nagios-wiki.de/nagios/doku3/#enable_environment_macros"; -+ $msg{"LinkEnaPerf"} = "[H] http://www.nagios-wiki.de/nagios/doku3/configmain#process_performance_data"; - $msg{"LinkNagiosCfg"} = "[H] http://www.nagios-wiki.de/nagios/doku3/configmain#%s"; - $msg{"LinkNagiosCfg2"} = "[H] http://www.nagios-wiki.de/nagios/doku3/configmain#process_performance_data\n (und folgende Optionen)"; - } diff --git a/pnp4nagios-README.fedora b/pnp4nagios-README.fedora deleted file mode 100644 index fb15f76..0000000 --- a/pnp4nagios-README.fedora +++ /dev/null @@ -1,76 +0,0 @@ -* Default Mode - -/etc/nagios/nagios.cfg - - process_performance_data=1 - service_perfdata_command=process-service-perfdata - -/etc/nagios/commands.cfg - -define command { - command_name process-service-perfdata - command_line /usr/bin/perl /usr/libexec/pnp4nagios/process_perfdata.pl -} - -define command { - command_name process-host-perfdata - command_line /usr/bin/perl /usr/libexec/pnp4nagios/process_perfdata.pl -d HOSTPERFDATA -} - - -* Bulk Mode - -/etc/nagios/nagios.cfg : - -process_performance_data=1 -# -# service performance data -# -service_perfdata_file=/var/spool/nagios/service-perfdata -service_perfdata_file_template=DATATYPE::SERVICEPERFDATA\tTIMET::$TIMET$\tHOSTNAME::$HOSTNAME$\tSERVICEDESC::$SERVICEDESC$\tSERVICEPERFDATA::$SERVICEPERFDATA$\tSERVICECHECKCOMMAND::$SERVICECHECKCOMMAND$\tHOSTSTATE::$HOSTSTATE$\tHOSTSTATETYPE::$HOSTSTATETYPE$\tSERVICESTATE::$SERVICESTATE$\tSERVICESTATETYPE::$SERVICESTATETYPE$ -service_perfdata_file_mode=a -service_perfdata_file_processing_interval=15 -service_perfdata_file_processing_command=process-service-perfdata-file - -/etc/nagios/commands.cfg : - -define command{ - command_name process-service-perfdata-file - command_line $USER1$/process_perfdata.pl --bulk=/var/spool/nagios/service-perfdata - } - -define command{ - command_name process-host-perfdata-file - command_line $USER1$/process_perfdata.pl --bulk=/var/spool/nagios/host-perfdata - } - - -* Bulk Mode with NPCD - -npcd daemon needs to be started : -service npcd start -chkconfig npcd on - -The configuration is identical to the bulk mode except for the used command. - -/etc/nagios/commands.cfg : - -define command{ - command_name process-service-perfdata-file - command_line /bin/mv /var/spool/nagios/service-perfdata /var/spool/pnp4nagios/service-perfdata.$TIMET$ - } - -define command{ - command_name process-host-perfdata-file - command_line /bin/mv /var/spool/nagios/host-perfdata /var/spool/pnp4nagios/service-perfdata.$TIMET$ - } - - -* Nagios integration - -/etc/nagios/hostextinfo.cfg : - -define hostextinfo { - host_name localhost - action_url /pnp4nagios/graph?host=$HOSTNAME$ - } diff --git a/pnp4nagios-cb925073edeeb97eb4ce61a86cdafccc9b87f9bb.patch b/pnp4nagios-cb925073edeeb97eb4ce61a86cdafccc9b87f9bb.patch deleted file mode 100644 index 6b32d91..0000000 --- a/pnp4nagios-cb925073edeeb97eb4ce61a86cdafccc9b87f9bb.patch +++ /dev/null @@ -1,29 +0,0 @@ -From cb925073edeeb97eb4ce61a86cdafccc9b87f9bb Mon Sep 17 00:00:00 2001 -From: Mikael Falkvidd -Date: Fri, 13 Jun 2014 14:13:03 +0200 -Subject: [PATCH] Plug potential XSS hole in views/template.php - -REQUEST_URI needs to be sanitized if used. Since we want to refresh -to the same page there is no need to set the URI. - -Signed-off-by: Mikael Falkvidd ---- - share/pnp/application/views/template.php | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/share/pnp/application/views/template.php b/share/pnp/application/views/template.php -index 109902f..0cce888 100644 ---- a/share/pnp/application/views/template.php -+++ b/share/pnp/application/views/template.php -@@ -4,7 +4,7 @@ - - - -- -+ - <?php if (isset($this->title)) echo html::specialchars($this->title) ?> - - --- -1.9.3 - diff --git a/pnp4nagios-e4a19768a5c5e5b1276caf3dd5bb721a540ec014.patch b/pnp4nagios-e4a19768a5c5e5b1276caf3dd5bb721a540ec014.patch deleted file mode 100644 index 3239e7e..0000000 --- a/pnp4nagios-e4a19768a5c5e5b1276caf3dd5bb721a540ec014.patch +++ /dev/null @@ -1,36 +0,0 @@ -From e4a19768a5c5e5b1276caf3dd5bb721a540ec014 Mon Sep 17 00:00:00 2001 -From: Mikael Falkvidd -Date: Thu, 12 Jun 2014 11:03:43 +0200 -Subject: [PATCH] pnp/views/kohana_error_page: plug another XSS hole - -By issuing the request -GET pnp/$item?996fb"><"951e1=1 -an alert is triggered in the meta refresh tag. - -The hole is plugged by not setting the URL of the meta refresh. -The default behavior is to refresh the current page, which is what -we want anyway. - -Change-Id: I6af0b15c929f95d651a576d46b99d2e1a88fe601 - -Signed-off-by: Mikael Falkvidd ---- - share/pnp/application/views/kohana_error_page.php | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/share/pnp/application/views/kohana_error_page.php b/share/pnp/application/views/kohana_error_page.php -index a950616..490ed62 100644 ---- a/share/pnp/application/views/kohana_error_page.php -+++ b/share/pnp/application/views/kohana_error_page.php -@@ -4,7 +4,7 @@ - - - -- -+ - - <?php echo $error ?> - --- -1.9.3 - diff --git a/pnp4nagios-httpd24.patch b/pnp4nagios-httpd24.patch deleted file mode 100644 index 84e345a..0000000 --- a/pnp4nagios-httpd24.patch +++ /dev/null @@ -1,25 +0,0 @@ -diff -urN pnp4nagios-0.6.21/sample-config/httpd.conf.in pnp4nagios-0.6.21.httpd24/sample-config/httpd.conf.in ---- pnp4nagios-0.6.21/sample-config/httpd.conf.in 2013-03-24 17:25:56.000000000 +0100 -+++ pnp4nagios-0.6.21.httpd24/sample-config/httpd.conf.in 2013-07-03 09:32:06.852570024 +0200 -@@ -4,8 +4,19 @@ - - - AllowOverride None -- Order allow,deny -- Allow from all -+ -+ # Apache 2.4 -+ -+ Require all granted -+ Require valid-user -+ -+ -+ -+ # Apache 2.2 -+ Order allow,deny -+ Allow from all -+ Require valid-user -+ - # - # Use the same value as defined in nagios.conf - # diff --git a/pnp4nagios-npcd.sysvinit b/pnp4nagios-npcd.sysvinit deleted file mode 100644 index 83f3582..0000000 --- a/pnp4nagios-npcd.sysvinit +++ /dev/null @@ -1,103 +0,0 @@ -#!/bin/sh -# -# npcd Nagios Performancedata C Daemon -# -# chkconfig: - 98 02 -# description: Nagios Performancedata C Daemon - -### BEGIN INIT INFO -# Provides: -# Required-Start: -# Required-Stop: -# Should-Start: -# Should-Stop: -# Default-Start: -# Default-Stop: -# Short-Description: -# Description: -### END INIT INFO - -# Source function library. -. /etc/rc.d/init.d/functions - -exec="/usr/sbin/npcd" -prog="npcd" -config="/etc/pnp4nagios/npcd.cfg" - -[ -e /etc/sysconfig/$prog ] && . /etc/sysconfig/$prog - -lockfile=/var/lock/subsys/$prog - -start() { - [ -x $exec ] || exit 5 - [ -f $config ] || exit 6 - echo -n $"Starting $prog: " - daemon $exec -f $config -d - retval=$? - echo - [ $retval -eq 0 ] && touch $lockfile - return $retval -} - -stop() { - echo -n $"Stopping $prog: " - killproc $prog - retval=$? - echo - [ $retval -eq 0 ] && rm -f $lockfile - return $retval -} - -restart() { - stop - start -} - -reload() { - restart -} - -force_reload() { - restart -} - -rh_status() { - status $prog -} - -rh_status_q() { - rh_status >/dev/null 2>&1 -} - - -case "$1" in - start) - rh_status_q && exit 0 - $1 - ;; - stop) - rh_status_q || exit 0 - $1 - ;; - restart) - $1 - ;; - reload) - rh_status_q || exit 7 - $1 - ;; - force-reload) - force_reload - ;; - status) - rh_status - ;; - condrestart|try-restart) - rh_status_q || exit 0 - restart - ;; - *) - echo $"Usage: $0 {start|stop|status|restart|condrestart|try-restart|reload|force-reload}" - exit 2 -esac -exit $? diff --git a/pnp4nagios-php53.patch b/pnp4nagios-php53.patch deleted file mode 100644 index 88b6c5f..0000000 --- a/pnp4nagios-php53.patch +++ /dev/null @@ -1,29 +0,0 @@ ---- share/pnp/include/function.inc.php.old 2009-08-27 23:40:59.000000000 +0200 -+++ share/pnp/include/function.inc.php 2010-03-12 08:43:28.000000000 +0100 -@@ -1029,7 +1029,7 @@ - } - } - -- $pdf =& new PDF('P', 'mm', 'A4'); -+ $pdf = new PDF('P', 'mm', 'A4'); - $pdf->AliasNbPages(); - $pdf->SetAutoPageBreak('off'); - $pdf->SetMargins(12.5,25,10); -@@ -1538,7 +1538,7 @@ - $NAGIOS['RRD'][$tag][$dsl] = urldecode($value); - } - -- if($level == 2 && $type == "complete" && eregi("^NAGIOS_",$tag)){ -+ if($level == 2 && $type == "complete" && preg_match("/^NAGIOS_/i",$tag)){ - if(isset($xml_elem['value'])){ - $value = $xml_elem['value']; - }else{ -@@ -1569,7 +1569,7 @@ - $PAGE=""; - $allowed_tags = array("page", "graph"); - foreach($data as $line){ -- if(ereg('(^#|^;)',$line)) { -+ if(preg_match('/(^#|^;)/',$line)) { - continue; - } - diff --git a/pnp4nagios.logrotate.conf b/pnp4nagios.logrotate.conf deleted file mode 100644 index 5ec5627..0000000 --- a/pnp4nagios.logrotate.conf +++ /dev/null @@ -1,7 +0,0 @@ -/var/log/pnp4nagios/*.log { - compress - missingok - notifempty - rotate 5 - size 100k -} diff --git a/pnp4nagios.spec b/pnp4nagios.spec deleted file mode 100644 index 10eb33b..0000000 --- a/pnp4nagios.spec +++ /dev/null @@ -1,285 +0,0 @@ -Name: pnp4nagios -Version: 0.6.25 -Release: 3%{?dist} -Summary: Nagios performance data analysis tool - -Group: Applications/System -License: GPLv2 -URL: http://www.pnp4nagios.org/ -Source0: http://downloads.sourceforge.net/%{name}/%{name}-%{version}.tar.gz -Source1: pnp4nagios.logrotate.conf -Source2: pnp4nagios-npcd.sysvinit -Source3: pnp4nagios-README.fedora -Patch1: pnp4nagios-httpd24.patch -BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) - -BuildRequires: autoconf, automake, libtool -BuildRequires: rrdtool-perl -BuildRequires: perl-generators -BuildRequires: perl(Time::HiRes) -Requires: nagios -Requires: rrdtool-perl -Requires: php-gd -Requires(post): chkconfig -Requires(preun): chkconfig -Requires(preun): initscripts -Requires(postun): initscripts - -%description -PNP is an addon to nagios which analyzes performance data provided by plugins -and stores them automatically into RRD-databases. - - -%prep -%setup -q -%patch1 -p1 -autoreconf - -cp -p %{SOURCE3} README.fedora -sed -i -e 's/^INSTALL_OPTS="-o $nagios_user -g $nagios_grp"/INSTALL_OPTS=""/' \ - configure -sed -i -e '/^\t$(MAKE) strip-post-install$/d' src/Makefile.in - - -%build -%configure --bindir=%{_sbindir} \ - --libexecdir=%{_libexecdir}/%{name} \ - --sysconfdir=%{_sysconfdir}/%{name} \ - --localstatedir=%{_localstatedir}/log/%{name} \ - --datadir=%{_datadir}/nagios/html/%{name} \ - --datarootdir=%{_datadir}/nagios/html/%{name} \ - --with-perfdata-dir=%{_localstatedir}/lib/%{name} \ - --with-perfdata-spool-dir=%{_localstatedir}/spool/%{name} -make %{?_smp_mflags} all - - -%install -rm -rf $RPM_BUILD_ROOT -make install DESTDIR=$RPM_BUILD_ROOT -make install-config DESTDIR=$RPM_BUILD_ROOT -# remove -sample from filename suffix -for i in $RPM_BUILD_ROOT/%{_sysconfdir}/pnp4nagios/*-sample \ - $RPM_BUILD_ROOT/%{_sysconfdir}/pnp4nagios/*/*-sample -do - mv ${i} ${i%%-sample} -done -rm -f $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/config.php.* -rm -f $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/config_local.php - -mkdir -p $RPM_BUILD_ROOT%{_localstatedir}/lib/%{name} -mkdir -p $RPM_BUILD_ROOT%{_localstatedir}/spool/%{name} -mkdir -p $RPM_BUILD_ROOT%{_localstatedir}/log/%{name} -install -Dp -m 0644 %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d/pnp4nagios -install -Dp -m 0755 %{SOURCE2} $RPM_BUILD_ROOT%{_initrddir}/npcd -mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/httpd/conf.d -sed 's|/usr/local/nagios/etc/htpasswd.users|/etc/nagios/passwd|' \ - sample-config/httpd.conf \ - > $RPM_BUILD_ROOT%{_sysconfdir}/httpd/conf.d/%{name}.conf -mkdir -p $RPM_BUILD_ROOT%{_libdir}/nagios/brokers -mv $RPM_BUILD_ROOT%{_libdir}/npcdmod.o \ - $RPM_BUILD_ROOT%{_libdir}/nagios/brokers/npcdmod.o -mv $RPM_BUILD_ROOT%{_prefix}/man $RPM_BUILD_ROOT%{_datadir}/ - -# Move kohana to pnp4nagios, there is another kohana in fedore/EPEL, -# which can be installed. -mv $RPM_BUILD_ROOT%{_libdir}/kohana \ - $RPM_BUILD_ROOT%{_datadir}/nagios/html/%{name}/kohana -sed -i 's|%{_libdir}/kohana|%{_datadir}/nagios/html/%{name}/kohana|' \ - $RPM_BUILD_ROOT%{_datadir}/nagios/html/%{name}/index.php - -%clean -rm -rf $RPM_BUILD_ROOT - - -%post -/sbin/chkconfig --add npcd - - -%preun -if [ $1 = 0 ]; then - /sbin/service npcd stop >/dev/null 2>&1 - /sbin/chkconfig --del npcd -fi - - -%postun -if [ "$1" -ge "1" ]; then - /sbin/service npcd condrestart >/dev/null 2>&1 || : -fi - - -%files -%defattr(644,root,root,755) -%doc AUTHORS ChangeLog COPYING INSTALL README README.fedora -%doc THANKS contrib/ -%dir %{_sysconfdir}/pnp4nagios -%config(noreplace) %attr(0640,root,nagios) %{_sysconfdir}/pnp4nagios/process_perfdata.cfg -%config(noreplace) %{_sysconfdir}/pnp4nagios/* -%config(noreplace) %{_sysconfdir}/logrotate.d/%{name} -%config(noreplace) %{_sysconfdir}/httpd/conf.d/%{name}.conf -%attr(755,root,root) %{_initrddir}/npcd -%attr(755,root,root) %{_sbindir}/npcd -%{_libdir}/nagios/brokers/npcdmod.o -%dir %{_libexecdir}/%{name} -%attr(755,root,root) %{_libexecdir}/%{name}/* -%attr(755,nagios,nagios) %{_localstatedir}/lib/%{name} -%attr(755,nagios,nagios) %{_localstatedir}/log/%{name} -%attr(755,nagios,nagios) %{_localstatedir}/spool/%{name} -%{_datadir}/nagios/html/%{name} -# Remove install check script -# as it is not required if all dependencies are met. -%exclude %{_datadir}/nagios/html/%{name}/install.php -%{_mandir}/man8/* -# This is a different version of Kohana like in Fedora/EPEL. -# Needed for pnp4nagios web interface to work. -%{_datadir}/nagios/html/%{name}/kohana - -%changelog -* Thu Feb 04 2016 Fedora Release Engineering - 0.6.25-3 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild - -* Thu Jun 18 2015 Fedora Release Engineering - 0.6.25-2 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild - -* Mon Jun 08 2015 Ján ONDREJ (SAL) - 0.6.25-1 -- Update to upstream. - -* Sun Aug 17 2014 Fedora Release Engineering - 0.6.22-3 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild - -* Fri Jul 04 2014 Ján ONDREJ (SAL) - 0.6.22-2 -- Fix two URL Cross-Site Scripting Vulnerabilities (bz#1115983) - -* Thu Jul 03 2014 Ján ONDREJ (SAL) - 0.6.22-1 -- Update to upstream (fixes XSS flaw in an error page - bz#1115770) - -* Sat Jun 07 2014 Fedora Release Engineering - 0.6.21-5 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild - -* Sun Aug 04 2013 Fedora Release Engineering - 0.6.21-4 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild - -* Wed Jul 17 2013 Petr Pisar - 0.6.21-3 -- Perl 5.18 rebuild - -* Wed Jul 03 2013 Ján ONDREJ (SAL) - 0.6.21-2 -- Broken configuration for httpd 2.4 fixed (bz#871465) -- fixed dates in changelog items - -* Tue Jun 04 2013 Ján ONDREJ (SAL) - 0.6.21-1 -- update to upstream - -* Sat Mar 23 2013 Ján ONDREJ (SAL) - 0.6.20-2 -- added autoreconf to prep section (bz#926359) - -* Sun Mar 03 2013 Ján ONDREJ (SAL) - 0.6.20-1 -- update to upstream - -* Sun Feb 17 2013 Ján ONDREJ (SAL) - 0.6.19-2 -- updated hostextinfo URL for pnp4nagios 0.6 -- spec file cleanup - -* Sat Feb 16 2013 Ján ONDREJ (SAL) - 0.6.19-1 -- update to upstream - -* Mon Sep 03 2012 Ján ONDREJ (SAL) - 0.6.16-4 -- CVE-2012-3457 - process_perfdata.cfg world readable - -* Thu Apr 05 2012 Ján ONDREJ (SAL) - 0.6.16-2 -- Removed double slashes fro directories (BZ#810212). - -* Thu Nov 24 2011 Ján ONDREJ (SAL) - 0.6.16-1 -- update to upstream - -* Mon Nov 21 2011 Ján ONDREJ (SAL) - 0.6.15-4 -- add back kohana, it's a different version -- added BR: perl(Time::HiRes) - -* Mon Nov 21 2011 Ján ONDREJ (SAL) - 0.6.15-2 -- exclude kohana sources and require php-Kohana package - -* Wed Nov 16 2011 Ján ONDREJ (SAL) - 0.6.15-1 -- update to upstream -- remove /usr/share/nagios/html/pnp4nagios/install.php -- added /etc/httpd/conf.d/pnp4nagios.conf -- removed -sample suffix from rest of sample files - -* Tue Oct 11 2011 Ján ONDREJ (SAL) - 0.6.1-3 -- Updated renaming of "-sample" config files. - -* Wed Sep 14 2011 Ján ONDREJ (SAL) - 0.6.1-1 -- Update to 0.6.1. - -* Tue Sep 13 2011 Ján ONDREJ (SAL) - 0.4.14-7 -- added perl-Time-HiRes to build requires - -* Tue Sep 13 2011 Ján ONDREJ (SAL) - 0.4.14-6 -- rebuilt for EPEL-6 - -* Wed Feb 09 2011 Fedora Release Engineering - 0.4.14-5 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild - -* Mon Sep 27 2010 Xavier Bachelot 0.4.14-4 -- Bump release for rebuild. - -* Sun Jul 18 2010 Xavier Bachelot 0.4.14-3 -- Add patch to fix PHP deprecated warnings with PHP 5.3. - (Patch from Jan Ondrej - RHBZ#572851) - -* Thu Aug 27 2009 Xavier Bachelot 0.4.14-2 -- Ship contrib directory as doc. - -* Thu Aug 27 2009 Xavier Bachelot 0.4.14-1 -- Update to 0.4.14 (RHBZ#518069). -- Fix typo in README.fedora (RHBZ#490664). -- Move npcdmod.o to a better place. -- BR: rrdtool-perl - -* Sun Jul 26 2009 Fedora Release Engineering - 0.4.12-4 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild - -* Thu Feb 26 2009 Fedora Release Engineering - 0.4.12-3 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild - -* Thu Dec 4 2008 Michael Schwendt 0.4.12-2 -- Include /usr/libexec/pnp4nagios directory. - -* Tue Oct 21 2008 Robert M. Albrecht 0.4.12-1 -- Upstream released 0.4.12 - -* Tue Sep 02 2008 Xavier Bachelot 0.4.10-3 -- Fix logrotate conf (RHBZ#460861). - -* Fri Jul 18 2008 Xavier Bachelot 0.4.10-2 -- Fix typo in logrotate conf. - -* Wed Jul 09 2008 Xavier Bachelot 0.4.10-1 -- Update to 0.4.10. - -* Tue May 27 2008 Xavier Bachelot 0.4.9-3 -- Fix npcd init script to use /etc/pnp4nagios. - -* Tue May 27 2008 Xavier Bachelot 0.4.9-2 -- Install npcd unstripped to let rpm do it. - -* Sat May 24 2008 Xavier Bachelot 0.4.9-1 -- Update to 0.4.9. -- Rename to pnp4nagios to match other distros packages. - -* Mon Apr 14 2008 Xavier Bachelot 0.4.7-5 -- Log to file by default. -- Kill pnpsender man page. - -* Mon Apr 07 2008 Xavier Bachelot 0.4.7-4 -- Install inside of nagios html dir. - -* Mon Apr 07 2008 Xavier Bachelot 0.4.7-3 -- Provide properly named config files. -- Add missing Requires:. -- Add a logrotate conf file. - -* Fri Apr 04 2008 Xavier Bachelot 0.4.7-2 -- Add an initscript for npcd. - -* Wed Mar 19 2008 Xavier Bachelot 0.4.7-1 -- Initial build. diff --git a/sources b/sources deleted file mode 100644 index 076fd63..0000000 --- a/sources +++ /dev/null @@ -1,2 +0,0 @@ -541344af6611637cee54f0f243747c16 pnp4nagios-0.6.22.tar.gz -0cdd3f77606738883af99e5a08986c70 pnp4nagios-0.6.25.tar.gz