}
}
+void CompatComponent::DumpTimeperiods(std::ostream& fp, const Service::Ptr& owner)
+{
+
+}
+void CompatComponent::DumpCommands(std::ostream& fp, const Service::Ptr& owner)
+{
+ /* check_command, event_command -> service
+ * notification_command -> GetNotifications() -> GetNotificationCommand()
+ */
+ CheckCommand::Ptr check_command = owner->GetCheckCommand();
+ EventCommand::Ptr event_command = owner->GetEventCommand();
+
+ if (check_command) {
+ fp << "define command {" << "\n"
+ << "\t" << "command_name\t" << check_command->GetName() << "\n"
+ << "\t" << "command_line\t" << check_command->GetCommandLine() << "\n"
+ << "\t" << "}" << "\n"
+ << "\n";
+ }
+
+ if (event_command) {
+ fp << "define command {" << "\n"
+ << "\t" << "command_name\t" << event_command->GetName() << "\n"
+ << "\t" << "command_line\t" << event_command->GetCommandLine() << "\n"
+ << "\t" << "}" << "\n"
+ << "\n";
+ }
+ BOOST_FOREACH(const Notification::Ptr& notification, owner->GetNotifications()) {
+ NotificationCommand::Ptr notification_command = notification->GetNotificationCommand();
+ if(!notification_command)
+ continue;
+
+ fp << "define command {" << "\n"
+ << "\t" << "command_name\t" << notification_command->GetName() << "\n"
+ << "\t" << "command_line\t" << notification_command->GetCommandLine() << "\n"
+ << "\t" << "}" << "\n"
+ << "\n";
+ }
+
+}
void CompatComponent::DumpDowntimes(std::ostream& fp, const Service::Ptr& owner, CompatObjectType type)
{
Host::Ptr host = owner->GetHost();
<< "\t" << "}" << "\n"
<< "\n";
}
+
+ DumpCommands(fp, service);
}
void CompatComponent::DumpCustomAttributes(std::ostream& fp, const DynamicObject::Ptr& object)
String GetObjectsPath(void) const;
String GetCommandPath(void) const;
+ void DumpCommands(std::ostream& fp, const Service::Ptr& owner);
+ void DumpTimeperiods(std::ostream& fp, const Service::Ptr& owner);
void DumpDowntimes(std::ostream& fp, const Service::Ptr& owner, CompatObjectType type);
void DumpComments(std::ostream& fp, const Service::Ptr& owner, CompatObjectType type);
void DumpHostStatus(std::ostream& fp, const Host::Ptr& host);
Array::Ptr GetExportMacros(void) const;
virtual bool ResolveMacro(const String& macro, const Dictionary::Ptr& cr, String *result) const;
+ String GetCommandLine(void) const;
+
private:
Attribute<Dictionary::Ptr> m_Macros;
Attribute<Array::Ptr> m_ExportMacros;