diff --git a/components/perfdata/graphitewriter.cpp b/components/perfdata/graphitewriter.cpp index 75360447a..ab01a2f07 100644 --- a/components/perfdata/graphitewriter.cpp +++ b/components/perfdata/graphitewriter.cpp @@ -94,7 +94,7 @@ void GraphiteWriter::ReconnectTimerHandler(void) void GraphiteWriter::CheckResultHandler(const Service::Ptr& service, const Dictionary::Ptr& cr) { - if (!(IcingaApplication::GetInstance()->GetEnablePerfdata() && service->GetEnablePerfdata())) + if (!IcingaApplication::GetInstance()->GetEnablePerfdata() || !service->GetEnablePerfdata()) return; Host::Ptr host = service->GetHost(); diff --git a/components/perfdata/perfdatawriter.cpp b/components/perfdata/perfdatawriter.cpp index 1dfe35c8c..6d9282dd1 100644 --- a/components/perfdata/perfdatawriter.cpp +++ b/components/perfdata/perfdatawriter.cpp @@ -84,7 +84,7 @@ double PerfdataWriter::GetRotationInterval(void) const void PerfdataWriter::CheckResultHandler(const Service::Ptr& service, const Dictionary::Ptr& cr) { - if (!(IcingaApplication::GetInstance()->GetEnablePerfdata() && service->GetEnablePerfdata())) + if (!IcingaApplication::GetInstance()->GetEnablePerfdata() || !service->GetEnablePerfdata()) return; Host::Ptr host = service->GetHost(); diff --git a/lib/icinga/service.cpp b/lib/icinga/service.cpp index a3e41d9d1..6caa1aa5f 100644 --- a/lib/icinga/service.cpp +++ b/lib/icinga/service.cpp @@ -330,7 +330,10 @@ std::set Service::GetParentServices(void) const bool Service::GetEnablePerfdata(void) const { - return m_EnablePerfdata; + if (!m_EnablePerfdata.IsEmpty()) + return m_EnablePerfdata; + else + return true; } int Service::GetModifiedAttributes(void) const