]> granicus.if.org Git - icinga2/commitdiff
Bugfixes.
authorGunnar Beutner <gunnar.beutner@netways.de>
Mon, 2 Jul 2012 13:48:49 +0000 (15:48 +0200)
committerGunnar Beutner <gunnar.beutner@netways.de>
Mon, 2 Jul 2012 13:48:49 +0000 (15:48 +0200)
cib/cib.cpp
components/cibsync/cibsynccomponent.h
components/compat/compatcomponent.cpp

index a562bc62cdce79dee62260eb7457aa7e9648e235..4065a5dbf20e643578351fbd9472b21a695fc5fd 100644 (file)
@@ -33,3 +33,4 @@ int CIB::GetInformationTypes(void)
 {
        return m_Types;
 }
+
index 95dae5828583c0383ab6d0783c9bc651e58ab4b0..93a95a657a06a3ba33cd2579ed63aba5d3024838 100644 (file)
@@ -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);
-
 };
 
 }
index 16ab3860798095a7a8be5bee35cd5c8749e95150..0acde0c3538787b8e260c574f9524fec2cf2bbff 100644 (file)
@@ -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";
 }