c53df6c
--- trunk/contrib/verify_pnp_config.in	2009/05/02 09:17:40	632
c53df6c
+++ trunk/contrib/verify_pnp_config.in	2009/08/26 22:12:22	654
c53df6c
@@ -1,7 +1,9 @@
c53df6c
-#!@PERL@ -w
c53df6c
+#!/usr/bin/perl -w
c53df6c
 #
c53df6c
 # (C) 2008-2009 pnp4nagios.org / Wolfgang Nieder
c53df6c
 #
c53df6c
+# $Id$ 
c53df6c
+#
c53df6c
 # check Nagios/PNP integration settings
c53df6c
 # 2008.09.21: 0.1    initial version
c53df6c
 # 2008.09.23: 0.1.1  precheck / logfile
c53df6c
@@ -16,24 +18,39 @@
c53df6c
 # 2009.02.23: 0.1.10 check perfdata directory / bugfixes
c53df6c
 # 2009.03.06: 0.1.11 check for multiple entries / bugfixes
c53df6c
 # 2009.04.21: 0.1.12 check for Time::HiRes
c53df6c
+# 2009.07.08: 0.1.13 Icinga support / bugfix (templates)
c53df6c
+# 2009.08.05: 0.1.14 bugfixes (Icinga support / non-standard paths)
c53df6c
+# 2009.08.11: 0.1.15 changed Doc-paths
c53df6c
+# 2009.08.18: 0.1.16 added layout option / package detection
c53df6c
 
c53df6c
 use strict;
c53df6c
 use Getopt::Long;
c53df6c
 use File::Find;
c53df6c
 
c53df6c
-my $program = "Check Nagios/PNP integration";
c53df6c
-my $version = "0.1.12";
c53df6c
+my $program = "Check Nagios/Icinga/PNP integration";
c53df6c
+my $version = "0.1.16";
c53df6c
 my $help = 0;
c53df6c
 my $debug = 0;
c53df6c
 my $quiet = 0;
c53df6c
+my $time = 0;
c53df6c
 my $wc = 0;
c53df6c
 my $err = 0;
c53df6c
+my $warn = 0;
c53df6c
+my $crit = 0;
c53df6c
+my $product = lc("nagios");
c53df6c
+my $pnp_version = '@PKG_VERSION@';
c53df6c
+my $install_opts = '@INSTALL_OPTS@';
c53df6c
+my $doc_version = '0.4';
c53df6c
+# 
c53df6c
+# please remove the hash sign (#) on the following line if you're using Icinga
c53df6c
+# or specify "-M icinga"
c53df6c
+# $product = lc("icinga");
c53df6c
+my $prod_name = ucfirst($product);
c53df6c
 my $basedir = '@prefix@';
c53df6c
-$basedir = "/usr/local/nagios" unless (-d "$basedir");
c53df6c
-my $NagiosBase = $basedir if (-d "$basedir");
c53df6c
-my $NagiosBin = "nagios" if (-f "$basedir/bin/nagios");
c53df6c
+my $NagiosBase = "";
c53df6c
+my $NagiosBin = "$product" if (-f "$basedir/bin/$product");
c53df6c
 my $mode = "";
c53df6c
-my $NagiosCfg = "$NagiosBase/etc/nagios.cfg" if (-f "$NagiosBase/etc/nagios.cfg");
c53df6c
+my $NagiosCfg = "";
c53df6c
 my %NagiosCfg = ();
c53df6c
 my $rrdtool = '@RRDTOOL@';
c53df6c
 $rrdtool = "/usr/bin/rrdtool" unless ((-f "$rrdtool") and (-x "$rrdtool"));
c53df6c
@@ -46,6 +63,8 @@
c53df6c
 my %PPcfg = ();
c53df6c
 my $CPcfg = "";	# config.php
c53df6c
 my %CPcfg = ();
c53df6c
+my $RFcfg = "";	# resource.cfg
c53df6c
+my %RFcfg = ();
c53df6c
 my $nFile = "";
c53df6c
 my @CfgFiles = ();
c53df6c
 my %commands = ();
c53df6c
@@ -60,10 +79,12 @@
c53df6c
 my $gid = "";
c53df6c
 my $user = "";
c53df6c
 my $group = "";
c53df6c
-my $language = "";
c53df6c
+my $layout = "";
c53df6c
+my $pkg_mgr = "";
c53df6c
+my $language = "en";
c53df6c
 my $english = "";
c53df6c
 if (exists $ENV{LANG}) {
c53df6c
-	$language = "/de" if ($ENV{LANG} =~ /de/i);
c53df6c
+	$language = "de" if ($ENV{LANG} =~ /de/i);
c53df6c
 }
c53df6c
 my %msg = ();
c53df6c
 
c53df6c
@@ -83,16 +104,25 @@
c53df6c
 	"q|quiet" => \$quiet,
c53df6c
 	"r|rrdtool=s" => \$rrdtool,
c53df6c
 	"R|RRDpath=s" => \$RRDpath,
c53df6c
+	"U|resource=s" => \$RFcfg,
c53df6c
 	"u|user=s" => \$user,
c53df6c
 	"g|group=s" => \$group,
c53df6c
 	"l|logfile=s" => \$LogFile,
c53df6c
 	"o|object=s" => \$Object,
c53df6c
+	"M|monitor=s" => \$product,
c53df6c
+	"L|layout=s" => \$layout,
c53df6c
+	"t|time" => \$time,
c53df6c
 );
c53df6c
 
c53df6c
+if ($pnp_version =~ /^(\d+\.\d+)/) {
c53df6c
+	$doc_version = "$1";
c53df6c
+}
c53df6c
+$product = lc($product);
c53df6c
+$prod_name = ucfirst($product);
c53df6c
 info ("\n\n$program, v$version\n");
c53df6c
 if ($english) {
c53df6c
 	info ("[I] option -e");
c53df6c
-	$language = "";
c53df6c
+	$language = "en";
c53df6c
 }
c53df6c
 message();
c53df6c
 
c53df6c
@@ -115,7 +145,62 @@
c53df6c
 	info ("info","OS","$line");
c53df6c
 }
c53df6c
 info ("info","Perl","$]");
c53df6c
+if ($mode) {
c53df6c
+	$pkg_mgr = eval "`whereis yum`";
c53df6c
+	if ($pkg_mgr =~/:\s+$/) {
c53df6c
+		$pkg_mgr = eval "`whereis dpkg`";
c53df6c
+		if ($pkg_mgr =~/:\s+$/) {
c53df6c
+			$pkg_mgr = eval "`whereis rpm`";
c53df6c
+		}
c53df6c
+	}
c53df6c
+	($pkg_mgr) = $pkg_mgr =~ /:\s*(\S+)/;
c53df6c
+	if ($pkg_mgr) {
c53df6c
+		info ("info","Package Manager","$pkg_mgr");
c53df6c
+		chk_pkg ("nagios",0,1);
c53df6c
+		chk_pkg ("icinga",0,1);
c53df6c
+		chk_pkg ("pnp4nagios",0,1);
c53df6c
+		chk_pkg ("mod-php5,mod_php5",1,0);
c53df6c
+		chk_pkg ("php,php5",1,1);
c53df6c
+		chk_pkg ("dejavu",1,0);
c53df6c
+		if ($crit) {
c53df6c
+			info ("LinkReqSW");
c53df6c
+			exit 30;
c53df6c
+		}
c53df6c
+	}
c53df6c
+	info ("install_opts","$install_opts") unless ($install_opts =~ /\@INSTALL_OPTS\@/i);
c53df6c
+	info ("PNP-version","$pnp_version") unless ($pnp_version =~ /\@PKG_VERSION\@/i);
c53df6c
+}	
c53df6c
+	
c53df6c
+if ($layout) {
c53df6c
+	info ("info","Layout","$layout");
c53df6c
+	if ($layout =~ /fedora/i) {
c53df6c
+		$basedir = "/usr/share" unless ($NagiosBase);
c53df6c
+		$NagiosCfg = "/etc/nagios/nagios.cfg" unless ($NagiosCfg);
c53df6c
+		$NagiosBin = "/usr/sbin/nagios" unless ($NagiosBin);
c53df6c
+		$RRDpath = "/var/lib/pnp4nagios" unless ($RRDpath);
c53df6c
+	}	
c53df6c
+	elsif ($layout =~ /suse/i) {
c53df6c
+		$basedir = "/usr/share" unless ($NagiosBase);
c53df6c
+		$NagiosCfg = "/etc/nagios/nagios.cfg" unless ($NagiosCfg);
c53df6c
+		$NagiosBin = "/usr/sbin/nagios" unless ($NagiosBin);
c53df6c
+		$RRDpath = "/var/spool/nagios-pnp" unless ($RRDpath);
c53df6c
+	}	
c53df6c
+	elsif ($layout =~ /nagios2/i) {
c53df6c
+		$basedir = "/etc/nagios2" unless ($NagiosBase);
c53df6c
+		$NagiosCfg = "/etc/nagios2/nagios.cfg" unless ($NagiosCfg);
c53df6c
+		$NagiosBin = "/usr/sbin/nagios2" unless ($NagiosBin);
c53df6c
+	}	
c53df6c
+	elsif ($layout =~ /nagios3/i) {
c53df6c
+		$basedir = "/etc/nagios3" unless ($NagiosBase);
c53df6c
+		$NagiosCfg = "/etc/nagios3/nagios.cfg" unless ($NagiosCfg);
c53df6c
+		$NagiosBin = "/usr/sbin/nagios3" unless ($NagiosBin);
c53df6c
+	} else {
c53df6c
+		info ("invOption","$layout");
c53df6c
+	}	
c53df6c
+}	
c53df6c
 
c53df6c
+$basedir = "/usr/local/$product" if ($basedir =~ /^\@prefix\@$/);
c53df6c
+$NagiosBase = $basedir unless ($NagiosBase);
c53df6c
 if (! defined($NagiosBase)) {
c53df6c
 	info ("noBase");
c53df6c
 	exit 3
c53df6c
@@ -125,27 +210,45 @@
c53df6c
 	exit 3
c53df6c
 }
c53df6c
 info ("useBase", "$NagiosBase");
c53df6c
+$NagiosCfg = "$NagiosBase/etc/$product.cfg" unless ($NagiosCfg);
c53df6c
 if (! defined($NagiosCfg)) {
c53df6c
-	info ("noCfg");
c53df6c
-	exit 4
c53df6c
+	if (-f "$NagiosBase/etc/$product.cfg") {
c53df6c
+		$NagiosCfg = "$NagiosBase/etc/$product.cfg";
c53df6c
+	} else {
c53df6c
+		info ("noCfg");
c53df6c
+		exit 4
c53df6c
+	}
c53df6c
 }
c53df6c
 if (! -f "$NagiosCfg") {
c53df6c
 	info ("noCfgFile","$NagiosCfg");
c53df6c
 	exit 5
c53df6c
 }
c53df6c
 info ("useCfg","$NagiosCfg");
c53df6c
+if (! defined($NagiosBin)) {
c53df6c
+	if (-f "$NagiosBase/bin/$product") {
c53df6c
+		$NagiosBin = "$NagiosBase/bin/$product";
c53df6c
+	} else {
c53df6c
+		info ("noBinary", "$product") && exit 6;
c53df6c
+	}
c53df6c
+}
c53df6c
 if ($NagiosBin !~ /^\//) {
c53df6c
 	$NagiosBin = "$NagiosBase/bin/$NagiosBin";
c53df6c
 }
c53df6c
-examine ("x;", "Nagios-Binary", "$NagiosBin") && exit 6;
c53df6c
+examine ("x;", "${prod_name}-Binary", "$NagiosBin") && exit 6;
c53df6c
 info ("useBinary","$NagiosBin");
c53df6c
 
c53df6c
 if ($mode) {
c53df6c
-	if ($mode !~ /^default$|^Bulk$|^NPCD$/i) {
c53df6c
+	if ($mode !~ /^default$|^sync$|^Bulk$|^NPCD$/i) {
c53df6c
 		info ("invPNPmode");
c53df6c
 		info ("LinkPNPconfig");
c53df6c
 		exit 7
c53df6c
 	}
c53df6c
+	if ($mode =~ /^default$/) {
c53df6c
+		$mode = "sync";
c53df6c
+		if (($pnp_version =~ /^(\d+\.\d+)/) and ($1 >= 0.6)) {
c53df6c
+			$mode = "NPCD";
c53df6c
+		}
c53df6c
+	}
c53df6c
 	info ("PNPmode","$mode");
c53df6c
 }
c53df6c
 if (($LogFile ne "") and (! -f $LogFile)) {
c53df6c
@@ -156,10 +259,10 @@
c53df6c
 info ("useLog","$LogFile") if ($LogFile);
c53df6c
 
c53df6c
 # get Nagios version 
c53df6c
-my $NagiosVer = `$NagiosBin -V | grep "Nagios "`;
c53df6c
+my $NagiosVer = `$NagiosBin -V | grep "$prod_name " | head -1`;
c53df6c
 chomp $NagiosVer;
c53df6c
-info ("[I] Nagios info: $NagiosVer");
c53df6c
-($NagiosVer) = $NagiosVer =~ /Nagios (\d+)\./;
c53df6c
+info ("[I] $prod_name info: $NagiosVer");
c53df6c
+($NagiosVer) = $NagiosVer =~ /$prod_name .*?(\d+)\./;
c53df6c
 
c53df6c
 # check Nagios Config
c53df6c
 info ("verifyCfg");
c53df6c
@@ -170,6 +273,7 @@
c53df6c
 	info ("LinkNagiosChk");
c53df6c
 	exit 9;
c53df6c
 }
c53df6c
+process_nagios_cfg();
c53df6c
 
c53df6c
 # check rrdtool
c53df6c
 if ($mode) {
c53df6c
@@ -209,9 +313,29 @@
c53df6c
 	if (! $erg) {
c53df6c
 		info ("noHiRes");
c53df6c
 	}
c53df6c
+
c53df6c
+	if ($RFcfg eq "") {
c53df6c
+#		($RFcfg) = $NagiosCfg =~ m#(^.*/)#;
c53df6c
+#		$RFcfg .= "resource.cfg";
c53df6c
+		$RFcfg = $NagiosCfg{"resource_file"};
c53df6c
+	}
c53df6c
+	info ("procFile","$RFcfg");
c53df6c
+	open (RFILE, "$RFcfg") || abort (29, "errOpen", "$RFcfg", "$!");
c53df6c
+	while (<RFILE>) {
c53df6c
+		chomp;
c53df6c
+		s/#.*//;
c53df6c
+		s/\s*$//;
c53df6c
+		next if (/^$/);
c53df6c
+		my ($par, $val) = /^(.*?)=(.*)/;	# shortest string (broker module contains multiple equal signs)
c53df6c
+		if (($par eq "") or ($val eq "")) {
c53df6c
+			info ("oddLine", "$_");
c53df6c
+			next;
c53df6c
+		}
c53df6c
+		$RFcfg{"$par"} .= $val;
c53df6c
+	}
c53df6c
+	close (RFILE);
c53df6c
 }
c53df6c
 
c53df6c
-process_nagios_cfg();
c53df6c
 status_log();
c53df6c
 process_cfg_log();
c53df6c
 
c53df6c
@@ -237,8 +361,8 @@
c53df6c
 	if ($NagiosCfg{"process_performance_data"} !~ /^1$/) {
c53df6c
 		info ("noPerfEna");
c53df6c
 		info ("LinkEnaPerf");
c53df6c
-		if ($mode =~ /default/i) {
c53df6c
-			info ("PNPdefault");
c53df6c
+		if ($mode =~ /sync/i) {
c53df6c
+			info ("PNPsync");
c53df6c
 		} elsif ($mode =~ /NPCD/i) {
c53df6c
 			info ("PNPnpcd");
c53df6c
 		} else {	
c53df6c
@@ -250,15 +374,15 @@
c53df6c
 	info ("LinkEnaPerf");
c53df6c
 }
c53df6c
 
c53df6c
-# check default mode
c53df6c
-if (($NagiosVer >= 3) and (uc($mode) =~ /default/i)) {
c53df6c
+# check sync mode
c53df6c
+if (($NagiosVer >= 3) and (uc($mode) =~ /sync/i)) {
c53df6c
 	if ((exists $NagiosCfg{"enable_environment_macros"}) and ($NagiosCfg{"enable_environment_macros"} !~ /^1$/)) {
c53df6c
 		info ("envMacrosDis");
c53df6c
 		info ("LinkEnaEnv");
c53df6c
 	}
c53df6c
 }
c53df6c
-chk_param ("service_perfdata_command", "default");
c53df6c
-chk_param ("host_perfdata_command", "default");
c53df6c
+chk_param ("service_perfdata_command", "sync");
c53df6c
+chk_param ("host_perfdata_command", "sync");
c53df6c
 
c53df6c
 # check Bulk modes
c53df6c
 chk_param ("service_perfdata_file", "Bulk|NPCD");
c53df6c
@@ -290,6 +414,12 @@
c53df6c
 		info ("invDir", "$RRDpath");
c53df6c
 	} else {
c53df6c
 		info ("RRDpath", "$RRDpath");
c53df6c
+		my $erg = eval "open (TST, \">$RRDpath/testfile\")";
c53df6c
+		if (! $erg) {
c53df6c
+			info ("noWrite","$RRDpath","$NagiosCfg{\"${product}_user\"}");
c53df6c
+		} else {
c53df6c
+			unlink ("$RRDpath/testfile");
c53df6c
+		}
c53df6c
 		find(\&chk_perfdata, "$RRDpath");
c53df6c
 		if ($RRDfile) {
c53df6c
 			info ("RRDcount", $RRDdir, $RRDfile);
c53df6c
@@ -301,11 +431,18 @@
c53df6c
 
c53df6c
 if ($wc == 0) {
c53df6c
 	info ("noErrors");
c53df6c
-} else {
c53df6c
+	print "OK | Errors=0\n" if ($quiet);
c53df6c
+	exit 0
c53df6c
+} elsif ($crit == 0) {
c53df6c
+	info ("Warnings");
c53df6c
+	print "WARNING | Warnings=$warn; Errors=$crit\n" if ($quiet);
c53df6c
+	exit 1
c53df6c
+} else {	
c53df6c
 	info ("Errors");
c53df6c
+	print "CRITICAL | Warnings=$warn; Errors=$crit\n" if ($quiet);
c53df6c
+	exit 2
c53df6c
 }
c53df6c
-print "\n";
c53df6c
-exit $wc;
c53df6c
+exit 3;
c53df6c
 
c53df6c
 #
c53df6c
 # subroutines
c53df6c
@@ -315,7 +452,7 @@
c53df6c
 	return if ($quiet);
c53df6c
 	if ($language =~ /de/i) {
c53df6c
 	print <
c53df6c
-Dieses Script prueft verschiedene Einstellungen/Eintraege in Ihrer Nagios-
c53df6c
+Dieses Script prueft verschiedene Einstellungen/Eintraege in Ihrer $prod_name-
c53df6c
 bzw. PNP-Umgebung, um Ihnen beim Finden von Problemen zu helfen.
c53df6c
 Es kann vor und waehrend der Laufzeit von PNP benutzt werden.
c53df6c
 
c53df6c
@@ -330,7 +467,7 @@
c53df6c
 EOF1
c53df6c
 } else {
c53df6c
 print <
c53df6c
-This script will check certain settings/entries of your Nagios/PNP environ-
c53df6c
+This script will check certain settings/entries of your $prod_name/PNP environ-
c53df6c
 ment to assist you in finding problems when you are using PNP.
c53df6c
 It may be used prior and during operation of PNP.
c53df6c
 
c53df6c
@@ -352,29 +489,40 @@
c53df6c
 	[ -c <config file> ]
c53df6c
 	[ -N <npcd config file> ]
c53df6c
 	[ -P <process_perfdata config file> ]
c53df6c
+	[ -r <rrdtool binary> ]
c53df6c
 	[ -R <perfdata directory>|no ]
c53df6c
+	[ -U <resource config file> ]
c53df6c
+	[ -u <user> ]
c53df6c
+	[ -g <group> ]
c53df6c
+	[ -M <monitoring product> ]
c53df6c
+	[ -L <layout> ]
c53df6c
+	[ -t ]
c53df6c
 	[ -e ]
c53df6c
 	[ -d | -q ]
c53df6c
 	   
c53df6c
 parameters:
c53df6c
 	-h, --help        print these lines
c53df6c
-	-b, --basedir=s   Nagios Base directory (default: $basedir)
c53df6c
-	-B, --binary=s    Nagios binary (default: nagios)
c53df6c
-	-c, --config=s    Nagios main config file (default: $basedir/etc/nagios.cfg)
c53df6c
-	-m, --mode=s      PNP mode ("default", "bulk", "NPCD")
c53df6c
+	-b, --basedir=s   $prod_name Base directory (default: $basedir)
c53df6c
+	-B, --binary=s    $prod_name binary (default: $product)
c53df6c
+	-c, --config=s    $prod_name main config file (default: $basedir/etc/product.cfg)
c53df6c
+	-m, --mode=s      PNP mode ("default", "sync", "bulk", "NPCD")
c53df6c
 	-l, --logfile=s   check configure log file 
c53df6c
 	-N, --npcdcfg=s   PNP config file for NPCD mode (default: $basedir/etc/pnp/npcd.cfg)
c53df6c
 	-P, --ppcfg=s     process_perfdata config file (default: $basedir/etc/pnp/process_perfdata.cfg)
c53df6c
 	-p, --precheck    use config files instead of objects cache
c53df6c
 	-r, --rrdtool=s   specify the location of the RRDtool binary
c53df6c
 	-R, --RRDpath=s   specify the perfdata directory (default: $basedir/share/perfdata) or "no" for no check
c53df6c
+	-U, --resource=s  specify the location of the resource.cfg (default: $basedir/etc/resource.cfg)
c53df6c
+	-M, --monitor=s   specify the monitoring product (default: nagios)
c53df6c
+	-L, --layout=s    specify a layout (Nagios2, Nagios3, SuSE, Fedora)
c53df6c
 	-u, --user=s      user of the perfdata directory
c53df6c
 	-g, --group=s     group of the perfdata directory
c53df6c
 	-q, --quiet       quiet mode, non-zero return code will indicate errors
c53df6c
-	-o, --object=s    Nagios object (host name/service description)
c53df6c
+	-o, --object=s    $prod_name object (host name/service description)
c53df6c
 	                  "Name" : search for matching host name or service desc
c53df6c
 	                  "Name;": search for matching host name
c53df6c
 	                  ";Name": search for service description
c53df6c
+	-t, --time        show warnings if RRDfiles are too old
c53df6c
 	-e, --english     show english messages/links
c53df6c
 	-d, --debug       some debugging output
c53df6c
 EOF3
c53df6c
@@ -406,7 +554,7 @@
c53df6c
 			info ("dupEntry","$key");
c53df6c
 		}
c53df6c
 	}
c53df6c
-	info ("[I] nagios_user=$NagiosCfg{nagios_user}");
c53df6c
+	info ("[I] ${product}_user=$NagiosCfg{\"${product}_user\"}");
c53df6c
 	if ($user) {
c53df6c
 		$uid = getpwnam ($user);
c53df6c
 		if (! $uid) {
c53df6c
@@ -415,10 +563,10 @@
c53df6c
 		}
c53df6c
 		info ("[I] perfdata_user=$user");
c53df6c
 	} else {
c53df6c
-		$uid = getpwnam ($NagiosCfg{nagios_user});
c53df6c
-		$user = $NagiosCfg{nagios_user};
c53df6c
+		$uid = getpwnam ($NagiosCfg{"${product}_user"});
c53df6c
+		$user = $NagiosCfg{"${product}_user"};
c53df6c
 	}
c53df6c
-	info ("[I] nagios_group=$NagiosCfg{nagios_group}");
c53df6c
+	info ("[I] ${product}_group=$NagiosCfg{\"${product}_group\"}");
c53df6c
 	if ($group) {
c53df6c
 		$gid = getgrnam ($group);
c53df6c
 		if (! $gid) {
c53df6c
@@ -427,8 +575,8 @@
c53df6c
 		}
c53df6c
 		info ("[I] perfdata_group=$group");
c53df6c
 	} else {
c53df6c
-		$gid = getgrnam ($NagiosCfg{nagios_group});
c53df6c
-		$group = $NagiosCfg{nagios_group};
c53df6c
+		$gid = getgrnam ($NagiosCfg{"${product}_group"});
c53df6c
+		$group = $NagiosCfg{"${product}_group"};
c53df6c
 	}
c53df6c
 }
c53df6c
 
c53df6c
@@ -473,15 +621,21 @@
c53df6c
 			$StatusLog{"$name"} = $zeile;
c53df6c
 			info ("[D] $zeile") if ($debug);
c53df6c
 			if ($hostname ne "") {
c53df6c
-				next if ($zeile !~ /host_name=$hostname/i);
c53df6c
+				if ($zeile !~ /host_name=$hostname/i) {
c53df6c
+					$zeile = "";
c53df6c
+					next;
c53df6c
+				}	
c53df6c
 			}
c53df6c
 			if ($srvdesc ne "") {
c53df6c
-				next if ($zeile !~ /service_description=$srvdesc/i);
c53df6c
+				if ($zeile !~ /service_description=$srvdesc/i) {
c53df6c
+					$zeile = "";
c53df6c
+					next;
c53df6c
+				}	
c53df6c
 			}
c53df6c
 			if (uc($name) =~ /$Object/i) {
c53df6c
 				$name =~ s/.*?;//;
c53df6c
-				my ($perf_data) = /performance_data\s*=\s*(.*)?#/;
c53df6c
-				if (defined($perf_data)) {
c53df6c
+				my ($perf_data) = $zeile =~ /#performance_data\s*=\s*(.*?)#/;
c53df6c
+				if ($perf_data ne "") {
c53df6c
 					info ("[I] Performance data ($name): $perf_data");
c53df6c
 					$_= $perf_data." ";
c53df6c
 					# try to check for valid performance data according to
c53df6c
@@ -501,6 +655,7 @@
c53df6c
 						} else {
c53df6c
 							info ("[D] Label:>$label<") if ($debug);
c53df6c
 						}
c53df6c
+						s/,/./g;	# change decimal comma 
c53df6c
 						s/^(.*?)[; ]//;
c53df6c
 						my ($value,$uom) = $1 =~ /([-]?[0-9.]+)(.*)/;
c53df6c
 						if (! defined($value)) {
c53df6c
@@ -570,8 +725,8 @@
c53df6c
 	examine ("f;","RRDTOOL",$LogFile{"RRDTOOL"});	
c53df6c
 	examine ("f;","NPCD_LOG",$LogFile{"NPCD_LOG"});	
c53df6c
 
c53df6c
-	examine ("u;","nagios_user",$LogFile{"nagios_user"});	
c53df6c
-	examine ("g;","nagios_grp",$LogFile{"nagios_grp"});	
c53df6c
+	examine ("u;","${product}_user",$LogFile{"${product}_user"});	
c53df6c
+	examine ("g;","${product}_grp",$LogFile{"${product}_grp"});	
c53df6c
 }
c53df6c
 
c53df6c
 # check parameter from nagios.cfg
c53df6c
@@ -598,7 +753,7 @@
c53df6c
 			$chk .= " -d HOSTPERFDATA" if ($param =~ /^host/);
c53df6c
 			if ( $cmd !~ /$chk$/i) {
c53df6c
 				info ("invValue2","$cmd","$param");
c53df6c
-				info ("PNPdefault");
c53df6c
+				info ("PNPsync");
c53df6c
 			}
c53df6c
 		}
c53df6c
 		if ($param =~ /perfdata_file_template/) {
c53df6c
@@ -619,12 +774,14 @@
c53df6c
 			info ("LinkNagiosCfg","$param");
c53df6c
 			return;
c53df6c
 		}
c53df6c
-		if ($NagiosVer >= 3) {
c53df6c
-			info ("noParCfgH","$param");
c53df6c
-		} else {
c53df6c
-			info ("notAdv","$param");
c53df6c
+		if ($prod_name eq "Icinga") {
c53df6c
+			if ($NagiosVer >= 3) {
c53df6c
+				info ("noParCfgH","$param");
c53df6c
+			} else {
c53df6c
+				info ("notAdv","$param");
c53df6c
+			}
c53df6c
+			info ("LinkNagiosCfg","$param");
c53df6c
 		}
c53df6c
-		info ("LinkNagiosCfg","$param");
c53df6c
 	}
c53df6c
 }
c53df6c
 
c53df6c
@@ -645,6 +802,20 @@
c53df6c
 		}
c53df6c
 		($line) = /command_line\s*(.*)/ ;	
c53df6c
 		$commands{"$cmd"} = "$line";
c53df6c
+		next unless (/process_perfdata.pl/);
c53df6c
+		my @cmd = split (/\s+/,$line);
c53df6c
+		for my $i (0..$#cmd) {
c53df6c
+			if ($cmd[$i] =~ /(\$USER\d+\$)/) {
c53df6c
+				if (exists $RFcfg{"$1"}) {		
c53df6c
+					my $val = $RFcfg{"$1"};
c53df6c
+					$cmd[$i] =~ s/\$USER\d+\$/$val/;
c53df6c
+				} else {
c53df6c
+					info ("noRes", "$1");	
c53df6c
+				}
c53df6c
+			}
c53df6c
+			info ("noFile", "$cmd", "$cmd[$i]") unless (-f "$cmd[$i]");
c53df6c
+			last if ($cmd[$i] =~ /perfdata.pl/);
c53df6c
+		}
c53df6c
 	}
c53df6c
 	close (CFILE);
c53df6c
 	if ($debug) {
c53df6c
@@ -685,8 +856,12 @@
c53df6c
 	my $zeile = "";
c53df6c
 	info ("[D] var:>$var<") if ($debug);
c53df6c
 	return if (/^$/);
c53df6c
-	s/^(.*?)[; ]//;
c53df6c
+	s/^(.*?)([; ])//;
c53df6c
 	my $value = $1 || "";
c53df6c
+	if (($value ne "") and ($2 eq " ")) {
c53df6c
+		$_ = " ".$_;
c53df6c
+		return;
c53df6c
+	}
c53df6c
 	$zeile .= "value:>$value< ";
c53df6c
 	if ($value) {
c53df6c
 		if ($value !~ /$pattern/) {
c53df6c
@@ -739,14 +914,10 @@
c53df6c
 #	$template{"${type}STATE"} = 0;
c53df6c
 	$template{"HOSTSTATE"} = 0;
c53df6c
 	$template{"HOSTSTATETYPE"} = 0;
c53df6c
-	if ($type eq "HOST") {
c53df6c
-		$template{"HOSTOUTPUT"} = 0;
c53df6c
-	}
c53df6c
 	if ($type eq "SERVICE") {
c53df6c
 		$template{"SERVICEDESC"} = 0;
c53df6c
 		$template{"SERVICESTATE"} = 0;
c53df6c
 		$template{"SERVICESTATETYPE"} = 0;
c53df6c
-		$template{"SERVICEOUTPUT"} = 0;
c53df6c
 	}
c53df6c
 	info ("chkTemplate","$param");
c53df6c
 	my $val = $NagiosCfg{"$param"};
c53df6c
@@ -806,6 +977,7 @@
c53df6c
 	$NPCDcfg{sleep_time} = 'n;^\d+$;439';	# new since 0.4.8
c53df6c
 	$NPCDcfg{identify_npcd} = "v;0|1;497";	# new since 0.4.11
c53df6c
 	$NPCDcfg{perfdata_file} = "d;;558";
c53df6c
+	$NPCDcfg{perfdata_spool_filename} = "f;;643";
c53df6c
 	$err = 0;
c53df6c
 
c53df6c
 # try to set a file name if variable is unset
c53df6c
@@ -899,7 +1071,7 @@
c53df6c
 	$CPcfg{'$conf[\'allowed_for_host_overview\']'} = 'S;[\S,]+;';
c53df6c
 	$CPcfg{'$conf[\'allowed_for_pages\']'} = 'S;[\S,]+;381';
c53df6c
 	$CPcfg{'$conf[\'overview-range\']'} = 'v;0|1;';
c53df6c
-	$CPcfg{'$conf[\'lang\']'} = 'v;en|de|fr|se|nl;';
c53df6c
+	$CPcfg{'$conf[\'lang\']'} = 'v;en|de|fr|se|nl|es;';
c53df6c
 	$CPcfg{'$conf[\'date_fmt\']'} = "S;.*;279";
c53df6c
 	$CPcfg{'$conf[\'rrd_daemon_opts\']'} = 'S;.*;520';
c53df6c
 	$CPcfg{'$conf[\'enable_recursive_template_search\']'} = 'v;0|1;595';
c53df6c
@@ -1048,7 +1220,6 @@
c53df6c
 sub info {
c53df6c
 	my @par = @_;
c53df6c
 	my $line = "";
c53df6c
-	return if ($quiet);
c53df6c
 	
c53df6c
 	if (exists ($msg{"$par[0]"})) {
c53df6c
 		$line = $msg{"$par[0]"};
c53df6c
@@ -1060,21 +1231,25 @@
c53df6c
 	}
c53df6c
 	if ($line =~ /\[E\]/) {
c53df6c
 		$wc++;
c53df6c
-		$err++;
c53df6c
+		$crit++;
c53df6c
+	}
c53df6c
+	if ($line =~ /\[W\]/) {
c53df6c
+		$wc++;
c53df6c
+		$warn++;
c53df6c
 	}
c53df6c
-	print "$line\n";
c53df6c
+	print "$line\n" unless ($quiet);
c53df6c
 }
c53df6c
 
c53df6c
 # abort script
c53df6c
 sub abort {
c53df6c
-	my ($rc, @par);
c53df6c
+	my ($rc, @par) = @_;
c53df6c
 	info (@par);
c53df6c
 	exit $rc;
c53df6c
 }
c53df6c
 
c53df6c
 # check perfdata dir
c53df6c
 sub chk_perfdata {
c53df6c
-	-d && $RRDdir++;
c53df6c
+	-d && $_ ne "." && $RRDdir++;
c53df6c
 	my $f = "$File::Find::name";
c53df6c
 	return unless (($f =~ /\/$/) or ($f =~ /rrd$|xml$/));
c53df6c
 	if ($uid) {
c53df6c
@@ -1092,6 +1267,19 @@
c53df6c
 	return unless ($f =~ /xml$/);
c53df6c
 	my $rc = 99;
c53df6c
 	my $txt = "no RC found in file";
c53df6c
+	if ($time) {
c53df6c
+		my $max_age = $CPcfg{'$conf[\'max_age\']'};
c53df6c
+		while ($max_age =~ /(\d+)\*(\d+)(\D.*)?/) {
c53df6c
+			if (defined($3)) {	
c53df6c
+				$max_age = $1 * $2."$3";
c53df6c
+			} else {
c53df6c
+				$max_age = $1 * $2;
c53df6c
+			}
c53df6c
+		}	
c53df6c
+		my $old = time() - $max_age;
c53df6c
+		my $age = (stat ($f))[9];
c53df6c
+		info ("RRDold","$f","$max_age") if ($age < $old);
c53df6c
+	}
c53df6c
 	open (F, "$f");
c53df6c
 	while (<F>) {
c53df6c
 		if (/<RC>(\d)<\/RC>/) {
c53df6c
@@ -1105,23 +1293,70 @@
c53df6c
 	info ("RRDrc","$f",$rc, "$txt") if ($rc);
c53df6c
 }
c53df6c
 	
c53df6c
+sub chk_pkg {
c53df6c
+	my ($pkg_names,$req,$exactly) = @_;
c53df6c
+	my @pkg_names = split (/,/,$pkg_names);
c53df6c
+	my $pkg_name = "";
c53df6c
+	my $pkg = "";
c53df6c
+
c53df6c
+	for my $idx (0..$#pkg_names) {
c53df6c
+		next if ($pkg);
c53df6c
+		$pkg_name = $pkg_names[$idx];
c53df6c
+		if ($pkg_mgr =~ /yum/) {
c53df6c
+			if ($exactly) {
c53df6c
+				$pkg = `yum list installed $pkg_name 2>/dev/null | grep "installed"`;
c53df6c
+			} else {
c53df6c
+				$pkg = `yum list installed 2>/dev/null | grep "$pkg_name" | grep "installed"`;
c53df6c
+			}
c53df6c
+			$pkg =~ s/\s+/ /g;
c53df6c
+			$pkg =~ s/ installed//g;
c53df6c
+		} elsif ($pkg_mgr =~ /dpkg/) {
c53df6c
+			if ($exactly) {
c53df6c
+				$pkg = `dpkg -l "$pkg_name" 2>/dev/null | grep "ii"`;
c53df6c
+			} else {
c53df6c
+				$pkg = `dpkg -l 2>/dev/null | grep "$pkg_name" | grep "ii"`;
c53df6c
+			}
c53df6c
+			$pkg =~ s/ii\s+//gs;
c53df6c
+			$pkg =~ s/\s+/ /gs;
c53df6c
+			$pkg =~ s/(\S+ \S+).*/$1/gs;
c53df6c
+		} elsif ($pkg_mgr =~ /rpm/) {
c53df6c
+			if ($exactly) {
c53df6c
+				$pkg = `rpm -qa $pkg_name`;
c53df6c
+			} else {
c53df6c
+				$pkg = `rpm -qa | grep $pkg_name`;
c53df6c
+			}
c53df6c
+		}
c53df6c
+	}
c53df6c
+	$pkg =~ s/\s$//gs;
c53df6c
+	if ($pkg) {
c53df6c
+		info ("Package","$pkg");
c53df6c
+		return 1
c53df6c
+	} else {
c53df6c
+		info ("noPkg","$pkg_names") if ($req);
c53df6c
+		return 0
c53df6c
+	}
c53df6c
+}
c53df6c
+
c53df6c
 # set different messages according to the language
c53df6c
 sub message {
c53df6c
 	$msg{"qd"} = "[E] --quiet and --debug are mutually exclusive";
c53df6c
-	$msg{"noBase"} = "[E] Nagios basedir not found/not specified";
c53df6c
-	$msg{"noBaseDir"} = "[E] Nagios basedir \"%s\" does not exist";
c53df6c
-	$msg{"useBase"} = "[I] using Nagios basedir \"%s\"";
c53df6c
-	$msg{"useBinary"} = "[I] using Nagios binary \"%s\"";
c53df6c
-	$msg{"noCfg"} = "[E] nagios.cfg not specified";
c53df6c
+	$msg{"noBase"} = "[E] $prod_name basedir not found/not specified";
c53df6c
+	$msg{"noBaseDir"} = "[E] $prod_name basedir \"%s\" does not exist";
c53df6c
+	$msg{"useBase"} = "[I] using $prod_name basedir \"%s\"";
c53df6c
+	$msg{"noBinary"} = "[E] binary \"%s\" not found/defined";
c53df6c
+	$msg{"useBinary"} = "[I] using $prod_name binary \"%s\"";
c53df6c
+	$msg{"noCfg"} = "[E] $product.cfg not specified";
c53df6c
 	$msg{"noCfgFile"} = "[E] config file \"%s\" not found";
c53df6c
-	$msg{"useCfg"} = "[I] using Nagios config \"%s\"";
c53df6c
+	$msg{"useCfg"} = "[I] using $prod_name config \"%s\"";
c53df6c
 	$msg{"binExec"} = "[E] File \"%s\" is not executable";
c53df6c
-	$msg{"verifyCfg"} = "[A] verifying Nagios config";
c53df6c
-	$msg{"invPNPmode"} = "[E] no valid mode specified (default, Bulk, NPCD)";
c53df6c
+	$msg{"verifyCfg"} = "[A] verifying $prod_name config";
c53df6c
+	$msg{"invPNPmode"} = "[E] no valid mode specified (sync, Bulk, NPCD, default)";
c53df6c
 	$msg{"PNPmode"} = "[I] PNP mode: \"%s\"";
c53df6c
+	$msg{"Package"} = "[I] Package: \"%s\"";
c53df6c
+	$msg{"noPkg"} = "[E] Package \"%s\" not found";
c53df6c
 	$msg{"useLog"} = "[I] LogFile \"%s\" specified";
c53df6c
-	$msg{"NagiosChkErr"} = "[E] Nagios check found errors";
c53df6c
-	$msg{"NagiosCfgErr"} = "[E] Nagios config contains errors";
c53df6c
+	$msg{"NagiosChkErr"} = "[E] $prod_name check found errors";
c53df6c
+	$msg{"NagiosCfgErr"} = "[E] $prod_name config contains errors";
c53df6c
 	$msg{"verifyRRD"} = "[A] checking RRDtool (%s)";
c53df6c
 	$msg{"info"} = "[I] %s: %s";
c53df6c
 	$msg{"invFile"} = "[E] \"%s\" is not a (regular) file";
c53df6c
@@ -1129,27 +1364,29 @@
c53df6c
 	$msg{"useEntry"} = "[I] using cfg_dir/cfg_file entries";
c53df6c
 	$msg{"useCache"} = "[I] using \"%s\" entries";
c53df6c
 	$msg{"dupEntry"} = "[E] directive \"%s\" is duplicate";
c53df6c
-	$msg{"noPerfEna"} = "[E] no performance data enabled (process_performance_data=1 in nagios.cfg)";
c53df6c
+	$msg{"noPerfEna"} = "[E] no performance data enabled (process_performance_data=1 in $product.cfg)";
c53df6c
 	$msg{"envMacrosDis"} = "[E] environment macros disabled (enable_environment_macros=0)";
c53df6c
 	$msg{"noFonts"} = "[H] dejavu fonts may be missing";
c53df6c
 	$msg{"noErrors"} = "\nNo (obvious) errors found. Happy graphing with PNP";
c53df6c
+	$msg{"Warnings"} = "\nWarnings found. Please check the settings.";
c53df6c
 	$msg{"Errors"} = "\nErrors found. Please check the settings and have a look at the documentation.";
c53df6c
 	$msg{"procFile"} = "[A] processing \"%s\"";
c53df6c
 	$msg{"searchObj"} = "[A] searching for \"%s\"";
c53df6c
 	$msg{"noLabel"} = "[E] no label defined";
c53df6c
 	$msg{"invValue"} = "[E] no valid value";
c53df6c
 	$msg{"invOption"} = "[E] \"%s\" is not a valid option";
c53df6c
-	$msg{"invUOM"} = "[E] \"%s\" doesn''t seem to be a valid UOM";
c53df6c
+	$msg{"invUOM"} = "[E] \"%s\" doesn't seem to be a valid UOM";
c53df6c
 	$msg{"minRev"} = "[W] option \"%s\" is valid starting with revision %s";
c53df6c
 	$msg{"maxRev"} = "[W] option \"%s\" is only valid until revision %s";
c53df6c
 	$msg{"noUser"} = "[E] (%s) user \"%s\" does not exist";
c53df6c
 	$msg{"noGroup"} = "[E] (%s) group \"%s\" does not exist";
c53df6c
 	$msg{"noPerf"} = "[E] There is NO performance data for \"%s\" !";
c53df6c
 	$msg{"noRRDchk"} = "[I] perfdata directory will NOT be checked";
c53df6c
-	$msg{"RRDpath"} = "[A] checking of \"%s\"";
c53df6c
+	$msg{"RRDpath"} = "[A] checking of RRDpath \"%s\"";
c53df6c
 	$msg{"RRDuser"} = "[E] \"%s\": owner is \"%s\" instead of %s";
c53df6c
 	$msg{"RRDgroup"} = "[E] \"%s\": group is \"%s\" instead of %s";
c53df6c
 	$msg{"RRDrc"} = "[E] \"%s\"\n\tRRDtool RC: %s, %s";
c53df6c
+	$msg{"RRDold"} = "[W] \"%s\" is older than %s seconds";
c53df6c
 	$msg{"RRDcount"} = "[I] %s dir(s) with a total of %s rrd file(s)";
c53df6c
 	$msg{"noRRDfiles"} = "[E] %s dir(s) but NO rrd files => NO graphs!";
c53df6c
 	$msg{"useRRDs"} = "[I] RRDs perl module installed";
c53df6c
@@ -1171,67 +1408,74 @@
c53df6c
 	$msg{"missTempVar"} = "[E] variable \"%s\" in template is missing";
c53df6c
 	$msg{"missinvTempVal"} = "[E] value \"%s\" in template is missing";
c53df6c
 	$msg{"noCmd"} = "[E] command_name \"%s\" not found";
c53df6c
-	$msg{"noParCfg"} = "[E] \"%s\" not found in nagios.cfg";
c53df6c
-	$msg{"noParCfgH"} = "[H] \"%s\" not found in nagios.cfg";
c53df6c
+	$msg{"noParCfg"} = "[E] \"%s\" not found in $product.cfg";
c53df6c
+	$msg{"noParCfgH"} = "[H] \"%s\" not found in $product.cfg";
c53df6c
 	$msg{"notAdv"} = "[H] \"%s\" not advisable in Nagios < 3.x";
c53df6c
 	$msg{"invChar"} = "[E] \"%s\" (\"%s\") has invalid format/contains invalid characters";
c53df6c
 	$msg{"undefVal"} = "[E] no (valid) value for \"%s\" defined";
c53df6c
 	$msg{"noNumber"} = "[E] %s not a valid number";
c53df6c
 	$msg{"startEnd"} = "[E] start (%s) is greater than end (%s)";
c53df6c
 	$msg{"noFile"} = "[E] (%s) file \"%s\" is missing";
c53df6c
-	$msg{"noFileYet"} = "[I] (%s) file \"%s\" doesn''t exist (yet)";
c53df6c
+	$msg{"noRes"} = "[E] resource \"%s\" is not defined";
c53df6c
+	$msg{"noFileYet"} = "[I] (%s) file \"%s\" doesn't exist (yet)";
c53df6c
 	$msg{"noDir"} = "[E] (%s) directory \"%s\" is missing";
c53df6c
 	$msg{"noSock"} = "[E] \"%s\" is not a socket";
c53df6c
+	$msg{"noWrite"} = "[E] \"%s\": no write permissions for \"%s\"";
c53df6c
 	$msg{"key"} = "[D] key:\"%s\"";
c53df6c
 	$msg{"keyValue"} = "[D] directive:\"%s\", value:\"%s\"";
c53df6c
 	$msg{"oddLine"} = "[W] \"%s\" looks odd";
c53df6c
 	$msg{"errOpen"} = "[E] open of %s failed, RC=%s";
c53df6c
 
c53df6c
 	$msg{"LinkNagiosChk"} = "[H] http://nagios.sourceforge.net/docs/3_0/verify_config.html";
c53df6c
-	$msg{"LinkReqSW"} = "[H] http://www.pnp4nagios.org/pnp/about#required_software";
c53df6c
-	$msg{"LinkPNPreq"} = "[H] http://www.pnp4nagios.org/pnp/about#requirements";
c53df6c
-	$msg{"PNPdefault"} = "[H] http://www.pnp4nagios.org/pnp$language/config#default_mode";
c53df6c
-	$msg{"PNPbulk"} = "[H] http://www.pnp4nagios.org/pnp$language/config#bulk_mode";
c53df6c
-	$msg{"PNPnpcd"} = "[H] http://www.pnp4nagios.org/pnp$language/config#npcd";
c53df6c
+	$msg{"LinkReqSW"} = "[H] http://docs.pnp4nagios.org/$language/pnp-${doc_version}/about#required_software";
c53df6c
+	$msg{"LinkRRDtool"} = "[H] http://www.rrdtool.org";
c53df6c
+	$msg{"LinkPNPreq"} = "[H] http://docs.pnp4nagios.org/$language/pnp-${doc_version}/about#requirements";
c53df6c
+	$msg{"PNPsync"} = "[H] http://docs.pnp4nagios.org/$language/pnp-${doc_version}/config#default_mode";
c53df6c
+	$msg{"PNPbulk"} = "[H] http://docs.pnp4nagios.org/$language/pnp-${doc_version}/config#bulk_mode";
c53df6c
+	$msg{"PNPnpcd"} = "[H] http://docs.pnp4nagios.org/$language/pnp-${doc_version}/config#npcd";
c53df6c
 	$msg{"NPCDcfgReq"} = "[E] NPCD config file required";
c53df6c
 	$msg{"noNPCDreq"} = "[H] NPCD config file is not required";
c53df6c
 	$msg{"LinkEnaEnv"} = "[H] http://nagios.sourceforge.net/docs/3_0/configmain.html#enable_environment_macros";
c53df6c
 	$msg{"LinkEnaPerf"} = "[H] http://nagios.sourceforge.net/docs/3_0/configmain.html#process_performance_data";
c53df6c
 	$msg{"LinkDevInfo"} = "[H] http://nagiosplug.sourceforge.net/developer-guidelines.html#AEN203";
c53df6c
-	$msg{"LinkPNPconfig"} = "[H] http://www.pnp4nagios.org/pnp$language/config";
c53df6c
-	$msg{"LinkPPcfg"} = "[H] http://www.pnp4nagios.org/pnp$language/config";
c53df6c
-	$msg{"LinkCPcfg"} = "[H] http://www.pnp4nagios.org/pnp$language/webfe";
c53df6c
+	$msg{"LinkPNPconfig"} = "[H] http://docs.pnp4nagios.org/$language/pnp-${doc_version}/config";
c53df6c
+	$msg{"LinkPPcfg"} = "[H] http://docs.pnp4nagios.org/$language/pnp-${doc_version}/config";
c53df6c
+	$msg{"LinkCPcfg"} = "[H] http://docs.pnp4nagios.org/$language/pnp-${doc_version}/webfe";
c53df6c
 	$msg{"LinkNagiosCfg"} = "[H] http://nagios.sourceforge.net/docs/3_0/configmain.html#%s";
c53df6c
 	$msg{"LinkNagiosCfg2"} = "[H] http://nagios.sourceforge.net/docs/3_0/configmain.html#process_performance_data\n    (and following options)";
c53df6c
 	
c53df6c
 	if ($language =~ /de/i) {
c53df6c
-		$msg{"qd"} = "[E]: --quiet und --debug schliessen sich gegenseitig aus";
c53df6c
-		$msg{"noBase"} = "[E]: Nagios-Basisverzeichnis nicht gefunden/angegeben";
c53df6c
-		$msg{"noBaseDir"} = "[E]: Nagios-Basisverzeichnis \"%s\" existiert nicht";
c53df6c
-		$msg{"useBase"} = "[I] benutze Nagios-Basisverzeichnis \"%s\"";
c53df6c
-		$msg{"useBinary"} = "[I] benutze Nagios-Binary \"%s\"";
c53df6c
-		$msg{"noCfg"} = "[E]: nagios.cfg nicht angegeben";
c53df6c
-		$msg{"noCfgFile"} = "[E]: Konfigurationsdatei \"%s\" nicht gefunden";
c53df6c
-		$msg{"useCfg"} = "[I] benutze Nagios-config \"%s\"";
c53df6c
-		$msg{"binExec"} = "[E]: Datei \"%s\" ist nicht ausfuehrbar";
c53df6c
-		$msg{"verifyCfg"} = "[A] verifiziere Nagios-Konfiguration";
c53df6c
-		$msg{"invPNPmode"} = "[E]: kein gueltiger PNP-Modus angegeben (default, Bulk, NPCD)";
c53df6c
+		$msg{"qd"} = "[E] --quiet und --debug schliessen sich gegenseitig aus";
c53df6c
+		$msg{"noBase"} = "[E] ${prod_name}-Basisverzeichnis nicht gefunden/angegeben";
c53df6c
+		$msg{"noBaseDir"} = "[E] ${prod_name}-Basisverzeichnis \"%s\" existiert nicht";
c53df6c
+		$msg{"useBase"} = "[I] benutze ${prod_name}-Basisverzeichnis \"%s\"";
c53df6c
+		$msg{"noBinary"} = "[E] Binary \"%s\" nicht gefunden/definiert";
c53df6c
+		$msg{"useBinary"} = "[I] benutze ${prod_name}-Binary \"%s\"";
c53df6c
+		$msg{"noCfg"} = "[E] $product.cfg nicht angegeben";
c53df6c
+		$msg{"noCfgFile"} = "[E] Konfigurationsdatei \"%s\" nicht gefunden";
c53df6c
+		$msg{"useCfg"} = "[I] benutze ${prod_name}-config \"%s\"";
c53df6c
+		$msg{"binExec"} = "[E] Datei \"%s\" ist nicht ausfuehrbar";
c53df6c
+		$msg{"verifyCfg"} = "[A] verifiziere ${prod_name}-Konfiguration";
c53df6c
+		$msg{"invPNPmode"} = "[E] kein gueltiger PNP-Modus angegeben (sync, Bulk, NPCD, default)";
c53df6c
 		$msg{"PNPmode"} = "[I] PNP-Modus: \"%s\"";
c53df6c
+		$msg{"Package"} = "[I] Paket: \"%s\"";
c53df6c
+		$msg{"noPkg"} = "[E] Paket \"%s\" nicht gefunden";
c53df6c
 		$msg{"NPCDcfgReq"} = "[E] NPCD-Konfigurationsdatei erforderlich";
c53df6c
 		$msg{"noNPCDreq"} = "[H] NPCD-Konfigurationsdatei nicht erforderlich";
c53df6c
 		$msg{"useLog"} = "[I] LogFile \"%s\" angegeben";
c53df6c
-		$msg{"NagiosChkErr"} = "[E] Nagios-Konfigurationspruefung findet Fehler";
c53df6c
-		$msg{"NagiosCfgErr"} = "[E] Nagios-Konfigurationsdatei enthaelt Fehler";
c53df6c
+		$msg{"NagiosChkErr"} = "[E] ${prod_name}-Konfigurationspruefung findet Fehler";
c53df6c
+		$msg{"NagiosCfgErr"} = "[E] ${prod_name}-Konfigurationsdatei enthaelt Fehler";
c53df6c
 		$msg{"verifyRRD"} = "[A] pruefe RRDtool (%s)";
c53df6c
 		$msg{"invFile"} = "[E]: \"%s\" ist keine (regulaere) Datei";
c53df6c
 		$msg{"invDir"} = "[E] Verzeichnis \"%s\" existiert nicht";
c53df6c
 		$msg{"useEntry"} = "[I] benutze cfg_dir/cfg_file-Eintraege";
c53df6c
 		$msg{"useCache"} = "[I] benutze \"%s\"-Eintraege";
c53df6c
 		$msg{"dupEntry"} = "[E] Direktive \"%s\" ist doppelt";
c53df6c
-		$msg{"noPerfEna"} = "[E] keine Performance-Daten aktiviert (process_performance_data=1 in nagios.cfg)";
c53df6c
+		$msg{"noPerfEna"} = "[E] keine Performance-Daten aktiviert (process_performance_data=1 in $product.cfg)";
c53df6c
 		$msg{"envMacrosDis"} = "[E] Environment-Makros deaktiviert (enable_environment_macros=0)";
c53df6c
 		$msg{"noFonts"} = "[H] dejavu-Fonts sind ggf. nicht installiert";
c53df6c
 		$msg{"noErrors"} = "\nKeine (offensichtlichen) Fehler gefunden. Viel Spass mit PNP";
c53df6c
+		$msg{"Warnings"} = "\nWarnungen gefunden.\nBitte ueberpruefen Sie die Einstellungen.";
c53df6c
 		$msg{"Errors"} = "\nFehler gefunden.\nBitte ueberpruefen Sie die Einstellungen und lesen Sie die Dokumentation.";
c53df6c
 		$msg{"procFile"} = "[A] verarbeite \"%s\"";
c53df6c
 		$msg{"searchObj"} = "[A] suche nach \"%s\"";
c53df6c
@@ -1245,9 +1489,10 @@
c53df6c
 		$msg{"noGroup"} = "[E] (%s) Gruppe \"%s\" existiert nicht";
c53df6c
 		$msg{"noPerf"} = "[E] es gibt KEINE Performance-Daten fuer \"%s\"";
c53df6c
 		$msg{"noRRDchk"} = "[I] perfdata-Verzeichnis wird NICHT geprueft";
c53df6c
-		$msg{"RRDpath"} = "[A] pruefen von \"%s\"";
c53df6c
+		$msg{"RRDpath"} = "[A] pruefen von RRDpath \"%s\"";
c53df6c
 		$msg{"RRDuser"} = "[E] \"%s\": Owner ist \"%s\" anstatt %s";
c53df6c
 		$msg{"RRDgroup"} = "[E] \"%s\": Group ist \"%s\" anstatt %s";
c53df6c
+		$msg{"RRDold"} = "[W] \"%s\" ist aelter als %s Sekunden";
c53df6c
 		$msg{"RRDcount"} = "[I] %s Verzeichnis(se) mit insgesamt %s rrd-Datei(en)";
c53df6c
 		$msg{"noRRDfiles"} = "[E] %s Verzeichnis(se) aber KEINE rrd-Dateien => KEINE Graphen!";
c53df6c
 		$msg{"useRRDs"} = "[I] RRDs Perl-Modul installiert";
c53df6c
@@ -1269,27 +1514,29 @@
c53df6c
 		$msg{"missTempVar"} = "[E] Variable \"%s\" im Template fehlt";
c53df6c
 		$msg{"missinvTempVal"} = "[E] Wert \"%s\" im Template fehlt";
c53df6c
 		$msg{"noCmd"} = "[E] command_name \"%s\" nicht gefunden";
c53df6c
-		$msg{"noParCfg"} = "[E] \"%s\" nicht in nagios.cfg gefunden";
c53df6c
-		$msg{"noParCfgH"} = "[H] \"%s\" nicht in nagios.cfg gefunden";
c53df6c
+		$msg{"noParCfg"} = "[E] \"%s\" nicht in $product.cfg gefunden";
c53df6c
+		$msg{"noParCfgH"} = "[H] \"%s\" nicht in $product.cfg gefunden";
c53df6c
 		$msg{"notAdv"} = "[H] \"%s\" wird fuer Nagios < 3.x nicht empfohlen";
c53df6c
 		$msg{"invChar"} = "[E] \"%s\" (%s) hat ein ungueltiges Format/enthaelt ungueltige Zeichen";
c53df6c
 		$msg{"undefVal"} = "[E] kein (gueltiger) Wert fuer \"%s\" definiert";
c53df6c
 		$msg{"noNumber"} = "[E] %s ist keine gueltige Zahl";
c53df6c
 		$msg{"startEnd"} = "[E] Startwert (%s) ist groesser als Endwert (%s)";
c53df6c
 		$msg{"noFile"} = "[E] (%s) Datei \"%s\" fehlt";
c53df6c
+		$msg{"noRes"} = "[E] Ressource \"%s\" ist nicht definiert";
c53df6c
 		$msg{"noFileYet"} = "[I] (%s) Datei \"%s\" existiert (noch) nicht";
c53df6c
 		$msg{"noDir"} = "[E] (%s) Verzeichnis \"%s\" fehlt";
c53df6c
 		$msg{"noSock"} = "[E] \"%s\" ist kein Socket";
c53df6c
+		$msg{"noWrite"} = "[E] \"%s\": keine Schreibberechtigung fuer \"%s\"";
c53df6c
 		$msg{"key"} = "[D] key:\"%s\"";
c53df6c
 		$msg{"keyValue"} = "[D] Direktive:\"%s\", Wert:\"%s\"";
c53df6c
 		$msg{"oddLine"} = "[W] \"%s\" sieht komisch aus";
c53df6c
 		$msg{"errOpen"} = "[E] oeffnen von %s fehlgeschlagen, RC=%s";
c53df6c
 
c53df6c
 		$msg{"LinkNagiosChk"} = "[H] http://www.nagios-wiki.de/nagios/doku3/verify_config";
c53df6c
-		$msg{"LinkReqSW"} = "[H] http://www.pnp4nagios.org/pnp$language/about#benoetigte_software";
c53df6c
-		$msg{"LinkPNPreq"} = "[H] http://www.pnp4nagios.org/pnp$language/about#anforderungen_an_plugins";
c53df6c
-		$msg{"LinkEnaEnv"} = "http://www.nagios-wiki.de/nagios/doku3/#enable_environment_macros";
c53df6c
-		$msg{"LinkEnaPerf"} = "http://www.nagios-wiki.de/nagios/doku3/#process_performance_data";
c53df6c
+		$msg{"LinkReqSW"} = "[H] http://docs.pnp4nagios.org/$language/pnp-${doc_version}/about#benoetigte_software";
c53df6c
+		$msg{"LinkPNPreq"} = "[H] http://docs.pnp4nagios.org/$language/pnp-${doc_version}/about#anforderungen_an_plugins";
c53df6c
+		$msg{"LinkEnaEnv"} = "[H] http://www.nagios-wiki.de/nagios/doku3/#enable_environment_macros";
c53df6c
+		$msg{"LinkEnaPerf"} = "[H] http://www.nagios-wiki.de/nagios/doku3/configmain#process_performance_data";
c53df6c
 		$msg{"LinkNagiosCfg"} = "[H] http://www.nagios-wiki.de/nagios/doku3/configmain#%s";
c53df6c
 		$msg{"LinkNagiosCfg2"} = "[H] http://www.nagios-wiki.de/nagios/doku3/configmain#process_performance_data\n    (und folgende Optionen)";
c53df6c
 	}