]> granicus.if.org Git - icinga2/commitdiff
Renamed NagiosCheckTask to PluginCheckTask.
authorGunnar Beutner <gunnar.beutner@netways.de>
Tue, 25 Sep 2012 07:06:21 +0000 (09:06 +0200)
committerGunnar Beutner <gunnar.beutner@netways.de>
Tue, 25 Sep 2012 07:08:50 +0000 (09:08 +0200)
Fixes #3146

components/checker/checkercomponent.cpp
icinga-app/config/icinga2.conf.dist
lib/icinga/Makefile.am
lib/icinga/i2-icinga.h
lib/icinga/icinga.vcxproj
lib/icinga/pluginchecktask.cpp [moved from lib/icinga/nagioschecktask.cpp with 88% similarity]
lib/icinga/pluginchecktask.h [moved from lib/icinga/nagioschecktask.h with 85% similarity]

index 2411b45d028d6d8e1ac4f603b12dcb750d835ddc..43e27239c63c5484e0367d3a3ebf67d1071dfcc8 100644 (file)
@@ -37,7 +37,8 @@ void CheckerComponent::Start(void)
        m_CheckTimer->OnTimerExpired.connect(boost::bind(&CheckerComponent::CheckTimerHandler, this));
        m_CheckTimer->Start();
 
-       NagiosCheckTask::Register();
+       /* TODO: figure out a way to register check types */
+       PluginCheckTask::Register();
        NullCheckTask::Register();
 
        m_ResultTimer = boost::make_shared<Timer>();
index beb48df441b965f3e890b9a49529a5bb7ab9e2f1..d932f6bde143ec13d43f0bf5300165e9c0eedaae 100644 (file)
@@ -16,7 +16,7 @@ local object Component "compat" {
 
 abstract object Service "nagios-service" {
   methods = {
-    check = "native::NagiosCheck"
+    check = "native::PluginCheck"
   },
 
   macros = {
index dcaf2301edc56fd463cb14ab757b0c7cbd26e030..9e003acec9b9cfc174fcdc6c3078287ffa0c3882 100644 (file)
@@ -16,10 +16,10 @@ libicinga_la_SOURCES =  \
        icingaapplication.h \
        macroprocessor.cpp \
        macroprocessor.h \
-       nagioschecktask.cpp \
-       nagioschecktask.h \
        nullchecktask.cpp \
        nullchecktask.h \
+       pluginchecktask.cpp \
+       pluginchecktask.h \
        service.cpp \
        servicegroup.cpp \
        servicegroup.h \
index d5f8e27666ff301446534b5d957d9c384b27f0a8..cc924f458def8555e0812df4e90835e4f0fe1e78 100644 (file)
@@ -50,7 +50,7 @@ using boost::algorithm::is_any_of;
 #include "servicegroup.h"
 
 #include "macroprocessor.h"
-#include "nagioschecktask.h"
+#include "pluginchecktask.h"
 #include "nullchecktask.h"
 
 #include "servicestatechangemessage.h"
index 26cae9771f1c8f8a18fb3bf7d263a4c849666067..b8d5727e4af25dba2e41f35159c36e80cceb40c5 100644 (file)
@@ -30,7 +30,7 @@
     </ClCompile>
     <ClCompile Include="icingaapplication.cpp" />
     <ClCompile Include="macroprocessor.cpp" />
-    <ClCompile Include="nagioschecktask.cpp" />
+    <ClCompile Include="pluginchecktask.cpp" />
     <ClCompile Include="nullchecktask.cpp" />
     <ClCompile Include="service.cpp" />
     <ClCompile Include="servicegroup.cpp" />
@@ -43,7 +43,7 @@
     <ClInclude Include="i2-icinga.h" />
     <ClInclude Include="icingaapplication.h" />
     <ClInclude Include="macroprocessor.h" />
-    <ClInclude Include="nagioschecktask.h" />
+    <ClInclude Include="pluginchecktask.h" />
     <ClInclude Include="nullchecktask.h" />
     <ClInclude Include="service.h" />
     <ClInclude Include="servicegroup.h" />
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
   <ImportGroup Label="ExtensionTargets">
   </ImportGroup>
-</Project>
\ No newline at end of file
+</Project>
similarity index 88%
rename from lib/icinga/nagioschecktask.cpp
rename to lib/icinga/pluginchecktask.cpp
index 64c2cce9b6d56f1d8f1ff1851f3539aa76c89483..b699c4c1de17981df3b9a21c5a5a4d4677bd6b6a 100644 (file)
 
 using namespace icinga;
 
-NagiosCheckTask::NagiosCheckTask(const ScriptTask::Ptr& task, const Process::Ptr& process)
+PluginCheckTask::PluginCheckTask(const ScriptTask::Ptr& task, const Process::Ptr& process)
        : m_Task(task), m_Process(process)
 { }
 
-void NagiosCheckTask::ScriptFunc(const ScriptTask::Ptr& task, const vector<Value>& arguments)
+void PluginCheckTask::ScriptFunc(const ScriptTask::Ptr& task, const vector<Value>& arguments)
 {
        if (arguments.size() < 1)
                throw_exception(invalid_argument("Missing argument: Service must be specified."));
@@ -46,15 +46,15 @@ void NagiosCheckTask::ScriptFunc(const ScriptTask::Ptr& task, const vector<Value
 
        Process::Ptr process = boost::make_shared<Process>(command);
 
-       NagiosCheckTask ct(task, process);
+       PluginCheckTask ct(task, process);
 
        ct.m_Result = boost::make_shared<Dictionary>();
        ct.m_Result->Set("schedule_start", Utility::GetTime());
 
-       process->Start(boost::bind(&NagiosCheckTask::ProcessFinishedHandler, ct));
+       process->Start(boost::bind(&PluginCheckTask::ProcessFinishedHandler, ct));
 }
 
-void NagiosCheckTask::ProcessFinishedHandler(NagiosCheckTask ct)
+void PluginCheckTask::ProcessFinishedHandler(PluginCheckTask ct)
 {
        ProcessResult pr;
 
@@ -96,7 +96,7 @@ void NagiosCheckTask::ProcessFinishedHandler(NagiosCheckTask ct)
        ct.m_Task->FinishResult(ct.m_Result);
 }
 
-void NagiosCheckTask::ProcessCheckOutput(const Dictionary::Ptr& result, String& output)
+void PluginCheckTask::ProcessCheckOutput(const Dictionary::Ptr& result, String& output)
 {
        String text;
        String perfdata;
@@ -125,8 +125,8 @@ void NagiosCheckTask::ProcessCheckOutput(const Dictionary::Ptr& result, String&
        result->Set("performance_data_raw", perfdata);
 }
 
-void NagiosCheckTask::Register(void)
+void PluginCheckTask::Register(void)
 {
-       ScriptFunction::Ptr func = boost::make_shared<ScriptFunction>(&NagiosCheckTask::ScriptFunc);
-       ScriptFunction::Register("native::NagiosCheck", func);
+       ScriptFunction::Ptr func = boost::make_shared<ScriptFunction>(&PluginCheckTask::ScriptFunc);
+       ScriptFunction::Register("native::PluginCheck", func);
 }
similarity index 85%
rename from lib/icinga/nagioschecktask.h
rename to lib/icinga/pluginchecktask.h
index c23cb1476b8ae726cf2e14e8ab63838830c8510a..d8dd8b3bfd17b15f085f95a905f1024bca55fd6b 100644 (file)
  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.             *
  ******************************************************************************/
 
-#ifndef NAGIOSCHECKTASK_H
-#define NAGIOSCHECKTASK_H
+#ifndef PLUGINCHECKTASK_H
+#define PLUGINCHECKTASK_H
 
 namespace icinga
 {
 
 /**
- * Implements Nagios(TM)-style checks.
+ * Implements service checks based on external plugins.
  *
  * @ingroup icinga
  */
-class I2_ICINGA_API NagiosCheckTask
+class I2_ICINGA_API PluginCheckTask
 {
 public:
        static void Register(void);
@@ -36,10 +36,10 @@ public:
 private:
        static void ScriptFunc(const ScriptTask::Ptr& task, const vector<Value>& arguments);
 
-       static void ProcessFinishedHandler(NagiosCheckTask ct);
+       static void ProcessFinishedHandler(PluginCheckTask ct);
        static void ProcessCheckOutput(const Dictionary::Ptr& result, String& output);
 
-       NagiosCheckTask(const ScriptTask::Ptr& task, const Process::Ptr& process);
+       PluginCheckTask(const ScriptTask::Ptr& task, const Process::Ptr& process);
 
        ScriptTask::Ptr m_Task;
        Process::Ptr m_Process;
@@ -48,4 +48,4 @@ private:
 
 }
 
-#endif /* NAGIOSCHECKTASK_H */
+#endif /* PLUGINCHECKTASK_H */