mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-27 15:54:29 +02:00
add ff_type Windows agent
Former-commit-id: d167449fe305d6a013eb2b2e22ec48a58af1e346
This commit is contained in:
parent
5ca01b0294
commit
be0f96b5f0
@ -78,6 +78,7 @@ Pandora_Module::Pandora_Module (string name) {
|
|||||||
this->warning_inverse = "";
|
this->warning_inverse = "";
|
||||||
this->quiet = "";
|
this->quiet = "";
|
||||||
this->module_ff_interval = "";
|
this->module_ff_interval = "";
|
||||||
|
this->module_ff_type = "";
|
||||||
this->module_alert_template = "";
|
this->module_alert_template = "";
|
||||||
this->module_crontab = "";
|
this->module_crontab = "";
|
||||||
}
|
}
|
||||||
@ -733,6 +734,13 @@ Pandora_Module::getXml () {
|
|||||||
module_xml += this->module_ff_interval;
|
module_xml += this->module_ff_interval;
|
||||||
module_xml += "</module_ff_interval>\n";
|
module_xml += "</module_ff_interval>\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Module FF type */
|
||||||
|
if (this->module_ff_type != "") {
|
||||||
|
module_xml += "\t<ff_type>";
|
||||||
|
module_xml += this->module_ff_type;
|
||||||
|
module_xml += "</ff_type>\n";
|
||||||
|
}
|
||||||
|
|
||||||
/* Module Alert template */
|
/* Module Alert template */
|
||||||
if (this->module_alert_template != "") {
|
if (this->module_alert_template != "") {
|
||||||
@ -1028,6 +1036,16 @@ Pandora_Module::setModuleFFInterval (string value) {
|
|||||||
this->module_ff_interval = value;
|
this->module_ff_interval = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set the module FF type for the module.
|
||||||
|
*
|
||||||
|
* @param value module FF type value to set.
|
||||||
|
*/
|
||||||
|
void
|
||||||
|
Pandora_Module::setModuleFFType (string value) {
|
||||||
|
this->module_ff_type = value;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set the module Alert template for the module.
|
* Set the module Alert template for the module.
|
||||||
*
|
*
|
||||||
|
@ -176,6 +176,7 @@ namespace Pandora_Modules {
|
|||||||
string unit, custom_id, str_warning, str_critical;
|
string unit, custom_id, str_warning, str_critical;
|
||||||
string module_group, warning_inverse, critical_inverse, quiet;
|
string module_group, warning_inverse, critical_inverse, quiet;
|
||||||
string module_ff_interval, module_alert_template, module_crontab;
|
string module_ff_interval, module_alert_template, module_crontab;
|
||||||
|
string module_ff_type;
|
||||||
string critical_instructions, warning_instructions, unknown_instructions, tags;
|
string critical_instructions, warning_instructions, unknown_instructions, tags;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
@ -277,6 +278,7 @@ namespace Pandora_Modules {
|
|||||||
void setWarningInverse (string value);
|
void setWarningInverse (string value);
|
||||||
void setQuiet (string value);
|
void setQuiet (string value);
|
||||||
void setModuleFFInterval (string value);
|
void setModuleFFInterval (string value);
|
||||||
|
void setModuleFFType (string value);
|
||||||
void setModuleAlertTemplate (string value);
|
void setModuleAlertTemplate (string value);
|
||||||
void setModuleCrontab (string value);
|
void setModuleCrontab (string value);
|
||||||
|
|
||||||
|
@ -119,6 +119,7 @@ using namespace Pandora_Strutils;
|
|||||||
#define TOKEN_WARNING_INVERSE ("module_warning_inverse ")
|
#define TOKEN_WARNING_INVERSE ("module_warning_inverse ")
|
||||||
#define TOKEN_QUIET ("module_quiet ")
|
#define TOKEN_QUIET ("module_quiet ")
|
||||||
#define TOKEN_MODULE_FF_INTERVAL ("module_ff_interval ")
|
#define TOKEN_MODULE_FF_INTERVAL ("module_ff_interval ")
|
||||||
|
#define TOKEN_MODULE_FF_TYPE ("module_ff_type ")
|
||||||
#define TOKEN_MACRO ("module_macro")
|
#define TOKEN_MACRO ("module_macro")
|
||||||
#define TOKEN_NATIVE_ENCODING ("module_native_encoding")
|
#define TOKEN_NATIVE_ENCODING ("module_native_encoding")
|
||||||
#define TOKEN_ALERT_TEMPLATE ("module_alert_template")
|
#define TOKEN_ALERT_TEMPLATE ("module_alert_template")
|
||||||
@ -176,7 +177,7 @@ Pandora_Module_Factory::getModuleFromDefinition (string definition) {
|
|||||||
string module_unit, module_group, module_custom_id, module_str_warning, module_str_critical;
|
string module_unit, module_group, module_custom_id, module_str_warning, module_str_critical;
|
||||||
string module_critical_instructions, module_warning_instructions, module_unknown_instructions, module_tags;
|
string module_critical_instructions, module_warning_instructions, module_unknown_instructions, module_tags;
|
||||||
string module_critical_inverse, module_warning_inverse, module_quiet, module_ff_interval;
|
string module_critical_inverse, module_warning_inverse, module_quiet, module_ff_interval;
|
||||||
string module_native_encoding, module_alert_template;
|
string module_native_encoding, module_alert_template, module_ff_type;
|
||||||
string macro;
|
string macro;
|
||||||
Pandora_Module *module;
|
Pandora_Module *module;
|
||||||
bool numeric;
|
bool numeric;
|
||||||
@ -254,6 +255,7 @@ Pandora_Module_Factory::getModuleFromDefinition (string definition) {
|
|||||||
module_warning_inverse = "";
|
module_warning_inverse = "";
|
||||||
module_quiet = "";
|
module_quiet = "";
|
||||||
module_ff_interval = "";
|
module_ff_interval = "";
|
||||||
|
module_ff_type = "";
|
||||||
module_native_encoding = "";
|
module_native_encoding = "";
|
||||||
module_alert_template = "";
|
module_alert_template = "";
|
||||||
module_user_session = "";
|
module_user_session = "";
|
||||||
@ -507,6 +509,10 @@ Pandora_Module_Factory::getModuleFromDefinition (string definition) {
|
|||||||
if (module_ff_interval == "") {
|
if (module_ff_interval == "") {
|
||||||
module_ff_interval = parseLine (line, TOKEN_MODULE_FF_INTERVAL);
|
module_ff_interval = parseLine (line, TOKEN_MODULE_FF_INTERVAL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (module_ff_type == "") {
|
||||||
|
module_ff_type = parseLine (line, TOKEN_MODULE_FF_TYPE);
|
||||||
|
}
|
||||||
|
|
||||||
if (module_alert_template == "") {
|
if (module_alert_template == "") {
|
||||||
module_alert_template = parseLine (line, TOKEN_ALERT_TEMPLATE);
|
module_alert_template = parseLine (line, TOKEN_ALERT_TEMPLATE);
|
||||||
@ -1087,6 +1093,13 @@ Pandora_Module_Factory::getModuleFromDefinition (string definition) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (module_ff_type != "") {
|
||||||
|
pos_macro = module_ff_type.find(macro_name);
|
||||||
|
if (pos_macro != string::npos){
|
||||||
|
module_ff_type.replace(pos_macro, macro_name.size(), macro_value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (module_alert_template != "") {
|
if (module_alert_template != "") {
|
||||||
pos_macro = module_alert_template.find(macro_name);
|
pos_macro = module_alert_template.find(macro_name);
|
||||||
if (pos_macro != string::npos){
|
if (pos_macro != string::npos){
|
||||||
@ -1447,6 +1460,10 @@ Pandora_Module_Factory::getModuleFromDefinition (string definition) {
|
|||||||
if (module_ff_interval != "") {
|
if (module_ff_interval != "") {
|
||||||
module->setModuleFFInterval (module_ff_interval);
|
module->setModuleFFInterval (module_ff_interval);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (module_ff_type != "") {
|
||||||
|
module->setModuleFFType (module_ff_type);
|
||||||
|
}
|
||||||
|
|
||||||
if (module_alert_template != "") {
|
if (module_alert_template != "") {
|
||||||
module->setModuleAlertTemplate (module_alert_template);
|
module->setModuleAlertTemplate (module_alert_template);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user