compat: Fix timestamps.

This commit is contained in:
Gunnar Beutner 2013-07-25 09:45:40 +02:00
parent 70220e7375
commit 73beb278cf
2 changed files with 15 additions and 12 deletions

View File

@ -437,17 +437,17 @@ void CompatComponent::DumpServiceStatusAttrs(std::ostream& fp, const Service::Pt
<< "\t" << "plugin_output=" << attrs->Get("plugin_output") << "\n"
<< "\t" << "long_plugin_output=" << attrs->Get("long_plugin_output") << "\n"
<< "\t" << "performance_data=" << attrs->Get("performance_data") << "\n"
<< "\t" << "last_check=" << attrs->Get("last_check") << "\n"
<< "\t" << "next_check=" << attrs->Get("next_check") << "\n"
<< "\t" << "last_check=" << static_cast<long>(attrs->Get("last_check")) << "\n"
<< "\t" << "next_check=" << static_cast<long>(attrs->Get("next_check")) << "\n"
<< "\t" << "current_attempt=" << attrs->Get("current_attempt") << "\n"
<< "\t" << "max_attempts=" << attrs->Get("max_attempts") << "\n"
<< "\t" << "last_state_change=" << attrs->Get("last_state_change") << "\n"
<< "\t" << "last_hard_state_change=" << attrs->Get("last_hard_state_change") << "\n"
<< "\t" << "last_time_ok=" << attrs->Get("last_time_ok") << "\n"
<< "\t" << "last_time_warn=" << attrs->Get("last_time_warn") << "\n"
<< "\t" << "last_time_critical=" << attrs->Get("last_time_critical") << "\n"
<< "\t" << "last_time_unknown=" << attrs->Get("last_time_unknown") << "\n"
<< "\t" << "last_update=" << attrs->Get("last_update") << "\n"
<< "\t" << "last_state_change=" << static_cast<long>(attrs->Get("last_state_change")) << "\n"
<< "\t" << "last_hard_state_change=" << static_cast<long>(attrs->Get("last_hard_state_change")) << "\n"
<< "\t" << "last_time_ok=" << static_cast<long>(attrs->Get("last_time_ok")) << "\n"
<< "\t" << "last_time_warn=" << static_cast<long>(attrs->Get("last_time_warn")) << "\n"
<< "\t" << "last_time_critical=" << static_cast<long>(attrs->Get("last_time_critical")) << "\n"
<< "\t" << "last_time_unknown=" << static_cast<long>(attrs->Get("last_time_unknown")) << "\n"
<< "\t" << "last_update=" << static_cast<long>(attrs->Get("last_update")) << "\n"
<< "\t" << "notifications_enabled=" << attrs->Get("notifications_enabled") << "\n"
<< "\t" << "active_checks_enabled=" << attrs->Get("active_checks_enabled") << "\n"
<< "\t" << "passive_checks_enabled=" << attrs->Get("passive_checks_enabled") << "\n"
@ -458,8 +458,8 @@ void CompatComponent::DumpServiceStatusAttrs(std::ostream& fp, const Service::Pt
<< "\t" << "acknowledgement_type=" << attrs->Get("acknowledgement_type") << "\n"
<< "\t" << "acknowledgement_end_time=" << attrs->Get("acknowledgement_end_time") << "\n"
<< "\t" << "scheduled_downtime_depth=" << attrs->Get("scheduled_downtime_depth") << "\n"
<< "\t" << "last_notification=" << attrs->Get("last_notification") << "\n"
<< "\t" << "next_notification=" << attrs->Get("next_notification") << "\n"
<< "\t" << "last_notification=" << static_cast<long>(attrs->Get("last_notification")) << "\n"
<< "\t" << "next_notification=" << static_cast<long>(attrs->Get("next_notification")) << "\n"
<< "\t" << "current_notification_number=" << attrs->Get("current_notification_number") << "\n";
}
@ -616,7 +616,7 @@ void CompatComponent::StatusTimerHandler(void)
statusfp << "programstatus {" << "\n"
<< "icinga_pid=" << Utility::GetPid() << "\n"
<< "\t" << "daemon_mode=1" << "\n"
<< "\t" << "program_start=" << IcingaApplication::GetInstance()->GetStartTime() << "\n"
<< "\t" << "program_start=" << static_cast<long>(IcingaApplication::GetInstance()->GetStartTime()) << "\n"
<< "\t" << "active_service_checks_enabled=1" << "\n"
<< "\t" << "passive_service_checks_enabled=1" << "\n"
<< "\t" << "active_host_checks_enabled=1" << "\n"

View File

@ -97,6 +97,9 @@ Value::operator double(void) const
if (value)
return *value;
if (IsEmpty())
return 0;
return boost::lexical_cast<double>(m_Value);
}