Merge branch 'ent-EDF' into 'develop'

Ent edf

See merge request artica/pandorafms!2890
This commit is contained in:
Daniel Rodriguez 2019-11-26 18:38:49 +01:00
commit becaad2447
17 changed files with 398 additions and 64 deletions

View File

@ -24,7 +24,7 @@ Requires(preun): chkconfig /bin/rm /usr/sbin/userdel
Requires: fileutils textutils unzip
Requires: util-linux procps grep
Requires: /sbin/ip /bin/awk
Requires: perl perl(Sys::Syslog) perl(IO::Compress::Zip)
Requires: perl perl(Sys::Syslog) perl(IO::Compress::Zip) perl(YAML::Tiny)
# Required by plugins
#Requires: sh-utils sed passwd net-tools rpm
AutoReq: 0

View File

@ -19,7 +19,7 @@ Prefix: /usr/share
BuildRoot: %{_tmppath}/%{name}-%{version}-buildroot
BuildArch: noarch
PreReq: %fillup_prereq %insserv_prereq /usr/bin/sed /usr/bin/grep /usr/sbin/useradd
Requires: coreutils unzip perl
Requires: coreutils unzip perl perl(Sys::Syslog) perl(IO::Compress::Zip) perl(YAML::Tiny)
AutoReq: 0
Provides: %{name}-%{version}

View File

@ -16,10 +16,45 @@ INSERT INTO `tnetwork_component` (`name`, `description`, `id_group`, `type`, `ma
INSERT INTO `tnetwork_component` (`name`, `description`, `id_group`, `type`, `max`, `min`, `module_interval`, `tcp_port`, `tcp_send`, `tcp_rcv`, `snmp_community`, `snmp_oid`, `id_module_group`, `id_modulo`, `id_plugin`, `plugin_user`, `plugin_pass`, `plugin_parameter`, `max_timeout`, `max_retries`, `history_data`, `min_warning`, `max_warning`, `max_critical`, `str_warning`, `min_ff_event`, `min_critical`, `custom_string_2`, `str_critical`, `custom_integer_1`, `custom_string_1`, `post_process`, `custom_string_3`, `wizard_level`, `custom_integer_2`, `critical_instructions`, `unit`, `unknown_instructions`, `macros`, `warning_inverse`, `warning_instructions`, `tags`, `critical_inverse`, `module_macros`, `id_category`, `min_ff_event_warning`, `disabled_types_event`, `ff_type`, `min_ff_event_normal`, `dynamic_interval`, `min_ff_event_critical`, `dynamic_min`, `each_ff`, `dynamic_two_tailed`, `dynamic_max`, `dynamic_next`) VALUES ('Linux available memory percent','Available memory %',43,34,0,0,300,0,'free | grep Mem | awk '{print $NF/$2 * 100}'','','','',4,2,0,'','','',0,0,1,0.00,0.00,'',0.00,0.00,'',0,'','linux','',0,0,0.000000000000000,'%','nowizard','','','','',0,0,0,'','{\"going_unknown\":1}','',0,0,0,0,0,0,0,0,0,0);
INSERT INTO `tnetwork_component` (`name`, `description`, `id_group`, `type`, `max`, `min`, `module_interval`, `tcp_port`, `tcp_send`, `tcp_rcv`, `snmp_community`, `snmp_oid`, `id_module_group`, `id_modulo`, `id_plugin`, `plugin_user`, `plugin_pass`, `plugin_parameter`, `max_timeout`, `max_retries`, `history_data`, `min_warning`, `max_warning`, `max_critical`, `str_warning`, `min_ff_event`, `min_critical`, `custom_string_2`, `str_critical`, `custom_integer_1`, `custom_string_1`, `post_process`, `custom_string_3`, `wizard_level`, `custom_integer_2`, `critical_instructions`, `unit`, `unknown_instructions`, `macros`, `warning_inverse`, `warning_instructions`, `tags`, `critical_inverse`, `module_macros`, `id_category`, `min_ff_event_warning`, `disabled_types_event`, `ff_type`, `min_ff_event_normal`, `dynamic_interval`, `min_ff_event_critical`, `dynamic_min`, `each_ff`, `dynamic_two_tailed`, `dynamic_max`, `dynamic_next`) VALUES ('Linux available disk /','Available free space in mountpoint /',43,34,0,0,300,0,'df / | tail -n +2 | awk '{print $(NF-1)}' | tr -d '%'','','','',4,2,0,'','','',0,0,1,0.00,0.00,'0.00',0.00,0.00,'',0,'','inherited','',0,0,0.000000000000000,'','nowizard','','nowizard','0','',0,0,0,'','{\"going_unknown\":1}','',0,0,0,0,0,0,0,0,0,0);
ALTER TABLE `tevent_rule` MODIFY COLUMN `event_type` enum('','unknown','alert_fired','alert_recovered','alert_ceased','alert_manual_validation','recon_host_detected','system','error','new_agent','going_up_warning','going_up_critical','going_down_warning','going_down_normal','going_down_critical','going_up_normal') default '';
ALTER TABLE `tevent_rule` MODIFY COLUMN `criticity` int(4) unsigned DEFAULT NULL;
ALTER TABLE `tevent_rule` MODIFY COLUMN `id_grupo` mediumint(4) DEFAULT NULL;
ALTER TABLE `tevent_rule` ADD COLUMN `log_content` TEXT;
ALTER TABLE `tevent_rule` ADD COLUMN `log_source` TEXT;
ALTER TABLE `tevent_rule` ADD COLUMN `log_agent` TEXT;
ALTER TABLE `tevent_rule` ADD COLUMN `operator_agent` text COMMENT 'Operator for agent';
ALTER TABLE `tevent_rule` ADD COLUMN `operator_id_usuario` text COMMENT 'Operator for id_usuario';
ALTER TABLE `tevent_rule` ADD COLUMN `operator_id_grupo` text COMMENT 'Operator for id_grupo';
ALTER TABLE `tevent_rule` ADD COLUMN `operator_evento` text COMMENT 'Operator for evento';
ALTER TABLE `tevent_rule` ADD COLUMN `operator_event_type` text COMMENT 'Operator for event_type';
ALTER TABLE `tevent_rule` ADD COLUMN `operator_module` text COMMENT 'Operator for module';
ALTER TABLE `tevent_rule` ADD COLUMN `operator_alert` text COMMENT 'Operator for alert';
ALTER TABLE `tevent_rule` ADD COLUMN `operator_criticity` text COMMENT 'Operator for criticity';
ALTER TABLE `tevent_rule` ADD COLUMN `operator_user_comment` text COMMENT 'Operator for user_comment';
ALTER TABLE `tevent_rule` ADD COLUMN `operator_id_tag` text COMMENT 'Operator for id_tag';
ALTER TABLE `tevent_rule` ADD COLUMN `operator_log_content` text COMMENT 'Operator for log_content';
ALTER TABLE `tevent_rule` ADD COLUMN `operator_log_source` text COMMENT 'Operator for log_source';
ALTER TABLE `tevent_rule` ADD COLUMN `operator_log_agent` text COMMENT 'Operator for log_agent';
UPDATE `tevent_rule` SET `operator_agent` = "REGEX" WHERE `agent` != '';
UPDATE `tevent_rule` SET `operator_id_usuario` = "REGEX" WHERE `id_usuario` != '';
UPDATE `tevent_rule` SET `operator_id_grupo` = "REGEX" WHERE `id_grupo` > 0;
UPDATE `tevent_rule` SET `operator_evento` = "REGEX" WHERE `evento` != '';
UPDATE `tevent_rule` SET `operator_event_type` = "REGEX" WHERE `event_type` != '';
UPDATE `tevent_rule` SET `operator_module` = "REGEX" WHERE `module` != '';
UPDATE `tevent_rule` SET `operator_alert` = "REGEX" WHERE `alert` != '';
UPDATE `tevent_rule` SET `operator_criticity` = "REGEX" WHERE `criticity` != '99';
UPDATE `tevent_rule` SET `operator_user_comment` = "REGEX" WHERE `user_comment` != '';
UPDATE `tevent_rule` SET `operator_id_tag` = "REGEX" WHERE `id_tag` > 0;
UPDATE `tevent_rule` SET `operator_log_content` = "REGEX" WHERE `log_content` != '';
UPDATE `tevent_rule` SET `operator_log_source` = "REGEX" WHERE `log_source` != '';
UPDATE `tevent_rule` SET `operator_log_agent` = "REGEX" WHERE `log_agent` != '';
ALTER TABLE `tevent_alert` ADD COLUMN `special_days` tinyint(1) default 0;
ALTER TABLE `tevent_alert` MODIFY COLUMN `time_threshold` int(10) NOT NULL default 86400;
CREATE TABLE `tremote_command` (
`id` SERIAL,
`name` varchar(150) NOT NULL,

View File

@ -579,6 +579,39 @@ CREATE TABLE IF NOT EXISTS `tevent_rule` (
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
ALTER TABLE `tevent_rule` ADD COLUMN `group_recursion` INT(1) unsigned default 0;
ALTER TABLE `tevent_rule` ADD COLUMN `log_content` TEXT;
ALTER TABLE `tevent_rule` ADD COLUMN `log_source` TEXT;
ALTER TABLE `tevent_rule` ADD COLUMN `log_agent` TEXT;
ALTER TABLE `tevent_rule` ADD COLUMN `operator_agent` text COMMENT 'Operator for agent';
ALTER TABLE `tevent_rule` ADD COLUMN `operator_id_usuario` text COMMENT 'Operator for id_usuario';
ALTER TABLE `tevent_rule` ADD COLUMN `operator_id_grupo` text COMMENT 'Operator for id_grupo';
ALTER TABLE `tevent_rule` ADD COLUMN `operator_evento` text COMMENT 'Operator for evento';
ALTER TABLE `tevent_rule` ADD COLUMN `operator_event_type` text COMMENT 'Operator for event_type';
ALTER TABLE `tevent_rule` ADD COLUMN `operator_module` text COMMENT 'Operator for module';
ALTER TABLE `tevent_rule` ADD COLUMN `operator_alert` text COMMENT 'Operator for alert';
ALTER TABLE `tevent_rule` ADD COLUMN `operator_criticity` text COMMENT 'Operator for criticity';
ALTER TABLE `tevent_rule` ADD COLUMN `operator_user_comment` text COMMENT 'Operator for user_comment';
ALTER TABLE `tevent_rule` ADD COLUMN `operator_id_tag` text COMMENT 'Operator for id_tag';
ALTER TABLE `tevent_rule` ADD COLUMN `operator_log_content` text COMMENT 'Operator for log_content';
ALTER TABLE `tevent_rule` ADD COLUMN `operator_log_source` text COMMENT 'Operator for log_source';
ALTER TABLE `tevent_rule` ADD COLUMN `operator_log_agent` text COMMENT 'Operator for log_agent';
ALTER TABLE `tevent_rule` MODIFY COLUMN `event_type` enum('','unknown','alert_fired','alert_recovered','alert_ceased','alert_manual_validation','recon_host_detected','system','error','new_agent','going_up_warning','going_up_critical','going_down_warning','going_down_normal','going_down_critical','going_up_normal') default '';
ALTER TABLE `tevent_rule` MODIFY COLUMN `criticity` int(4) unsigned DEFAULT NULL;
ALTER TABLE `tevent_rule` MODIFY COLUMN `id_grupo` mediumint(4) DEFAULT NULL;
UPDATE `tevent_rule` SET `operator_agent` = "REGEX" WHERE `agent` != '';
UPDATE `tevent_rule` SET `operator_id_usuario` = "REGEX" WHERE `id_usuario` != '';
UPDATE `tevent_rule` SET `operator_id_grupo` = "REGEX" WHERE `id_grupo` > 0;
UPDATE `tevent_rule` SET `operator_evento` = "REGEX" WHERE `evento` != '';
UPDATE `tevent_rule` SET `operator_event_type` = "REGEX" WHERE `event_type` != '';
UPDATE `tevent_rule` SET `operator_module` = "REGEX" WHERE `module` != '';
UPDATE `tevent_rule` SET `operator_alert` = "REGEX" WHERE `alert` != '';
UPDATE `tevent_rule` SET `operator_criticity` = "REGEX" WHERE `criticity` != '99';
UPDATE `tevent_rule` SET `operator_user_comment` = "REGEX" WHERE `user_comment` != '';
UPDATE `tevent_rule` SET `operator_id_tag` = "REGEX" WHERE `id_tag` > 0;
UPDATE `tevent_rule` SET `operator_log_content` = "REGEX" WHERE `log_content` != '';
UPDATE `tevent_rule` SET `operator_log_source` = "REGEX" WHERE `log_source` != '';
UPDATE `tevent_rule` SET `operator_log_agent` = "REGEX" WHERE `log_agent` != '';
-- -----------------------------------------------------
-- Table `tevent_alert`
@ -627,6 +660,9 @@ CREATE TABLE IF NOT EXISTS `tevent_alert` (
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
ALTER TABLE `tevent_alert` ADD COLUMN `special_days` tinyint(1) default 0;
ALTER TABLE `tevent_alert` MODIFY COLUMN `time_threshold` int(10) NOT NULL default 86400;
-- -----------------------------------------------------
-- Table `tevent_alert_action`
-- -----------------------------------------------------
@ -2359,7 +2395,7 @@ CREATE TABLE `tvisual_console_elements_cache` (
CREATE TABLE IF NOT EXISTS `tcredential_store` (
`identifier` varchar(100) NOT NULL,
`id_group` mediumint(4) unsigned NOT NULL DEFAULT 0,
`product` enum('CUSTOM', 'AWS', 'AZURE', 'GOOGLE') default 'CUSTOM',
`product` enum('CUSTOM', 'AWS', 'AZURE', 'GOOGLE', 'SAP') default 'CUSTOM',
`username` text,
`password` text,
`extra_1` text,

View File

@ -514,7 +514,9 @@ class Wizard
$output .= '</li>';
} else {
if ($input['arguments']['type'] != 'hidden') {
if ($input['arguments']['type'] != 'hidden'
&& $input['arguments']['type'] != 'hidden_extended'
) {
if (!$direct) {
$output .= '<li id="'.$input['id'].'" class="'.$class.'">';
}
@ -572,7 +574,9 @@ class Wizard
$output .= '</ul></li>';
} else {
if ($input['arguments']['type'] != 'hidden') {
if ($input['arguments']['type'] != 'hidden'
&& $input['arguments']['type'] != 'hidden_extended'
) {
if ($input['arguments']['inline'] != 'true') {
$output .= '<div class="edit_discovery_input">';
} else {
@ -675,7 +679,9 @@ class Wizard
$output .= '</ul></li>';
} else {
if ($input['arguments']['type'] != 'hidden') {
if ($input['arguments']['type'] != 'hidden'
&& $input['arguments']['type'] != 'hidden_extended'
) {
$output .= '<li id="'.$input['id'].'" class="'.$class.'">';
$output .= '<label>'.$input['label'].'</label>';
$output .= $this->printInput($input['arguments']);

Binary file not shown.

After

Width:  |  Height:  |  Size: 344 B

View File

@ -3542,17 +3542,22 @@ function agents_get_sap_agents($id_agent)
$array_agents = [];
foreach ($sap_modules as $module => $key) {
$new_ones = db_get_all_rows_sql(
'SELECT ta.id_agente,ta.alias
FROM tagente ta
INNER JOIN tagente_modulo tam
ON tam.id_agente = ta.id_agente
WHERE tam.nombre
LIKE "%SAP%"
GROUP BY ta.id_agente'
);
if ($new_ones === false) {
continue;
}
$array_agents = array_merge(
$array_agents,
db_get_all_rows_sql(
'SELECT ta.id_agente,ta.alias
FROM tagente ta
INNER JOIN tagente_modulo tam
ON tam.id_agente = ta.id_agente
WHERE tam.nombre
LIKE "%SAP%"
GROUP BY ta.id_agente'
)
$new_ones
);
}

View File

@ -1828,11 +1828,18 @@ function html_print_input_hidden($name, $value, $return=false, $class=false)
* @param string $id Input value.
* @param boolean $return Whether to return an output string or echo now (optional, echo by default).
* @param string $class Set the class of input.
* @param boolean $quotes Use simple quotes or double quotes.
*
* @return string HTML code if return parameter is true.
*/
function html_print_input_hidden_extended($name, $value, $id, $return=false, $class=false)
{
function html_print_input_hidden_extended(
$name,
$value,
$id,
$return=false,
$class=false,
$quotes=false
) {
if ($class !== false) {
$classText = 'class="'.$class.'"';
} else {
@ -1845,7 +1852,16 @@ function html_print_input_hidden_extended($name, $value, $id, $return=false, $cl
$ouput_id = $id;
}
$output = '<input id="'.$ouput_id.'" name="'.$name.'" type="hidden" '.$classText.' value="'.$value.'" />';
$quote = '"';
if ($quotes === true) {
$quote = "'";
}
$output = '<input id='.$quote.''.$ouput_id.''.$quote.' ';
$output .= ' name='.$quote.''.$name.''.$quote.' ';
$output .= ' type='.$quote.'hidden'.$quote.' '.$classText;
$output .= ' value='.$quote.''.$value.''.$quote.'';
$output .= ' />';
if ($return) {
return $output;
@ -2464,19 +2480,27 @@ function html_print_radio_button($name, $value, $label='', $checkedvalue='', $re
/**
* Render a checkbox button input. Extended version, use html_print_checkbox() to simplify.
*
* @param string Input name.
* @param string Input value.
* @param string Set the button to be marked (optional, unmarked by default).
* @param bool Disable the button (optional, button enabled by default).
* @param string Script to execute when onClick event is triggered (optional).
* @param string Optional HTML attributes. It's a free string which will be
inserted into the HTML tag, use it carefully (optional).
* @param bool Whether to return an output string or echo now (optional, echo by default).
* @param string $name Input name.
* @param string $value Input value.
* @param string $checked Set the button to be marked (optional, unmarked by default).
* @param boolean $disabled Disable the button (optional, button enabled by default).
* @param string $script Script to execute when onClick event is triggered (optional).
* @param string $attributes Optional HTML attributes. It's a free string which will be inserted into the HTML tag, use it carefully (optional).
* @param boolean $return Whether to return an output string or echo now (optional, echo by default).
* @param string $id Custom id.
*
* @return string HTML code if return parameter is true.
*/
function html_print_checkbox_extended($name, $value, $checked, $disabled, $script, $attributes, $return=false, $id='')
{
function html_print_checkbox_extended(
$name,
$value,
$checked,
$disabled,
$script,
$attributes,
$return=false,
$id=''
) {
static $idcounter = [];
// If duplicate names exist, it will start numbering. Otherwise it won't
@ -2492,7 +2516,7 @@ function html_print_checkbox_extended($name, $value, $checked, $disabled, $scrip
if ($id == '') {
$output .= ' id="checkbox-'.$id_aux.'"';
} else {
$output .= ' '.$id.'"';
$output .= ' id="'.$id.'"';
}
if ($script != '') {
@ -2518,17 +2542,39 @@ function html_print_checkbox_extended($name, $value, $checked, $disabled, $scrip
/**
* Render a checkbox button input.
*
* @param string Input name.
* @param string Input value.
* @param string Set the button to be marked (optional, unmarked by default).
* @param bool Whether to return an output string or echo now (optional, echo by default).
* @param boolean $disabled Disable the button (optional, button enabled by default).
* @param string $name Input name.
* @param string $value Input value.
* @param string $checked Set the button to be marked (optional, unmarked by default).
* @param boolean $return Whether to return an output string or echo now (optional, echo by default).
* @param boolean $disabled Disable the button (optional, button enabled by default).
* @param string $script Script.
* @param string $disabled_hidden Disabled_hidden.
* @param string $attributes Extra attributes.
* @param string $id Custom ID.
*
* @return string HTML code if return parameter is true.
*/
function html_print_checkbox($name, $value, $checked=false, $return=false, $disabled=false, $script='', $disabled_hidden=false)
{
$output = html_print_checkbox_extended($name, $value, (bool) $checked, $disabled, $script, '', true);
function html_print_checkbox(
$name,
$value,
$checked=false,
$return=false,
$disabled=false,
$script='',
$disabled_hidden=false,
$attributes='',
$id=''
) {
$output = html_print_checkbox_extended(
$name,
$value,
(bool) $checked,
$disabled,
$script,
$attributes,
true,
$id
);
if (!$disabled_hidden) {
$output .= html_print_input_hidden($name.'_sent', 1, true);
}
@ -3411,7 +3457,8 @@ function html_print_input($data, $wrapper='div', $input_only=false)
$data['value'],
$data['id'],
((isset($data['return']) === true) ? $data['return'] : false),
((isset($data['class']) === true) ? $data['class'] : false)
((isset($data['class']) === true) ? $data['class'] : false),
((isset($data['quotes']) === true) ? $data['quotes'] : false)
);
break;
@ -3518,7 +3565,9 @@ function html_print_input($data, $wrapper='div', $input_only=false)
((isset($data['return']) === true) ? $data['return'] : false),
((isset($data['disabled']) === true) ? $data['disabled'] : false),
((isset($data['script']) === true) ? $data['script'] : ''),
((isset($data['disabled_hidden']) === true) ? $data['disabled_hidden'] : false)
((isset($data['disabled_hidden']) === true) ? $data['disabled_hidden'] : false),
((isset($data['attributes']) === true) ? $data['attributes'] : ''),
((isset($data['id']) === true) ? $data['id'] : '')
);
break;

View File

@ -1533,6 +1533,9 @@ function ui_require_javascript_file($name, $path='include/javascript/', $echo_ta
/**
* Add a enteprise javascript file to the HTML head tag.
*
* * THIS FUNCTION COULD PRODUCE ISSUES WHILE INCLUDING JS FILES.
* * USE ui_require_javascript_file('file', ENTERPRISE_DIR.'/location') INSTEAD.
*
* To make a javascript file available just put it in <ENTERPRISE_DIR>/include/javascript. The
* file name should be like "name.js". The "name" would be the value
* needed to pass to this function.

View File

@ -2,6 +2,44 @@ li#li-buttons-alert-list > div {
margin-left: 10px;
}
#rule-builder .rule-builder-actions li {
display: inline;
width: auto;
}
#rule-builder .rule-builder-actions li label {
width: 0;
}
div.white_box {
min-width: 800px;
}
#rules,
ul.sample {
margin-bottom: 2em;
flex: 1 1 300px;
}
#rules.flex-row label {
flex: 1 1 70px;
}
#rules.flex-row div {
flex: 10 1 200px;
}
span.rule-title {
font-family: "lato-lighter", "Open Sans", sans-serif;
font-weight: normal;
font-size: 2em;
text-align: center;
display: block;
margin-bottom: 0.8em;
width: 100%;
}
li#li-filters_show_action_alerts > label,
li#li-buttons-alert-list > label,
li#li-filters-alert-list > label {
width: initial;
@ -62,8 +100,6 @@ img.handle-alerts {
.content {
width: 80%;
min-height: 4em;
border: 1px solid #ddd;
padding-top: 1em;
padding-bottom: 1em;
}
ul.sample {
@ -79,21 +115,63 @@ ul.sample li:last-child {
}
div.target {
flex-grow: 1;
flex-basis: auto;
margin-left: 3em;
border: 1px solid #ddd;
display: flex;
flex-direction: column;
}
div.target.flex {
display: block;
border: 2px dashed #ddd;
margin-left: 0em;
margin-top: 10px;
padding: 1em;
}
.fields,
.operators,
.variables,
.modifiers,
.nexos,
.blocks {
cursor: move;
}
div#rules.show::after {
content: "Drop here";
position: relative;
top: 25%;
display: block;
left: 37%;
font-size: 3em;
color: #aaa;
overflow: hidden;
width: 6em;
background: #fff;
text-align: center;
z-index: 2;
}
div#rules.show {
box-shadow: 0 0 15px -5px #424242;
border: 1px solid #ddd;
}
.field {
display: inline-block;
border-radius: 10px;
padding: 5px;
padding-left: 8px;
padding-right: 8px;
margin: 3px;
font-size: 1.2em;
padding-left: 1em;
padding-right: 1em;
margin: 0 0.5em 0.5em 0px;
color: #fff;
font-family: "lato-lighter", "Open Sans", sans-serif;
font-weight: 600;
background-color: #333;
word-break: break-all;
}
.field.opacityElements {
opacity: 0.2;
cursor: not-allowed;
}
.log {
@ -126,3 +204,63 @@ div.target {
.inEdit {
background-color: #888;
}
.info-container {
width: 100%;
display: flex;
flex-direction: row;
flex-wrap: wrap;
justify-content: space-around;
}
.info-item {
width: 25%;
}
.info-days {
width: 65%;
}
.info-item table.info_table thead tr th {
text-align: center;
}
.info-item table.info_table tbody tr {
border-bottom: none;
}
.info-container table.no-class tbody tr td {
padding: 10px;
}
.mode_table_firing {
margin-top: 20px;
}
.mode_table_firing table.info_table thead tr th {
font-weight: bolder;
}
.mode_table_firing table.info_table thead tr th img {
padding: 10px;
vertical-align: middle;
}
#rules select.click-list-elements {
border-radius: 0px;
background-color: #424242;
border: 0px;
color: #fff;
font-family: "lato-lighter", "Open Sans", sans-serif;
font-weight: 600;
}
#rules select.click-list-elements.fields-elements-log {
background-color: #638460;
}
#rules select.click-list-elements.fields-elements-event {
background-color: #587cff;
}
#rules select.click-list-elements:focus {
outline-color: transparent;
}

View File

@ -515,6 +515,14 @@ select:-internal-list-box {
.no-text-imp {
font-size: 0 !important;
}
.noselect {
-webkit-touch-callout: none; /* iOS Safari */
-webkit-user-select: none; /* Safari */
-khtml-user-select: none; /* Konqueror HTML */
-moz-user-select: none; /* Old versions of Firefox */
-ms-user-select: none; /* Internet Explorer/Edge */
user-select: none; /* Non-prefixed version, currently supported by Chrome, Opera and Firefox */
}
.flex-content-right {
display: flex;
flex-direction: row;
@ -4989,6 +4997,7 @@ input:checked + .p-slider:before {
.action_buttons a,
.action_buttons input[type="image"] {
margin-right: 5px;
display: inline-block;
}
.action_buttons a:last-child,
@ -4998,7 +5007,6 @@ input:checked + .p-slider:before {
.action_buttons a:hover {
background-color: #fff;
display: inline-block;
border-radius: 4px;
}

View File

@ -2772,12 +2772,12 @@ CREATE TABLE IF NOT EXISTS `tevent_rule` (
`count` int(4) NOT NULL default '1',
`agent` text default '',
`id_usuario` varchar(100) NOT NULL default '',
`id_grupo` mediumint(4) NOT NULL default '0',
`id_grupo` mediumint(4) default NULL,
`evento` text NOT NULL default '',
`event_type` enum('','unknown','alert_fired','alert_recovered','alert_ceased','alert_manual_validation','recon_host_detected','system','error','new_agent','going_up_warning','going_up_critical','going_down_warning','going_down_normal','going_down_critical','going_up_normal') default 'unknown',
`event_type` enum('','unknown','alert_fired','alert_recovered','alert_ceased','alert_manual_validation','recon_host_detected','system','error','new_agent','going_up_warning','going_up_critical','going_down_warning','going_down_normal','going_down_critical','going_up_normal') default '',
`module` text default '',
`alert` text default '',
`criticity` int(4) unsigned NOT NULL default '0',
`criticity` int(4) unsigned default NULL,
`user_comment` text NOT NULL,
`id_tag` integer(10) unsigned NOT NULL default '0',
`name` text default '',
@ -2785,6 +2785,19 @@ CREATE TABLE IF NOT EXISTS `tevent_rule` (
`log_content` text,
`log_source` text,
`log_agent` text,
`operator_agent` text COMMENT 'Operator for agent',
`operator_id_usuario` text COMMENT 'Operator for id_usuario',
`operator_id_grupo` text COMMENT 'Operator for id_grupo',
`operator_evento` text COMMENT 'Operator for evento',
`operator_event_type` text COMMENT 'Operator for event_type',
`operator_module` text COMMENT 'Operator for module',
`operator_alert` text COMMENT 'Operator for alert',
`operator_criticity` text COMMENT 'Operator for criticity',
`operator_user_comment` text COMMENT 'Operator for user_comment',
`operator_id_tag` text COMMENT 'Operator for id_tag',
`operator_log_content` text COMMENT 'Operator for log_content',
`operator_log_source` text COMMENT 'Operator for log_source',
`operator_log_agent` text COMMENT 'Operator for log_agent',
PRIMARY KEY (`id_event_rule`),
KEY `idx_id_event_alert` (`id_event_alert`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
@ -2808,7 +2821,7 @@ CREATE TABLE IF NOT EXISTS `tevent_alert` (
`field8` text NOT NULL default '',
`field9` text NOT NULL default '',
`field10` text NOT NULL default '',
`time_threshold` int(10) NOT NULL default '0',
`time_threshold` int(10) NOT NULL default 86400,
`max_alerts` int(4) unsigned NOT NULL default '1',
`min_alerts` int(4) unsigned NOT NULL default '0',
`time_from` time default '00:00:00',
@ -2833,6 +2846,7 @@ CREATE TABLE IF NOT EXISTS `tevent_alert` (
`priority` tinyint(4) default '0',
`force_execution` tinyint(1) default '0',
`group_by` enum ('','id_agente','id_agentmodule','id_alert_am','id_grupo') default '',
`special_days` tinyint(1) default 0,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
@ -3694,4 +3708,4 @@ CREATE TABLE `tremote_command_target` (
PRIMARY KEY (`id`),
FOREIGN KEY (`rcmd_id`) REFERENCES `tremote_command`(`id`)
ON UPDATE CASCADE ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

View File

@ -449,10 +449,17 @@ export_threads 1
eventserver 0
# Event Server event window in seconds (3600 by default) (PANDORA FMS ENTERPRISE ONLY).
# Correlated alerts, event window in seconds (3600 by default) (PANDORA FMS ENTERPRISE ONLY).
event_window 3600
# Correlated Alerts, log window in seconds (3600 by default) (PANDORA FMS ENTERPRISE ONLY).
log_window 3600
# Pre-load windows on start with available information. (PANDORA FMS ENTERPRISE ONLY).
#preload_windows 0
# If set to 1, an alert will not be fired if the last event it generated is in 'in-process' status.
event_inhibit_alerts 0

View File

@ -303,6 +303,8 @@ sub pandora_load_config {
$pa_config->{'openstreetmaps_description'} = 0;
$pa_config->{"eventserver"} = 1; # 4.0
$pa_config->{"event_window"} = 3600; # 4.0
$pa_config->{"log_window"} = 3600; # 7.741
$pa_config->{"preload_windows"} = 0; # 7.741
$pa_config->{"icmpserver"} = 0; # 4.0
$pa_config->{"icmp_threads"} = 3; # 4.0
$pa_config->{"snmpserver"} = 0; # 4.0
@ -354,6 +356,9 @@ sub pandora_load_config {
# Discovery SAP utils
$pa_config->{"sap_utils"} = "/usr/share/pandora_server/util/recon_scripts/SAP";
# Discovery SAP Artica environment
$pa_config->{"sap_artica_test"} = 0;
# braa for enterprise snmp server
$pa_config->{"braa"} = "/usr/bin/braa";
@ -853,6 +858,9 @@ sub pandora_load_config {
elsif ($parametro =~ m/^sap_utils\s(.*)/i) {
$pa_config->{'sap_utils'}= clean_blank($1);
}
elsif ($parametro =~ m/^sap_artica_test\s(.*)/i) {
$pa_config->{'sap_artica_test'}= clean_blank($1);
}
elsif ($parametro =~ m/^nmap_timing_template\s+([0-9]*)/i) {
$pa_config->{'nmap_timing_template'}= clean_blank($1);
}
@ -980,6 +988,12 @@ sub pandora_load_config {
elsif ($parametro =~ m/^event_window\s+([0-9]*)/i) {
$pa_config->{'event_window'}= clean_blank($1);
}
elsif ($parametro =~ m/^log_window\s+([0-9]*)/i) {
$pa_config->{'log_window'}= clean_blank($1);
}
elsif ($parametro =~ m/^preload_windows\s+([0-9]*)/i) {
$pa_config->{'preload_windows'}= clean_blank($1);
}
elsif ($parametro =~ m/^snmp_threads\s+([0-9]*)/i) {
$pa_config->{'snmp_threads'}= clean_blank($1);
}

View File

@ -448,8 +448,9 @@ B<Returns>:
=cut
##########################################################################
sub pandora_evaluate_alert ($$$$$$$;$$$) {
my ($pa_config, $agent, $data, $last_status, $alert, $utimestamp, $dbh, $last_data_value, $events, $event) = @_;
sub pandora_evaluate_alert ($$$$$$$;$$$$) {
my ($pa_config, $agent, $data, $last_status, $alert, $utimestamp, $dbh,
$last_data_value, $correlatedItems, $event, $log) = @_;
if (defined ($agent)) {
logger ($pa_config, "Evaluating alert '" . safe_output($alert->{'name'}) . "' for agent '" . safe_output ($agent->{'nombre'}) . "'.", 10);
@ -592,9 +593,20 @@ sub pandora_evaluate_alert ($$$$$$$;$$$) {
return $status if ($last_status != 3 && $alert->{'type'} eq 'unknown');
return $status if ($last_status == 0 && $alert->{'type'} eq 'not_normal');
}
# Event alert
# Correlated alert
else {
my $rc = enterprise_hook ('evaluate_event_alert', [$pa_config, $dbh, $alert, $events, $event]);
my $rc = enterprise_hook (
'evaluate_correlated_alert',
[
$pa_config,
$dbh,
$alert,
$correlatedItems,
$event,
$log
]
);
return $status unless (defined ($rc) && $rc == 1);
}
@ -1203,7 +1215,7 @@ sub pandora_execute_action ($$$$$$$$$;$) {
my $cid_data = "CID_IMAGE";
my $dataname = "CID_IMAGE.png";
if ($data =~ /^data:image\/png;base64, /) {
if (defined($data) && $data =~ /^data:image\/png;base64, /) {
# macro _data_ substitution in case is image.
$attach_data_as_image = 1;
my $_cid = '<img style="height: 150px;" src="cid:' . $cid_data . '"/>';

View File

@ -1531,7 +1531,7 @@ sub database_scan($$$) {
&& "$dbObjCfg->{'scan_databases'}" eq "1") {
# Skip database scan in Oracle tasks
next if $self->{'type'} == DISCOVERY_APP_ORACLE;
next if defined($self->{'type'}) && $self->{'type'} == DISCOVERY_APP_ORACLE;
my $__data = $obj->scan_databases();
@ -1556,8 +1556,8 @@ sub database_scan($$$) {
}
return {
'modules' => @modules,
'data' => @data
'modules' => \@modules,
'data' => \@data
};
}
@ -1674,11 +1674,11 @@ sub app_scan($) {
# Add results.
if (ref($results) eq 'HASH') {
if (defined($results->{'modules'})) {
push @modules, $results->{'modules'};
push @modules, @{$results->{'modules'}};
}
if (defined($results->{'data'})) {
push @data, $results->{'data'};
push @data, @{$results->{'data'}};
}
}
}
@ -1767,8 +1767,8 @@ sub scan($) {
if ( $self->{'task_data'}->{'type'} == DISCOVERY_APP_MYSQL
|| $self->{'task_data'}->{'type'} == DISCOVERY_APP_ORACLE
|| $self->{'task_data'}->{'type'} == DISCOVERY_APP_SAP) {
# Application scan.
$self->call('message', "Scanning application ...", 6);
return $self->app_scan();
}

View File

@ -21,7 +21,6 @@ use warnings;
use Time::Local;
use POSIX qw(setsid strftime);
use POSIX;
use PandoraFMS::Sendmail;
use HTML::Entities;
use Encode;
use Socket qw(inet_ntoa inet_aton);
@ -31,6 +30,9 @@ use LWP::UserAgent;
use threads;
use threads::shared;
use lib '/usr/lib/perl5';
use PandoraFMS::Sendmail;
# New in 3.2. Used to sendmail internally, without external scripts
# use Module::Loaded;
@ -824,6 +826,11 @@ sub enterprise_hook ($$) {
# Try to call the function
my $output = eval { &$func (@args); };
# Discomment to debug.
if ($@) {
print STDERR $@;
}
# Check for errors
#return undef if ($@);
return '' unless defined ($output);