From: Gunnar Beutner Date: Sun, 10 Mar 2013 21:20:13 +0000 (+0100) Subject: Implement some more tables. X-Git-Tag: v0.0.2~289 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=7274d4680e830ff96498b712e6f3da4c61bdbc7b;p=icinga2 Implement some more tables. --- diff --git a/components/livestatus/commentstable.cpp b/components/livestatus/commentstable.cpp new file mode 100644 index 000000000..935361727 --- /dev/null +++ b/components/livestatus/commentstable.cpp @@ -0,0 +1,69 @@ +/****************************************************************************** + * Icinga 2 * + * Copyright (C) 2012 Icinga Development Team (http://www.icinga.org/) * + * * + * This program is free software; you can redistribute it and/or * + * modify it under the terms of the GNU General Public License * + * as published by the Free Software Foundation; either version 2 * + * of the License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the Free Software Foundation * + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. * + ******************************************************************************/ + +#include "i2-livestatus.h" + +using namespace icinga; +using namespace livestatus; + +CommentsTable::CommentsTable(void) +{ + AddColumns(this); +} + +void CommentsTable::AddColumns(Table *table, const String& prefix, + const Column::ObjectAccessor& objectAccessor) +{ + table->AddColumn(prefix + "author", Column(&Table::EmptyStringAccessor, objectAccessor)); + table->AddColumn(prefix + "comment", Column(&Table::EmptyStringAccessor, objectAccessor)); + table->AddColumn(prefix + "id", Column(&Table::EmptyStringAccessor, objectAccessor)); + table->AddColumn(prefix + "entry_time", Column(&Table::EmptyStringAccessor, objectAccessor)); + table->AddColumn(prefix + "type", Column(&Table::EmptyStringAccessor, objectAccessor)); + table->AddColumn(prefix + "is_service", Column(&Table::EmptyStringAccessor, objectAccessor)); + table->AddColumn(prefix + "persistent", Column(&Table::EmptyStringAccessor, objectAccessor)); + table->AddColumn(prefix + "source", Column(&Table::EmptyStringAccessor, objectAccessor)); + table->AddColumn(prefix + "entry_type", Column(&Table::EmptyStringAccessor, objectAccessor)); + table->AddColumn(prefix + "expires", Column(&Table::EmptyStringAccessor, objectAccessor)); + table->AddColumn(prefix + "expire_time", Column(&Table::EmptyStringAccessor, objectAccessor)); + + // TODO: Join services table. +} + +String CommentsTable::GetName(void) const +{ + return "comments"; +} + +void CommentsTable::FetchRows(const function& addRowFn) +{ + BOOST_FOREACH(const DynamicObject::Ptr& object, DynamicType::GetObjects("Service")) { + Service::Ptr service = static_pointer_cast(object); + Dictionary::Ptr comments = service->GetComments(); + + if (!comments) + continue; + + ObjectLock olock(comments); + + Value comment; + BOOST_FOREACH(tie(tuples::ignore, comment), comments) { + addRowFn(comment); + } + } +} diff --git a/components/livestatus/commentstable.h b/components/livestatus/commentstable.h new file mode 100644 index 000000000..e3997dfba --- /dev/null +++ b/components/livestatus/commentstable.h @@ -0,0 +1,48 @@ +/****************************************************************************** + * Icinga 2 * + * Copyright (C) 2012 Icinga Development Team (http://www.icinga.org/) * + * * + * This program is free software; you can redistribute it and/or * + * modify it under the terms of the GNU General Public License * + * as published by the Free Software Foundation; either version 2 * + * of the License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the Free Software Foundation * + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. * + ******************************************************************************/ + +#ifndef COMMENTSTABLE_H +#define COMMENTSTABLE_H + +namespace livestatus +{ + +/** + * @ingroup livestatus + */ +class CommentsTable : public Table +{ +public: + typedef shared_ptr Ptr; + typedef weak_ptr WeakPtr; + + CommentsTable(void); + + static void AddColumns(Table *table, const String& prefix = String(), + const Column::ObjectAccessor& objectAccessor = Column::ObjectAccessor()); + + virtual String GetName(void) const; + +protected: + virtual void FetchRows(const function& addRowFn); +}; + +} + +#endif /* COMMENTSTABLE_H */ diff --git a/components/livestatus/downtimestable.cpp b/components/livestatus/downtimestable.cpp new file mode 100644 index 000000000..7ce057f92 --- /dev/null +++ b/components/livestatus/downtimestable.cpp @@ -0,0 +1,69 @@ +/****************************************************************************** + * Icinga 2 * + * Copyright (C) 2012 Icinga Development Team (http://www.icinga.org/) * + * * + * This program is free software; you can redistribute it and/or * + * modify it under the terms of the GNU General Public License * + * as published by the Free Software Foundation; either version 2 * + * of the License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the Free Software Foundation * + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. * + ******************************************************************************/ + +#include "i2-livestatus.h" + +using namespace icinga; +using namespace livestatus; + +DowntimesTable::DowntimesTable(void) +{ + AddColumns(this); +} + +void DowntimesTable::AddColumns(Table *table, const String& prefix, + const Column::ObjectAccessor& objectAccessor) +{ + table->AddColumn(prefix + "author", Column(&Table::EmptyStringAccessor, objectAccessor)); + table->AddColumn(prefix + "comment", Column(&Table::EmptyStringAccessor, objectAccessor)); + table->AddColumn(prefix + "id", Column(&Table::EmptyStringAccessor, objectAccessor)); + table->AddColumn(prefix + "entry_time", Column(&Table::EmptyStringAccessor, objectAccessor)); + table->AddColumn(prefix + "type", Column(&Table::EmptyStringAccessor, objectAccessor)); + table->AddColumn(prefix + "is_service", Column(&Table::EmptyStringAccessor, objectAccessor)); + table->AddColumn(prefix + "start_time", Column(&Table::EmptyStringAccessor, objectAccessor)); + table->AddColumn(prefix + "end_time", Column(&Table::EmptyStringAccessor, objectAccessor)); + table->AddColumn(prefix + "fixed", Column(&Table::EmptyStringAccessor, objectAccessor)); + table->AddColumn(prefix + "duration", Column(&Table::EmptyStringAccessor, objectAccessor)); + table->AddColumn(prefix + "triggered_by", Column(&Table::EmptyStringAccessor, objectAccessor)); + + // TODO: Join services table. +} + +String DowntimesTable::GetName(void) const +{ + return "downtimes"; +} + +void DowntimesTable::FetchRows(const function& addRowFn) +{ + BOOST_FOREACH(const DynamicObject::Ptr& object, DynamicType::GetObjects("Service")) { + Service::Ptr service = static_pointer_cast(object); + Dictionary::Ptr downtimes = service->GetDowntimes(); + + if (!downtimes) + continue; + + ObjectLock olock(downtimes); + + Value downtime; + BOOST_FOREACH(tie(tuples::ignore, downtime), downtimes) { + addRowFn(downtime); + } + } +} diff --git a/components/livestatus/downtimestable.h b/components/livestatus/downtimestable.h new file mode 100644 index 000000000..1505321d7 --- /dev/null +++ b/components/livestatus/downtimestable.h @@ -0,0 +1,48 @@ +/****************************************************************************** + * Icinga 2 * + * Copyright (C) 2012 Icinga Development Team (http://www.icinga.org/) * + * * + * This program is free software; you can redistribute it and/or * + * modify it under the terms of the GNU General Public License * + * as published by the Free Software Foundation; either version 2 * + * of the License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the Free Software Foundation * + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. * + ******************************************************************************/ + +#ifndef DOWNTIMESTABLE_H +#define DOWNTIMESTABLE_H + +namespace livestatus +{ + +/** + * @ingroup livestatus + */ +class DowntimesTable : public Table +{ +public: + typedef shared_ptr Ptr; + typedef weak_ptr WeakPtr; + + DowntimesTable(void); + + static void AddColumns(Table *table, const String& prefix = String(), + const Column::ObjectAccessor& objectAccessor = Column::ObjectAccessor()); + + virtual String GetName(void) const; + +protected: + virtual void FetchRows(const function& addRowFn); +}; + +} + +#endif /* DOWNTIMESTABLE_H */ diff --git a/components/livestatus/i2-livestatus.h b/components/livestatus/i2-livestatus.h index b44772076..db0fe0993 100644 --- a/components/livestatus/i2-livestatus.h +++ b/components/livestatus/i2-livestatus.h @@ -46,6 +46,9 @@ using namespace icinga; #include "contactgroupstable.h" #include "contactstable.h" #include "hoststable.h" +#include "servicestable.h" +#include "commentstable.h" +#include "downtimestable.h" #include "component.h" #endif /* I2LIVESTATUS_H */ diff --git a/components/livestatus/livestatus.vcxproj b/components/livestatus/livestatus.vcxproj index 63878266e..187fe5aa1 100644 --- a/components/livestatus/livestatus.vcxproj +++ b/components/livestatus/livestatus.vcxproj @@ -23,8 +23,10 @@ + + @@ -33,6 +35,7 @@ + @@ -41,15 +44,18 @@ + + + diff --git a/components/livestatus/livestatus.vcxproj.filters b/components/livestatus/livestatus.vcxproj.filters index a4cd2e691..c59ccd68d 100644 --- a/components/livestatus/livestatus.vcxproj.filters +++ b/components/livestatus/livestatus.vcxproj.filters @@ -57,6 +57,15 @@ Headerdateien + + Headerdateien + + + Headerdateien + + + Headerdateien + @@ -104,5 +113,14 @@ Quelldateien + + Quelldateien + + + Quelldateien + + + Quelldateien + \ No newline at end of file diff --git a/components/livestatus/servicestable.cpp b/components/livestatus/servicestable.cpp new file mode 100644 index 000000000..2010abef0 --- /dev/null +++ b/components/livestatus/servicestable.cpp @@ -0,0 +1,144 @@ +/****************************************************************************** + * Icinga 2 * + * Copyright (C) 2012 Icinga Development Team (http://www.icinga.org/) * + * * + * This program is free software; you can redistribute it and/or * + * modify it under the terms of the GNU General Public License * + * as published by the Free Software Foundation; either version 2 * + * of the License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the Free Software Foundation * + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. * + ******************************************************************************/ + +#include "i2-livestatus.h" + +using namespace icinga; +using namespace livestatus; + +ServicesTable::ServicesTable(void) +{ + AddColumns(this); +} + +void ServicesTable::AddColumns(Table *table, const String& prefix, + const Column::ObjectAccessor& objectAccessor) +{ + table->AddColumn(prefix + "description", Column(&ServicesTable::ShortNameAccessor, objectAccessor)); + table->AddColumn(prefix + "display_name", Column(&ServicesTable::DisplayNameAccessor, objectAccessor)); + table->AddColumn(prefix + "check_command", Column(&Table::EmptyStringAccessor, objectAccessor)); + table->AddColumn(prefix + "check_command_expanded", Column(&Table::EmptyStringAccessor, objectAccessor)); + table->AddColumn(prefix + "event_handler", Column(&Table::EmptyStringAccessor, objectAccessor)); + table->AddColumn(prefix + "plugin_output", Column(&Table::EmptyStringAccessor, objectAccessor)); + table->AddColumn(prefix + "long_plugin_output", Column(&Table::EmptyStringAccessor, objectAccessor)); + table->AddColumn(prefix + "perf_data", Column(&Table::EmptyStringAccessor, objectAccessor)); + table->AddColumn(prefix + "notification_period", Column(&Table::EmptyStringAccessor, objectAccessor)); + table->AddColumn(prefix + "check_period", Column(&Table::EmptyStringAccessor, objectAccessor)); + table->AddColumn(prefix + "notes", Column(&Table::EmptyStringAccessor, objectAccessor)); + table->AddColumn(prefix + "notes_expanded", Column(&Table::EmptyStringAccessor, objectAccessor)); + table->AddColumn(prefix + "notes_url", Column(&Table::EmptyStringAccessor, objectAccessor)); + table->AddColumn(prefix + "notes_url_expanded", Column(&Table::EmptyStringAccessor, objectAccessor)); + table->AddColumn(prefix + "action_url", Column(&Table::EmptyStringAccessor, objectAccessor)); + table->AddColumn(prefix + "action_url_expanded", Column(&Table::EmptyStringAccessor, objectAccessor)); + table->AddColumn(prefix + "icon_image", Column(&Table::EmptyStringAccessor, objectAccessor)); + table->AddColumn(prefix + "icon_image_expanded", Column(&Table::EmptyStringAccessor, objectAccessor)); + table->AddColumn(prefix + "icon_image_alt", Column(&Table::EmptyStringAccessor, objectAccessor)); + table->AddColumn(prefix + "initial_state", Column(&Table::EmptyStringAccessor, objectAccessor)); + table->AddColumn(prefix + "max_check_attempts", Column(&Table::EmptyStringAccessor, objectAccessor)); + table->AddColumn(prefix + "current_attempt", Column(&Table::EmptyStringAccessor, objectAccessor)); + table->AddColumn(prefix + "state", Column(&Table::EmptyStringAccessor, objectAccessor)); + table->AddColumn(prefix + "has_been_checked", Column(&Table::EmptyStringAccessor, objectAccessor)); + table->AddColumn(prefix + "last_state", Column(&Table::EmptyStringAccessor, objectAccessor)); + table->AddColumn(prefix + "last_hard_state", Column(&Table::EmptyStringAccessor, objectAccessor)); + table->AddColumn(prefix + "state_type", Column(&Table::EmptyStringAccessor, objectAccessor)); + table->AddColumn(prefix + "check_type", Column(&Table::EmptyStringAccessor, objectAccessor)); + table->AddColumn(prefix + "acknowledged", Column(&Table::EmptyStringAccessor, objectAccessor)); + table->AddColumn(prefix + "acknowledgement_type", Column(&Table::EmptyStringAccessor, objectAccessor)); + table->AddColumn(prefix + "no_more_notifications", Column(&Table::EmptyStringAccessor, objectAccessor)); + table->AddColumn(prefix + "last_state_change", Column(&Table::EmptyStringAccessor, objectAccessor)); + table->AddColumn(prefix + "last_time_ok", Column(&Table::EmptyStringAccessor, objectAccessor)); + table->AddColumn(prefix + "last_time_warning", Column(&Table::EmptyStringAccessor, objectAccessor)); + table->AddColumn(prefix + "last_time_critical", Column(&Table::EmptyStringAccessor, objectAccessor)); + table->AddColumn(prefix + "last_time_unknown", Column(&Table::EmptyStringAccessor, objectAccessor)); + table->AddColumn(prefix + "last_check", Column(&Table::EmptyStringAccessor, objectAccessor)); + table->AddColumn(prefix + "next_check", Column(&Table::EmptyStringAccessor, objectAccessor)); + table->AddColumn(prefix + "last_notification", Column(&Table::EmptyStringAccessor, objectAccessor)); + table->AddColumn(prefix + "next_notification", Column(&Table::EmptyStringAccessor, objectAccessor)); + table->AddColumn(prefix + "current_notification_number", Column(&Table::EmptyStringAccessor, objectAccessor)); + table->AddColumn(prefix + "last_state_change", Column(&Table::EmptyStringAccessor, objectAccessor)); + table->AddColumn(prefix + "last_hard_state_change", Column(&Table::EmptyStringAccessor, objectAccessor)); + table->AddColumn(prefix + "scheduled_downtime_depth", Column(&Table::EmptyStringAccessor, objectAccessor)); + table->AddColumn(prefix + "is_flapping", Column(&Table::EmptyStringAccessor, objectAccessor)); + table->AddColumn(prefix + "checks_enabled", Column(&Table::EmptyStringAccessor, objectAccessor)); + table->AddColumn(prefix + "accept_passive_checks", Column(&Table::EmptyStringAccessor, objectAccessor)); + table->AddColumn(prefix + "event_handler_enabled", Column(&Table::EmptyStringAccessor, objectAccessor)); + table->AddColumn(prefix + "notifications_enabled", Column(&Table::EmptyStringAccessor, objectAccessor)); + table->AddColumn(prefix + "process_performance_data", Column(&Table::EmptyStringAccessor, objectAccessor)); + table->AddColumn(prefix + "is_executing", Column(&Table::EmptyStringAccessor, objectAccessor)); + table->AddColumn(prefix + "active_checks_enabled", Column(&Table::EmptyStringAccessor, objectAccessor)); + table->AddColumn(prefix + "check_options", Column(&Table::EmptyStringAccessor, objectAccessor)); + table->AddColumn(prefix + "flap_detection_enabled", Column(&Table::EmptyStringAccessor, objectAccessor)); + table->AddColumn(prefix + "check_freshness", Column(&Table::EmptyStringAccessor, objectAccessor)); + table->AddColumn(prefix + "obsess_over_service", Column(&Table::EmptyStringAccessor, objectAccessor)); + table->AddColumn(prefix + "modified_attributes", Column(&Table::EmptyStringAccessor, objectAccessor)); + table->AddColumn(prefix + "modified_attributes_list", Column(&Table::EmptyStringAccessor, objectAccessor)); + table->AddColumn(prefix + "pnpgraph_present", Column(&Table::EmptyStringAccessor, objectAccessor)); + table->AddColumn(prefix + "check_interval", Column(&Table::EmptyStringAccessor, objectAccessor)); + table->AddColumn(prefix + "retry_interval", Column(&Table::EmptyStringAccessor, objectAccessor)); + table->AddColumn(prefix + "notification_interval", Column(&Table::EmptyStringAccessor, objectAccessor)); + table->AddColumn(prefix + "first_notification_delay", Column(&Table::EmptyStringAccessor, objectAccessor)); + table->AddColumn(prefix + "low_flap_threshold", Column(&Table::EmptyStringAccessor, objectAccessor)); + table->AddColumn(prefix + "high_flap_threshold", Column(&Table::EmptyStringAccessor, objectAccessor)); + table->AddColumn(prefix + "latency", Column(&Table::EmptyStringAccessor, objectAccessor)); + table->AddColumn(prefix + "execution_time", Column(&Table::EmptyStringAccessor, objectAccessor)); + table->AddColumn(prefix + "percent_state_change", Column(&Table::EmptyStringAccessor, objectAccessor)); + table->AddColumn(prefix + "in_check_period", Column(&Table::EmptyStringAccessor, objectAccessor)); + table->AddColumn(prefix + "in_notification_period", Column(&Table::EmptyStringAccessor, objectAccessor)); + table->AddColumn(prefix + "contacts", Column(&Table::EmptyStringAccessor, objectAccessor)); + table->AddColumn(prefix + "downtimes", Column(&Table::EmptyStringAccessor, objectAccessor)); + table->AddColumn(prefix + "downtimes_with_info", Column(&Table::EmptyStringAccessor, objectAccessor)); + table->AddColumn(prefix + "comments", Column(&Table::EmptyStringAccessor, objectAccessor)); + table->AddColumn(prefix + "comments_with_info", Column(&Table::EmptyStringAccessor, objectAccessor)); + table->AddColumn(prefix + "comments_with_extra_info", Column(&Table::EmptyStringAccessor, objectAccessor)); + table->AddColumn(prefix + "host_", Column(&Table::EmptyStringAccessor, objectAccessor)); + table->AddColumn(prefix + "custom_variable_names", Column(&Table::EmptyStringAccessor, objectAccessor)); + table->AddColumn(prefix + "custom_variable_values", Column(&Table::EmptyStringAccessor, objectAccessor)); + table->AddColumn(prefix + "custom_variables", Column(&Table::EmptyStringAccessor, objectAccessor)); + table->AddColumn(prefix + "groups", Column(&Table::EmptyStringAccessor, objectAccessor)); + table->AddColumn(prefix + "contact_groups", Column(&Table::EmptyStringAccessor, objectAccessor)); + + HostsTable::AddColumns(table, "host_", &ServicesTable::HostAccessor); +} + +String ServicesTable::GetName(void) const +{ + return "services"; +} + +void ServicesTable::FetchRows(const function& addRowFn) +{ + BOOST_FOREACH(const DynamicObject::Ptr& object, DynamicType::GetObjects("Service")) { + addRowFn(object); + } +} + +Object::Ptr ServicesTable::HostAccessor(const Object::Ptr& object) +{ + return static_pointer_cast(object)->GetHost(); +} + +Value ServicesTable::ShortNameAccessor(const Object::Ptr& object) +{ + return static_pointer_cast(object)->GetShortName(); +} + +Value ServicesTable::DisplayNameAccessor(const Object::Ptr& object) +{ + return static_pointer_cast(object)->GetDisplayName(); +} diff --git a/components/livestatus/servicestable.h b/components/livestatus/servicestable.h new file mode 100644 index 000000000..7b08199f9 --- /dev/null +++ b/components/livestatus/servicestable.h @@ -0,0 +1,53 @@ +/****************************************************************************** + * Icinga 2 * + * Copyright (C) 2012 Icinga Development Team (http://www.icinga.org/) * + * * + * This program is free software; you can redistribute it and/or * + * modify it under the terms of the GNU General Public License * + * as published by the Free Software Foundation; either version 2 * + * of the License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the Free Software Foundation * + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. * + ******************************************************************************/ + +#ifndef SERVICESTABLE_H +#define SERVICESTABLE_H + +namespace livestatus +{ + +/** + * @ingroup livestatus + */ +class ServicesTable : public Table +{ +public: + typedef shared_ptr Ptr; + typedef weak_ptr WeakPtr; + + ServicesTable(void); + + static void AddColumns(Table *table, const String& prefix = String(), + const Column::ObjectAccessor& objectAccessor = Column::ObjectAccessor()); + + virtual String GetName(void) const; + +protected: + virtual void FetchRows(const function& addRowFn); + + static Object::Ptr HostAccessor(const Object::Ptr& object); + + static Value ShortNameAccessor(const Object::Ptr& object); + static Value DisplayNameAccessor(const Object::Ptr& object); +}; + +} + +#endif /* SERVICESTABLE_H */ diff --git a/components/livestatus/table.cpp b/components/livestatus/table.cpp index 9cb48a882..dba1178b5 100644 --- a/components/livestatus/table.cpp +++ b/components/livestatus/table.cpp @@ -35,6 +35,12 @@ Table::Ptr Table::GetByName(const String& name) return boost::make_shared(); else if (name == "hosts") return boost::make_shared(); + else if (name == "services") + return boost::make_shared(); + else if (name == "comments") + return boost::make_shared(); + else if (name == "downtimes") + return boost::make_shared(); return Table::Ptr(); }