Merge remote-tracking branch 'origin/master' into Openstack
This commit is contained in:
commit
8cf127646e
|
@ -55,7 +55,6 @@ sub check_options {
|
||||||
|
|
||||||
sub run {
|
sub run {
|
||||||
my ($self, %options) = @_;
|
my ($self, %options) = @_;
|
||||||
# $options{snmp} = snmp object
|
|
||||||
$self->{snmp} = $options{snmp};
|
$self->{snmp} = $options{snmp};
|
||||||
|
|
||||||
my $oid_cacheAge = ".1.3.6.1.4.1.789.1.2.2.23.0";
|
my $oid_cacheAge = ".1.3.6.1.4.1.789.1.2.2.23.0";
|
||||||
|
@ -63,13 +62,13 @@ sub run {
|
||||||
my $result = $self->{snmp}->get_leef(oids => [$oid_cacheAge],
|
my $result = $self->{snmp}->get_leef(oids => [$oid_cacheAge],
|
||||||
nothing_quit => 1);
|
nothing_quit => 1);
|
||||||
|
|
||||||
my $exit = $self->{perfdata}->threshold_check(value => $results->{$oid_cacheAge},
|
my $exit = $self->{perfdata}->threshold_check(value => $result->{$oid_cacheAge},
|
||||||
threshold => [ { label => 'critical', 'exit_litteral' => 'critical' },
|
threshold => [ { label => 'critical', 'exit_litteral' => 'critical' },
|
||||||
{ label => 'warning', exit_litteral => 'warning' } ]);
|
{ label => 'warning', exit_litteral => 'warning' } ]);
|
||||||
$self->{output}->output_add(severity => $exit,
|
$self->{output}->output_add(severity => $exit,
|
||||||
short_msg => sprintf("Cache age is '%s' minutes", $results->{$oid_cacheAge}));
|
short_msg => sprintf("Cache age is '%s' minutes", $result->{$oid_cacheAge}));
|
||||||
$self->{output}->perfdata_add(label => 'cache_age', unit => 'm',
|
$self->{output}->perfdata_add(label => 'cache_age', unit => 'm',
|
||||||
value => $results->{$oid_cacheAge},
|
value => $result->{$oid_cacheAge},
|
||||||
warning => $self->{option_results}->{warning},
|
warning => $self->{option_results}->{warning},
|
||||||
critical => $self->{option_results}->{critical},
|
critical => $self->{option_results}->{critical},
|
||||||
min => 0);
|
min => 0);
|
||||||
|
|
Loading…
Reference in New Issue