mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-29 16:55:05 +02:00
[Windows Agent] Fixed error on non cron configured modules
This commit is contained in:
parent
94c1ce304d
commit
8e6e5480d2
@ -31,6 +31,15 @@
|
|||||||
Cron::Cron (string cron_string) {
|
Cron::Cron (string cron_string) {
|
||||||
char cron_params[5][256], bottom[256], top[256];
|
char cron_params[5][256], bottom[256], top[256];
|
||||||
|
|
||||||
|
// Check if cron string is the default or empty
|
||||||
|
if (
|
||||||
|
cron_string.compare(CRON_DEFAULT_STRING) == 0 ||
|
||||||
|
cron_string.compare("") == 0
|
||||||
|
) {
|
||||||
|
this->isSet = false;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// Parse the cron string
|
// Parse the cron string
|
||||||
if (sscanf (cron_string.c_str (), "%255s %255s %255s %255s %255s", cron_params[0], cron_params[1], cron_params[2], cron_params[3], cron_params[4]) != 5) {
|
if (sscanf (cron_string.c_str (), "%255s %255s %255s %255s %255s", cron_params[0], cron_params[1], cron_params[2], cron_params[3], cron_params[4]) != 5) {
|
||||||
Pandora::pandoraDebug ("Invalid cron string: %s", cron_string.c_str ());
|
Pandora::pandoraDebug ("Invalid cron string: %s", cron_string.c_str ());
|
||||||
@ -41,12 +50,6 @@ Cron::Cron (string cron_string) {
|
|||||||
|
|
||||||
this->cronString = cron_string;
|
this->cronString = cron_string;
|
||||||
|
|
||||||
// Check if cron string is the default
|
|
||||||
if (cron_string.compare(CRON_DEFAULT_STRING) == 0) {
|
|
||||||
this->isSet = false;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Fill the cron structure
|
// Fill the cron structure
|
||||||
this->utimestamp = 0;
|
this->utimestamp = 0;
|
||||||
this->cronInterval = 0;
|
this->cronInterval = 0;
|
||||||
|
@ -1307,9 +1307,7 @@ Pandora_Module_Factory::getModuleFromDefinition (string definition) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Module cron */
|
/* Module cron */
|
||||||
if (module_crontab != "") {
|
|
||||||
module->setCron (module_crontab);
|
module->setCron (module_crontab);
|
||||||
}
|
|
||||||
|
|
||||||
/* Plugins do not have a module type */
|
/* Plugins do not have a module type */
|
||||||
if (module_plugin == "") {
|
if (module_plugin == "") {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user