Skip to content
This repository was archived by the owner on Sep 26, 2019. It is now read-only.
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions plugin-dir/check_rhev3.pl
Original file line number Diff line number Diff line change
Expand Up @@ -1464,14 +1464,15 @@ sub check_nic_errors{
print "Interface errors in file $cookie/$host/$nic not a number: $errors\n";
exit $ERRORS{$status{'unknown'}};
}

$return = $error - $errors;
# set counter to 0 if value is negative
# this can happen if counter is reseted on host (e.g. reboot)
$return = 0 if $return < 0;
write_errors_file($cookie . "/" . $host . "/" . $nic, $return);
write_errors_file($cookie . "/" . $host . "/" . $nic, $error);
}else{
$return = $error;
write_errors_file($cookie . "/" . $host . "/" . $nic, $return);
write_errors_file($cookie . "/" . $host . "/" . $nic, $error);
}

return $return;
Expand Down Expand Up @@ -1805,4 +1806,3 @@ sub rest_api_connect{
}

exit $ERRORS{$status{'unknown'}};