aboutsummaryrefslogtreecommitdiff
path: root/plugins/t
diff options
context:
space:
mode:
authorGravatar Holger Weiss <holger@zedat.fu-berlin.de> 2014-01-21 16:07:38 +0100
committerGravatar Holger Weiss <holger@zedat.fu-berlin.de> 2014-01-21 16:07:38 +0100
commit7ee3525423f17cb8269a11e679355733867131e9 (patch)
tree6b68b8bddc3603925a5eb2b996859c94e0c06b46 /plugins/t
parent11cf54ca78185d820085a476cdbf7d8f9149c292 (diff)
parenta3871201821d9abe8a12e637e7dd00d9d1dde2a5 (diff)
downloadmonitoring-plugins-7ee3525423f17cb8269a11e679355733867131e9.tar.gz
Merge branch 'maint'
* maint: check_ssh: Get rid of sshd: Read from socket failed: Connection reset by peer fixed tests when there is no direct internet connection NEWS: Mention fix for check_http's -S option Fix for SSL Versioning when multiple options are used. Fix #1217 spec file fails to build due to duplicate files and unused files check_http: Don't let "-N" expect an argument README: Change GitHub URL README: Clarify license notice Update URLs and mailing list addresses Just using the posix conform extended regular expression grep check_oracle: --db +ASM bad string matching check_oracle doesn't correctly check for pmon +ASM instance from at least Oracle 11 as the pmon proces was renamed from ora_pmon_.* to asm_pmon_.*. -- Just turning attached patch of github issue #1207 into a push request. (Closes #1207) Update web site URLs Conflicts: FAQ NEWS README SUPPORT configure.in monitoring-plugins.spec.in pkg/solaris/pkginfo.in plugins-root/check_dhcp.c plugins-root/check_icmp.c plugins-scripts/check_ifoperstatus.pl plugins-scripts/check_mssql.pl plugins/check_apt.c plugins/check_by_ssh.c plugins/check_cluster.c plugins/check_dbi.c plugins/check_dig.c plugins/check_disk.c plugins/check_dns.c plugins/check_dummy.c plugins/check_fping.c plugins/check_game.c plugins/check_hpjd.c plugins/check_http.c plugins/check_ide_smart.c plugins/check_ldap.c plugins/check_load.c plugins/check_mrtg.c plugins/check_mrtgtraf.c plugins/check_mysql.c plugins/check_mysql_query.c plugins/check_nagios.c plugins/check_nt.c plugins/check_ntp.c plugins/check_ntp_peer.c plugins/check_ntp_time.c plugins/check_nwstat.c plugins/check_overcr.c plugins/check_pgsql.c plugins/check_ping.c plugins/check_procs.c plugins/check_radius.c plugins/check_real.c plugins/check_smtp.c plugins/check_snmp.c plugins/check_ssh.c plugins/check_swap.c plugins/check_tcp.c plugins/check_time.c plugins/check_ups.c plugins/check_users.c plugins/negate.c plugins/urlize.c plugins/utils.h po/Makevars po/de.po po/fr.po po/monitoring-plugins.pot
Diffstat (limited to 'plugins/t')
-rw-r--r--plugins/t/check_http.t2
-rw-r--r--plugins/t/check_tcp.t18
2 files changed, 14 insertions, 6 deletions
diff --git a/plugins/t/check_http.t b/plugins/t/check_http.t
index a74220e2..2539a289 100644
--- a/plugins/t/check_http.t
+++ b/plugins/t/check_http.t
@@ -82,7 +82,7 @@ SKIP: {
cmp_ok( $res->return_code, "==", 0, "And also when not found");
}
SKIP: {
- skip "No internet access", 11 if $internet_access eq "no";
+ skip "No internet access", 16 if $internet_access eq "no";
$res = NPTest->testCmd(
"./check_http --ssl www.verisign.com"
diff --git a/plugins/t/check_tcp.t b/plugins/t/check_tcp.t
index abb16aec..f996685d 100644
--- a/plugins/t/check_tcp.t
+++ b/plugins/t/check_tcp.t
@@ -12,7 +12,6 @@ BEGIN {
use NPTest;
$has_ipv6 = NPTest::has_ipv6();
$tests = $has_ipv6 ? 14 : 11;
- plan tests => $tests;
}
@@ -25,20 +24,29 @@ my $host_nonresponsive = getTestParameter( "host_nonresponsive", "NP_HOST_NONRES
my $hostname_invalid = getTestParameter( "hostname_invalid", "NP_HOSTNAME_INVALID", "nosuchhost",
"An invalid (not known to DNS) hostname" );
+my $internet_access = getTestParameter( "NP_INTERNET_ACCESS",
+ "Is this system directly connected to the internet?",
+ "yes");
+
my $successOutput = '/^TCP OK\s-\s+[0-9]?\.?[0-9]+ second response time on port [0-9]+/';
my $failedExpect = '/^TCP WARNING\s-\sUnexpected response from host/socket on port [0-9]+/';
my $t;
+$tests = $tests - 4 if $internet_access eq "no";
+plan tests => $tests;
+
$t += checkCmd( "./check_tcp $host_tcp_http -p 80 -wt 300 -ct 600", 0, $successOutput );
$t += checkCmd( "./check_tcp $host_tcp_http -p 81 -wt 0 -ct 0 -to 1", 2 ); # use invalid port for this test
$t += checkCmd( "./check_tcp $host_nonresponsive -p 80 -wt 0 -ct 0 -to 1", 2 );
$t += checkCmd( "./check_tcp $hostname_invalid -p 80 -wt 0 -ct 0 -to 1", 2 );
-$t += checkCmd( "./check_tcp -S -D 1 -H www.verisign.com -p 443", 0 );
-$t += checkCmd( "./check_tcp -S -D 9000,1 -H www.verisign.com -p 443", 1 );
-$t += checkCmd( "./check_tcp -S -D 9000 -H www.verisign.com -p 443", 1 );
-$t += checkCmd( "./check_tcp -S -D 9000,8999 -H www.verisign.com -p 443", 2 );
+if($internet_access ne "no") {
+ $t += checkCmd( "./check_tcp -S -D 1 -H www.verisign.com -p 443", 0 );
+ $t += checkCmd( "./check_tcp -S -D 9000,1 -H www.verisign.com -p 443", 1 );
+ $t += checkCmd( "./check_tcp -S -D 9000 -H www.verisign.com -p 443", 1 );
+ $t += checkCmd( "./check_tcp -S -D 9000,8999 -H www.verisign.com -p 443", 2 );
+}
# Need the \r\n to make it more standards compliant with web servers. Need the various quotes
# so that perl doesn't interpret the \r\n and is passed onto command line correctly