This commit is contained in:
garnier-quentin 2019-10-02 09:07:36 +02:00
parent 9af86db6f9
commit 7de4e47895
1 changed files with 23 additions and 25 deletions

View File

@ -52,6 +52,7 @@ sub set_counters {
closure_custom_calc => $self->can('custom_updates_calc'), closure_custom_calc => $self->can('custom_updates_calc'),
closure_custom_output => $self->can('custom_updates_output'), closure_custom_output => $self->can('custom_updates_output'),
closure_custom_perfdata => sub { return 0; }, closure_custom_perfdata => sub { return 0; },
closure_custom_threshold_check => sub { return 'ok'; }
} }
}, },
]; ];
@ -60,10 +61,12 @@ sub set_counters {
sub custom_updates_output { sub custom_updates_output {
my ($self, %options) = @_; my ($self, %options) = @_;
my $msg = sprintf("Package '%s' [version: %s] [repository: %s]", my $msg = sprintf(
$self->{result_values}->{package}, "Package '%s' [version: %s] [repository: %s]",
$self->{result_values}->{version}, $self->{result_values}->{package},
$self->{result_values}->{repository}); $self->{result_values}->{version},
$self->{result_values}->{repository}
);
return $msg; return $msg;
} }
@ -81,30 +84,25 @@ sub new {
my $self = $class->SUPER::new(package => __PACKAGE__, %options); my $self = $class->SUPER::new(package => __PACKAGE__, %options);
bless $self, $class; bless $self, $class;
$options{options}->add_options(arguments => $options{options}->add_options(arguments => {
{ 'hostname:s' => { name => 'hostname' },
"hostname:s" => { name => 'hostname' }, 'remote' => { name => 'remote' },
"remote" => { name => 'remote' }, 'ssh-option:s@' => { name => 'ssh_option' },
"ssh-option:s@" => { name => 'ssh_option' }, 'ssh-path:s' => { name => 'ssh_path' },
"ssh-path:s" => { name => 'ssh_path' }, 'ssh-command:s' => { name => 'ssh_command', default => 'ssh' },
"ssh-command:s" => { name => 'ssh_command', default => 'ssh' }, 'timeout:s' => { name => 'timeout', default => 30 },
"timeout:s" => { name => 'timeout', default => 30 }, 'sudo' => { name => 'sudo' },
"sudo" => { name => 'sudo' }, 'command:s' => { name => 'command', default => 'yum' },
"command:s" => { name => 'command', default => 'yum' }, 'command-path:s' => { name => 'command_path', },
"command-path:s" => { name => 'command_path', }, 'command-options:s' => { name => 'command_options', default => 'check-update 2>&1' },
"command-options:s" => { name => 'command_options', default => 'check-update 2>&1' }, 'filter-package:s' => { name => 'filter_package' },
"filter-package:s" => { name => 'filter_package' }, 'filter-repository:s' => { name => 'filter_repository' },
"filter-repository:s" => { name => 'filter_repository' }, });
});
$self->{result} = {}; $self->{result} = {};
return $self; return $self;
} }
sub check_options {
my ($self, %options) = @_;
$self->SUPER::check_options(%options);
}
sub manage_selection { sub manage_selection {
my ($self, %options) = @_; my ($self, %options) = @_;