]> granicus.if.org Git - icinga2/commitdiff
Move internal script functions into the 'Internal' namespace
authorGunnar Beutner <gunnar.beutner@netways.de>
Tue, 9 Aug 2016 08:40:29 +0000 (10:40 +0200)
committerGunnar Beutner <gunnar.beutner@netways.de>
Wed, 10 Aug 2016 04:55:44 +0000 (06:55 +0200)
fixes #12338

26 files changed:
itl/CMakeLists.txt
itl/itl
lib/base/configobject.cpp
lib/base/function.hpp
lib/base/loader.hpp
lib/base/scriptglobal.cpp
lib/config/configitem.cpp
lib/config/configitem.hpp
lib/db_ido/db_ido-itl.conf
lib/db_ido/idochecktask.cpp
lib/icinga/CMakeLists.txt
lib/icinga/icinga-itl.conf [moved from itl/timeperiod.conf with 90% similarity]
lib/icinga/legacytimeperiod.cpp
lib/methods/clrchecktask.cpp
lib/methods/clusterchecktask.cpp
lib/methods/clusterzonechecktask.cpp
lib/methods/exceptionchecktask.cpp
lib/methods/icingachecktask.cpp
lib/methods/methods-itl.conf
lib/methods/nullchecktask.cpp
lib/methods/nulleventtask.cpp
lib/methods/pluginchecktask.cpp
lib/methods/plugineventtask.cpp
lib/methods/pluginnotificationtask.cpp
lib/methods/randomchecktask.cpp
lib/methods/timeperiodtask.cpp

index 85ec7e0c985de13ade738c401deb54b7d5d77eae..7f12eb0d85be9ebfa3cdb9819985c126b4194977 100644 (file)
@@ -18,6 +18,6 @@
 add_subdirectory(plugins-contrib.d)
 
 install(
-  FILES itl command.conf command-icinga.conf hangman timeperiod.conf 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.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
   DESTINATION ${CMAKE_INSTALL_DATADIR}/icinga2/include
 )
diff --git a/itl/itl b/itl/itl
index faa614644ed88d99c6905a7af4e07bf3939f12c8..dead0bb0aada1fbecee37c1841491c8926597f7e 100644 (file)
--- a/itl/itl
+++ b/itl/itl
@@ -24,4 +24,3 @@
 
 include "command.conf"
 include "command-icinga.conf"
-include "timeperiod.conf"
index 26cefeca17a0dd2fb2f8dca963549007b214fa82..520e4b2317985a698e57f1805fe1062644bb96da 100644 (file)
@@ -548,7 +548,6 @@ void ConfigObject::RestoreObject(const String& message, int attributeTypes)
        if (!object)
                return;
 
-       ASSERT(!object->IsActive());
 #ifdef I2_DEBUG
        Log(LogDebug, "ConfigObject")
            << "Restoring object '" << name << "' of type '" << type << "'.";
index f08a6fdc74003c0ec9a5c27aaee2c61609e7b540..6dba72582d42ea46f9c8b3b46489bd2cb358d4c5 100644 (file)
@@ -63,7 +63,16 @@ private:
                        Function::Ptr sf = new icinga::Function(WrapFunction(callback)); \
                        ScriptGlobal::Set(#name, sf); \
                } \
-               INITIALIZE_ONCE(RegisterFunction); \
+               INITIALIZE_ONCE_WITH_PRIORITY(RegisterFunction, 10); \
+       } } }
+
+#define REGISTER_SCRIPTFUNCTION_NS(ns, name, callback) \
+       namespace { namespace UNIQUE_NAME(sf) { namespace sf ## ns ## name { \
+               void RegisterFunction(void) { \
+                       Function::Ptr sf = new icinga::Function(WrapFunction(callback)); \
+                       ScriptGlobal::Set(#ns "." #name, sf); \
+               } \
+               INITIALIZE_ONCE_WITH_PRIORITY(RegisterFunction, 10); \
        } } }
 
 #define REGISTER_SAFE_SCRIPTFUNCTION(name, callback) \
@@ -72,9 +81,17 @@ private:
                        Function::Ptr sf = new icinga::Function(WrapFunction(callback), true); \
                        ScriptGlobal::Set(#name, sf); \
                } \
-               INITIALIZE_ONCE(RegisterFunction); \
+               INITIALIZE_ONCE_WITH_PRIORITY(RegisterFunction, 10); \
        } } }
 
+#define REGISTER_SAFE_SCRIPTFUNCTION_NS(ns, name, callback) \
+       namespace { namespace UNIQUE_NAME(sf) { namespace sf ## ns ## name { \
+               void RegisterFunction(void) { \
+                       Function::Ptr sf = new icinga::Function(WrapFunction(callback), true); \
+                       ScriptGlobal::Set(#ns "." #name, sf); \
+               } \
+               INITIALIZE_ONCE_WITH_PRIORITY(RegisterFunction, 10); \
+       } } }
 }
 
 #endif /* SCRIPTFUNCTION_H */
index bc1dddba90059fbd8dea21ff4be73fe2b287c8c1..12edc11c707a0708fdb20aac934f09c02d3cbcc4 100644 (file)
@@ -68,7 +68,6 @@ private:
        Loader(void);
 
        static boost::thread_specific_ptr<std::priority_queue<DeferredInitializer> >& GetDeferredInitializers(void);
-
 };
 
 }
index b5b59900086a94abb2c8e2ffcce42f281055b15d..d1dd2687111d83084501161a031aba1bc1630a4e 100644 (file)
@@ -27,6 +27,7 @@
 #include "base/objectlock.hpp"
 #include "base/exception.hpp"
 #include <boost/foreach.hpp>
+#include <boost/algorithm/string/split.hpp>
 #include <fstream>
 
 using namespace icinga;
@@ -47,7 +48,33 @@ Value ScriptGlobal::Get(const String& name, const Value *defaultValue)
 
 void ScriptGlobal::Set(const String& name, const Value& value)
 {
-       m_Globals->Set(name, value);
+       std::vector<String> tokens;
+       boost::algorithm::split(tokens, name, boost::is_any_of("."));
+
+       if (tokens.empty())
+               BOOST_THROW_EXCEPTION(std::invalid_argument("Name must not be empty"));
+
+       {
+               ObjectLock olock(m_Globals);
+
+               Dictionary::Ptr parent = m_Globals;
+
+               for (std::vector<String>::size_type i = 0; i < tokens.size(); i++) {
+                       const String& token = tokens[i];
+
+                       if (i + 1 != tokens.size()) {
+                               if (!parent->Contains(token)) {
+                                       Dictionary::Ptr dict = new Dictionary();
+                                       parent->Set(token, dict);
+                                       parent = dict;
+                               } else {
+                                       parent = parent->Get(token);
+                               }
+                       }
+               }
+
+               parent->Set(tokens[tokens.size() - 1], value);
+       }
 }
 
 bool ScriptGlobal::Exists(const String& name)
index 5f95c210e45168495b3502f6c00faa7149af099a..fa1b9714ddb8900b767fd0d8cbe95c31b634d4ad 100644 (file)
@@ -46,9 +46,7 @@ ConfigItem::TypeMap ConfigItem::m_Items;
 ConfigItem::ItemList ConfigItem::m_UnnamedItems;
 ConfigItem::IgnoredItemList ConfigItem::m_IgnoredItems;
 
-#ifdef I2_DEBUG
-REGISTER_SCRIPTFUNCTION(__run_with_activation_context, &ConfigItem::RunWithActivationContext);
-#endif /* I2_DEBUG */
+REGISTER_SCRIPTFUNCTION_NS(Internal, run_with_activation_context, &ConfigItem::RunWithActivationContext);
 
 /**
  * Constructor for the ConfigItem class.
@@ -534,9 +532,10 @@ bool ConfigItem::CommitNewItems(const ActivationContext::Ptr& context, WorkQueue
        return true;
 }
 
-bool ConfigItem::CommitItems(const ActivationContext::Ptr& context, WorkQueue& upq, std::vector<ConfigItem::Ptr>& newItems)
+bool ConfigItem::CommitItems(const ActivationContext::Ptr& context, WorkQueue& upq, std::vector<ConfigItem::Ptr>& newItems, bool silent)
 {
-       Log(LogInformation, "ConfigItem", "Committing config item(s).");
+       if (!silent)
+               Log(LogInformation, "ConfigItem", "Committing config item(s).");
 
        if (!CommitNewItems(context, upq, newItems)) {
                upq.ReportExceptions("config");
@@ -550,30 +549,33 @@ bool ConfigItem::CommitItems(const ActivationContext::Ptr& context, WorkQueue& u
 
        ApplyRule::CheckMatches();
 
-       /* log stats for external parsers */
-       typedef std::map<Type::Ptr, int> ItemCountMap;
-       ItemCountMap itemCounts;
-       BOOST_FOREACH(const ConfigItem::Ptr& item, newItems) {
-               if (!item->m_Object)
-                       continue;
+       if (!silent) {
+               /* log stats for external parsers */
+               typedef std::map<Type::Ptr, int> ItemCountMap;
+               ItemCountMap itemCounts;
+               BOOST_FOREACH(const ConfigItem::Ptr& item, newItems) {
+                       if (!item->m_Object)
+                               continue;
 
-               itemCounts[item->m_Object->GetReflectionType()]++;
-       }
+                       itemCounts[item->m_Object->GetReflectionType()]++;
+               }
 
-       BOOST_FOREACH(const ItemCountMap::value_type& kv, itemCounts) {
-               Log(LogInformation, "ConfigItem")
-                   << "Instantiated " << kv.second << " " << (kv.second != 1 ? kv.first->GetPluralName() : kv.first->GetName()) << ".";
+               BOOST_FOREACH(const ItemCountMap::value_type& kv, itemCounts) {
+                       Log(LogInformation, "ConfigItem")
+                           << "Instantiated " << kv.second << " " << (kv.second != 1 ? kv.first->GetPluralName() : kv.first->GetName()) << ".";
+               }
        }
 
        return true;
 }
 
-bool ConfigItem::ActivateItems(WorkQueue& upq, const std::vector<ConfigItem::Ptr>& newItems, bool runtimeCreated)
+bool ConfigItem::ActivateItems(WorkQueue& upq, const std::vector<ConfigItem::Ptr>& newItems, bool runtimeCreated, bool silent)
 {
        static boost::mutex mtx;
        boost::mutex::scoped_lock lock(mtx);
 
-       Log(LogInformation, "ConfigItem", "Triggering Start signal for config items");
+       if (!silent)
+               Log(LogInformation, "ConfigItem", "Triggering Start signal for config items");
 
        BOOST_FOREACH(const ConfigItem::Ptr& item, newItems) {
                if (!item->m_Object)
@@ -609,12 +611,12 @@ bool ConfigItem::ActivateItems(WorkQueue& upq, const std::vector<ConfigItem::Ptr
        }
 #endif /* I2_DEBUG */
 
-       Log(LogInformation, "ConfigItem", "Activated all objects.");
+       if (!silent)
+               Log(LogInformation, "ConfigItem", "Activated all objects.");
 
        return true;
 }
 
-#ifdef I2_DEBUG
 bool ConfigItem::RunWithActivationContext(const Function::Ptr& function)
 {
        ActivationScope scope;
@@ -629,15 +631,14 @@ bool ConfigItem::RunWithActivationContext(const Function::Ptr& function)
 
        std::vector<ConfigItem::Ptr> newItems;
 
-       if (!CommitItems(scope.GetContext(), upq, newItems))
+       if (!CommitItems(scope.GetContext(), upq, newItems, true))
                return false;
 
-       if (!ActivateItems(upq, newItems))
+       if (!ActivateItems(upq, newItems, false, true))
                return false;
 
        return true;
 }
-#endif /* I2_DEBUG */
 
 std::vector<ConfigItem::Ptr> ConfigItem::GetItems(const String& type)
 {
index 19aff26a98fcb753dc52121e4e7abcc31d98e0bb..96e5e6ea487785f8c96d3aecc00ff75606516f6b 100644 (file)
@@ -68,12 +68,10 @@ public:
        static ConfigItem::Ptr GetByTypeAndName(const String& type,
            const String& name);
 
-       static bool CommitItems(const ActivationContext::Ptr& context, WorkQueue& upq, std::vector<ConfigItem::Ptr>& newItems);
-       static bool ActivateItems(WorkQueue& upq, const std::vector<ConfigItem::Ptr>& newItems, bool runtimeCreated = false);
+       static bool CommitItems(const ActivationContext::Ptr& context, WorkQueue& upq, std::vector<ConfigItem::Ptr>& newItems, bool silent = false);
+       static bool ActivateItems(WorkQueue& upq, const std::vector<ConfigItem::Ptr>& newItems, bool runtimeCreated = false, bool silent = false);
 
-#ifdef I2_DEBUG
        static bool RunWithActivationContext(const Function::Ptr& function);
-#endif /* I2_DEBUG */
 
        static std::vector<ConfigItem::Ptr> GetItems(const String& type);
 
index c81fa668c8bf1daffacb3abca5c7e75d5dcf2568..0ff414d24c8f8e6164f308750e8267733093757a 100644 (file)
  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.             *
  ******************************************************************************/
 
-template CheckCommand "ido-check-command" {
-       execute = IdoCheck
-}
+assert(Internal.run_with_activation_context(function() {
+       template CheckCommand "ido-check-command" {
+               execute = Internal.IdoCheck
+       }
 
-object CheckCommand "ido" {
-       import "ido-check-command"
-}
+       object CheckCommand "ido" {
+               import "ido-check-command"
+       }
+}))
index 519262f49c2fb867e877fcbce577b96b32335f7d..4a63ba5b9b9255ce177c6e1a5e616d19c0008418 100644 (file)
@@ -33,7 +33,7 @@
 
 using namespace icinga;
 
-REGISTER_SCRIPTFUNCTION(IdoCheck, &IdoCheckTask::ScriptFunc);
+REGISTER_SCRIPTFUNCTION_NS(Internal, IdoCheck, &IdoCheckTask::ScriptFunc);
 
 void IdoCheckTask::ScriptFunc(const Checkable::Ptr& checkable, const CheckResult::Ptr& cr,
     const Dictionary::Ptr& resolvedMacros, bool useResolvedMacros)
index 521da77b96f7dfb5ff9782326716b19d7c6052c5..401792e0c708747d6cd2a8a5551ce682dc8e59ac 100644 (file)
@@ -37,13 +37,15 @@ mkclass_target(timeperiod.ti timeperiod.tcpp timeperiod.thpp)
 mkclass_target(usergroup.ti usergroup.tcpp usergroup.thpp)
 mkclass_target(user.ti user.tcpp user.thpp)
 
+mkembedconfig_target(icinga-itl.conf icinga-itl.cpp)
+
 set(icinga_SOURCES
   apiactions.cpp apievents.cpp checkable.cpp checkable.thpp checkable-dependency.cpp checkable-downtime.cpp checkable-event.cpp
   checkable-flapping.cpp checkable-script.cpp checkcommand.cpp checkcommand.thpp checkresult.cpp checkresult.thpp
   cib.cpp clusterevents.cpp command.cpp command.thpp comment.cpp comment.thpp compatutility.cpp dependency.cpp dependency.thpp
   dependency-apply.cpp downtime.cpp downtime.thpp eventcommand.cpp eventcommand.thpp
   externalcommandprocessor.cpp host.cpp host.thpp hostgroup.cpp hostgroup.thpp icingaapplication.cpp icingaapplication.thpp
-  customvarobject.cpp customvarobject.thpp
+  icinga-itl.cpp customvarobject.cpp customvarobject.thpp
   legacytimeperiod.cpp macroprocessor.cpp notificationcommand.cpp notificationcommand.thpp notification.cpp notification.thpp
   notification-apply.cpp objectutils.cpp perfdatavalue.cpp perfdatavalue.thpp pluginutility.cpp scheduleddowntime.cpp scheduleddowntime.thpp
   scheduleddowntime-apply.cpp service-apply.cpp checkable-check.cpp checkable-comment.cpp
similarity index 90%
rename from itl/timeperiod.conf
rename to lib/icinga/icinga-itl.conf
index 7ed84100a52158049e675d0556bf03d9e915e8dd..17b23dac33e928ef0f9da031bf9d52e3299fe45c 100644 (file)
@@ -17,6 +17,8 @@
  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.             *
  ******************************************************************************/
 
-template TimePeriod "legacy-timeperiod" {
-       update = LegacyTimePeriod
-}
+assert(Internal.run_with_activation_context(function() {
+       template TimePeriod "legacy-timeperiod" {
+               update = Internal.LegacyTimePeriod
+       }
+}))
index 2c08394e95eebe231e6c7311638fb953dc233e2f..3ab43f0c6ecafaeb91f8e70f5b3237f54f63273e 100644 (file)
@@ -31,7 +31,7 @@
 
 using namespace icinga;
 
-REGISTER_SCRIPTFUNCTION(LegacyTimePeriod, &LegacyTimePeriod::ScriptFunc);
+REGISTER_SCRIPTFUNCTION_NS(Internal, LegacyTimePeriod, &LegacyTimePeriod::ScriptFunc);
 
 bool LegacyTimePeriod::IsInTimeRange(tm *begin, tm *end, int stride, tm *reference)
 {
index 39b24ab83b393859978214e43d3f74b3de6c82b9..6e3580c82a1c0bf996466f9cfeb87af16cd3ddc5 100644 (file)
@@ -39,7 +39,7 @@
 
 using namespace icinga;
 
-REGISTER_SCRIPTFUNCTION(ClrCheck,  &ClrCheckTask::ScriptFunc);
+REGISTER_SCRIPTFUNCTION_NS(Internal, ClrCheck,  &ClrCheckTask::ScriptFunc);
 
 static boost::once_flag l_OnceFlag = BOOST_ONCE_INIT;
 
index 75e98065479e60773e497fb6f85adadf66140166..99ebda29c8f566a817e7aac51cb60c58d303a82b 100644 (file)
@@ -34,7 +34,7 @@
 
 using namespace icinga;
 
-REGISTER_SCRIPTFUNCTION(ClusterCheck, &ClusterCheckTask::ScriptFunc);
+REGISTER_SCRIPTFUNCTION_NS(Internal, ClusterCheck, &ClusterCheckTask::ScriptFunc);
 
 void ClusterCheckTask::ScriptFunc(const Checkable::Ptr& checkable, const CheckResult::Ptr& cr,
     const Dictionary::Ptr& resolvedMacros, bool useResolvedMacros)
index 03e33213159965bdc774074c0e59c3e467788804..b31444547947e551120aefb7c62069ca083beda2 100644 (file)
@@ -30,7 +30,7 @@
 
 using namespace icinga;
 
-REGISTER_SCRIPTFUNCTION(ClusterZoneCheck, &ClusterZoneCheckTask::ScriptFunc);
+REGISTER_SCRIPTFUNCTION_NS(Internal, ClusterZoneCheck, &ClusterZoneCheckTask::ScriptFunc);
 
 void ClusterZoneCheckTask::ScriptFunc(const Checkable::Ptr& checkable, const CheckResult::Ptr& cr,
     const Dictionary::Ptr& resolvedMacros, bool useResolvedMacros)
index f9a3516a9ff47549dde55dbe88f386a0b5f873c7..6e2fa7adecaa9ba0328aaeb72a15851df0d34dac 100644 (file)
@@ -29,7 +29,7 @@
 
 using namespace icinga;
 
-REGISTER_SCRIPTFUNCTION(ExceptionCheck, &ExceptionCheckTask::ScriptFunc);
+REGISTER_SCRIPTFUNCTION_NS(Internal, ExceptionCheck, &ExceptionCheckTask::ScriptFunc);
 
 void ExceptionCheckTask::ScriptFunc(const Checkable::Ptr& service, const CheckResult::Ptr& cr,
     const Dictionary::Ptr& resolvedMacros, bool useResolvedMacros)
index d39705d5182fa6cf512a0dd2995949a459e7aec7..082881b1f5adf415162806d95543b783c597d0b2 100644 (file)
@@ -30,7 +30,7 @@
 
 using namespace icinga;
 
-REGISTER_SCRIPTFUNCTION(IcingaCheck, &IcingaCheckTask::ScriptFunc);
+REGISTER_SCRIPTFUNCTION_NS(Internal, IcingaCheck, &IcingaCheckTask::ScriptFunc);
 
 void IcingaCheckTask::ScriptFunc(const Checkable::Ptr& service, const CheckResult::Ptr& cr,
     const Dictionary::Ptr& resolvedMacros, bool useResolvedMacros)
index 3255be31381f1c72471dda7c8c885976b1cf53a2..eed5dbbf6e386e3afd964b136f06ffc0f5b7c037 100644 (file)
  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.             *
  ******************************************************************************/
 
-template CheckCommand "icinga-check-command" {
-       execute = IcingaCheck
-}
-
-template CheckCommand "cluster-check-command" {
-       execute = ClusterCheck
-}
-
-template CheckCommand "cluster-zone-check-command" {
-       execute = ClusterZoneCheck
-}
-
-template CheckCommand "plugin-check-command" {
-       execute = PluginCheck
-}
-
-template CheckCommand "clr-check-command" {
-       execute = ClrCheck
-}
-
-template NotificationCommand "plugin-notification-command" {
-       execute = PluginNotification
-}
-
-template EventCommand "plugin-event-command" {
-       execute = PluginEvent
-}
-
-template CheckCommand "random-check-command" {
-       execute = RandomCheck
-}
-
-template CheckCommand "exception-check-command" {
-       execute = ExceptionCheck
-}
+assert(Internal.run_with_activation_context(function() {
+       template CheckCommand "icinga-check-command" {
+               execute = Internal.IcingaCheck
+       }
+
+       template CheckCommand "cluster-check-command" {
+               execute = Internal.ClusterCheck
+       }
+
+       template CheckCommand "cluster-zone-check-command" {
+               execute = Internal.ClusterZoneCheck
+       }
+
+       template CheckCommand "plugin-check-command" {
+               execute = Internal.PluginCheck
+       }
+
+       template CheckCommand "clr-check-command" {
+               execute = Internal.ClrCheck
+       }
+
+       template NotificationCommand "plugin-notification-command" {
+               execute = Internal.PluginNotification
+       }
+
+       template EventCommand "plugin-event-command" {
+               execute = Internal.PluginEvent
+       }
+
+       template CheckCommand "random-check-command" {
+               execute = Internal.RandomCheck
+       }
+
+       template CheckCommand "exception-check-command" {
+               execute = Internal.ExceptionCheck
+       }
+}))
index 2df58e9944d077891ae2af48b0ed10a843b73191..9f7a85d60f12d9faf4947114c546da48a5a7679f 100644 (file)
@@ -30,7 +30,7 @@
 
 using namespace icinga;
 
-REGISTER_SCRIPTFUNCTION(NullCheck, &NullCheckTask::ScriptFunc);
+REGISTER_SCRIPTFUNCTION_NS(Internal, NullCheck, &NullCheckTask::ScriptFunc);
 
 void NullCheckTask::ScriptFunc(const Checkable::Ptr& service, const CheckResult::Ptr& cr,
     const Dictionary::Ptr& resolvedMacros, bool useResolvedMacros)
index 14b2b123499948ac638a24dc4f745f425e78d65d..e2bbff52b8aa9e548352f33904d1f392d3d57c8a 100644 (file)
@@ -23,7 +23,7 @@
 
 using namespace icinga;
 
-REGISTER_SCRIPTFUNCTION(NullEvent, &NullEventTask::ScriptFunc);
+REGISTER_SCRIPTFUNCTION_NS(Internal, NullEvent, &NullEventTask::ScriptFunc);
 
 void NullEventTask::ScriptFunc(const Checkable::Ptr&, const Dictionary::Ptr& resolvedMacros, bool useResolvedMacros)
 { }
index d53e287f84628cb05ac0ea06ed18d1270ea5daeb..83ad4610a43f98474eb69fdc09420359452b9815 100644 (file)
@@ -34,7 +34,7 @@
 
 using namespace icinga;
 
-REGISTER_SCRIPTFUNCTION(PluginCheck,  &PluginCheckTask::ScriptFunc);
+REGISTER_SCRIPTFUNCTION_NS(Internal, PluginCheck,  &PluginCheckTask::ScriptFunc);
 
 void PluginCheckTask::ScriptFunc(const Checkable::Ptr& checkable, const CheckResult::Ptr& cr,
     const Dictionary::Ptr& resolvedMacros, bool useResolvedMacros)
index 328a349e9631e6a39ca91e94e2e52b775d25ecee..3e6f72f4f5a5a2016b3c0a3296df2e968f81a54d 100644 (file)
@@ -32,7 +32,7 @@
 
 using namespace icinga;
 
-REGISTER_SCRIPTFUNCTION(PluginEvent, &PluginEventTask::ScriptFunc);
+REGISTER_SCRIPTFUNCTION_NS(Internal, PluginEvent, &PluginEventTask::ScriptFunc);
 
 void PluginEventTask::ScriptFunc(const Checkable::Ptr& checkable,
     const Dictionary::Ptr& resolvedMacros, bool useResolvedMacros)
index e228eae32d6e76a5873eda5e0aff45c3abb67c76..28708684b18257fd1eace44ca30efd9903b05044 100644 (file)
@@ -33,7 +33,7 @@
 
 using namespace icinga;
 
-REGISTER_SCRIPTFUNCTION(PluginNotification, &PluginNotificationTask::ScriptFunc);
+REGISTER_SCRIPTFUNCTION_NS(Internal, PluginNotification, &PluginNotificationTask::ScriptFunc);
 
 void PluginNotificationTask::ScriptFunc(const Notification::Ptr& notification,
     const User::Ptr& user, const CheckResult::Ptr& cr, int itype,
index 8a0cc2d292ab51c2b96ffb77dadac2adcb04bb7b..3ace01ff8231f6f96a527063e69df9487c44a33b 100644 (file)
@@ -30,7 +30,7 @@
 
 using namespace icinga;
 
-REGISTER_SCRIPTFUNCTION(RandomCheck, &RandomCheckTask::ScriptFunc);
+REGISTER_SCRIPTFUNCTION_NS(Internal, RandomCheck, &RandomCheckTask::ScriptFunc);
 
 void RandomCheckTask::ScriptFunc(const Checkable::Ptr& service, const CheckResult::Ptr& cr,
     const Dictionary::Ptr& resolvedMacros, bool useResolvedMacros)
index 90a58f4db406eaa46972a43c9dd9d51c319fae13..05987795076950159e9a999c42198808e8457973 100644 (file)
@@ -22,8 +22,8 @@
 
 using namespace icinga;
 
-REGISTER_SCRIPTFUNCTION(EmptyTimePeriod, &TimePeriodTask::EmptyTimePeriodUpdate);
-REGISTER_SCRIPTFUNCTION(EvenMinutesTimePeriod, &TimePeriodTask::EvenMinutesTimePeriodUpdate);
+REGISTER_SCRIPTFUNCTION_NS(Internal, EmptyTimePeriod, &TimePeriodTask::EmptyTimePeriodUpdate);
+REGISTER_SCRIPTFUNCTION_NS(Internal, EvenMinutesTimePeriod, &TimePeriodTask::EvenMinutesTimePeriodUpdate);
 
 Array::Ptr TimePeriodTask::EmptyTimePeriodUpdate(const TimePeriod::Ptr&, double, double)
 {