]> granicus.if.org Git - icinga2/commitdiff
compat: add last_time_* for status.dat
authorMichael Friedrich <michael.friedrich@netways.de>
Thu, 18 Jul 2013 16:28:43 +0000 (18:28 +0200)
committerMichael Friedrich <michael.friedrich@netways.de>
Thu, 18 Jul 2013 16:28:43 +0000 (18:28 +0200)
components/compat/compatcomponent.cpp

index c12180fdb72c18443dc45fe9c27a5660464751bd..91033c1bc203b13213e5f69df18d0aa8d17698b3 100644 (file)
@@ -354,6 +354,11 @@ void CompatComponent::DumpHostStatus(std::ostream& fp, const Host::Ptr& host)
        if (hc)
                DumpServiceStatusAttrs(fp, hc, CompatTypeHost);
 
+       /* ugly but cgis parse only that */
+       fp << "\t" << "last_time_up=" << host->GetLastStateUp() << "\n"
+          << "\t" << "last_time_down=" << host->GetLastStateDown() << "\n"
+          << "\t" << "last_time_unreachable=" << host->GetLastStateUnreachable() << "\n";
+
        fp << "\t" << "}" << "\n"
           << "\n";
 
@@ -518,6 +523,10 @@ void CompatComponent::DumpServiceStatusAttrs(std::ostream& fp, const Service::Pt
           << "\t" << "max_attempts=" << service->GetMaxCheckAttempts() << "\n"
           << "\t" << "last_state_change=" << service->GetLastStateChange() << "\n"
           << "\t" << "last_hard_state_change=" << service->GetLastHardStateChange() << "\n"
+          << "\t" << "last_time_ok=" << service->GetLastStateOK() << "\n"
+          << "\t" << "last_time_warn=" << service->GetLastStateWarning() << "\n"
+          << "\t" << "last_time_critical=" << service->GetLastStateCritical() << "\n"
+          << "\t" << "last_time_unknown=" << service->GetLastStateUnknown() << "\n"
           << "\t" << "last_update=" << time(NULL) << "\n"
           << "\t" << "notifications_enabled=" << (service->GetEnableNotifications() ? 1 : 0) << "\n"
           << "\t" << "active_checks_enabled=" << (service->GetEnableActiveChecks() ? 1 : 0) <<"\n"