Fix #6132
This commit is contained in:
parent
b44825df22
commit
176ce337db
|
@ -53,6 +53,7 @@ sub new {
|
||||||
{
|
{
|
||||||
"memcached:s" => { name => 'memcached' },
|
"memcached:s" => { name => 'memcached' },
|
||||||
"statefile-dir:s" => { name => 'statefile_dir', default => $default_dir },
|
"statefile-dir:s" => { name => 'statefile_dir', default => $default_dir },
|
||||||
|
"statefile-suffix:s" => { name => 'statefile_suffix', default => '' },
|
||||||
"statefile-concat-cwd" => { name => 'statefile_concat_cwd' },
|
"statefile-concat-cwd" => { name => 'statefile_concat_cwd' },
|
||||||
"statefile-storable" => { name => 'statefile_storable' },
|
"statefile-storable" => { name => 'statefile_storable' },
|
||||||
});
|
});
|
||||||
|
@ -95,7 +96,8 @@ sub check_options {
|
||||||
sub read {
|
sub read {
|
||||||
my ($self, %options) = @_;
|
my ($self, %options) = @_;
|
||||||
$self->{statefile_dir} = defined($options{statefile_dir}) ? $options{statefile_dir} : $self->{statefile_dir};
|
$self->{statefile_dir} = defined($options{statefile_dir}) ? $options{statefile_dir} : $self->{statefile_dir};
|
||||||
$self->{statefile} = defined($options{statefile}) ? $options{statefile} : $self->{statefile};
|
$self->{statefile} = defined($options{statefile}) ? $options{statefile} . $options{option_results}->{statefile_suffix} :
|
||||||
|
$self->{statefile} . $options{option_results}->{statefile_suffix};
|
||||||
|
|
||||||
if (defined($self->{memcached})) {
|
if (defined($self->{memcached})) {
|
||||||
# if "SUCCESS" or "NOT FOUND" is ok. Other with use the file
|
# if "SUCCESS" or "NOT FOUND" is ok. Other with use the file
|
||||||
|
@ -218,6 +220,10 @@ Memcached server to use (only one server).
|
||||||
|
|
||||||
Directory for statefile (Default: '/var/lib/centreon/centplugins').
|
Directory for statefile (Default: '/var/lib/centreon/centplugins').
|
||||||
|
|
||||||
|
=item B<--statefile-suffix>
|
||||||
|
|
||||||
|
Add a suffix for the statefile name (Default: '').
|
||||||
|
|
||||||
=item B<--statefile-concat-cwd>
|
=item B<--statefile-concat-cwd>
|
||||||
|
|
||||||
Concat current working directory with option '--statefile-dir'.
|
Concat current working directory with option '--statefile-dir'.
|
||||||
|
|
Loading…
Reference in New Issue