[Windows Agent] Removed all references to module_cron_interval

This commit is contained in:
fermin831 2018-02-21 15:57:46 +01:00
parent 0446cdd820
commit f8f322e328
3 changed files with 5 additions and 23 deletions

View File

@ -292,7 +292,6 @@ namespace Pandora_Modules {
void evaluateConditions ();
bool checkCron (int interval);
void setCron (string cron_string);
void setCronInterval (int interval);
int evaluateCondition (string string_value, double double_value, Condition *condition);
int evaluateIntensiveConditions ();
int hasOutput ();

View File

@ -94,7 +94,6 @@ using namespace Pandora_Strutils;
#define TOKEN_SAVE ("module_save ")
#define TOKEN_CONDITION ("module_condition ")
#define TOKEN_CRONTAB ("module_crontab ")
#define TOKEN_CRONINTERVAL ("module_cron_interval ")
#define TOKEN_PRECONDITION ("module_precondition ")
#define TOKEN_NOSEEKEOF ("module_noseekeof ")
#define TOKEN_PING ("module_ping ")
@ -168,7 +167,7 @@ Pandora_Module_Factory::getModuleFromDefinition (string definition) {
string module_perfcounter, module_tcpcheck;
string module_port, module_timeout, module_regexp;
string module_plugin, module_save, module_condition, module_precondition;
string module_crontab, module_cron_interval, module_post_process;
string module_crontab, module_post_process;
string module_min_critical, module_max_critical, module_min_warning, module_max_warning;
string module_disabled, module_min_ff_event, module_noseekeof;
string module_ping, module_ping_count, module_ping_timeout;
@ -222,7 +221,6 @@ Pandora_Module_Factory::getModuleFromDefinition (string definition) {
module_save = "";
module_condition = "";
module_crontab = "";
module_cron_interval = "";
module_post_process = "";
module_precondition = "";
module_min_critical = "";
@ -423,9 +421,6 @@ Pandora_Module_Factory::getModuleFromDefinition (string definition) {
if (module_crontab == "") {
module_crontab = parseLine (line, TOKEN_CRONTAB);
}
if (module_cron_interval == "") {
module_cron_interval = parseLine (line, TOKEN_CRONINTERVAL);
}
if (module_noseekeof == "") {
module_noseekeof = parseLine (line, TOKEN_NOSEEKEOF);
}
@ -904,13 +899,6 @@ Pandora_Module_Factory::getModuleFromDefinition (string definition) {
}
}
if (module_cron_interval != "") {
pos_macro = module_cron_interval.find(macro_name);
if (pos_macro != string::npos){
module_cron_interval.replace(pos_macro, macro_name.size(), macro_value);
}
}
if (module_noseekeof != "") {
pos_macro = module_noseekeof.find(macro_name);
if (pos_macro != string::npos){
@ -1321,11 +1309,6 @@ Pandora_Module_Factory::getModuleFromDefinition (string definition) {
/* Module cron */
if (module_crontab != "") {
module->setCron (module_crontab);
/* Set the cron interval */
if (module_cron_interval != "") {
module->setCronInterval (atoi (module_cron_interval.c_str ()));
}
}
/* Plugins do not have a module type */

View File

@ -1884,8 +1884,8 @@ Pandora_Windows_Service::pandora_run_broker (string config) {
continue;
}
/* Check preconditions */
if (module->checkCron (module->getInterval (), atoi (conf->getValue ("interval").c_str())) == 0) {
/* Check cron */
if (!module->checkCron (module->getInterval () * atoi (conf->getValue ("interval").c_str()))) {
pandoraDebug ("Cron not matched for module %s", module->getName ().c_str ());
module->setNoOutput ();
this->broker_modules->goNext ();
@ -2012,8 +2012,8 @@ Pandora_Windows_Service::pandora_run (int forced_run) {
continue;
}
/* Check preconditions */
if (module->checkCron (module->getInterval (), atoi (conf->getValue ("interval").c_str())) == 0) {
/* Check cron */
if (!module->checkCron (module->getInterval () * atoi (conf->getValue ("interval").c_str()))) {
pandoraDebug ("Cron not matched for module %s", module->getName ().c_str ());
module->setNoOutput ();
this->modules->goNext ();