[svn-buildpackage] Tagging nagios-plugins 1.4.16-1

This commit is contained in:
Jan Wagner 2012-06-27 21:14:42 +00:00
16 changed files with 85 additions and 610 deletions

45
debian/changelog vendored
View file

@ -1,3 +1,48 @@
nagios-plugins (1.4.16-1) unstable; urgency=low
* New upstream release
- Drop 00_fix_release_version.dpatch
* Droped the following upstream integrated patches
- 03_check_disk_smb_perfdata.dpatch
- 10_check_dhcp_Fix-handling-of-pad-options.dpatch
- 11_check_dhcp_Don-t-misinterpret-the-siaddr-field.dpatch
* Updated debian/copyright
-- Jan Wagner <waja@cyconet.org> Wed, 27 Jun 2012 23:06:52 +0200
nagios-plugins (1.4.16~pre1-1) unstable; urgency=medium
* New upstream snapshot (Closes: #662638, #514588)
* Droped the following upstream integrated patches
- 10_check_disk_smb_spaces.dpatch
- 11_check_disk_smb_NT_STATUS_ACCESS_DENIED.dpatch
- 12_check_snmp_1.4.15_regression.dpatch
- 13_check_smtp_greeting.dpatch
- 14_check_icmp_multiple_ips.dpatch
- 15_check_sensors_fault.dpatch
- 16_check_raduis_fix_format-security.dpatch
- 17_check_tcp_fix_duplicate_cert_message.dpatch
- 17_check_smtp_fix_duplicate_cert_message.dpatch
- 18_check_snmp_labels.dpatch
- 19_check_http_help.dpatch
* Added the following upstream patches
- 10_check_dhcp_Fix-handling-of-pad-options.dpatch
- 11_check_dhcp_Don-t-misinterpret-the-siaddr-field.dpatch
* Add 00_fix_release_version.dpatch to fix release version
* Bump Standards-Version to 3.9.3, no changes needed
-- Jan Wagner <waja@cyconet.org> Thu, 14 Jun 2012 10:39:44 +0200
nagios-plugins (1.4.15-7) unstable; urgency=low
* Recommand nagios-plugins-contrib via nagios-plugins, drop
nagios-plugins-common which gets installed by nagios-plugins-basic
anyways
* Add Replaces: nagios-plugins-basic to nagios-plugins-common
(Closes: #673891), thanks to Christoph Anton Mitterer
-- Jan Wagner <waja@cyconet.org> Tue, 22 May 2012 20:00:03 +0200
nagios-plugins (1.4.15-6) unstable; urgency=low nagios-plugins (1.4.15-6) unstable; urgency=low
* Add nagios-plugins-common package which ships files possibly needed also by * Add nagios-plugins-common package which ships files possibly needed also by

8
debian/control vendored
View file

@ -7,12 +7,12 @@ Build-Depends: debhelper (>= 5), dpatch (>= 2.0.9), perl, autotools-dev, libldap
Homepage: http://nagiosplug.sourceforge.net Homepage: http://nagiosplug.sourceforge.net
Vcs-Browser: http://anonscm.debian.org/viewvc/pkg-nagios/nagios-plugins/ Vcs-Browser: http://anonscm.debian.org/viewvc/pkg-nagios/nagios-plugins/
Vcs-Svn: svn://svn.debian.org/pkg-nagios/nagios-plugins/trunk/ Vcs-Svn: svn://svn.debian.org/pkg-nagios/nagios-plugins/trunk/
Standards-Version: 3.9.2 Standards-Version: 3.9.3
Package: nagios-plugins Package: nagios-plugins
Architecture: all Architecture: all
Depends: ${misc:Depends}, nagios-plugins-basic, nagios-plugins-standard Depends: ${misc:Depends}, nagios-plugins-basic, nagios-plugins-standard
Recommends: nagios-plugins-common Recommends: nagios-plugins-contrib
Suggests: nagios3 | icinga Suggests: nagios3 | icinga
Description: Plugins for nagios compatible monitoring systems (metapackage) Description: Plugins for nagios compatible monitoring systems (metapackage)
Plugins for nagios compatible monitoring systems like Nagios and Icinga. Plugins for nagios compatible monitoring systems like Nagios and Icinga.
@ -25,7 +25,7 @@ Description: Plugins for nagios compatible monitoring systems (metapackage)
Package: nagios-plugins-common Package: nagios-plugins-common
Architecture: any Architecture: any
Depends: ${shlibs:Depends}, ${misc:Depends}, ucf Depends: ${shlibs:Depends}, ${misc:Depends}, ucf
Breaks: nagios-plugins-basic (<= 1.4.15-5) Replaces: nagios-plugins-basic (<= 1.4.15-5)
Suggests: nagios3 | icinga Suggests: nagios3 | icinga
Description: Common files for plugins for nagios compatible monitoring Description: Common files for plugins for nagios compatible monitoring
Common files for plugins for nagios compatible monitoring systems like Nagios Common files for plugins for nagios compatible monitoring systems like Nagios
@ -36,7 +36,7 @@ Description: Common files for plugins for nagios compatible monitoring
Package: nagios-plugins-basic Package: nagios-plugins-basic
Architecture: any Architecture: any
Depends: ${shlibs:Depends}, ${misc:Depends}, procps, iputils-ping [linux-any], inetutils-ping [kfreebsd-any hurd-any], ucf Depends: ${shlibs:Depends}, ${misc:Depends}, procps, iputils-ping [linux-any], inetutils-ping [kfreebsd-any hurd-any], ucf
Pre-Depends: nagios-plugins-common Pre-Depends: nagios-plugins-common (>= 1.4.15-6)
Conflicts: nagios-plugins (<= 1.4.2-3) Conflicts: nagios-plugins (<= 1.4.2-3)
Replaces: nagios-plugins, nagios-plugins-standard Replaces: nagios-plugins, nagios-plugins-standard
Suggests: nagios3 | icinga Suggests: nagios3 | icinga

51
debian/copyright vendored
View file

@ -26,6 +26,7 @@ Upstream Authors: Felipe Gustavo de Almeida
Matthew Kent Matthew Kent
Harper Mann Harper Mann
Benoit Mortier Benoit Mortier
Sven Nierlein
Nathan Vonnahme Nathan Vonnahme
Ton Voon Ton Voon
Holger Weiss Holger Weiss
@ -35,6 +36,41 @@ Copyright:
Copyright (C) 1985, 2009 Free Software Foundation, Inc. Copyright (C) 1985, 2009 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This package is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
On Debian systems, the complete text of the GNU General
Public License version 3 can be found in "/usr/share/common-licenses/GPL-3".
From upstream README:
This software is released under the GNU Public License with the additional
exemption that compiling, linking and/or using OpenSSL is allowed.
Files with different Licenses:
build-aux/config.guess
build-aux/config.sub
build-aux/ltmain.sh
contrib/check_cpqarray.c
contrib/check_linux_raid.pl
contrib/check_traceroute-pure_perl.pl
contrib/check_cluster2.c
contrib/check_snmp_printer.pl
contrib/check_http-with-client-certificate.c
contrib/check_cluster.c
plugins-scripts/check_mailq.pl
This program is free software; you can redistribute it and/or modify This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or the Free Software Foundation; either version 2 of the License, or
@ -50,21 +86,6 @@ Copyright (C) 1985, 2009 Free Software Foundation, Inc.
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
USA. USA.
From upstream README:
This software is released under the GNU Public License with the additional
exemption that compiling, linking and/or using OpenSSL is allowed.
Files with different Licenses:
lib/*.c
lib/tests/*.c
plugins/*.c
plugins/runcmd.h
plugins/common.h
plugins/netutils.h
plugins-root/check_*.c
plugins-root/pst3.c
gl/alloca.in.h gl/alloca.in.h
gl/as* gl/as*
gl/base64* gl/base64*

12
debian/patches/00list vendored
View file

@ -1,14 +1,2 @@
02_check_icmp_links.dpatch 02_check_icmp_links.dpatch
# commited upstream # commited upstream
10_check_disk_smb_spaces.dpatch
11_check_disk_smb_NT_STATUS_ACCESS_DENIED.dpatch
12_check_snmp_1.4.15_regression.dpatch
13_check_smtp_greeting.dpatch
14_check_icmp_multiple_ips.dpatch
15_check_sensors_fault.dpatch
16_check_raduis_fix_format-security.dpatch
17_check_tcp_fix_duplicate_cert_message.dpatch
17_check_smtp_fix_duplicate_cert_message.dpatch
03_check_disk_smb_perfdata.dpatch
18_check_snmp_labels.dpatch
19_check_http_help.dpatch

View file

@ -1,102 +0,0 @@
#! /bin/sh /usr/share/dpatch/dpatch-run
## 03_check_disk_smb_perfdata.dpatch by G. Leimua <gaufrettes.aumiel@gmail.com>
##
## DP: Add perfdata fo check_disk_smb (http://bugs.debian.org/654259)
@DPATCH@
diff --git a/plugins-scripts/check_disk_smb.pl b/plugins-scripts/check_disk_smb.pl
index 7c81fc2..bca9552 100755
--- a/plugins-scripts/check_disk_smb.pl
+++ b/plugins-scripts/check_disk_smb.pl
@@ -166,6 +166,7 @@ my $address = $1 if (defined($opt_a) && $opt_a =~ /(.*)/);
my $state = "OK";
my $answer = undef;
my $res = undef;
+my $perfdata = "";
my @lines = undef;
# Just in case of problems, let's not hang Nagios
@@ -204,11 +205,23 @@ $_ = $lines[$#lines];
#If line does not match required regexp, return an UNKNOWN error
if (/\s*(\d*) blocks of size (\d*)\. (\d*) blocks available/) {
- my ($avail) = ($3*$2)/1024;
- my ($avail_bytes) = $avail;
+ my ($avail_bytes) = $3 * $2;
+ my ($total_bytes) = $1 * $2;
+ my ($occupied_bytes) = $1 * $2 - $avail_bytes;
+ my ($avail) = $avail_bytes/1024;
my ($capper) = int(($3/$1)*100);
my ($mountpt) = "\\\\$host\\$share";
+ # TODO : why is the kB the standard unit for args ?
+ my ($warn_bytes) = $total_bytes - $warn * 1024;
+ if ($warn_type eq "P") {
+ $warn_bytes = $warn * $1 * $2 / 100;
+ }
+ my ($crit_bytes) = $total_bytes - $crit * 1024;
+ if ($crit_type eq "P") {
+ $crit_bytes = $crit * $1 * $2 / 100;
+ }
+
if (int($avail / 1024) > 0) {
$avail = int($avail / 1024);
@@ -225,32 +238,37 @@ if (/\s*(\d*) blocks of size (\d*)\. (\d*) blocks available/) {
#print ":$warn:$warn_type:\n";
#print ":$crit:$crit_type:\n";
#print ":$avail:$avail_bytes:$capper:$mountpt:\n";
+ $perfdata = "'" . $share . "'=" . $occupied_bytes . 'B;'
+ . $warn_bytes . ';'
+ . $crit_bytes . ';'
+ . '0;'
+ . $total_bytes;
- if ((($warn_type eq "P") && (100 - $capper) < $warn) || (($warn_type eq "K") && ($avail_bytes > $warn))) {
- $answer = "Disk ok - $avail ($capper%) free on $mountpt\n";
- } elsif ((($crit_type eq "P") && (100 - $capper) < $crit) || (($crit_type eq "K") && ($avail_bytes > $crit))) {
+ if ($occupied_bytes > $crit_bytes) {
+ $state = "CRITICAL";
+ $answer = "CRITICAL: Only $avail ($capper%) free on $mountpt";
+ } elsif ( $occupied_bytes > $warn_bytes ) {
$state = "WARNING";
- $answer = "WARNING: Only $avail ($capper%) free on $mountpt\n";
+ $answer = "WARNING: Only $avail ($capper%) free on $mountpt";
} else {
- $state = "CRITICAL";
- $answer = "CRITICAL: Only $avail ($capper%) free on $mountpt\n";
+ $answer = "Disk ok - $avail ($capper%) free on $mountpt";
}
} else {
- $answer = "Result from smbclient not suitable\n";
+ $answer = "Result from smbclient not suitable";
$state = "UNKNOWN";
foreach (@lines) {
if (/(Access denied|NT_STATUS_LOGON_FAILURE|NT_STATUS_ACCESS_DENIED)/) {
- $answer = "Access Denied\n";
+ $answer = "Access Denied";
$state = "CRITICAL";
last;
}
if (/(Unknown host \w*|Connection.*failed)/) {
- $answer = "$1\n";
+ $answer = "$1";
$state = "CRITICAL";
last;
}
if (/(You specified an invalid share name|NT_STATUS_BAD_NETWORK_NAME)/) {
- $answer = "Invalid share name \\\\$host\\$share\n";
+ $answer = "Invalid share name \\\\$host\\$share";
$state = "CRITICAL";
last;
}
@@ -259,6 +277,8 @@ if (/\s*(\d*) blocks of size (\d*)\. (\d*) blocks available/) {
print $answer;
+print " | " . $perfdata if ($perfdata);
+print "\n";
print "$state\n" if ($verbose);
exit $ERRORS{$state};

View file

@ -1,29 +0,0 @@
#! /bin/sh /usr/share/dpatch/dpatch-run
## 10_check_disk_smb_spaces.dpatch by
## Matthias Eble <psychotrahe@users.sourceforge.net>
##
## From 0892c4ac28c4c2e3b6275187f845813b4cd6d320 Mon Sep 17 00:00:00 2001
## From: Matthias Eble <psychotrahe@users.sourceforge.net>
## Date: Sun, 28 Nov 2010 21:35:59 +0100
## Subject: [PATCH] Make check_disk_smb accept spaces in share names
## (#990948, #1370031, Debian #601699)
##
## DP: Enables Support sharenames with spaces (http://bugs.debian.org/601699)
## DP: Upstream bug is: http://sourceforge.net/tracker/?func=detail&aid=990948&group_id=29880&atid=397597
@DPATCH@
diff --git a/plugins-scripts/check_disk_smb.pl b/plugins-scripts/check_disk_smb.pl
index 7c81fc2..4698700 100755
--- a/plugins-scripts/check_disk_smb.pl
+++ b/plugins-scripts/check_disk_smb.pl
@@ -67,7 +67,7 @@ my $host = $1 if ($opt_H =~ /^([-_.A-Za-z0-9 ]+\$?)$/);
($host) || usage("Invalid host: $opt_H\n");
($opt_s) || ($opt_s = shift @ARGV) || usage("Share volume not specified\n");
-my $share = $1 if ($opt_s =~ /^([-_.A-Za-z0-9]+\$?)$/);
+my $share = $1 if ($opt_s =~ /^([-_.A-Za-z0-9 ]+\$?)$/);
($share) || usage("Invalid share: $opt_s\n");
defined($opt_u) || ($opt_u = shift @ARGV) || ($opt_u = "guest");

View file

@ -1,28 +0,0 @@
#! /bin/sh /usr/share/dpatch/dpatch-run
## 11_check_disk_smb_NT_STATUS_ACCESS_DENIED.dpatch by
## Matthias Eble <psychotrahe@users.sourceforge.net>
##
## From 3c67c9cb60a4681a29e509fccbb333e0f6234f54 Mon Sep 17 00:00:00 2001
## From: Matthias Eble <psychotrahe@users.sourceforge.net>
## Date: Sun, 28 Nov 2010 21:43:48 +0100
## Subject: [PATCH] check_disk_smb now handles NT_STATUS_ACCESS_DENIED properly
## (Debian #601696)
##
## DP: Handles NT_STATUS_ACCESS_DENIED properly (http://bugs.debian.org/601696)
@DPATCH@
diff --git a/plugins-scripts/check_disk_smb.pl b/plugins-scripts/check_disk_smb.pl
index 4698700..6783543 100755
--- a/plugins-scripts/check_disk_smb.pl
+++ b/plugins-scripts/check_disk_smb.pl
@@ -239,7 +239,7 @@ if (/\s*(\d*) blocks of size (\d*)\. (\d*) blocks available/) {
$answer = "Result from smbclient not suitable\n";
$state = "UNKNOWN";
foreach (@lines) {
- if (/(Access denied|NT_STATUS_LOGON_FAILURE)/) {
+ if (/(Access denied|NT_STATUS_LOGON_FAILURE|NT_STATUS_ACCESS_DENIED)/) {
$answer = "Access Denied\n";
$state = "CRITICAL";
last;

View file

@ -1,180 +0,0 @@
#! /bin/sh /usr/share/dpatch/dpatch-run
## 12_check_snmp_1.4.15_regression.dpatch by
## Thomas Guyot-Sionnest <dermoth@aei.ca>
##
## Original patch to make Timeticks works as in check_snmp v1.4.14, it turns
## out is_numeric isn't so useful and treating all types as numeric works
## best for backwards-compatibility. This is how it used to work in 1.4.14.
##
## As a special case, I also make calculate_rate look up for numeric values
## as it would otherwise return the last value instead.
##
## DP: Remove that is_numeric madness
@DPATCH@
diff --git a/NEWS b/NEWS
index ff92401..e3e8f37 100644
--- a/NEWS
+++ b/NEWS
@@ -1,5 +1,10 @@
This file documents the major additions and syntax changes between releases.
+ ...
+
+ FIXES
+ Make check_snmp work more like v1.4.14 with regard to using special values (Timeticks, STRING) as numeric thresholds.
+
1.4.15 27th July 2010
ENHANCEMENTS
New check_ntp_peer -m and -n options to check the number of usable time sources ("truechimers")
diff --git a/plugins/check_snmp.c b/plugins/check_snmp.c
index f32a26e..d79da8c 100644
--- a/plugins/check_snmp.c
+++ b/plugins/check_snmp.c
@@ -169,7 +169,6 @@ main (int argc, char **argv)
char *state_string=NULL;
size_t response_length, current_length, string_length;
char *temp_string=NULL;
- int is_numeric=0;
time_t current_time;
double temp_double;
time_t duration;
@@ -335,29 +334,24 @@ main (int argc, char **argv)
/* We strip out the datatype indicator for PHBs */
if (strstr (response, "Gauge: ")) {
show = strstr (response, "Gauge: ") + 7;
- is_numeric++;
}
else if (strstr (response, "Gauge32: ")) {
show = strstr (response, "Gauge32: ") + 9;
- is_numeric++;
}
else if (strstr (response, "Counter32: ")) {
show = strstr (response, "Counter32: ") + 11;
- is_numeric++;
is_counter=1;
if(!calculate_rate)
strcpy(type, "c");
}
else if (strstr (response, "Counter64: ")) {
show = strstr (response, "Counter64: ") + 11;
- is_numeric++;
is_counter=1;
if(!calculate_rate)
strcpy(type, "c");
}
else if (strstr (response, "INTEGER: ")) {
show = strstr (response, "INTEGER: ") + 9;
- is_numeric++;
}
else if (strstr (response, "STRING: ")) {
show = strstr (response, "STRING: ") + 8;
@@ -396,15 +390,17 @@ main (int argc, char **argv)
}
}
- else if (strstr (response, "Timeticks: "))
+ else if (strstr (response, "Timeticks: ")) {
show = strstr (response, "Timeticks: ");
+ }
else
show = response;
iresult = STATE_DEPENDENT;
/* Process this block for numeric comparisons */
- if (is_numeric) {
+ /* Make some special values,like Timeticks numeric only if a threshold is defined */
+ if (thlds[i]->warning || thlds[i]->critical || calculate_rate) {
ptr = strpbrk (show, "0123456789");
if (ptr == NULL)
die (STATE_UNKNOWN,_("No valid data returned"));
diff --git a/plugins/t/check_snmp.t b/plugins/t/check_snmp.t
index 004ba1a..25a2999 100644
--- a/plugins/t/check_snmp.t
+++ b/plugins/t/check_snmp.t
@@ -8,7 +8,7 @@ use strict;
use Test::More;
use NPTest;
-my $tests = 8+38+2+2;
+my $tests = 8+42+2+2;
plan tests => $tests;
my $res;
@@ -124,6 +124,13 @@ SKIP: {
cmp_ok( $res->return_code, '==', 0, "Skipping all thresholds");
like($res->output, '/^SNMP OK - \d+ \w+ \d+\s.*$/', "Skipping all thresholds, result printed rather than parsed");
+ $res = NPTest->testCmd( "./check_snmp -H $host_snmp -C $snmp_community -o system.sysUpTime.0 -c 1000000000: -u '1/100 sec'");
+ cmp_ok( $res->return_code, '==', 2, "Timetick used as a threshold");
+ like($res->output, '/^SNMP CRITICAL - \*\d+\* 1\/100 sec.*$/', "Timetick used as a threshold, parsed as numeric");
+
+ $res = NPTest->testCmd( "./check_snmp -H $host_snmp -C $snmp_community -o system.sysUpTime.0");
+ cmp_ok( $res->return_code, '==', 0, "Timetick used as a string");
+ like($res->output, '/^SNMP OK - Timeticks:\s\(\d+\)\s+(?:\d+ days?,\s+)?\d+:\d+:\d+\.\d+\s.*$/', "Timetick used as a string, result printed rather than parsed");
}
# These checks need a complete command line. An invalid community is used so
diff --git a/plugins/tests/check_snmp.t b/plugins/tests/check_snmp.t
index e7ad192..c960f7b 100755
--- a/plugins/tests/check_snmp.t
+++ b/plugins/tests/check_snmp.t
@@ -51,7 +51,10 @@ if ($ARGV[0] && $ARGV[0] eq "-d") {
}
}
-my $tests = 33;
+# We should merge that with $ENV{'NPTEST_CACHE'}, use one dir for all test data
+$ENV{'NAGIOS_PLUGIN_STATE_DIRECTORY'} ||= "/var/tmp";
+
+my $tests = 39;
if (-x "./check_snmp") {
plan tests => $tests;
} else {
@@ -106,7 +109,7 @@ like($res->output, '/'.quotemeta('SNMP OK - And now have fun with with this: \"C
"And now have fun with with this: \"C:\\\\\"
because we\'re not done yet!"').'/m', "Attempt to confuse parser No.3");
-system("rm /usr/local/nagios/var/check_snmp/*");
+system("rm -f ".$ENV{'NAGIOS_PLUGIN_STATE_DIRECTORY'}."/check_snmp/*");
$res = NPTest->testCmd( "./check_snmp -H 127.0.0.1 -C public -p $port_snmp -o .1.3.6.1.4.1.8072.3.2.67.10 --rate -w 600" );
is($res->return_code, 0, "Returns OK");
is($res->output, "No previous data to calculate rate - assume okay");
@@ -170,5 +173,16 @@ $res = NPTest->testCmd( "./check_snmp -H 127.0.0.1 -C public -p $port_snmp -o .1
is($res->return_code, 0, "OK as string doesn't match but inverted" );
is($res->output, 'SNMP OK - "stringtests" | ', "OK as inverted string no match" );
+$res = NPTest->testCmd( "./check_snmp -H 127.0.0.1 -C public -p $port_snmp -o .1.3.6.1.4.1.8072.3.2.67.12 -w 4:5" );
+is($res->return_code, 1, "Numeric in string test" );
+is($res->output, 'SNMP WARNING - *3.5* | iso.3.6.1.4.1.8072.3.2.67.12=3.5 ', "WARNING threshold checks for string masquerading as number" );
+
+$res = NPTest->testCmd( "./check_snmp -H 127.0.0.1 -C public -p $port_snmp -o .1.3.6.1.4.1.8072.3.2.67.13" );
+is($res->return_code, 0, "Not really numeric test" );
+is($res->output, 'SNMP OK - "87.4startswithnumberbutshouldbestring" | ', "Check string with numeric start is still string" );
+
+$res = NPTest->testCmd( "./check_snmp -H 127.0.0.1 -C public -p $port_snmp -o .1.3.6.1.4.1.8072.3.2.67.14" );
+is($res->return_code, 0, "Not really numeric test (trying best to fool it)" );
+is($res->output, 'SNMP OK - "555\"I said\"" | ', "Check string with a double quote following is still a string (looks like the perl routine will always escape though)" );
diff --git a/plugins/tests/check_snmp_agent.pl b/plugins/tests/check_snmp_agent.pl
index 8784ab1..2ad8516 100644
--- a/plugins/tests/check_snmp_agent.pl
+++ b/plugins/tests/check_snmp_agent.pl
@@ -33,9 +33,9 @@ ends with with this: C:\\';
my $multilin5 = 'And now have fun with with this: "C:\\"
because we\'re not done yet!';
-my @fields = (ASN_OCTET_STR, ASN_OCTET_STR, ASN_OCTET_STR, ASN_OCTET_STR, ASN_OCTET_STR, ASN_UNSIGNED, ASN_UNSIGNED, ASN_COUNTER, ASN_COUNTER64, ASN_UNSIGNED, ASN_COUNTER, ASN_OCTET_STR);
-my @values = ($multiline, $multilin2, $multilin3, $multilin4, $multilin5, 4294965296, 1000, 4294965296, uint64("18446744073709351616"), int(rand(2**32)), 64000, "stringtests");
-my @incrts = (undef, undef, undef, undef, undef, 1000, -500, 1000, 100000, undef, 666, undef);
+my @fields = (ASN_OCTET_STR, ASN_OCTET_STR, ASN_OCTET_STR, ASN_OCTET_STR, ASN_OCTET_STR, ASN_UNSIGNED, ASN_UNSIGNED, ASN_COUNTER, ASN_COUNTER64, ASN_UNSIGNED, ASN_COUNTER, ASN_OCTET_STR, ASN_OCTET_STR, ASN_OCTET_STR, ASN_OCTET_STR );
+my @values = ($multiline, $multilin2, $multilin3, $multilin4, $multilin5, 4294965296, 1000, 4294965296, uint64("18446744073709351616"), int(rand(2**32)), 64000, "stringtests", "3.5", "87.4startswithnumberbutshouldbestring", '555"I said"' );
+my @incrts = (undef, undef, undef, undef, undef, 1000, -500, 1000, 100000, undef, 666, undef, undef, undef, undef );
# Number of elements in our OID
my $oidelts;

View file

@ -1,37 +0,0 @@
#! /bin/sh /usr/share/dpatch/dpatch-run
## 13_check_smtp_greeting.dpatch
## Holger Weiss <holger@zedat.fu-berlin.de>
##
## From: d16f3fb0a9bb37cc1ce73ef14b5de83e907ef23c Tue, 8 Feb 2011 16:07:52 +0000 (+0100)
## From: Holger Weiss <holger@zedat.fu-berlin.de>
## Date: Tue, 8 Feb 2011 16:07:52 +0000 (+0100)
## Subject: [PATCH] check_smtp: Abort on missing/unexpected greeting
## (Debian #611914)
## X-Git-Url: http://nagiosplug.git.sourceforge.net/git/gitweb.cgi?p=nagiosplug%2Fnagiosplug;a=commitdiff_plain;h=d16f3fb0a9bb37cc1ce73ef14b5de83e907ef23c
##
## DP: Abort on missing/unexpected greeting (http://bugs.debian.org/611914)
@DPATCH@
diff --git a/plugins/check_smtp.c b/plugins/check_smtp.c
index 3da724b..ed49163 100644
--- a/plugins/check_smtp.c
+++ b/plugins/check_smtp.c
@@ -183,7 +183,7 @@ main (int argc, char **argv)
/* return a WARNING status if we couldn't read any data */
if (recvlines(buffer, MAX_INPUT_BUFFER) <= 0) {
printf (_("recv() failed\n"));
- result = STATE_WARNING;
+ return STATE_WARNING;
}
else {
if (verbose)
@@ -197,7 +197,7 @@ main (int argc, char **argv)
else
printf (_("Invalid SMTP response received from host on port %d: %s\n"),
server_port, buffer);
- result = STATE_WARNING;
+ return STATE_WARNING;
}
}

View file

@ -1,27 +0,0 @@
#! /bin/sh /usr/share/dpatch/dpatch-run
## 14_check_icmp_multiple_ips.dpatch
## Sebastian Harl <sh@teamix.net>
##
## From: 1374f80872412b64bd13f17e6edd70aa59437012 Mon Sep 17 00:00:00 2001
## From: Sebastian Harl <sh@teamix.net>
## Date: Thu, 28 Apr 2011 09:18:21 +0200
## Subject: [PATCH] check_host: Allocate a large-enough buffer for the host table.
## (Debian #623702)
## X-Git-Url: http://nagiosplug.git.sourceforge.net/git/gitweb.cgi?p=nagiosplug/nagiosplug;a=commitdiff_plain;h=1374f80872412b64bd13f17e6edd70aa59437012
##
## DP: Allocate a large-enough buffer for the host table. (http://bugs.debian.org/623702)
@DPATCH@
--- a/plugins-root/check_icmp.c
+++ b/plugins-root/check_icmp.c
@@ -621,7 +621,7 @@ main(int argc, char **argv)
}
host = list;
- table = malloc(sizeof(struct rta_host **) * (argc - 1));
+ table = malloc(sizeof(struct rta_host **) * targets);
i = 0;
while(host) {
host->id = i*packets;

View file

@ -1,40 +0,0 @@
#! /bin/sh /usr/share/dpatch/dpatch-run
## 15_check_sensors_fault.dpatch by Holger Weiss <holger@zedat.fu-berlin.de>
##
## From 276c5b98bf619eabd8b0bd5fc3ff60c0a59489a7 Mon Sep 17 00:00:00 2001
## From: Holger Weiss <holger@zedat.fu-berlin.de>
## Date: Wed, 7 Sep 2011 13:55:53 +0200
## Subject: [PATCH] check_sensors: Detect FAULT status
##
## DP: Return an UNKNOWN status if a faulty sensor is detected. This can be
## suppressed with the new "--ignore-fault" option.
@DPATCH@
--- a/plugins-scripts/check_sensors.sh
+++ b/plugins-scripts/check_sensors.sh
@@ -10,7 +10,7 @@ REVISION="@NP_VERSION@"
print_usage() {
- echo "Usage: $PROGNAME"
+ echo "Usage: $PROGNAME" [--ignore-fault]
}
print_help() {
@@ -57,9 +57,12 @@ case "$1" in
if echo ${sensordata} | egrep ALARM > /dev/null; then
echo SENSOR CRITICAL - Sensor alarm detected!
exit 2
- else
- echo sensor ok
- exit 0
+ elif echo ${sensordata} | egrep FAULT > /dev/null \
+ && test "$1" != "-i" -a "$1" != "--ignore-fault"; then
+ echo SENSOR UNKNOWN - Sensor reported fault
+ exit 3
fi
+ echo sensor ok
+ exit 0
;;
esac

View file

@ -1,24 +0,0 @@
#! /bin/sh /usr/share/dpatch/dpatch-run
## 16_check_raduis_fix_format-security.dpatch
## From 055b2570eddff9a312dc1445bb7de4a6d7c4887d Mon Sep 17 00:00:00 2001
## From: Thomas Guyot-Sionnest <dermoth@aei.ca>
## Date: Tue, 6 Sep 2011 23:20:21 -0400
## Subject: [PATCH] Make GCC happy
## X-Git-Url: http://nagiosplug.git.sourceforge.net/git/gitweb.cgi?p=nagiosplug/nagiosplug;a=commitdiff_plain;h=055b2570eddff9a312dc1445bb7de4a6d7c4887d
##
## DP: It won't trust us about msg containing no format string, and fail miserably
## when compiled with -Werror=format-security. (https://bugs.launchpad.net/bugs/837085)
@DPATCH@
--- a/plugins/check_radius.c
+++ b/plugins/check_radius.c
@@ -211,7 +211,7 @@ main (int argc, char **argv)
if (result == OK_RC)
die (STATE_OK, _("Auth OK"));
(void)snprintf(msg, sizeof(msg), _("Unexpected result code %d"), result);
- die (STATE_UNKNOWN, msg);
+ die (STATE_UNKNOWN, "%s", msg);
}

View file

@ -1,24 +0,0 @@
#! /bin/sh /usr/share/dpatch/dpatch-run
## 17_check_smtp_fix_duplicate_cert_message.dpatch
## From 4d06603060fc1233861b164870f0d3a2e0d8d2eb Fri, 15 Jul 2011 20:19:15 +0000 (+0100)
## From: Ton Voon <ton.voon@opsera.com>
## Date: Tue, 6 Sep 2011 23:20:21 -0400
## Subject: [PATCH] Fix check_smtp and check_tcp where duplicate messages were displayed for certificate...
## X-Git-Url: http://nagiosplug.git.sourceforge.net/git/gitweb.cgi?p=nagiosplug/nagiosplug;a=commitdiff_plain;h=4d06603060fc1233861b164870f0d3a2e0d8d2eb
##
## DP: Fix check_smtp where duplicate messages were displayed for certificate errors
@DPATCH@
--- a/plugins/check_smtp.c
+++ b/plugins/check_smtp.c
@@ -276,9 +276,6 @@ main (int argc, char **argv)
# ifdef USE_OPENSSL
if ( check_cert ) {
result = np_net_ssl_check_cert(days_till_exp);
- if(result != STATE_OK){
- printf ("%s\n", _("CRITICAL - Cannot retrieve server certificate."));
- }
my_close();
return result;
}

View file

@ -1,28 +0,0 @@
#! /bin/sh /usr/share/dpatch/dpatch-run
## 17_check_tcp_fix_duplicate_cert_message.dpatch
## From 4d06603060fc1233861b164870f0d3a2e0d8d2eb Fri, 15 Jul 2011 20:19:15 +0000 (+0100)
## From: Ton Voon <ton.voon@opsera.com>
## Date: Tue, 6 Sep 2011 23:20:21 -0400
## Subject: [PATCH] Fix check_smtp and check_tcp where duplicate messages were displayed for certificate...
## X-Git-Url: http://nagiosplug.git.sourceforge.net/git/gitweb.cgi?p=nagiosplug/nagiosplug;a=commitdiff_plain;h=4d06603060fc1233861b164870f0d3a2e0d8d2eb
##
## DP: Fix check_tcp where duplicate messages were displayed for certificate errors
@DPATCH@
--- a/plugins/check_tcp.c
+++ b/plugins/check_tcp.c
@@ -236,12 +236,9 @@ main (int argc, char **argv)
result = np_net_ssl_init(sd);
if (result == STATE_OK && check_cert == TRUE) {
result = np_net_ssl_check_cert(days_till_exp);
- if(result != STATE_OK) {
- printf(_("CRITICAL - Cannot retrieve server certificate.\n"));
- }
}
}
- if(result != STATE_OK){
+ if(result != STATE_OK || check_cert == TRUE){
np_net_ssl_cleanup();
if(sd) close(sd);
return result;

View file

@ -1,34 +0,0 @@
#! /bin/sh /usr/share/dpatch/dpatch-run
## 18_check_snmp_labels.dpatch
## From 0e3fa54782f8cbb47af058c4bf13688e8b23865b Mon Sep 17 00:00:00 2001
## From: Holger Weiss <holger@zedat.fu-berlin.de>
## Date: Fri, 24 Feb 2012 12:29:00 +0100
## Subject: [PATCH] Accept multiple labels specified with "-l"
## X-Git-Url: http://nagiosplug.git.sourceforge.net/git/gitweb.cgi?p=nagiosplug/nagiosplug;a=patch;h=0e3fa54782f8cbb47af058c4bf13688e8b23865b
##
## DP: check_snmp: fix multiple labels. (http://bugs.debian.org/647020)
@DPATCH@
--- a/plugins/check_snmp.c
+++ b/plugins/check_snmp.c
@@ -749,7 +749,7 @@ process_arguments (int argc, char **argv)
if (labels == NULL)
die (STATE_UNKNOWN, _("Could not reallocate labels\n"));
}
- labels++;
+ nlabels++;
ptr = thisarg (ptr);
if (strstr (ptr, "'") == ptr)
labels[nlabels - 1] = ptr + 1;
@@ -1072,8 +1072,8 @@ print_help (void)
printf ("\n");
printf ("%s\n", _("Notes:"));
- printf (" %s\n", _("- Multiple OIDs may be indicated by a comma or space-delimited list (lists with"));
- printf (" %s %i %s\n", _("internal spaces must be quoted). Maximum:"), MAX_OIDS, _("OIDs."));
+ printf (" %s\n", _("- Multiple OIDs (and labels) may be indicated by a comma or space-delimited "));
+ printf (" %s %i %s\n", _("list (lists with internal spaces must be quoted). Maximum:"), MAX_OIDS, _("OIDs."));
printf(" -%s", UT_THRESHOLDS_NOTES);

View file

@ -1,26 +0,0 @@
#! /bin/sh /usr/share/dpatch/dpatch-run
## 18_check_snmp_labels.dpatch
## From d796c16327e6e315dd528f17e8bd597c5f506730 Mon Sep 17 00:00:00 2001
## From: Holger Weiss <holger@zedat.fu-berlin.de>
## Date: Fri, 24 Feb 2012 13:24:56 +0100
## Subject: [PATCH] Clarify that check_http won't verify certificates
## X-Git-Url: http://nagiosplug.git.sourceforge.net/git/gitweb.cgi?p=nagiosplug/nagiosplug;a=patch;h=d796c16327e6e315dd528f17e8bd597c5f506730
##
## DP: check_http: clarify that check_http won't verify certificates (http://bugs.debian.org/644627)
@DPATCH@
--- a/plugins/check_http.c
+++ b/plugins/check_http.c
@@ -1400,6 +1400,10 @@ print_help (void)
printf (" %s\n", _("serve content (optionally within a specified time) or whether the X509 "));
printf (" %s\n", _("certificate is still valid for the specified number of days."));
printf ("\n");
+ printf (" %s\n", _("Please note that this plugin does not check if the presented server"));
+ printf (" %s\n", _("certificate matches the hostname of the server, or if the certificate"));
+ printf (" %s\n", _("has a valid chain of trust to one of the locally installed CAs."));
+ printf ("\n");
printf ("%s\n", _("Examples:"));
printf (" %s\n\n", "CHECK CONTENT: check_http -w 5 -c 10 --ssl -H www.verisign.com");
printf (" %s\n", _("When the 'www.verisign.com' server returns its content within 5 seconds,"));