git-svn-id: http://svn.centreon.com/Plugins/Dev@2132 6bcd3966-0018-0410-8128-fd23d134de7e
This commit is contained in:
parent
9c16e89302
commit
059dfe2950
|
@ -26,7 +26,8 @@ use strict;
|
|||
use Net::SNMP qw(:snmp oid_lex_sort);
|
||||
use FindBin;
|
||||
use lib "$FindBin::Bin";
|
||||
use lib "@NAGIOS_PLUGINS@";
|
||||
#use lib "@NAGIOS_PLUGINS@";
|
||||
use lib "/srv/nagios/libexec/";
|
||||
use utils qw($TIMEOUT %ERRORS &print_revision &support);
|
||||
|
||||
if (eval "require oreon" ) {
|
||||
|
@ -249,6 +250,7 @@ if (defined($opt_T)){
|
|||
} else {
|
||||
$speed_card = $result->{$OID_SPEED};
|
||||
}
|
||||
|
||||
#############################################
|
||||
##### Plugin return code
|
||||
##
|
||||
|
@ -272,7 +274,7 @@ if (-e "/tmp/traffic_if".$interface."_".$opt_H) {
|
|||
$flg_created = 0;
|
||||
}
|
||||
|
||||
$update_time = time;
|
||||
$update_time = time();
|
||||
|
||||
unless (open(FILE,">"."/tmp/traffic_if".$interface."_".$opt_H)){
|
||||
print "Unknown - /tmp/traffic_if".$interface."_".$opt_H. " !\n";
|
||||
|
@ -299,7 +301,9 @@ if (($in_bits - $last_in_bits > 0) && defined($last_in_bits)) {
|
|||
} else {
|
||||
$total = $in_bits - $last_in_bits;
|
||||
}
|
||||
my $pct_in_traffic = $in_traffic = abs($total / (time - $last_check_time));
|
||||
my $diff = time() - $last_check_time;
|
||||
if ($diff == 0){$diff = 1;}
|
||||
my $pct_in_traffic = $in_traffic = abs($total / $diff);
|
||||
} else {
|
||||
$in_traffic = 0;
|
||||
}
|
||||
|
@ -311,7 +315,9 @@ if ($out_bits - $last_out_bits > 0 && defined($last_out_bits)) {
|
|||
} else {
|
||||
$total = $out_bits - $last_out_bits;
|
||||
}
|
||||
my $pct_out_traffic = $out_traffic = abs($total / (time - $last_check_time));
|
||||
my $diff = time() - $last_check_time;
|
||||
if ($diff == 0){$diff = 1;}
|
||||
my $pct_out_traffic = $out_traffic = abs($total / $diff);
|
||||
} else {
|
||||
$out_traffic = 0;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue