]> granicus.if.org Git - icinga2/commitdiff
Make sure that libmethods is automatically loaded even when not using the ITL
authorGunnar Beutner <gunnar.beutner@netways.de>
Sun, 28 Aug 2016 15:03:08 +0000 (17:03 +0200)
committerGunnar Beutner <gunnar.beutner@netways.de>
Sun, 28 Aug 2016 15:03:08 +0000 (17:03 +0200)
fixes #12578

doc/10-icinga-template-library.md
itl/CMakeLists.txt
itl/command.conf [deleted file]
itl/itl
lib/icinga/icingaapplication.cpp
test/livestatus-test.cpp

index ae5efd9b635ea5c3445663d78f45e4c5e8db1d03..f5ee616ad68394bf87f3c445af7b478074613a10 100644 (file)
@@ -16,11 +16,6 @@ These templates are imported by the provided example configuration.
 > These templates are built into the binaries. By convention
 > all command and timeperiod objects should import these templates.
 
-If you're not using the ITL includes you can manually load the
-library which contains these templates:
-
-    library "methods"
-
 ### <a id="itl-plugin-check-command"></a> plugin-check-command
 
 Command template for check plugins executed by Icinga 2.
index 7f12eb0d85be9ebfa3cdb9819985c126b4194977..934195fa7e5a93c8d8447d202db0eb9732118595 100644 (file)
@@ -18,6 +18,6 @@
 add_subdirectory(plugins-contrib.d)
 
 install(
-  FILES itl command.conf command-icinga.conf hangman plugins command-plugins.conf manubulon command-plugins-manubulon.conf windows-plugins command-plugins-windows.conf nscp command-nscp-local.conf plugins-contrib
+  FILES itl command-icinga.conf hangman plugins command-plugins.conf manubulon command-plugins-manubulon.conf windows-plugins command-plugins-windows.conf nscp command-nscp-local.conf plugins-contrib
   DESTINATION ${CMAKE_INSTALL_DATADIR}/icinga2/include
 )
diff --git a/itl/command.conf b/itl/command.conf
deleted file mode 100644 (file)
index 3a9d917..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-/******************************************************************************
- * Icinga 2                                                                   *
- * Copyright (C) 2012-2016 Icinga Development Team (https://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.             *
- ******************************************************************************/
-
-library "methods"
diff --git a/itl/itl b/itl/itl
index dead0bb0aada1fbecee37c1841491c8926597f7e..ad8fbe092501d51d3e0a362bf4b100544fe13cee 100644 (file)
--- a/itl/itl
+++ b/itl/itl
@@ -22,5 +22,4 @@
  * configuration templates.
  */
 
-include "command.conf"
 include "command-icinga.conf"
index 0be50a0d4a4fe6b08f81dd35b3bd2b4459e01ad7..478a7ae0a52c01404ffe351e988d131526cc2c00 100644 (file)
@@ -33,6 +33,7 @@
 #include "base/scriptglobal.hpp"
 #include "base/initialize.hpp"
 #include "base/statsfunction.hpp"
+#include "base/loader.hpp"
 
 using namespace icinga;
 
@@ -43,6 +44,8 @@ INITIALIZE_ONCE(&IcingaApplication::StaticInitialize);
 
 void IcingaApplication::StaticInitialize(void)
 {
+       Loader::LoadExtensionLibrary("methods");
+
        String node_name = Utility::GetFQDN();
 
        if (node_name.IsEmpty()) {
index 37ff491d7653fbbbd1f4d1e455dbf9b070f082a5..18aa93207a4b1e4b13ede26ea7befbc104d33ea8 100644 (file)
@@ -52,8 +52,6 @@ struct LivestatusFixture
        static void CreateTestObjects(void)
        {
                String config = R"CONFIG(
-library "methods"
-
 object CheckCommand "dummy" {
   command = "/bin/echo"
 }