diff --git a/components/compat/checkresultreader.cpp b/components/compat/checkresultreader.cpp index 03df0211c..acb7c8d42 100644 --- a/components/compat/checkresultreader.cpp +++ b/components/compat/checkresultreader.cpp @@ -19,7 +19,7 @@ #include "compat/checkresultreader.h" #include "icinga/service.h" -#include "icinga/pluginchecktask.h" +#include "icinga/pluginutility.h" #include "base/dynamictype.h" #include "base/objectlock.h" #include "base/logger_fwd.h" @@ -102,8 +102,8 @@ void CheckResultReader::ProcessCheckResultFile(const String& path) const return; } - Dictionary::Ptr result = PluginCheckTask::ParseCheckOutput(attrs["output"]); - result->Set("state", PluginCheckTask::ExitStatusToState(Convert::ToLong(attrs["return_code"]))); + Dictionary::Ptr result = PluginUtility::ParseCheckOutput(attrs["output"]); + result->Set("state", PluginUtility::ExitStatusToState(Convert::ToLong(attrs["return_code"]))); result->Set("execution_start", Convert::ToDouble(attrs["start_time"])); result->Set("execution_end", Convert::ToDouble(attrs["finish_time"])); result->Set("active", 1); diff --git a/icinga-app/icinga.cpp b/icinga-app/icinga.cpp index b92fa5cd8..781fef86b 100644 --- a/icinga-app/icinga.cpp +++ b/icinga-app/icinga.cpp @@ -312,6 +312,7 @@ int main(int argc, char **argv) Log(LogInformation, "icinga-app", "Icinga application loader (version: " + Application::GetVersion() + ")"); (void) Utility::LoadExtensionLibrary("icinga"); + (void) Utility::LoadExtensionLibrary("methods"); if (g_AppParams.count("library")) { BOOST_FOREACH(const String& libraryName, g_AppParams["library"].as >()) { diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt index bbe32b3fe..358be7d3b 100644 --- a/lib/CMakeLists.txt +++ b/lib/CMakeLists.txt @@ -19,3 +19,4 @@ add_subdirectory(base) add_subdirectory(config) add_subdirectory(icinga) add_subdirectory(db_ido) +add_subdirectory(methods) diff --git a/lib/db_ido/CMakeLists.txt b/lib/db_ido/CMakeLists.txt index 1eb75719a..ae3620ff2 100644 --- a/lib/db_ido/CMakeLists.txt +++ b/lib/db_ido/CMakeLists.txt @@ -28,7 +28,7 @@ add_library(db_ido SHARED ) include_directories(${Boost_INCLUDE_DIRS}) -target_link_libraries(db_ido ${Boost_LIBRARIES} base config icinga) +target_link_libraries(db_ido ${Boost_LIBRARIES} base config icinga methods) set_target_properties ( db_ido PROPERTIES diff --git a/lib/db_ido/timeperioddbobject.cpp b/lib/db_ido/timeperioddbobject.cpp index d7c2d4381..03bd78f61 100644 --- a/lib/db_ido/timeperioddbobject.cpp +++ b/lib/db_ido/timeperioddbobject.cpp @@ -21,7 +21,7 @@ #include "db_ido/dbtype.h" #include "db_ido/dbvalue.h" #include "icinga/timeperiod.h" -#include "icinga/legacytimeperiod.h" +#include "methods/legacytimeperiod.h" #include "base/utility.h" #include "base/exception.h" #include "base/objectlock.h" diff --git a/lib/icinga/CMakeLists.txt b/lib/icinga/CMakeLists.txt index aab58606d..8f2cdf089 100644 --- a/lib/icinga/CMakeLists.txt +++ b/lib/icinga/CMakeLists.txt @@ -36,11 +36,9 @@ add_library(icinga SHARED api.cpp api.h checkcommand.cpp checkcommand.th cib.cpp command.cpp command.th compatutility.cpp domain.cpp domain.th eventcommand.cpp eventcommand.th externalcommandprocessor.cpp host.cpp host.th hostgroup.cpp hostgroup.th - icingaapplication.cpp icingaapplication.th legacytimeperiod.cpp - macroprocessor.cpp macroresolver.cpp notificationcommand.cpp - notificationcommand.th notification.cpp notification.th nullchecktask.cpp - nulleventtask.cpp pluginchecktask.cpp plugineventtask.cpp - pluginnotificationtask.cpp randomchecktask.cpp service-check.cpp + icingaapplication.cpp icingaapplication.th macroprocessor.cpp + macroresolver.cpp notificationcommand.cpp notificationcommand.th + notification.cpp notification.th pluginutility.cpp service-check.cpp service-comment.cpp service.cpp service-downtime.cpp service-event.cpp service-flapping.cpp service.th servicegroup.cpp servicegroup.th service-notification.cpp timeperiod.cpp timeperiod.th user.cpp user.th diff --git a/lib/icinga/externalcommandprocessor.cpp b/lib/icinga/externalcommandprocessor.cpp index de7345a93..2a40a128f 100644 --- a/lib/icinga/externalcommandprocessor.cpp +++ b/lib/icinga/externalcommandprocessor.cpp @@ -23,7 +23,7 @@ #include "icinga/user.h" #include "icinga/hostgroup.h" #include "icinga/servicegroup.h" -#include "icinga/pluginchecktask.h" +#include "icinga/pluginutility.h" #include "icinga/icingaapplication.h" #include "base/convert.h" #include "base/logger_fwd.h" @@ -214,8 +214,8 @@ void ExternalCommandProcessor::ProcessHostCheckResult(double time, const std::ve BOOST_THROW_EXCEPTION(std::invalid_argument("Got passive check result for host '" + arguments[0] + "' which has passive checks disabled.")); int exitStatus = Convert::ToDouble(arguments[1]); - Dictionary::Ptr result = PluginCheckTask::ParseCheckOutput(arguments[2]); - result->Set("state", PluginCheckTask::ExitStatusToState(exitStatus)); + Dictionary::Ptr result = PluginUtility::ParseCheckOutput(arguments[2]); + result->Set("state", PluginUtility::ExitStatusToState(exitStatus)); result->Set("schedule_start", time); result->Set("schedule_end", time); @@ -250,8 +250,8 @@ void ExternalCommandProcessor::ProcessServiceCheckResult(double time, const std: BOOST_THROW_EXCEPTION(std::invalid_argument("Got passive check result for service '" + arguments[1] + "' which has passive checks disabled.")); int exitStatus = Convert::ToDouble(arguments[2]); - Dictionary::Ptr result = PluginCheckTask::ParseCheckOutput(arguments[3]); - result->Set("state", PluginCheckTask::ExitStatusToState(exitStatus)); + Dictionary::Ptr result = PluginUtility::ParseCheckOutput(arguments[3]); + result->Set("state", PluginUtility::ExitStatusToState(exitStatus)); result->Set("schedule_start", time); result->Set("schedule_end", time); diff --git a/lib/icinga/pluginutility.cpp b/lib/icinga/pluginutility.cpp new file mode 100644 index 000000000..a5b3dfb2f --- /dev/null +++ b/lib/icinga/pluginutility.cpp @@ -0,0 +1,82 @@ +/****************************************************************************** + * Icinga 2 * + * Copyright (C) 2012-2013 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 "icinga/pluginutility.h" +#include "icinga/checkcommand.h" +#include "icinga/macroprocessor.h" +#include "icinga/icingaapplication.h" +#include "base/dynamictype.h" +#include "base/logger_fwd.h" +#include "base/scriptfunction.h" +#include "base/utility.h" +#include "base/process.h" +#include +#include +#include +#include + +using namespace icinga; + +ServiceState PluginUtility::ExitStatusToState(int exitStatus) +{ + switch (exitStatus) { + case 0: + return StateOK; + case 1: + return StateWarning; + case 2: + return StateCritical; + default: + return StateUnknown; + } +} + +Dictionary::Ptr PluginUtility::ParseCheckOutput(const String& output) +{ + Dictionary::Ptr result = boost::make_shared(); + + String text; + String perfdata; + + std::vector lines; + boost::algorithm::split(lines, output, boost::is_any_of("\r\n")); + + BOOST_FOREACH (const String& line, lines) { + size_t delim = line.FindFirstOf("|"); + + if (!text.IsEmpty()) + text += "\n"; + + if (delim != String::NPos) { + text += line.SubStr(0, delim); + + if (!perfdata.IsEmpty()) + perfdata += " "; + + perfdata += line.SubStr(delim + 1, line.GetLength()); + } else { + text += line; + } + } + + result->Set("output", text); + result->Set("performance_data_raw", perfdata); + + return result; +} diff --git a/lib/icinga/pluginutility.h b/lib/icinga/pluginutility.h new file mode 100644 index 000000000..96cca7897 --- /dev/null +++ b/lib/icinga/pluginutility.h @@ -0,0 +1,50 @@ +/****************************************************************************** + * Icinga 2 * + * Copyright (C) 2012-2013 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 PLUGINUTILITY_H +#define PLUGINUTILITY_H + +#include "icinga/i2-icinga.h" +#include "icinga/service.h" +#include "icinga/checkcommand.h" +#include "base/dictionary.h" +#include "base/dynamicobject.h" +#include + +namespace icinga +{ + +/** + * Utility functions for plugin-based checks. + * + * @ingroup icinga + */ +class I2_ICINGA_API PluginUtility +{ +public: + static ServiceState ExitStatusToState(int exitStatus); + static Dictionary::Ptr ParseCheckOutput(const String& output); + +private: + PluginUtility(void); +}; + +} + +#endif /* PLUGINUTILITY_H */ diff --git a/lib/methods/CMakeLists.txt b/lib/methods/CMakeLists.txt new file mode 100644 index 000000000..7bfdd8e63 --- /dev/null +++ b/lib/methods/CMakeLists.txt @@ -0,0 +1,38 @@ +# Icinga 2 +# Copyright (C) 2012-2013 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. + +add_library(methods SHARED + legacytimeperiod.cpp nullchecktask.cpp nulleventtask.cpp pluginchecktask.cpp + plugineventtask.cpp pluginnotificationtask.cpp randomchecktask.cpp +) + +target_link_libraries(methods ${Boost_LIBRARIES} base config icinga) + +set_target_properties ( + methods PROPERTIES + INSTALL_RPATH ${CMAKE_INSTALL_FULL_LIBDIR}/icinga2 + DEFINE_SYMBOL I2_METHODS_BUILD + FOLDER Lib +) + +install( + TARGETS methods + RUNTIME DESTINATION ${CMAKE_INSTALL_SBINDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}/icinga2 +) + + diff --git a/lib/methods/i2-methods.h b/lib/methods/i2-methods.h new file mode 100644 index 000000000..addf52308 --- /dev/null +++ b/lib/methods/i2-methods.h @@ -0,0 +1,38 @@ +/****************************************************************************** + * Icinga 2 * + * Copyright (C) 2012-2013 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 I2METHODS_H +#define I2METHODS_H + +/** + * @defgroup methods Icinga methods + * + * The methods library implements methods for various task (e.g. checks, event + * handlers, etc.). + */ + +#include "base/i2-base.h" + +#ifdef I2_METHODS_BUILD +# define I2_METHODS_API I2_EXPORT +#else /* I2_METHODS_BUILD */ +# define I2_METHODS_API I2_IMPORT +#endif /* I2_METHODS_BUILD */ + +#endif /* I2METHODS_H */ diff --git a/lib/icinga/legacytimeperiod.cpp b/lib/methods/legacytimeperiod.cpp similarity index 99% rename from lib/icinga/legacytimeperiod.cpp rename to lib/methods/legacytimeperiod.cpp index f7d1674da..c2e7e552e 100644 --- a/lib/icinga/legacytimeperiod.cpp +++ b/lib/methods/legacytimeperiod.cpp @@ -17,7 +17,7 @@ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. * ******************************************************************************/ -#include "icinga/legacytimeperiod.h" +#include "methods/legacytimeperiod.h" #include "base/scriptfunction.h" #include "base/convert.h" #include "base/exception.h" diff --git a/lib/icinga/legacytimeperiod.h b/lib/methods/legacytimeperiod.h similarity index 97% rename from lib/icinga/legacytimeperiod.h rename to lib/methods/legacytimeperiod.h index e90b19ac2..d2cb2ea06 100644 --- a/lib/icinga/legacytimeperiod.h +++ b/lib/methods/legacytimeperiod.h @@ -20,7 +20,7 @@ #ifndef LEGACYTIMEPERIOD_H #define LEGACYTIMEPERIOD_H -#include "icinga/i2-icinga.h" +#include "methods/i2-methods.h" #include "icinga/service.h" #include "base/dictionary.h" @@ -32,7 +32,7 @@ namespace icinga * * @ingroup icinga */ -class I2_ICINGA_API LegacyTimePeriod +class I2_METHODS_API LegacyTimePeriod { public: static Array::Ptr ScriptFunc(const TimePeriod::Ptr& tp, double start, double end); diff --git a/lib/icinga/nullchecktask.cpp b/lib/methods/nullchecktask.cpp similarity index 98% rename from lib/icinga/nullchecktask.cpp rename to lib/methods/nullchecktask.cpp index b4fcdae2b..58f5ca70e 100644 --- a/lib/icinga/nullchecktask.cpp +++ b/lib/methods/nullchecktask.cpp @@ -20,7 +20,7 @@ #ifndef _WIN32 # include #endif /* _WIN32 */ -#include "icinga/nullchecktask.h" +#include "methods/nullchecktask.h" #include "base/utility.h" #include "base/convert.h" #include "base/scriptfunction.h" diff --git a/lib/icinga/nullchecktask.h b/lib/methods/nullchecktask.h similarity index 95% rename from lib/icinga/nullchecktask.h rename to lib/methods/nullchecktask.h index fa9fcf873..8b7b42d1c 100644 --- a/lib/icinga/nullchecktask.h +++ b/lib/methods/nullchecktask.h @@ -20,7 +20,7 @@ #ifndef NULLCHECKTASK_H #define NULLCHECKTASK_H -#include "icinga/i2-icinga.h" +#include "methods/i2-methods.h" #include "icinga/service.h" #include "base/dictionary.h" @@ -30,9 +30,9 @@ namespace icinga /** * Test class for additional check types. Implements the "null" check type. * - * @ingroup icinga + * @ingroup methods */ -class I2_ICINGA_API NullCheckTask +class I2_METHODS_API NullCheckTask { public: static Dictionary::Ptr ScriptFunc(const Service::Ptr& service); diff --git a/lib/icinga/nulleventtask.cpp b/lib/methods/nulleventtask.cpp similarity index 97% rename from lib/icinga/nulleventtask.cpp rename to lib/methods/nulleventtask.cpp index 8142e924f..5e19fcf4d 100644 --- a/lib/icinga/nulleventtask.cpp +++ b/lib/methods/nulleventtask.cpp @@ -17,7 +17,7 @@ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. * ******************************************************************************/ -#include "icinga/nulleventtask.h" +#include "methods/nulleventtask.h" #include "base/scriptfunction.h" #include "base/logger_fwd.h" #include diff --git a/lib/icinga/nulleventtask.h b/lib/methods/nulleventtask.h similarity index 95% rename from lib/icinga/nulleventtask.h rename to lib/methods/nulleventtask.h index 571b8ac6d..d1067f14e 100644 --- a/lib/icinga/nulleventtask.h +++ b/lib/methods/nulleventtask.h @@ -20,7 +20,7 @@ #ifndef NULLEVENTTASK_H #define NULLEVENTTASK_H -#include "icinga/i2-icinga.h" +#include "methods/i2-methods.h" #include "icinga/service.h" #include "base/dictionary.h" @@ -30,9 +30,9 @@ namespace icinga /** * Test class for additional event handler types. Implements the "null" event handler type. * - * @ingroup icinga + * @ingroup methods */ -class I2_ICINGA_API NullEventTask +class I2_METHODS_API NullEventTask { public: static void ScriptFunc(const Service::Ptr& service); diff --git a/lib/icinga/pluginchecktask.cpp b/lib/methods/pluginchecktask.cpp similarity index 76% rename from lib/icinga/pluginchecktask.cpp rename to lib/methods/pluginchecktask.cpp index dbb224175..4869a5d7f 100644 --- a/lib/icinga/pluginchecktask.cpp +++ b/lib/methods/pluginchecktask.cpp @@ -17,7 +17,8 @@ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. * ******************************************************************************/ -#include "icinga/pluginchecktask.h" +#include "methods/pluginchecktask.h" +#include "icinga/pluginutility.h" #include "icinga/checkcommand.h" #include "icinga/macroprocessor.h" #include "icinga/icingaapplication.h" @@ -73,9 +74,9 @@ Dictionary::Ptr PluginCheckTask::ScriptFunc(const Service::Ptr& service) String output = pr.Output; output.Trim(); - Dictionary::Ptr result = ParseCheckOutput(output); + Dictionary::Ptr result = PluginUtility::ParseCheckOutput(output); result->Set("command", command); - result->Set("state", ExitStatusToState(pr.ExitStatus)); + result->Set("state", PluginUtility::ExitStatusToState(pr.ExitStatus)); result->Set("exit_state", pr.ExitStatus); result->Set("execution_start", pr.ExecutionStart); result->Set("execution_end", pr.ExecutionEnd); @@ -83,50 +84,3 @@ Dictionary::Ptr PluginCheckTask::ScriptFunc(const Service::Ptr& service) return result; } -ServiceState PluginCheckTask::ExitStatusToState(int exitStatus) -{ - switch (exitStatus) { - case 0: - return StateOK; - case 1: - return StateWarning; - case 2: - return StateCritical; - default: - return StateUnknown; - } -} - -Dictionary::Ptr PluginCheckTask::ParseCheckOutput(const String& output) -{ - Dictionary::Ptr result = boost::make_shared(); - - String text; - String perfdata; - - std::vector lines; - boost::algorithm::split(lines, output, boost::is_any_of("\r\n")); - - BOOST_FOREACH (const String& line, lines) { - size_t delim = line.FindFirstOf("|"); - - if (!text.IsEmpty()) - text += "\n"; - - if (delim != String::NPos) { - text += line.SubStr(0, delim); - - if (!perfdata.IsEmpty()) - perfdata += " "; - - perfdata += line.SubStr(delim + 1, line.GetLength()); - } else { - text += line; - } - } - - result->Set("output", text); - result->Set("performance_data_raw", perfdata); - - return result; -} diff --git a/lib/icinga/pluginchecktask.h b/lib/methods/pluginchecktask.h similarity index 89% rename from lib/icinga/pluginchecktask.h rename to lib/methods/pluginchecktask.h index f3c598f4f..8b178593f 100644 --- a/lib/icinga/pluginchecktask.h +++ b/lib/methods/pluginchecktask.h @@ -20,7 +20,7 @@ #ifndef PLUGINCHECKTASK_H #define PLUGINCHECKTASK_H -#include "icinga/i2-icinga.h" +#include "methods/i2-methods.h" #include "icinga/service.h" namespace icinga @@ -29,16 +29,13 @@ namespace icinga /** * Implements service checks based on external plugins. * - * @ingroup icinga + * @ingroup methods */ -class I2_ICINGA_API PluginCheckTask +class I2_METHODS_API PluginCheckTask { public: static Dictionary::Ptr ScriptFunc(const Service::Ptr& service); - static ServiceState ExitStatusToState(int exitStatus); - static Dictionary::Ptr ParseCheckOutput(const String& output); - private: PluginCheckTask(void); }; diff --git a/lib/icinga/plugineventtask.cpp b/lib/methods/plugineventtask.cpp similarity index 98% rename from lib/icinga/plugineventtask.cpp rename to lib/methods/plugineventtask.cpp index 611c2eab0..4aaf42a03 100644 --- a/lib/icinga/plugineventtask.cpp +++ b/lib/methods/plugineventtask.cpp @@ -17,7 +17,7 @@ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. * ******************************************************************************/ -#include "icinga/plugineventtask.h" +#include "methods/plugineventtask.h" #include "icinga/eventcommand.h" #include "icinga/macroprocessor.h" #include "icinga/icingaapplication.h" diff --git a/lib/icinga/plugineventtask.h b/lib/methods/plugineventtask.h similarity index 95% rename from lib/icinga/plugineventtask.h rename to lib/methods/plugineventtask.h index 00adfbf44..8b10eeefb 100644 --- a/lib/icinga/plugineventtask.h +++ b/lib/methods/plugineventtask.h @@ -20,7 +20,7 @@ #ifndef PLUGINEVENTTASK_H #define PLUGINEVENTTASK_H -#include "icinga/i2-icinga.h" +#include "methods/i2-methods.h" #include "icinga/service.h" namespace icinga @@ -29,9 +29,9 @@ namespace icinga /** * Implements event handlers based on external plugins. * - * @ingroup icinga + * @ingroup methods */ -class I2_ICINGA_API PluginEventTask +class I2_METHODS_API PluginEventTask { public: static void ScriptFunc(const Service::Ptr& service); diff --git a/lib/icinga/pluginnotificationtask.cpp b/lib/methods/pluginnotificationtask.cpp similarity index 98% rename from lib/icinga/pluginnotificationtask.cpp rename to lib/methods/pluginnotificationtask.cpp index 5cacf9e83..a94b1a110 100644 --- a/lib/icinga/pluginnotificationtask.cpp +++ b/lib/methods/pluginnotificationtask.cpp @@ -17,7 +17,7 @@ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. * ******************************************************************************/ -#include "icinga/pluginnotificationtask.h" +#include "methods/pluginnotificationtask.h" #include "icinga/notification.h" #include "icinga/notificationcommand.h" #include "icinga/service.h" diff --git a/lib/icinga/pluginnotificationtask.h b/lib/methods/pluginnotificationtask.h similarity index 95% rename from lib/icinga/pluginnotificationtask.h rename to lib/methods/pluginnotificationtask.h index ef732e017..b899ef5a3 100644 --- a/lib/icinga/pluginnotificationtask.h +++ b/lib/methods/pluginnotificationtask.h @@ -20,7 +20,7 @@ #ifndef PLUGINNOTIFICATIONTASK_H #define PLUGINNOTIFICATIONTASK_H -#include "icinga/i2-icinga.h" +#include "methods/i2-methods.h" #include "icinga/notification.h" namespace icinga @@ -29,9 +29,9 @@ namespace icinga /** * Implements sending notifications based on external plugins. * - * @ingroup icinga + * @ingroup methods */ -class I2_ICINGA_API PluginNotificationTask +class I2_METHODS_API PluginNotificationTask { public: static void ScriptFunc(const Notification::Ptr& notification, diff --git a/lib/icinga/randomchecktask.cpp b/lib/methods/randomchecktask.cpp similarity index 98% rename from lib/icinga/randomchecktask.cpp rename to lib/methods/randomchecktask.cpp index cdbb4bc14..2fb8ea110 100644 --- a/lib/icinga/randomchecktask.cpp +++ b/lib/methods/randomchecktask.cpp @@ -20,7 +20,7 @@ #ifndef _WIN32 # include #endif /* _WIN32 */ -#include "icinga/randomchecktask.h" +#include "methods/randomchecktask.h" #include "base/utility.h" #include "base/convert.h" #include "base/scriptfunction.h" diff --git a/lib/icinga/randomchecktask.h b/lib/methods/randomchecktask.h similarity index 95% rename from lib/icinga/randomchecktask.h rename to lib/methods/randomchecktask.h index 3007eaa33..95592492d 100644 --- a/lib/icinga/randomchecktask.h +++ b/lib/methods/randomchecktask.h @@ -20,7 +20,6 @@ #ifndef RANDOMCHECKTASK_H #define RANDOMCHECKTASK_H -#include "icinga/i2-icinga.h" #include "icinga/service.h" #include "base/dictionary.h" @@ -30,9 +29,9 @@ namespace icinga /** * Test class for additional check types. Implements the "null" check type. * - * @ingroup icinga + * @ingroup methods */ -class I2_ICINGA_API RandomCheckTask +class RandomCheckTask { public: static Dictionary::Ptr ScriptFunc(const Service::Ptr& service);