From: Michael Friedrich Date: Fri, 4 Apr 2014 15:35:56 +0000 (+0200) Subject: StatusDataWriter: Dump command and application custom variables. X-Git-Tag: v0.0.10~225 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=19434dc73dafd5d98b52d3d487be3eb4988671a1;p=icinga2 StatusDataWriter: Dump command and application custom variables. Refs #5855 --- diff --git a/components/compat/statusdatawriter.cpp b/components/compat/statusdatawriter.cpp index 63beb7b2f..632e35b57 100644 --- a/components/compat/statusdatawriter.cpp +++ b/components/compat/statusdatawriter.cpp @@ -154,6 +154,10 @@ void StatusDataWriter::DumpCommand(std::ostream& fp, const Command::Ptr& command fp << "\t" "command_line" "\t" << CompatUtility::GetCommandLine(command); + fp << "\n"; + + DumpCustomAttributes(fp, command); + fp << "\n" "\t" "}" "\n" "\n"; } @@ -514,8 +518,7 @@ void StatusDataWriter::DumpCustomAttributes(std::ostream& fp, const DynamicObjec if (!kv.first.IsEmpty()) { fp << "\t"; - if (kv.first != "notes" && kv.first != "action_url" && kv.first != "notes_url" && - kv.first != "icon_image" && kv.first != "icon_image_alt" && kv.first != "statusmap_image" && kv.first != "2d_coords") + if (!CompatUtility::IsLegacyAttribute(kv.first)) fp << "_"; fp << kv.first << "\t" << kv.second << "\n"; @@ -738,8 +741,11 @@ void StatusDataWriter::StatusTimerHandler(void) "\t" "active_scheduled_service_check_stats=" << CIB::GetActiveChecksStatistics(60) << "," << CIB::GetActiveChecksStatistics(5 * 60) << "," << CIB::GetActiveChecksStatistics(15 * 60) << "\n" "\t" "passive_service_check_stats=" << CIB::GetPassiveChecksStatistics(60) << "," << CIB::GetPassiveChecksStatistics(5 * 60) << "," << CIB::GetPassiveChecksStatistics(15 * 60) << "\n" "\t" "next_downtime_id=" << Service::GetNextDowntimeID() << "\n" - "\t" "next_comment_id=" << Service::GetNextCommentID() << "\n" - "\t" "}" "\n" + "\t" "next_comment_id=" << Service::GetNextCommentID() << "\n"; + + DumpCustomAttributes(statusfp, IcingaApplication::GetInstance()); + + statusfp << "\t" "}" "\n" "\n"; BOOST_FOREACH(const Host::Ptr& host, DynamicType::GetObjects()) {