From b30e1750389afd338f43dab79b72e737af7c6199 Mon Sep 17 00:00:00 2001 From: Ramon Novoa Date: Wed, 18 Jun 2008 14:26:43 +0000 Subject: [PATCH] 2008-06-18 Ramon Novoa * win32/modules/pandora_module_logevent.cc: Fixed execution interval. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@878 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_agents/ChangeLog | 4 ++++ .../win32/modules/pandora_module_logevent.cc | 17 +++++++++++++++++ 2 files changed, 21 insertions(+) diff --git a/pandora_agents/ChangeLog b/pandora_agents/ChangeLog index 3cbb024b4f..dbf5323302 100644 --- a/pandora_agents/ChangeLog +++ b/pandora_agents/ChangeLog @@ -1,3 +1,7 @@ +2008-06-18 Ramon Novoa + + * win32/modules/pandora_module_logevent.cc: Fixed execution interval. + 2008-06-18 Ramon Novoa * win32/modules/pandora_module_logevent.cc: Now returns "empty" data diff --git a/pandora_agents/win32/modules/pandora_module_logevent.cc b/pandora_agents/win32/modules/pandora_module_logevent.cc index 7023c6aa8a..725665908a 100755 --- a/pandora_agents/win32/modules/pandora_module_logevent.cc +++ b/pandora_agents/win32/modules/pandora_module_logevent.cc @@ -21,6 +21,7 @@ #include "pandora_module_logevent.h" #include "../windows/pandora_wmi.h" +#include "../pandora_windows_service.h" using namespace Pandora; using namespace Pandora_Modules; @@ -42,9 +43,24 @@ Pandora_Module_Logevent::Pandora_Module_Logevent (string name, string source, st void Pandora_Module_Logevent::run () { + int interval, module_interval; + string value; list event_list; list::iterator event; + Pandora_Agent_Conf::Pandora_Agent_Conf *conf; + conf = Pandora_Agent_Conf::getInstance (); + + // Get execution interval + value = conf->getValue ("interval"); + interval = atoi(value.c_str ()); + + module_interval = this->getInterval (); + if (module_interval > 0) { + interval *= module_interval; + } + + // Run try { Pandora_Module::run (); } catch (Interval_Not_Fulfilled e) { @@ -53,6 +69,7 @@ Pandora_Module_Logevent::run () { Pandora_Wmi::getEventList (this->source, this->type, this->pattern, this->getInterval (), event_list); + // No data if (event_list.size () < 1) { this->setOutput (""); return;