Merge pull request #1707 from CPbN/str2time

Add possiblity to use str2time()
This commit is contained in:
qgarnier 2019-11-03 19:17:03 +01:00 committed by GitHub
commit 54441d414c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 12 additions and 0 deletions

View File

@ -70,6 +70,8 @@ sub new {
'map-value-other:s' => { name => 'map_value_other' },
'map-values-separator:s' => { name => 'map_values_separator', default => ',' },
'convert-custom-values:s' => { name => 'convert_custom_values' },
"use-perl-mod:s@" => { name => 'use_perl_mod' },
});
$self->{macros} = { ok => {}, warning => {}, critical => {}, unknown => {} };
@ -80,6 +82,11 @@ sub check_options {
my ($self, %options) = @_;
$self->SUPER::init(%options);
foreach my $mod (@{$self->{option_results}->{use_perl_mod}}) {
centreon::plugins::misc::mymodule_load(output => $self->{output}, module => $mod,
error_msg => "Cannot load module '" . $mod . "'.");
}
$self->{option_results}->{oid_leef} = $self->{option_results}->{oid} if (defined($self->{option_results}->{oid}) && $self->{option_results}->{oid} ne '');
if ((!defined($self->{option_results}->{oid_leef}) || $self->{option_results}->{oid_leef} eq '') &&
(!defined($self->{option_results}->{oid_table}) || $self->{option_results}->{oid_table} eq '')) {
@ -386,6 +393,11 @@ Separator uses between values (default: coma).
Custom code to convert values.
Example to convert octetstring to macaddress: --convert-custom-values='join(":", unpack("(H2)*", $value))'
=item B<--use-perl-mod>
Load additional Perl module (Can be multiple)
Example : --use-perl-mod='Date::Parse'
=back
=cut