diff options
| author | Greg Cox <gcox@fibbsbozza.local> | 2014-07-29 18:52:12 -0400 |
|---|---|---|
| committer | Greg Cox <gcox@fibbsbozza.local> | 2014-07-29 18:52:12 -0400 |
| commit | 4273dd06ff3e52094d6b267d00e8c51dd74de364 (patch) | |
| tree | 425d127da5dbec7013999ed01b469fc3f72992d9 /plugins/t/check_fping.t | |
| parent | f05e7016320f4671fbf86cc5abc277efea20f79e (diff) | |
| parent | 6f3d5825b203b75aef8d68bf0d117e7a1a4c0616 (diff) | |
| download | monitoring-plugins-4273dd06ff3e52094d6b267d00e8c51dd74de364.tar.gz | |
Merge remote-tracking branch 'upstream/master'
Conflicts:
plugins/netutils.c
Diffstat (limited to 'plugins/t/check_fping.t')
| -rw-r--r-- | plugins/t/check_fping.t | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/plugins/t/check_fping.t b/plugins/t/check_fping.t index 45a9be8a..08692e46 100644 --- a/plugins/t/check_fping.t +++ b/plugins/t/check_fping.t | |||
| @@ -27,16 +27,18 @@ my $hostname_invalid = getTestParameter( "hostname_invalid", "NP_HOSTNAME_IN | |||
| 27 | 27 | ||
| 28 | my $t; | 28 | my $t; |
| 29 | 29 | ||
| 30 | if ( -x "./check_fping" ) | 30 | my $fping = qx(which fping 2> /dev/null); |
| 31 | { | 31 | chomp($fping); |
| 32 | if( ! -x "./check_fping") { | ||
| 33 | $t += skipMissingCmd( "./check_fping", $tests ); | ||
| 34 | } | ||
| 35 | elsif ( $> != 0 && (!$fping || ! -u $fping)) { | ||
| 36 | $t += skipMsg( "./check_fping", $tests ); | ||
| 37 | } else { | ||
| 32 | $t += checkCmd( "./check_fping $host_responsive", 0, $successOutput ); | 38 | $t += checkCmd( "./check_fping $host_responsive", 0, $successOutput ); |
| 33 | $t += checkCmd( "./check_fping $host_nonresponsive", [ 1, 2 ] ); | 39 | $t += checkCmd( "./check_fping $host_nonresponsive", [ 1, 2 ] ); |
| 34 | $t += checkCmd( "./check_fping $hostname_invalid", [ 1, 2 ] ); | 40 | $t += checkCmd( "./check_fping $hostname_invalid", [ 1, 2 ] ); |
| 35 | } | 41 | } |
| 36 | else | ||
| 37 | { | ||
| 38 | $t += skipMissingCmd( "./check_fping", $tests ); | ||
| 39 | } | ||
| 40 | 42 | ||
| 41 | exit(0) if defined($Test::Harness::VERSION); | 43 | exit(0) if defined($Test::Harness::VERSION); |
| 42 | exit($tests - $t); | 44 | exit($tests - $t); |
