From ea300fceb1c7162e679785436e717e1e407be617 Mon Sep 17 00:00:00 2001 From: Quentin Garnier Date: Thu, 20 Feb 2014 17:58:37 +0100 Subject: [PATCH] + Big fix on cache file --- centreon/plugins/statefile.pm | 3 +++ 1 file changed, 3 insertions(+) diff --git a/centreon/plugins/statefile.pm b/centreon/plugins/statefile.pm index a1fa0756a..7077757a5 100644 --- a/centreon/plugins/statefile.pm +++ b/centreon/plugins/statefile.pm @@ -100,6 +100,9 @@ sub read { } elsif (! -w $self->{statefile_dir} . "/" . $self->{statefile}) { $self->{output}->add_option_msg(short_msg => "Cannot write statefile '" . $self->{statefile_dir} . "/" . $self->{statefile} . "'. Need write permissions on file."); $self->{output}->option_exit(); + } elsif (! -s $self->{statefile_dir} . "/" . $self->{statefile}) { + # Empty file. Not a problem. Maybe plugin not manage not values + return 0; } unless (my $return = do $self->{statefile_dir} . "/" . $self->{statefile}) {