add option in mode to force new perfdata

This commit is contained in:
garnier-quentin 2019-04-19 16:32:24 +02:00
parent dec0e1b191
commit af8afec1b9
2 changed files with 5 additions and 1 deletions

View File

@ -33,6 +33,8 @@ sub new {
%{$self->{option_results}} = ();
$self->{output} = $options{output};
$self->{output}->use_new_perfdata(value => 1)
if (defined($options{force_new_perfdata}) && $options{force_new_perfdata} == 1);
$self->{mode} = $options{mode};
$self->{version} = undef;

View File

@ -815,8 +815,10 @@ sub is_debug {
}
sub use_new_perfdata {
my ($self) = @_;
my ($self, %options) = @_;
$self->{option_results}->{use_new_perfdata} = $options{value}
if (defined($options{value}));
if (defined($self->{option_results}->{use_new_perfdata})) {
return 1;
}