Merge pull request #1707 from CPbN/str2time
Add possiblity to use str2time()
This commit is contained in:
commit
54441d414c
|
@ -70,6 +70,8 @@ sub new {
|
||||||
'map-value-other:s' => { name => 'map_value_other' },
|
'map-value-other:s' => { name => 'map_value_other' },
|
||||||
'map-values-separator:s' => { name => 'map_values_separator', default => ',' },
|
'map-values-separator:s' => { name => 'map_values_separator', default => ',' },
|
||||||
'convert-custom-values:s' => { name => 'convert_custom_values' },
|
'convert-custom-values:s' => { name => 'convert_custom_values' },
|
||||||
|
|
||||||
|
"use-perl-mod:s@" => { name => 'use_perl_mod' },
|
||||||
});
|
});
|
||||||
|
|
||||||
$self->{macros} = { ok => {}, warning => {}, critical => {}, unknown => {} };
|
$self->{macros} = { ok => {}, warning => {}, critical => {}, unknown => {} };
|
||||||
|
@ -80,6 +82,11 @@ sub check_options {
|
||||||
my ($self, %options) = @_;
|
my ($self, %options) = @_;
|
||||||
$self->SUPER::init(%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 '');
|
$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 '') &&
|
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 '')) {
|
(!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.
|
Custom code to convert values.
|
||||||
Example to convert octetstring to macaddress: --convert-custom-values='join(":", unpack("(H2)*", $value))'
|
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
|
=back
|
||||||
|
|
||||||
=cut
|
=cut
|
||||||
|
|
Loading…
Reference in New Issue