improve ping plugins

git-svn-id: http://svn.centreon.com/trunk/plugins-2.x@10138 6bcd3966-0018-0410-8128-fd23d134de7e
This commit is contained in:
Julien Mathis 2010-03-05 11:19:48 +00:00
parent 2248e0ca03
commit 4a1f7633f6
1 changed files with 12 additions and 2 deletions

View File

@ -174,8 +174,18 @@ if( ( $return != 0 ) || $ping_result_array[@ping_result_array -2 ] =~ /100% pack
my $result_str = ""; my $result_str = "";
if( $rta == -1 ) { if( $rta == -1 ) {
$ping_result_array[@ping_result_array -2 ] =~ s/\%/percent/g; $ping_result_array[@ping_result_array - 2] =~ s/\%/percent/g;
print "GPING CRITICAL - ".$ping_result_array[@ping_result_array -2 ]."|time=0 ok=0\n"; if (length($ping_result_array[@ping_result_array - 5]) && $ping_result_array[@ping_result_array - 5] !~ m/pipe/g) {
print "PING CRITICAL - ".$ping_result_array[@ping_result_array - 5]."|time=0 ok=0\n";
} elsif (length($ping_result_array[@ping_result_array - 1]) != 0 && $ping_result_array[@ping_result_array - 1] !~ m/pipe/g) {
print "PING CRITICAL - ".$ping_result_array[@ping_result_array - 1]."|time=0 ok=0\n";
} elsif (length($ping_result_array[@ping_result_array - 4]) && $ping_result_array[@ping_result_array - 4] !~ m/pipe/g) {
print "PING CRITICAL - ".$ping_result_array[@ping_result_array - 4]."|time=0 ok=0\n";
} elsif (length($ping_result_array[@ping_result_array - 1]) !~ m/pipe/g) {
print "PING CRITICAL - ".$ping_result_array[@ping_result_array - 1]."|time=0 ok=0\n";
} else {
print "PING CRITICAL - ".$ping_result_array[@ping_result_array - 3]."|time=0 ok=0\n";
}
exit $ERRORS{'CRITICAL'}; exit $ERRORS{'CRITICAL'};
} elsif ( ($pl >= $pl_critical) || ($rta >= $rta_critical) ) { } elsif ( ($pl >= $pl_critical) || ($rta >= $rta_critical) ) {
$ping_result_array[@ping_result_array -1 ] =~ s/\%/percent/g; $ping_result_array[@ping_result_array -1 ] =~ s/\%/percent/g;