forked from lausser/check_nwc_health
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Currently the broadcast values are calculated on the total number o packets. This is to ask a change in order to have tha value calculated on the input/outputRate. GR
- Loading branch information
1 parent
d46f9dd
commit 348eb8a
Showing
1 changed file
with
40 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
} elsif ($self->mode =~ /device::interfaces::broadcast/) { | ||
$self->add_info(sprintf 'interface %s broadcast in:%.2f out:%.2f ', | ||
$full_descr, | ||
$self->{broadcastInPercent} / 100 * $self->{inputRate} , $self->{broadcastOutPercent} / 100 * $self->{outputRate} ); | ||
$self->set_thresholds( | ||
metric => $self->{ifDescr}.'_broadcast_in', | ||
warning => $self->{maxInputRate} / 100 * 10, | ||
critical => $self->{maxInputRate} / 100 * 20, | ||
); | ||
my $in = $self->check_thresholds( | ||
metric => $self->{ifDescr}.'_broadcast_in', | ||
value => $self->{broadcastInPercent} / 100 * $self->{inputRate}, | ||
); | ||
$self->set_thresholds( | ||
metric => $self->{ifDescr}.'_broadcast_out', | ||
warning => $self->{maxOutputRate} / 100 * 10, | ||
critical => $self->{maxOutputRate} / 100 * 20, | ||
); | ||
my $out = $self->check_thresholds( | ||
metric => $self->{ifDescr}.'_broadcast_out', | ||
value => $self->{broadcastOutPercent} / 100 * $self->{outputRate}, | ||
); | ||
my $level = ($in > $out) ? $in : ($out > $in) ? $out : $in; | ||
$self->add_message($level); | ||
$self->add_perfdata( | ||
label => $self->{ifDescr}.'_broadcast_in', | ||
value => $self->{broadcastInPercent} / 100 * $self->{inputRate}, | ||
uom => $self->opts->units =~ /^(B|KB|MB|GB|TB)$/ ? $self->opts->units : undef, | ||
places => 2, | ||
min => 0, | ||
max => $self->{maxInputRate}, | ||
); | ||
$self->add_perfdata( | ||
label => $self->{ifDescr}.'_broadcast_out', | ||
value => $self->{broadcastOutPercent} / 100 * $self->{outputRate}, | ||
uom => $self->opts->units =~ /^(B|KB|MB|GB|TB)$/ ? $self->opts->units : undef, | ||
places => 2, | ||
min => 0, | ||
max => $self->{maxOutputRate}, | ||
); |