remove dep in rad airmux

This commit is contained in:
garnier-quentin 2019-07-08 09:05:52 +02:00
parent b031e397cc
commit bfd3889210
1 changed files with 7 additions and 9 deletions

View File

@ -76,14 +76,12 @@ sub new {
bless $self, $class; bless $self, $class;
$options{options}->add_options(arguments => { $options{options}->add_options(arguments => {
"filter-msg:s" => { name => 'filter_msg' }, 'filter-msg:s' => { name => 'filter_msg' },
"warning-status:s" => { name => 'warning_status', default => '%{severity} =~ /minor|warning/i' }, 'warning-status:s' => { name => 'warning_status', default => '%{severity} =~ /minor|warning/i' },
"critical-status:s" => { name => 'critical_status', default => '%{severity} =~ /critical|major/i' }, 'critical-status:s' => { name => 'critical_status', default => '%{severity} =~ /critical|major/i' },
"memory" => { name => 'memory' }, 'memory' => { name => 'memory' },
}); });
centreon::plugins::misc::mymodule_load(output => $self->{output}, module => 'Date::Parse',
error_msg => "Cannot load module 'Date::Parse'.");
$self->{statefile_cache} = centreon::plugins::statefile->new(%options); $self->{statefile_cache} = centreon::plugins::statefile->new(%options);
return $self; return $self;
} }
@ -131,8 +129,8 @@ sub manage_selection {
my $instance = $1; my $instance = $1;
my $result = $options{snmp}->map_instance(mapping => $mapping, results => $snmp_result, instance => $instance); my $result = $options{snmp}->map_instance(mapping => $mapping, results => $snmp_result, instance => $instance);
my $create_time = $result->{radwllMilOduAgnLastEventsTimeT}; my $create_time = $result->{radwllMilOduAgnLastEventsTimeT};
$result->{radwllMilOduAgnLastEventsTimeT} = strftime("%d/%m/%Y %H:%M:%S",localtime($result->{radwllMilOduAgnLastEventsTimeT})); $result->{radwllMilOduAgnLastEventsTimeT} = strftime("%d/%m/%Y %H:%M:%S", localtime($result->{radwllMilOduAgnLastEventsTimeT}));
if (!defined($create_time)) { if (!defined($create_time)) {
$self->{manager}->{output}->output_add(severity => 'UNKNOWN', $self->{manager}->{output}->output_add(severity => 'UNKNOWN',
short_msg => "Can't get date '" . $result->{radwllMilOduAgnLastEventsTimeT} . "'"); short_msg => "Can't get date '" . $result->{radwllMilOduAgnLastEventsTimeT} . "'");