diff --git a/centreon-plugins/apps/protocols/snmp/mode/collection.pm b/centreon-plugins/apps/protocols/snmp/mode/collection.pm index ff833324a..f3d09d67d 100644 --- a/centreon-plugins/apps/protocols/snmp/mode/collection.pm +++ b/centreon-plugins/apps/protocols/snmp/mode/collection.pm @@ -153,7 +153,9 @@ sub read_config { my ($self, %options) = @_; my $content; - if (-f $self->{option_results}->{config}) { + if ($self->{option_results}->{config} =~ /\n/m || ! -f "$self->{option_results}->{config}") { + $content = $self->{option_results}->{config}; + } else { $content = do { local $/ = undef; if (!open my $fh, '<', $self->{option_results}->{config}) { @@ -162,8 +164,6 @@ sub read_config { } <$fh>; }; - } else { - $content = $self->{option_results}->{config}; } eval {