Fix dashboards

This commit is contained in:
Daniel Barbero Martin 2020-04-13 15:01:18 +02:00
parent 8d27ff9350
commit 3280ad479f
7 changed files with 20 additions and 13 deletions

View File

@ -10,4 +10,8 @@ ALTER TABLE `talert_templates` ADD COLUMN `disable_event` tinyint(1) DEFAULT 0;
ALTER TABLE `tevent_alert` ADD COLUMN `disable_event` tinyint(1) DEFAULT 0;
ALTER TABLE `talert_snmp` ADD COLUMN `disable_event` tinyint(1) DEFAULT 0;
UPDATE twidget SET description='Show a visual console' WHERE class_name='MapsMadeByUser';
UPDATE twidget SET description='Clock' WHERE class_name='ClockWidget';
UPDATE twidget SET description='Group status' WHERE class_name='SystemGroupStatusWidget';
COMMIT;

View File

@ -2536,3 +2536,9 @@ 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 system load','Current load (5 min)',43,34,0,0,300,0,'uptime | awk '{print $(NF-1)}' | tr -d ','','','','',6,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 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);
-- Update widget.
UPDATE twidget SET description='Show a visual console' WHERE class_name='MapsMadeByUser';
UPDATE twidget SET description='Clock' WHERE class_name='ClockWidget';
UPDATE twidget SET description='Group status' WHERE class_name='SystemGroupStatusWidget';

View File

@ -416,7 +416,12 @@ class EventsListWidget extends Widget
$filter['limit'] = $this->values['limit'];
$filter['order'] = '`utimestamp` DESC';
if ((int) $this->values['severity'] !== -1) {
if ((int) $this->values['severity'] === 20) {
$filter['criticity'] = [
EVENT_CRIT_WARNING,
EVENT_CRIT_CRITICAL,
];
} else if ((int) $this->values['severity'] !== -1) {
$filter['criticity'] = $this->values['severity'];
}

View File

@ -309,12 +309,6 @@ class GraphModuleHistogramWidget extends Widget
$size = parent::getSize();
// Desactive scroll bars only this item.
$output .= '<style type="text/css">
.grid-stack-item .grid-stack-item-content .content-widget {
overflow-x: hidden;
overflow-y: hidden;
}
</style>';
$id_agent = $this->values['agentId'];
$id_module = $this->values['moduleId'];
$period = $this->values['period'];

View File

@ -206,9 +206,9 @@ class MapsMadeByUser extends Widget
$fields = \visual_map_get_user_layouts($config['id_user'], true);
// Event Type.
// Visual console.
$inputs[] = [
'label' => __('Event type'),
'label' => __('Visual console'),
'arguments' => [
'type' => 'select',
'fields' => $fields,

View File

@ -439,7 +439,7 @@ class SystemGroupStatusWidget extends Widget
}
}
$height = (count($result_groups) * 30);
$height = (count($table->data) * 30);
$style = 'min-width:200px; min-height:'.$height.'px;';
$output = '<div class="container-center" style="'.$style.'">';
if ($flag_groups === true) {

View File

@ -339,10 +339,8 @@ table.widget_maps_status tr td:first-child {
table.widget_maps_status tr td a {
font-family: "lato-lighter", "Open Sans", sans-serif;
letter-spacing: 0.03pt;
font-size: 11pt;
font-size: 9pt;
text-decoration: none;
color: #3f3f3f;
font-weight: bolder;
}
table.widget_maps_status tr td img {