From: Gunnar Beutner Date: Mon, 2 Jul 2012 13:48:49 +0000 (+0200) Subject: Bugfixes. X-Git-Tag: v0.0.1~329 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=1b421d0cc06afc9dd6405cdc426284f3ed4135a8;p=icinga2 Bugfixes. --- diff --git a/cib/cib.cpp b/cib/cib.cpp index a562bc62c..4065a5dbf 100644 --- a/cib/cib.cpp +++ b/cib/cib.cpp @@ -33,3 +33,4 @@ int CIB::GetInformationTypes(void) { return m_Types; } + diff --git a/components/cibsync/cibsynccomponent.h b/components/cibsync/cibsynccomponent.h index 95dae5828..93a95a657 100644 --- a/components/cibsync/cibsynccomponent.h +++ b/components/cibsync/cibsynccomponent.h @@ -35,11 +35,10 @@ public: private: VirtualEndpoint::Ptr m_Endpoint; + bool m_SyncingConfig; static void ServiceStatusRequestHandler(const Endpoint::Ptr& sender, const RequestMessage& request); - bool m_SyncingConfig; - void NewEndpointHandler(const Endpoint::Ptr& endpoint); void SessionEstablishedHandler(const Endpoint::Ptr& endpoint); @@ -54,7 +53,6 @@ private: string method, bool includeProperties); static bool ShouldReplicateObject(const ConfigObject::Ptr& object); - }; } diff --git a/components/compat/compatcomponent.cpp b/components/compat/compatcomponent.cpp index 16ab38607..0acde0c35 100644 --- a/components/compat/compatcomponent.cpp +++ b/components/compat/compatcomponent.cpp @@ -112,6 +112,11 @@ void CompatComponent::DumpServiceStatus(ofstream& fp, Service service) long execution_time = (execution_end - execution_start); long latency = (schedule_end - schedule_start) - execution_time; + int state = service.GetState(); + + if (state >= StateUnknown) + state = StateUnknown; + fp << "servicestatus {" << "\n" << "\t" << "host_name=" << service.GetHost().GetName() << "\n" << "\t" << "service_description=" << service.GetAlias() << "\n" @@ -121,7 +126,7 @@ void CompatComponent::DumpServiceStatus(ofstream& fp, Service service) << "\t" << "should_be_scheduled=1" << "\n" << "\t" << "check_execution_time=" << execution_time << "\n" << "\t" << "check_latency=" << latency << "\n" - << "\t" << "current_state=" << service.GetState() << "\n" + << "\t" << "current_state=" << state << "\n" << "\t" << "state_type=" << service.GetStateType() << "\n" << "\t" << "plugin_output=" << output << "\n" << "\t" << "performance_data=" << perfdata << "\n" @@ -149,6 +154,7 @@ void CompatComponent::DumpServiceObject(ofstream& fp, Service service) << "\t" << "max_check_attempts" << "\t" << 1 << "\n" << "\t" << "active_checks_enabled" << "\t" << 1 << "\n" << "\t" << "passive_checks_enabled" << "\t" << 1 << "\n" + << "\t" << "check_freshness" << "\t" << 1 << "\n" << "\t" << "}" << "\n" << "\n"; }