Skip to content

Commit

Permalink
Merge pull request #54 from posteingang/adjustable_CRC_count
Browse files Browse the repository at this point in the history
Adjustable crc counter for cdot interfaces
  • Loading branch information
aleex42 authored May 25, 2021
2 parents 1b36c90 + d34bb38 commit 108f41f
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions check_cdot_interfaces.pl
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,11 @@
use Data::Dumper;

GetOptions(
'hostname=s' => \my $Hostname,
'username=s' => \my $Username,
'password=s' => \my $Password,
'help|?' => sub { exec perldoc => -F => $0 or die "Cannot execute perldoc: $!\n"; },
'hostname=s' => \my $Hostname,
'username=s' => \my $Username,
'password=s' => \my $Password,
'crc-count:i' => \(my $CrcMaxCount = 10),
'help|?' => sub { exec perldoc => -F => $0 or die "Cannot execute perldoc: $!\n"; },
) or Error( "$0: Error in command line arguments\n" );

sub Error {
Expand Down Expand Up @@ -228,7 +229,7 @@ sub Error {
my $key = $counter->child_get_string( "name" );
my $value = $counter->child_get_string( "value" );

if($value > 10) {
if($value > $CrcMaxCount) {
push(@nic_errors, $nic_name);
}
}
Expand Down Expand Up @@ -325,3 +326,4 @@ =head1 EXIT CODE
=head1 AUTHORS
Alexander Krogloth <git at krogloth.de>

0 comments on commit 108f41f

Please sign in to comment.