Merge remote-tracking branch 'origin/develop' into ent-3943-Plantillas-de-alerta-con-varios-horarios

Conflicts:
	pandora_console/include/styles/pandora.css
This commit is contained in:
Daniel Barbero Martin 2022-01-26 08:10:40 +01:00
commit 74f73e2004
79 changed files with 736 additions and 399 deletions

View File

@ -1,5 +1,5 @@
package: pandorafms-agent-unix
Version: 7.0NG.759-220125
Version: 7.0NG.759-220126
Architecture: all
Priority: optional
Section: admin

View File

@ -14,7 +14,7 @@
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
pandora_version="7.0NG.759-220125"
pandora_version="7.0NG.759-220126"
echo "Test if you has the tools for to make the packages."
whereis dpkg-deb | cut -d":" -f2 | grep dpkg-deb > /dev/null

View File

@ -1015,7 +1015,7 @@ my $Sem = undef;
my $ThreadSem = undef;
use constant AGENT_VERSION => '7.0NG.759';
use constant AGENT_BUILD => '220125';
use constant AGENT_BUILD => '220126';
# Agent log default file size maximum and instances
use constant DEFAULT_MAX_LOG_SIZE => 600000;

View File

@ -3,7 +3,7 @@
#
%define name pandorafms_agent_unix
%define version 7.0NG.759
%define release 220125
%define release 220126
Summary: Pandora FMS Linux agent, PERL version
Name: %{name}

View File

@ -3,7 +3,7 @@
#
%define name pandorafms_agent_unix
%define version 7.0NG.759
%define release 220125
%define release 220126
Summary: Pandora FMS Linux agent, PERL version
Name: %{name}

View File

@ -10,7 +10,7 @@
# **********************************************************************
PI_VERSION="7.0NG.759"
PI_BUILD="220125"
PI_BUILD="220126"
OS_NAME=`uname -s`
FORCE=0

View File

@ -186,7 +186,7 @@ UpgradeApplicationID
{}
Version
{220125}
{220126}
ViewReadme
{Yes}

View File

@ -30,7 +30,7 @@ using namespace Pandora;
using namespace Pandora_Strutils;
#define PATH_SIZE _MAX_PATH+1
#define PANDORA_VERSION ("7.0NG.759 Build 220125")
#define PANDORA_VERSION ("7.0NG.759 Build 220126")
string pandora_path;
string pandora_dir;

View File

@ -11,7 +11,7 @@ BEGIN
VALUE "LegalCopyright", "Artica ST"
VALUE "OriginalFilename", "PandoraAgent.exe"
VALUE "ProductName", "Pandora FMS Windows Agent"
VALUE "ProductVersion", "(7.0NG.759(Build 220125))"
VALUE "ProductVersion", "(7.0NG.759(Build 220126))"
VALUE "FileVersion", "1.0.0.0"
END
END

View File

@ -1,5 +1,5 @@
package: pandorafms-console
Version: 7.0NG.759-220125
Version: 7.0NG.759-220126
Architecture: all
Priority: optional
Section: admin

View File

@ -14,7 +14,7 @@
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
pandora_version="7.0NG.759-220125"
pandora_version="7.0NG.759-220126"
package_pear=0
package_pandora=1

View File

@ -302,7 +302,7 @@ function mainModuleGroups()
$table->style[0] = 'color: #ffffff; background-color: #373737; font-weight: bolder; min-width: 230px;';
$table->width = '100%';
if ($config['style'] === 'pandora_black') {
if ($config['style'] === 'pandora_black' && !is_metaconsole()) {
$background_color = '#333';
} else {
$background_color = '#fff';

View File

@ -42,7 +42,7 @@ function pandora_realtime_graphs()
global $config;
check_login();
if ($config['style'] === 'pandora_black') {
if ($config['style'] === 'pandora_black' && !is_metaconsole()) {
ui_require_css_file('pandora_black', 'include/styles/', true);
}

View File

@ -98,7 +98,7 @@ function add_component_selection($id_network_component_type)
global $table_simple;
global $config;
if ($config['style'] === 'pandora_black') {
if ($config['style'] === 'pandora_black' && !is_metaconsole()) {
$background_row = 'background-color: #444';
} else {
$background_row = 'background-color: #cfcfcf';

View File

@ -3914,7 +3914,7 @@ function print_SLA_list($width, $action, $idItem=null)
<input id="hidden-id_server" name="id_server" value="" type="hidden">
<?php
// Set autocomplete image.
$autocompleteImage = html_print_image(($config['style'] === 'pandora_black') ? 'images/agent_mc.menu.png' : 'images/search_agent.png', true, false, true);
$autocompleteImage = html_print_image(($config['style'] === 'pandora_black' && !is_metaconsole()) ? 'images/agent_mc.menu.png' : 'images/search_agent.png', true, false, true);
// Params for agent autocomplete input.
$params = [];
$params['show_helptip'] = true;

View File

@ -116,7 +116,7 @@ $table_remote->data['ehorus_test'] = $row;
// Print.
echo '<div class="center pdd_b_20px">';
echo '<a target="_blank" rel="noopener noreferrer" href="http://ehorus.com">';
if ($config['style'] === 'pandora_black') {
if ($config['style'] === 'pandora_black' && !is_metaconsole()) {
html_print_image('include/ehorus/images/ehorus-logo.png');
} else {
html_print_image('include/ehorus/images/ehorus-logo-grey.png');

Binary file not shown.

After

Width:  |  Height:  |  Size: 933 B

View File

@ -1189,14 +1189,25 @@ if (check_login()) {
$data[8] = ' ';
if ($module['history_data'] == 1) {
$tresholds = true;
if (empty((float) $module['min_warning']) === true
&& empty((float) $module['max_warning']) === true
&& empty($module['warning_inverse']) === true
&& empty((float) $module['min_critical']) === true
&& empty((float) $module['max_critical']) === true
&& empty($module['critical_inverse']) === true
) {
$tresholds = false;
}
$nombre_tipo_modulo = modules_get_moduletype_name($module['id_tipo_modulo']);
$handle = 'stat'.$nombre_tipo_modulo.'_'.$module['id_agente_modulo'];
$url = 'include/procesos.php?agente='.$module['id_agente_modulo'];
$win_handle = dechex(crc32($module['id_agente_modulo'].$module['nombre']));
// Try to display the SNMP module realtime graph
// Try to display the SNMP module realtime graph.
$rt_button = get_module_realtime_link_graph($module);
if (!empty($rt_button)) {
if (empty($rt_button) === false) {
$data[8] = $rt_button.'&nbsp;&nbsp;';
}
@ -1207,6 +1218,19 @@ if (check_login()) {
$draw_events = 0;
}
if ($tresholds === true || $graph_type === 'boolean') {
$link = "winopeng_var('".'operation/agentes/stat_win.php?'."type=$graph_type&amp;".'period='.SECONDS_1DAY.'&amp;id='.$module['id_agente_modulo'].'&amp;refresh='.SECONDS_10MINUTES.'&amp;'."histogram=1', 'day_".$win_handle."', 800, 480)";
$data[8] .= '<a href="javascript:'.$link.'">'.html_print_image(
'images/histograma.png',
true,
[
'border' => '0',
'alt' => '',
'class' => 'invert_filter',
]
).'</a> &nbsp;&nbsp;';
}
$link = "winopeng_var('".'operation/agentes/stat_win.php?'."type=$graph_type&amp;".'period='.SECONDS_1DAY.'&amp;id='.$module['id_agente_modulo'].'&amp;refresh='.SECONDS_10MINUTES.'&amp;'."draw_events=$draw_events', 'day_".$win_handle."', 800, 480)";
if (!is_snapshot_data($module['datos'])) {
$data[8] .= '<a href="javascript:'.$link.'">'.html_print_image(
@ -1349,13 +1373,34 @@ if (check_login()) {
metaconsole_connect($server);
}
$output .= grafico_modulo_sparse($params);
echo $output;
if ($params['histogram'] === true) {
$params['id_agent_module'] = $params['agent_module_id'];
$params['dinamic_proc'] = 1;
$output .= '<div class="stat_win_histogram">';
if ($params['compare'] === 'separated') {
$graph = \reporting_module_histogram_graph(
['datetime' => ($params['begin_date'] - $params['period'])],
$params
);
$output .= $graph['chart'];
}
$graph = \reporting_module_histogram_graph(
['datetime' => $params['begin_date']],
$params
);
$output .= $graph['chart'];
$output .= '</div>';
} else {
$output .= grafico_modulo_sparse($params);
}
if (is_metaconsole() === true && empty($server_id) === false) {
metaconsole_restore_db();
}
echo $output;
return;
}

View File

@ -473,7 +473,7 @@ class HTML
bool $direct=false
) {
global $config;
if ($config['style'] === 'pandora_black') {
if ($config['style'] === 'pandora_black' && !is_metaconsole()) {
$text_color = 'style="color: white"';
}

View File

@ -669,15 +669,20 @@ class Tree
// HTML of the server type image
$module['serverTypeHTML'] = servers_show_type($module['server_type']);
// Link to the Module graph
// ACL
// Link to the Module graph.
// ACL.
$acl_graphs = false;
$module['showGraphs'] = 0;
// Avoid the check on the metaconsole. Too slow to show/hide an icon depending on the permissions
if (!empty($group_id) && !is_metaconsole()) {
$acl_graphs = check_acl_one_of_groups($config['id_user'], $all_groups, 'RR');
} else if (!empty($all_groups)) {
// Avoid the check on the metaconsole.
// Too slow to show/hide an icon depending on the permissions.
if (empty($group_id) === false && is_metaconsole() === false) {
$acl_graphs = check_acl_one_of_groups(
$config['id_user'],
$all_groups,
'RR'
);
} else if (empty($all_groups) === false) {
$acl_graphs = true;
}
@ -686,8 +691,24 @@ class Tree
}
if ($module['showGraphs']) {
$tresholds = true;
if (empty((float) $module['min_warning']) === true
&& empty((float) $module['max_warning']) === true
&& empty($module['warning_inverse']) === true
&& empty((float) $module['min_critical']) === true
&& empty((float) $module['max_critical']) === true
&& empty($module['critical_inverse']) === true
) {
$tresholds = false;
}
$graphType = return_graphtype($module['id_module_type']);
$url = ui_get_full_url('operation/agentes/stat_win.php', false, false, false);
$url = ui_get_full_url(
'operation/agentes/stat_win.php',
false,
false,
false
);
$winHandle = dechex(crc32($module['id'].$module['name']));
$graph_params = [
@ -697,20 +718,20 @@ class Tree
'refresh' => SECONDS_10MINUTES,
];
if (is_metaconsole()) {
// Set the server id
if (is_metaconsole() === true) {
// Set the server id.
$graph_params['server'] = $module['serverID'];
}
$graph_params_str = http_build_query($graph_params);
$moduleGraphURL = "$url?$graph_params_str";
$moduleGraphURL = $url.'?'.$graph_params_str;
$module['moduleGraph'] = [
'url' => $moduleGraphURL,
'handle' => $winHandle,
];
// Info to be able to open the snapshot image new page
// Info to be able to open the snapshot image new page.
$module['snapshot'] = ui_get_snapshot_link(
[
'id_module' => $module['id'],
@ -720,6 +741,16 @@ class Tree
],
true
);
if ($tresholds === true || $graphType === 'boolean') {
$graph_params['histogram'] = 1;
$graph_params_str_th = http_build_query($graph_params);
$moduleGraphURLTh = $url.'?'.$graph_params_str_th;
$module['histogramGraph'] = [
'url' => $moduleGraphURLTh,
'handle' => $winHandle,
];
}
}
$module_alerts = alerts_get_alerts_agent_module($module['id']);

View File

@ -430,6 +430,7 @@ class TreeService extends Tree
$tmp['searchChildren'] = 1;
} else {
$tmp['searchChildren'] = 0;
$tmp['noAcl'] = 1;
}
$tmp['showEventsBtn'] = 1;

View File

@ -20,7 +20,7 @@
/**
* Pandora build version and version
*/
$build_version = 'PC220125';
$build_version = 'PC220126';
$pandora_version = 'v7.0NG.759';
// Do not overwrite default timezone set if defined.

View File

@ -4185,6 +4185,9 @@ function generator_chart_to_pdf(
) {
$width_img = 650;
$height_img = ($params['height'] + 50);
} else if ($type_graph_pdf === 'hbar') {
$width_img = ($params['width'] ?? 550);
$height_img = $params['height'];
} else {
$width_img = 550;
$height_img = $params['height'];

View File

@ -910,7 +910,11 @@ function agents_process_manage_config($source_id_agent, $destiny_id_agents, $cop
[
'nombre' => $module['nombre'],
'disabled' => false,
]
],
true,
true,
false,
false
);
// Keep all modules repeated
@ -1443,7 +1447,8 @@ function agents_get_modules(
$filter=false,
$indexed=true,
$get_not_init_modules=true,
$force_tags=false
$force_tags=false,
$filter_include_sql=true
) {
global $config;
@ -1542,18 +1547,18 @@ function agents_get_modules(
}
}
if ($value[0] == '%') {
if ($value[0] == '%' && $filter_include_sql === true) {
array_push(
$fields,
$field.' LIKE "'.$value.'"'
);
} else if ($operatorDistin) {
} else if ($operatorDistin && $filter_include_sql === true) {
array_push($fields, $field.' <> '.substr($value, 2));
} else if (substr($value, -1) == '%') {
} else if (substr($value, -1) == '%' && $filter_include_sql === true) {
array_push($fields, $field.' LIKE "'.$value.'"');
} else if (strncmp($value, '666=666', 7) == 0) {
array_push($fields, ' '.$value);
} else if (preg_match('/\bin\b/i', $field)) {
} else if (preg_match('/\bin\b/i', $field) && $filter_include_sql === true) {
array_push($fields, $field.' '.$value);
} else {
array_push($fields, 'tagente_modulo.'.$field.' = "'.$value.'"');
@ -3876,7 +3881,7 @@ function agents_get_status_animation($up=true)
$red = 'images/heartbeat_green.gif';
$green = 'images/heartbeat_green.gif';
if ($config['style'] === 'pandora_black') {
if ($config['style'] === 'pandora_black' && !is_metaconsole()) {
$red = 'images/heartbeat_green_black.gif';
$green = 'images/heartbeat_green_black.gif';
}

View File

@ -2183,6 +2183,7 @@ function get_group_alerts(
// WHEN SELECT ALL TAGS TO FILTER ALERTS
if ($action_filter) {
$filter .= ' AND (talert_template_modules.id IN (SELECT id_alert_template_module FROM talert_template_module_actions where id_alert_action = '.$action_filter.'))';
$filter .= ' OR talert_template_modules.id_alert_template IN (SELECT talert_templates.id FROM talert_templates where talert_templates.id_alert_action = '.$action_filter.')';
}
if (is_array($options)) {

View File

@ -16590,7 +16590,11 @@ function api_get_user_info($thrash1, $thrash2, $other, $returnType)
$other = json_decode(base64_decode($other['data']), true);
$sql = 'select * from tusuario where id_user = "'.$other[0]['id_user'].'" and password = "'.$other[0]['password'].'"';
$sql = sprintf(
'SELECT * FROM tusuario WHERE id_user = "%s" and password = "%s"',
mysql_escape_string_sql($other[0]['id_user']),
mysql_escape_string_sql($other[0]['password'])
);
$user_info = db_get_all_rows_sql($sql);

View File

@ -1555,7 +1555,7 @@ function graphic_combined_module(
$long_index = '';
if ($config['style'] === 'pandora_black' && ($params['pdf'] === false || $params['pdf'] === null )
if (($config['style'] === 'pandora_black' && !is_metaconsole()) && ($params['pdf'] === false || $params['pdf'] === null )
) {
$background_color = '#222';
$params['legend_color'] = '#fff';

View File

@ -471,7 +471,7 @@ function html_print_select_groups(
global $config;
$select2_css = 'select2.min';
if ($config['style'] === 'pandora_black') {
if ($config['style'] === 'pandora_black' && !is_metaconsole()) {
$select2_css = 'select2_dark.min';
}
@ -777,11 +777,11 @@ function html_print_select(
if ($style === false) {
$styleText = ' ';
if ($config['style'] === 'pandora_black') {
if ($config['style'] === 'pandora_black' && !is_metaconsole()) {
$styleText = 'style="color: white"';
}
} else {
if ($config['style'] === 'pandora_black') {
if ($config['style'] === 'pandora_black' && !is_metaconsole()) {
$style .= ' color: white';
}
@ -922,7 +922,7 @@ function html_print_select(
}
$select2 = 'select2.min';
if ($config['style'] === 'pandora_black') {
if ($config['style'] === 'pandora_black' && !is_metaconsole()) {
$select2 = 'select2_dark.min';
}
@ -2810,7 +2810,7 @@ function html_print_input_number(array $settings):string
global $config;
$text_color = '';
if ($config['style'] === 'pandora_black') {
if ($config['style'] === 'pandora_black' && !is_metaconsole()) {
$text_color = 'style="color: white"';
}
@ -4287,7 +4287,7 @@ function html_print_autocomplete_modules(
$text_color = '';
$module_icon = 'images/search_module.png';
if ($config['style'] === 'pandora_black') {
if ($config['style'] === 'pandora_black' && !is_metaconsole()) {
$text_color = 'color: white';
$module_icon = 'images/brick.menu.png';
}
@ -4589,7 +4589,7 @@ function html_print_input($data, $wrapper='div', $input_only=false)
enterprise_include_once('include/functions_metaconsole.php');
if ($config['style'] === 'pandora_black') {
if ($config['style'] === 'pandora_black' && !is_metaconsole()) {
$style = 'style="color: white"';
}
@ -5250,7 +5250,7 @@ function html_print_autocomplete_users_from_integria(
global $config;
$user_icon = 'images/user_green.png';
if ($config['style'] === 'pandora_black') {
if ($config['style'] === 'pandora_black' && !is_metaconsole()) {
$user_icon = 'images/header_user.png';
}
@ -5357,7 +5357,7 @@ function html_print_tabs(array $tabs)
$bg_color = '';
if ($config['style'] === 'pandora_black') {
if ($config['style'] === 'pandora_black' && !is_metaconsole()) {
$bg_color = 'style="background-color: #222"';
}
@ -5459,7 +5459,7 @@ function html_print_select_search(
$select2_css = 'select2.min';
if ($config['style'] === 'pandora_black') {
if ($config['style'] === 'pandora_black' && !is_metaconsole()) {
$select2_css = 'select2_dark.min';
}

View File

@ -189,7 +189,11 @@ function modules_copy_agent_module_to_agent($id_agent_module, $id_destiny_agent,
[
'nombre' => $module['nombre'],
'disabled' => false,
]
],
true,
true,
false,
false
);
// The module already exist in the target
@ -203,7 +207,11 @@ function modules_copy_agent_module_to_agent($id_agent_module, $id_destiny_agent,
[
'nombre' => $module['nombre'],
'disabled' => true,
]
],
true,
true,
false,
false
);
// If the module exist but disabled, we enable it

View File

@ -14165,7 +14165,7 @@ function reporting_module_histogram_graph($report, $content, $pdf=0)
if (modules_is_disable_agent($content['id_agent_module'])
|| modules_is_not_init($content['id_agent_module'])
) {
if ($metaconsole_on) {
if ($metaconsole_on && $server_name != '') {
// Restore db connection.
metaconsole_restore_db();
}
@ -14189,6 +14189,9 @@ function reporting_module_histogram_graph($report, $content, $pdf=0)
if ($modules_is_string === false) {
if ($agentmodule_info['max_critical'] == 0) {
$max_value_critical = null;
if ((bool) $content['dinamic_proc'] === true) {
$max_value_critical = 0.01;
}
} else {
$max_value_critical = $agentmodule_info['max_critical'];
}
@ -14396,28 +14399,37 @@ function reporting_module_histogram_graph($report, $content, $pdf=0)
$width_graph = 100;
$height_graph = 80;
$return['chart'] = flot_slicesbar_graph(
$array_result,
$time_total,
$width_graph,
$height_graph,
$legend,
$colors,
$config['fontpath'],
$config['round_corner'],
$homeurl,
'',
'',
false,
0,
[],
true,
$ttl,
$content['sizeForTicks'],
true
);
if (empty($array_result) === false) {
$return['chart'] = flot_slicesbar_graph(
$array_result,
$time_total,
$width_graph,
$height_graph,
$legend,
$colors,
$config['fontpath'],
$config['round_corner'],
$homeurl,
'',
'',
false,
0,
[],
true,
$ttl,
$content['sizeForTicks'],
true,
$report['datetime']
);
} else {
$return['chart'] = graph_nodata_image(
$width_graph,
$height_graph,
'area'
);
}
if ($metaconsole_on) {
if ($metaconsole_on && $server_name != '') {
// Restore db connection.
metaconsole_restore_db();
}

View File

@ -122,7 +122,7 @@ function html_do_report_info($report)
{
global $config;
if ($config['style'] === 'pandora_black') {
if ($config['style'] === 'pandora_black' && !is_metaconsole()) {
$background_color = '#222';
} else {
$background_color = '#f5f5f5';

View File

@ -1627,31 +1627,31 @@ function tags_get_agents_counter($id_tag, $groups_and_tags=[], $agent_filter=[],
switch ($agent_status) {
case AGENT_STATUS_CRITICAL:
if ($critical > 0) {
$count ++;
$count++;
}
break;
case AGENT_STATUS_WARNING:
if ($total > 0 && $critical = 0 && $warning > 0) {
$count ++;
$count++;
}
break;
case AGENT_STATUS_UNKNOWN:
if ($critical == 0 && $warning == 0 && $unknown > 0) {
$count ++;
$count++;
}
break;
case AGENT_STATUS_NOT_INIT:
if ($total == 0 || $total == $not_init) {
$count ++;
$count++;
}
break;
case AGENT_STATUS_NORMAL:
if ($critical == 0 && $warning == 0 && $unknown == 0 && $normal > 0) {
$count ++;
$count++;
}
break;
@ -1662,23 +1662,23 @@ function tags_get_agents_counter($id_tag, $groups_and_tags=[], $agent_filter=[],
} else {
if (array_search(AGENT_STATUS_CRITICAL, $agent_status) !== false) {
if ($critical > 0) {
$count ++;
$count++;
}
} else if (array_search(AGENT_STATUS_WARNING, $agent_status) !== false) {
if ($total > 0 && $critical = 0 && $warning > 0) {
$count ++;
$count++;
}
} else if (array_search(AGENT_STATUS_UNKNOWN, $agent_status) !== false) {
if ($critical == 0 && $warning == 0 && $unknown > 0) {
$count ++;
$count++;
}
} else if (array_search(AGENT_STATUS_NOT_INIT, $agent_status) !== false) {
if ($total == 0 || $total == $not_init) {
$count ++;
$count++;
}
} else if (array_search(AGENT_STATUS_NORMAL, $agent_status) !== false) {
if ($critical == 0 && $warning == 0 && $unknown == 0 && $normal > 0) {
$count ++;
$count++;
}
}
// Invalid status.

View File

@ -1203,7 +1203,7 @@ function ui_format_alert_row(
$actions = alerts_get_alert_agent_module_actions($alert['id'], false, $alert['server_data']['id']);
if (empty($actions) === false) {
if (empty($actions) === false || $actionDefault != '') {
$actionText = '<div><ul class="action_list">';
foreach ($actions as $action) {
$actionText .= '<div class="mrgn_btn_5px" ><span class="action_name"><li>'.$action['name'];
@ -1215,9 +1215,9 @@ function ui_format_alert_row(
}
$actionText .= '</ul></div>';
} else {
if ($actionDefault != '') {
$actionText = db_get_sql(
$actionText .= db_get_sql(
sprintf(
'SELECT name FROM talert_actions WHERE id = %d',
$actionDefault
@ -4964,7 +4964,7 @@ function ui_print_agent_autocomplete_input($parameters)
// Default value.
$icon_agent = 'images/search_agent.png';
if ($config['style'] === 'pandora_black') {
if ($config['style'] === 'pandora_black' && !is_metaconsole()) {
$text_color = 'style="color: white"';
$icon_agent = 'images/agent_mc.menu.png';
}
@ -5820,7 +5820,7 @@ function ui_print_agent_autocomplete_input($parameters)
$html = '';
$text_color = '';
if ($config['style'] === 'pandora_black') {
if ($config['style'] === 'pandora_black' && !is_metaconsole()) {
$text_color = 'color: white';
}

View File

@ -220,7 +220,7 @@ function vbar_graph(
$options['x']['font']['color'] = '#545454';
if ($options['pdf'] === true) {
$options['x']['font']['color'] = '#000';
} else if ($config['style'] === 'pandora_black') {
} else if ($config['style'] === 'pandora_black' && !is_metaconsole()) {
$options['x']['font']['color'] = '#fff';
}
}
@ -238,7 +238,7 @@ function vbar_graph(
// Grid color axes x.
if (isset($options['x']['color']) === false) {
$options['x']['color'] = '#ffffff';
if ($config['style'] === 'pandora_black') {
if ($config['style'] === 'pandora_black' && !is_metaconsole()) {
$options['x']['color'] = '#222';
}
}
@ -305,7 +305,7 @@ function vbar_graph(
$options['y']['font']['color'] = '#545454';
if ($options['pdf'] === true) {
$options['y']['font']['color'] = '#000';
} else if ($config['style'] === 'pandora_black') {
} else if ($config['style'] === 'pandora_black' && !is_metaconsole()) {
$options['y']['font']['color'] = '#fff';
}
}
@ -323,7 +323,7 @@ function vbar_graph(
// Grid color axes y.
if (isset($options['y']['color']) === false) {
$options['y']['color'] = '#ffffff';
if ($config['style'] === 'pandora_black') {
if ($config['style'] === 'pandora_black' && !is_metaconsole()) {
$options['y']['color'] = '#222';
}
}
@ -361,7 +361,7 @@ function vbar_graph(
if (isset($options['grid']['color']) === false) {
$options['grid']['color'] = '#ffffff';
if ($config['style'] === 'pandora_black') {
if ($config['style'] === 'pandora_black' && !is_metaconsole()) {
$options['grid']['color'] = '#111';
}
}
@ -373,7 +373,7 @@ function vbar_graph(
'#ffffff',
],
];
if ($config['style'] === 'pandora_black' && $ttl === 1) {
if ($config['style'] === 'pandora_black' && !is_metaconsole() && $ttl === 1) {
$options['grid']['backgroundColor'] = [
'colors' => [
'#222',
@ -746,11 +746,11 @@ function hbar_graph(
return generator_chart_to_pdf('hbar', $params);
}
if ($config['style'] === 'pandora_black' && $ttl === 1) {
if ($config['style'] === 'pandora_black' && !is_metaconsole() && $ttl === 1) {
$backgroundColor = '#222';
}
if ($config['style'] === 'pandora_black' && $ttl === 1) {
if ($config['style'] === 'pandora_black' && !is_metaconsole() && $ttl === 1) {
$tick_color = '#fff';
}

View File

@ -202,7 +202,7 @@ function d3_bullet_chart(
$font = array_shift(explode('.', array_pop(explode('/', $font))));
$invert_color = '';
if ($config['style'] === 'pandora_black') {
if ($config['style'] === 'pandora_black' && !is_metaconsole()) {
$invert_color = 'filter: invert(100%);';
}

View File

@ -146,7 +146,7 @@ function flot_area_graph(
break;
}
if ($config['style'] === 'pandora_black' && ($params['pdf'] === false || $params['pdf'] === null) && (isset($is_mobile) === false || $is_mobile === false)
if (($config['style'] === 'pandora_black' && !is_metaconsole()) && ($params['pdf'] === false || $params['pdf'] === null) && (isset($is_mobile) === false || $is_mobile === false)
) {
$background_style = '#222';
$params['grid_color'] = '#fff';
@ -553,11 +553,6 @@ function flot_hcolumn_chart($graph_data, $width, $height, $water_mark, $font='',
{
global $config;
if ($pdf === true) {
$background_color = 'white';
$tick_color = '#000';
}
// Include_javascript_dependencies_flot_graph().
$return = '';

View File

@ -990,6 +990,35 @@ var TreeController = {
typeof element.showGraphs != "undefined" &&
element.showGraphs != 0
) {
// Graph histogram pop-up
if (typeof element.histogramGraph != "undefined") {
var graphImageHistogram = $(
'<img src="' +
(controller.baseURL.length > 0
? controller.baseURL
: "") +
'images/histograma.png" /> '
);
graphImageHistogram
.addClass("module-graph")
.click(function(e) {
e.stopPropagation();
try {
winopeng_var(
element.histogramGraph.url,
element.histogramGraph.handle,
800,
480
);
} catch (error) {
// console.log(error);
}
});
$content.append(graphImageHistogram);
}
// Graph pop-up
if (typeof element.moduleGraph != "undefined") {
if (element.statusImageHTML.indexOf("data:image") != -1) {
@ -1183,24 +1212,26 @@ var TreeController = {
disabled == false
) {
if (element.type == "agent" || element.type == "module") {
$content
.click(function(e) {
_getTreeDetailData(
element.type,
element.id,
element.serverID,
function(error, data) {
if (error) {
// console.error(error);
} else {
controller.detailRecipient
.render(element.name, data)
.open();
if (typeof element.noAcl === "undefined") {
$content
.click(function(e) {
_getTreeDetailData(
element.type,
element.id,
element.serverID,
function(error, data) {
if (error) {
// console.error(error);
} else {
controller.detailRecipient
.render(element.name, data)
.open();
}
}
}
);
})
.css("cursor", "pointer");
);
})
.css("cursor", "pointer");
}
}
}

View File

@ -512,7 +512,7 @@ class Widget
if (empty($values['background']) === true) {
$values['background'] = '#ffffff';
if ($config['style'] === 'pandora_black') {
if ($config['style'] === 'pandora_black' && !is_metaconsole()) {
$values['background'] = '#222222';
}
}

View File

@ -750,7 +750,7 @@ class EventsListWidget extends Widget
$table->data[$i] = $data;
$bg_color = 'background: #E8E8E8;';
if ($config['style'] === 'pandora_black') {
if ($config['style'] === 'pandora_black' && !is_metaconsole()) {
$bg_color = 'background: #222;';
}

View File

@ -378,6 +378,8 @@ class GraphModuleHistogramWidget extends Widget
$size = parent::getSize();
$output = '';
// Desactive scroll bars only this item.
$id_agent = $this->values['agentId'];
$id_module = $this->values['moduleId'];

View File

@ -318,7 +318,7 @@ class ServiceViewWidget extends Widget
// Css Files.
\ui_require_css_file('tree', 'include/styles/', true);
if ($config['style'] == 'pandora_black') {
if ($config['style'] == 'pandora_black' && !is_metaconsole()) {
\ui_require_css_file('pandora_black', 'include/styles/', true);
}

View File

@ -542,7 +542,7 @@ class TreeViewWidget extends Widget
// Css Files.
\ui_require_css_file('tree', 'include/styles/', true);
if ($config['style'] == 'pandora_black') {
if ($config['style'] == 'pandora_black' && !is_metaconsole()) {
\ui_require_css_file('pandora_black', 'include/styles/', true);
}

View File

@ -776,6 +776,10 @@ select:-internal-list-box {
.padding-bottom-4 {
padding-bottom: 4em;
}
.padding-bottom-5px {
padding-bottom: 5px;
}
.padding-right-2 {
padding-right: 2em;
}
@ -8439,6 +8443,16 @@ div.stat-win-spinner img {
color: #fff;
}
.stat_win_histogram {
width: 95%;
margin: 0 auto;
margin-top: 18%;
}
#stat-win-module-graph .stat_win_histogram div.nodata_container {
width: 100%;
}
/* For backups dt, can be useful for others */
#backups_list > thead > tr > th:last-child,
#backups_list > tbody > tr > td:last-child {

View File

@ -129,7 +129,7 @@
<div style='height: 10px'>
<?php
$version = '7.0NG.759';
$build = '220125';
$build = '220126';
$banner = "v$version Build $build";
error_reporting(0);

View File

@ -420,17 +420,17 @@ if ($filter_standby == 'standby_on') {
if (is_metaconsole() === true) {
include_once $config['homedir'].'/enterprise/meta/include/functions_alerts_meta.php';
if ($idAgent != 0) {
$alerts['alerts_simple'] = alerts_meta_get_alerts($agents, $filter_alert, $options_simple, $whereAlertSimple, false, false, $idGroup, false, $strict_user);
$alerts['alerts_simple'] = alerts_meta_get_alerts($agents, $filter_alert, $options_simple, $whereAlertSimple, false, false, $idGroup, false, $strict_user, $tag_filter, $action_filter);
$countAlertsSimple = alerts_meta_get_alerts($agents, $filter_alert, false, $whereAlertSimple, false, false, $idGroup, true, $strict_user);
$countAlertsSimple = alerts_meta_get_alerts($agents, $filter_alert, false, $whereAlertSimple, false, false, $idGroup, true, $strict_user, $tag_filter, $action_filter);
} else {
$id_groups = array_keys(
users_get_groups($config['id_user'], 'AR', false)
);
$alerts['alerts_simple'] = alerts_meta_get_group_alerts($id_groups, $filter_alert, $options_simple, $whereAlertSimple, false, false, $idGroup, false, $strict_user, $tag_filter);
$alerts['alerts_simple'] = alerts_meta_get_group_alerts($id_groups, $filter_alert, $options_simple, $whereAlertSimple, false, false, $idGroup, false, $strict_user, $tag_filter, $action_filter);
$countAlertsSimple = alerts_meta_get_group_alerts($id_groups, $filter_alert, false, $whereAlertSimple, false, false, $idGroup, true, $strict_user, $tag_filter);
$countAlertsSimple = alerts_meta_get_group_alerts($id_groups, $filter_alert, false, $whereAlertSimple, false, false, $idGroup, true, $strict_user, $tag_filter, $action_filter);
}
} else {
if ($idAgent != 0) {

View File

@ -68,7 +68,7 @@ if (file_exists('../../include/languages/'.$user_language.'.mo')) {
}
echo '<link rel="stylesheet" href="../../include/styles/pandora.css" type="text/css"/>';
if ($config['style'] === 'pandora_black') {
if ($config['style'] === 'pandora_black' && !is_metaconsole()) {
ui_require_css_file('pandora_black', 'include/styles/', true);
}

View File

@ -64,7 +64,7 @@ if (file_exists('../../include/languages/'.$user_language.'.mo')) {
$l10n->load_tables();
}
if ($config['style'] === 'pandora_black') {
if ($config['style'] === 'pandora_black' && !is_metaconsole()) {
ui_require_css_file('pandora_black', 'include/styles/', true);
}
@ -97,7 +97,7 @@ echo '<link rel="stylesheet" href="../../include/styles/pandora.css" type="text/
?>
</head>
<?php
if ($config['style'] === 'pandora_black') {
if ($config['style'] === 'pandora_black' && !is_metaconsole()) {
}
?>
<body bgcolor="#ffffff" class='bg_white'>

View File

@ -79,7 +79,7 @@ if (!check_acl_one_of_groups($config['id_user'], $all_groups, 'AR')) {
if ($refresh > 0) {
$query = ui_get_url_refresh(false);
echo '<meta http-equiv="refresh" content="'.$refresh.'; URL='.$query.'" />';
if ($config['style'] === 'pandora_black') {
if ($config['style'] === 'pandora_black' && !is_metaconsole()) {
echo '<link rel="stylesheet" href="../../include/styles/pandora_black.css" type="text/css"/>';
}
}

View File

@ -67,7 +67,7 @@ if (file_exists('../../include/languages/'.$user_language.'.mo')) {
global $config;
echo '<link rel="stylesheet" href="../../include/styles/pandora.css" type="text/css"/>';
if ($config['style'] === 'pandora_black') {
if ($config['style'] === 'pandora_black' && !is_metaconsole()) {
echo '<link rel="stylesheet" href="../../include/styles/pandora_black.css" type="text/css"/>';
}
@ -194,60 +194,7 @@ ui_print_message_dialog(
$time_compare_separated = get_parameter('time_compare_separated', 0);
$time_compare_overlapped = get_parameter('time_compare_overlapped', 0);
$unknown_graph = get_parameter_checkbox('unknown_graph', 1);
$fullscale_sent = get_parameter('fullscale_sent', 0);
if (!$fullscale_sent) {
if (isset($config['full_scale_option']) === false
|| $config['full_scale_option'] == 0
) {
$fullscale = 0;
} else if ($config['full_scale_option'] == 1) {
$fullscale = 1;
} else if ($config['full_scale_option'] == 2) {
if ($graph_type == 'boolean') {
$fullscale = 1;
} else {
$fullscale = 0;
}
}
} else {
$fullscale = get_parameter('fullscale', 0);
}
$type_mode_graph = get_parameter_checkbox(
'type_mode_graph',
($fullscale === 1) ? 0 : $config['type_mode_graph']
);
$time_compare = false;
if ($time_compare_separated) {
$time_compare = 'separated';
} else if ($time_compare_overlapped) {
$time_compare = 'overlapped';
}
if ($zoom > 1) {
$height = ($height * ($zoom / 2.1));
$width = ($width * ($zoom / 1.4));
}
// Build date.
$date = strtotime($start_date.' '.$start_time);
$now = time();
if ($date > $now) {
$date = $now;
}
$urlImage = ui_get_full_url(false, false, false, false);
$unit = db_get_value(
'unit',
'tagente_modulo',
'id_agente_modulo',
$id
);
$histogram = (bool) get_parameter('histogram', 0);
// FORM TABLE.
$table = html_get_predefined_table('transparent', 2);
@ -258,162 +205,257 @@ ui_print_message_dialog(
$table->style[2] = 'text-align:left;font-weight: bold;';
$table->style[3] = 'text-align:left;';
$table->class = 'table_modal_alternate';
$table->data = [];
$table->data[0][0] = __('Refresh time');
$table->data[0][1] = html_print_extended_select_for_time(
'refresh',
$refresh,
'',
'',
0,
7,
true
);
$table->data[0][2] = __('Show events');
$disabled = false;
if (isset($config['event_replication']) === true) {
if ($config['event_replication']
&& !$config['show_events_in_local']
) {
$disabled = true;
$time_compare = false;
if ($time_compare_separated) {
$time_compare = 'separated';
} else if ($time_compare_overlapped) {
$time_compare = 'overlapped';
}
if ($histogram === false) {
$fullscale_sent = get_parameter('fullscale_sent', 0);
if (!$fullscale_sent) {
if (isset($config['full_scale_option']) === false
|| $config['full_scale_option'] == 0
) {
$fullscale = 0;
} else if ($config['full_scale_option'] == 1) {
$fullscale = 1;
} else if ($config['full_scale_option'] == 2) {
if ($graph_type == 'boolean') {
$fullscale = 1;
} else {
$fullscale = 0;
}
}
} else {
$fullscale = get_parameter('fullscale', 0);
}
}
$table->data[0][3] = html_print_checkbox_switch(
'draw_events',
1,
(bool) $draw_events,
true,
$disabled
);
if ($disabled) {
$table->data[1] .= ui_print_help_tip(
__("'Show events' is disabled because this %s node is set to event replication.", get_product_name()),
true
$type_mode_graph = get_parameter_checkbox(
'type_mode_graph',
($fullscale === 1) ? 0 : $config['type_mode_graph']
);
}
$table->data[1][0] = __('Begin date');
$table->data[1][1] = html_print_input_text(
'start_date',
$start_date,
'',
10,
20,
true
);
if ($zoom > 1) {
$height = ($height * ($zoom / 2.1));
$width = ($width * ($zoom / 1.4));
}
$table->data[1][2] = __('Show alerts');
$table->data[1][3] = html_print_checkbox_switch(
'draw_alerts',
1,
(bool) $draw_alerts,
true
);
// Build date.
$date = strtotime($start_date.' '.$start_time);
$now = time();
$table->data[2][0] = __('Begin time');
$table->data[2][1] = html_print_input_text(
'start_time',
$start_time,
'',
10,
10,
true
);
if ($date > $now) {
$date = $now;
}
$table->data[2][2] = __('Show unknown graph');
$table->data[2][3] = html_print_checkbox_switch(
'unknown_graph',
1,
(bool) $unknown_graph,
true
);
$urlImage = ui_get_full_url(false, false, false, false);
$table->data[3][0] = __('Time range');
$table->data[3][1] = html_print_extended_select_for_time(
'period',
$period,
'',
'',
0,
7,
true
);
$unit = db_get_value(
'unit',
'tagente_modulo',
'id_agente_modulo',
$id
);
$table->data[3][2] = '';
$table->data[3][3] = '';
if (!modules_is_boolean($id)) {
$table->data[4][0] = __('Zoom');
$options = [];
$options[$zoom] = 'x'.$zoom;
$options[1] = 'x1';
$options[2] = 'x2';
$options[3] = 'x3';
$options[4] = 'x4';
$options[5] = 'x5';
$table->data[4][1] = html_print_select(
$options,
'zoom',
$zoom,
$table->data[0][0] = __('Refresh time');
$table->data[0][1] = html_print_extended_select_for_time(
'refresh',
$refresh,
'',
'',
0,
7,
true
);
$table->data[0][2] = __('Show events');
$disabled = false;
if (isset($config['event_replication']) === true) {
if ($config['event_replication']
&& !$config['show_events_in_local']
) {
$disabled = true;
}
}
$table->data[0][3] = html_print_checkbox_switch(
'draw_events',
1,
(bool) $draw_events,
true,
$disabled
);
if ($disabled) {
$table->data[1] .= ui_print_help_tip(
__("'Show events' is disabled because this %s node is set to event replication.", get_product_name()),
true
);
}
$table->data[1][0] = __('Begin date');
$table->data[1][1] = html_print_input_text(
'start_date',
$start_date,
'',
10,
20,
true
);
$table->data[1][2] = __('Show alerts');
$table->data[1][3] = html_print_checkbox_switch(
'draw_alerts',
1,
(bool) $draw_alerts,
true
);
$table->data[2][0] = __('Begin time');
$table->data[2][1] = html_print_input_text(
'start_time',
$start_time,
'',
10,
10,
true
);
$table->data[2][2] = __('Show unknown graph');
$table->data[2][3] = html_print_checkbox_switch(
'unknown_graph',
1,
(bool) $unknown_graph,
true
);
$table->data[3][0] = __('Time range');
$table->data[3][1] = html_print_extended_select_for_time(
'period',
$period,
'',
'',
0,
7,
true
);
$table->data[3][2] = '';
$table->data[3][3] = '';
if (!modules_is_boolean($id)) {
$table->data[4][0] = __('Zoom');
$options = [];
$options[$zoom] = 'x'.$zoom;
$options[1] = 'x1';
$options[2] = 'x2';
$options[3] = 'x3';
$options[4] = 'x4';
$options[5] = 'x5';
$table->data[4][1] = html_print_select(
$options,
'zoom',
$zoom,
'',
'',
0,
true,
false,
false
);
$table->data[4][2] = __('Show percentil');
$table->data[4][3] = html_print_checkbox_switch(
'show_percentil',
1,
(bool) $show_percentil,
true
);
}
$table->data[5][0] = __('Time compare (Overlapped)');
$table->data[5][1] = html_print_checkbox_switch(
'time_compare_overlapped',
1,
(bool) $time_compare_overlapped,
true
);
$table->data[5][2] = __('Time compare (Separated)');
$table->data[5][3] = html_print_checkbox_switch(
'time_compare_separated',
1,
(bool) $time_compare_separated,
true
);
$table->data[6][0] = __('Show AVG/MAX/MIN data series in graph');
$table->data[6][1] = html_print_checkbox_switch(
'type_mode_graph',
1,
(bool) $type_mode_graph,
true,
false,
false
);
$table->data[4][2] = __('Show percentil');
$table->data[4][3] = html_print_checkbox_switch(
'show_percentil',
$table->data[6][2] = __('Show full scale graph (TIP)');
$table->data[6][2] .= ui_print_help_tip(
__('TIP mode charts do not support average - maximum - minimum series, you can only enable TIP or average, maximum or minimum series'),
true
);
$table->data[6][3] = html_print_checkbox_switch(
'fullscale',
1,
(bool) $show_percentil,
(bool) $fullscale,
true,
false
);
} else {
$table->data[0][0] = __('Begin date');
$table->data[0][1] = html_print_input_text(
'start_date',
$start_date,
'',
10,
20,
true
);
$table->data[0][2] = __('Begin time');
$table->data[0][3] = html_print_input_text(
'start_time',
$start_time,
'',
10,
10,
true
);
$table->data[1][0] = __('Time range');
$table->data[1][1] = html_print_extended_select_for_time(
'period',
$period,
'',
'',
0,
7,
true
);
$table->data[1][2] = __('Time compare (Separated)');
$table->data[1][3] = html_print_checkbox_switch(
'time_compare_separated',
1,
(bool) $time_compare_separated,
true
);
}
$table->data[5][0] = __('Time compare (Overlapped)');
$table->data[5][1] = html_print_checkbox_switch(
'time_compare_overlapped',
1,
(bool) $time_compare_overlapped,
true
);
$table->data[5][2] = __('Time compare (Separated)');
$table->data[5][3] = html_print_checkbox_switch(
'time_compare_separated',
1,
(bool) $time_compare_separated,
true
);
$table->data[6][0] = __('Show AVG/MAX/MIN data series in graph');
$table->data[6][1] = html_print_checkbox_switch(
'type_mode_graph',
1,
(bool) $type_mode_graph,
true,
false
);
$table->data[6][2] = __('Show full scale graph (TIP)');
$table->data[6][2] .= ui_print_help_tip(
__('TIP mode charts do not support average - maximum - minimum series, you can only enable TIP or average, maximum or minimum series'),
true
);
$table->data[6][3] = html_print_checkbox_switch(
'fullscale',
1,
(bool) $fullscale,
true,
false
);
$form_table = html_print_table($table, true);
$form_table .= '<div class="w100p right mrgn_top_15px right_align">';
$form_table .= html_print_submit_button(
@ -434,6 +476,8 @@ ui_print_message_dialog(
$menu_form .= html_print_input_hidden('server', $server_id, true);
}
$menu_form .= html_print_input_hidden('histogram', $histogram, true);
if (isset($_GET['type']) === true) {
$type = get_parameter_get('type');
$menu_form .= html_print_input_hidden('type', $type, true);
@ -460,7 +504,13 @@ ui_print_message_dialog(
);
$menu_form .= '</span>';
$menu_form .= '</div>';
$menu_form .= '<div class="module_graph_menu_content module_graph_menu_content_closed invisible">';
$class = 'module_graph_menu_content';
if ($histogram === false) {
$class .= ' module_graph_menu_content_closed invisible';
}
$menu_form .= '<div class="'.$class.'">';
$menu_form .= $form_table;
$menu_form .= '</div>';
$menu_form .= '</div>';
@ -497,6 +547,8 @@ ui_print_message_dialog(
'zoom' => $zoom,
'height' => 300,
'type_mode_graph' => $type_mode_graph,
'histogram' => $histogram,
'begin_date' => strtotime($start_date.' '.$start_time),
];
// Graph.

View File

@ -1725,6 +1725,17 @@ $table->data[4][0] .= __('Not condition').'&nbsp;'.ui_print_help_tip(__('If you
}
if ($row['history_data'] == 1 && $acl_graphs) {
$tresholds = true;
if (empty((float) $module['min_warning']) === true
&& empty((float) $module['max_warning']) === true
&& empty($module['warning_inverse']) === true
&& empty((float) $module['min_critical']) === true
&& empty((float) $module['max_critical']) === true
&& empty($module['critical_inverse']) === true
) {
$tresholds = false;
}
$graph_type = return_graphtype($row['module_type']);
$url = ui_get_full_url('operation/agentes/stat_win.php', false, false, false);
@ -1738,6 +1749,10 @@ $table->data[4][0] .= __('Not condition').'&nbsp;'.ui_print_help_tip(__('If you
'refresh' => SECONDS_10MINUTES,
];
if ($tresholds === true || $graph_type === 'boolean') {
$graph_params['histogram'] = 1;
}
if (is_metaconsole() && isset($row['server_id'])) {
// Set the server id.
$graph_params['server'] = $row['server_id'];
@ -1749,6 +1764,18 @@ $table->data[4][0] .= __('Not condition').'&nbsp;'.ui_print_help_tip(__('If you
$data[8] = get_module_realtime_link_graph($row);
if ($tresholds === true || $graph_type === 'boolean') {
$data[8] .= '<a href="javascript:'.$link.'">'.html_print_image(
'images/histograma.png',
true,
[
'border' => '0',
'alt' => '',
'class' => 'invert_filter',
]
).'</a>';
}
if (!is_snapshot_data($row['datos'])) {
$data[8] .= '<a href="javascript:'.$link.'">'.html_print_image('images/chart.png', true, ['border' => '0', 'alt' => '', 'class' => 'invert_filter']).'</a>';
}

View File

@ -147,7 +147,7 @@ echo '<td class="tactical_left_column" id="leftcolumn">';
// The status horizontal bars (Global health, Monitor sanity...
// ---------------------------------------------------------------------
$bg_color = 'background-color: #222';
if ($config['style'] !== 'pandora_black') {
if ($config['style'] !== 'pandora_black' && !is_metaconsole()) {
$bg_color = 'background-color: #fff';
}

View File

@ -72,7 +72,7 @@ echo '<title>'.__('Sound Events').'</title>';
</style>
<?php
echo '<link rel="icon" href="../../'.ui_get_favicon().'" type="image/ico" />';
if ($config['style'] === 'pandora_black') {
if ($config['style'] === 'pandora_black' && !is_metaconsole()) {
echo '<link rel="stylesheet" href="../../include/styles/pandora_black.css" type="text/css" />';
} else {
echo '<link rel="stylesheet" href="../../include/styles/pandora.css" type="text/css" />';

View File

@ -225,7 +225,7 @@ $table->data[0][0] .= '<div class="label_select_parent">'.html_print_input_text(
).'</div>';
$integria_logo = 'images/integria_logo_gray.png';
if ($config['style'] === 'pandora_black') {
if ($config['style'] === 'pandora_black' && !is_metaconsole()) {
$integria_logo = 'images/integria_logo.svg';
}

View File

@ -65,6 +65,42 @@ if ($enable_init_date) {
$period = ($datetime - $datetime_init);
}
// Shchedule report email.
$schedule_report = get_parameter('schbutton', '');
if (empty($schedule_report) === false) {
$id_user_task = 1;
$scheduled = 'no';
$date = date(DATE_FORMAT);
$time = date(TIME_FORMAT);
$parameters[0] = get_parameter('id_schedule_report');
$parameters[1] = get_parameter('schedule_email_address');
$parameters[2] = get_parameter('schedule_subject', '');
$parameters[3] = get_parameter('schedule_email', '');
$parameters[4] = get_parameter('report_type', '');
$parameters['first_execution'] = strtotime($date.' '.$time);
$values = [
'id_usuario' => $config['id_user'],
'id_user_task' => $id_user_task,
'args' => serialize($parameters),
'scheduled' => $scheduled,
'flag_delete' => 1,
];
$result = db_process_sql_insert('tuser_task_scheduled', $values);
$report_type = $parameters[4];
ui_print_result_message(
$result,
__('Your report has been planned, and the system will email you a '.$report_type.' file with the report as soon as its finished'),
__('An error has ocurred')
);
echo '<br>';
}
// ------------------- INIT HEADER --------------------------------------
$url = "index.php?sec=reporting&sec2=operation/reporting/reporting_viewer&id=$id_report&date=$date&time=$time&pure=$pure";
@ -249,16 +285,18 @@ if (reporting_get_description($id_report)) {
$table->data[0][1] = '<div class="float-left">'.reporting_get_name($id_report).'</div>';
}
$table->data[0][1] .= '<div class="right w100p mrgn_right_50px right_align">'.__('Set initial date').html_print_checkbox('enable_init_date', 1, $enable_init_date, true);
$html_enterprise = enterprise_hook(
'reporting_print_button_PDF',
[$id_report]
);
if ($html_enterprise !== ENTERPRISE_NOT_HOOK) {
$table->data[0][1] .= $html_enterprise;
$table->data[0][1] .= '<div class="flex-content-right">'.__('Set initial date').html_print_checkbox('enable_init_date', 1, $enable_init_date, true).'</br>';
$html_menu_export = enterprise_hook('reporting_print_button_export');
if ($html_menu_export === ENTERPRISE_NOT_HOOK) {
$html_menu_export = '';
}
$table->data[0][1] .= '</div>';
$table->data[0][1] .= $html_menu_export;
$table->data[1][1] = '<div>'.__('From').': </div>';
$table->data[1][1] .= html_print_input_text('date_init', $date_init, '', 12, 10, true).' ';

View File

@ -36,7 +36,8 @@ if (!$agents || !$searchAgents) {
$table->width = '98%';
$table->class = 'databox';
$table->head = [];
$table->head = [];
if ($only_count) {
$table->head[0] = __('Agent');
$table->head[1] = __('Description');
@ -57,6 +58,18 @@ if (!$agents || !$searchAgents) {
$table->head[8] = __('Last contact').' '.'<a href="index.php?search_category=agents&keywords='.$config['search_keywords'].'&head_search_keywords=abc&offset='.$offset.'&sort_field=last_contact&sort=up">'.html_print_image('images/sort_up.png', true, ['style' => $selectLastContactUp]).'</a>'.'<a href="index.php?search_category=agents&keywords='.$config['search_keywords'].'&head_search_keywords=abc&offset='.$offset.'&sort_field=last_contact&sort=down">'.html_print_image('images/sort_down.png', true, ['style' => $selectLastContactDown]).'</a>';
$table->head[9] = '';
$table->headstyle = [];
$table->headstyle[0] = 'text-align: left';
$table->headstyle[1] = 'text-align: left';
$table->headstyle[2] = 'text-align: left';
$table->headstyle[3] = 'text-align: left';
$table->headstyle[4] = 'text-align: left';
$table->headstyle[5] = 'text-align: left';
$table->headstyle[6] = 'text-align: left';
$table->headstyle[7] = 'text-align: left';
$table->headstyle[8] = 'text-align: left';
$table->headstyle[9] = 'text-align: center';
$table->align = [];
$table->align[0] = 'left';
$table->align[1] = 'left';

View File

@ -42,6 +42,13 @@ if ($alerts === false || $totalAlerts == 0 || !$searchAlerts) {
$table->align[3] = 'left';
$table->align[4] = 'left';
$table->headstyle = [];
$table->headstyle[0] = 'text-align: center';
$table->headstyle[1] = 'text-align: left';
$table->headstyle[2] = 'text-align: left';
$table->headstyle[3] = 'text-align: left';
$table->headstyle[4] = 'text-align: left';
$table->valign = [];
$table->valign[0] = 'top';
$table->valign[1] = 'top';

View File

@ -29,6 +29,10 @@ if ($graphs === false || !$searchGraphs) {
$table->head[0] = __('Graph name');
$table->head[1] = __('Description');
$table->headstyle = [];
$table->headstyle[0] = 'text-align: left';
$table->headstyle[1] = 'text-align: left';
$table->data = [];
foreach ($graphs as $graph) {
array_push(

View File

@ -32,21 +32,21 @@ $table->id = 'summary';
$table->width = '98%';
$table->style = [];
$table->style[0] = 'font-weight: bold; text-align: center;';
$table->style[1] = 'font-weight: bold; text-align: center;';
$table->style[2] = 'font-weight: bold; text-align: center;';
$table->style[3] = 'font-weight: bold; text-align: center;';
$table->style[4] = 'font-weight: bold; text-align: center;';
$table->style[5] = 'font-weight: bold; text-align: center;';
$table->style[6] = 'font-weight: bold; text-align: center;';
$table->style[7] = 'font-weight: bold; text-align: center;';
$table->style[8] = 'font-weight: bold; text-align: center;';
$table->style[9] = 'font-weight: bold; text-align: center;';
$table->style[10] = 'font-weight: bold; text-align: center;';
$table->style[11] = 'font-weight: bold; text-align: center;';
$table->style[13] = 'font-weight: bold; text-align: center;';
$table->style[14] = 'font-weight: bold; text-align: center;';
$table->style[15] = 'font-weight: bold; text-align: center;';
$table->style[0] = 'font-weight: bold; text-align: left;';
$table->style[1] = 'font-weight: bold; text-align: left;';
$table->style[2] = 'font-weight: bold; text-align: left;';
$table->style[3] = 'font-weight: bold; text-align: left;';
$table->style[4] = 'font-weight: bold; text-align: left;';
$table->style[5] = 'font-weight: bold; text-align: left;';
$table->style[6] = 'font-weight: bold; text-align: left;';
$table->style[7] = 'font-weight: bold; text-align: left;';
$table->style[8] = 'font-weight: bold; text-align: left;';
$table->style[9] = 'font-weight: bold; text-align: left;';
$table->style[10] = 'font-weight: bold; text-align: left;';
$table->style[11] = 'font-weight: bold; text-align: left;';
$table->style[13] = 'font-weight: bold; text-align: left;';
$table->style[14] = 'font-weight: bold; text-align: left;';
$table->style[15] = 'font-weight: bold; text-align: left;';

View File

@ -32,6 +32,13 @@ if ($maps === false || !$searchMaps) {
$table->align[1] = 'center';
$table->align[2] = 'center';
$table->headstyle = [];
$table->headstyle[0] = 'text-align: left';
$table->headstyle[1] = 'text-align: center';
$table->headstyle[1] = 'text-align: center';
$table->data = [];
foreach ($maps as $map) {
array_push(

View File

@ -51,6 +51,17 @@ if (!$modules || !$searchModules) {
$table->align[7] = 'left';
$table->align[8] = 'left';
$table->headstyle = [];
$table->headstyle[0] = 'text-align: left';
$table->headstyle[1] = 'text-align: left';
$table->headstyle[2] = 'text-align: left';
$table->headstyle[3] = 'text-align: left';
$table->headstyle[4] = 'text-align: left';
$table->headstyle[5] = 'text-align: left';
$table->headstyle[6] = 'text-align: left';
$table->headstyle[7] = 'text-align: left';
$table->headstyle[8] = 'text-align: left';
$table->data = [];
$id_type_web_content_string = db_get_value(

View File

@ -44,6 +44,8 @@ if ($reports === false || !$searchReports) {
$table->head[3] = __('XML');
$table->size[0] = '50%';
$table->size[1] = '20%';
$table->headstyle[0] = 'text-align: left';
$table->headstyle[1] = 'text-align: left';
$table->size[2] = '2%';
$table->headstyle[2] = 'min-width: 35px;text-align: left;';
$table->size[3] = '2%';

View File

@ -30,6 +30,14 @@ if (!$users || !$searchUsers) {
$table->align = [];
$table->align[4] = 'center';
$table->headstyle = [];
$table->headstyle[0] = 'text-align: left';
$table->headstyle[1] = 'text-align: left';
$table->headstyle[2] = 'text-align: left';
$table->headstyle[3] = 'text-align: left';
$table->headstyle[4] = 'text-align: center';
$table->headstyle[5] = 'text-align: left';
$table->head = [];
$table->head[0] = __('User ID').' '.'<a href="index.php?search_category=users&keywords='.$config['search_keywords'].'&head_search_keywords=abc&offset='.$offset.'&sort_field=id_user&sort=up">'.html_print_image('images/sort_up.png', true, ['style' => $selectUserIDUp]).'</a>'.'<a href="index.php?search_category=users&keywords='.$config['search_keywords'].'&head_search_keywords=abc&offset='.$offset.'&sort_field=id_user&sort=down">'.html_print_image('images/sort_down.png', true, ['style' => $selectUserIDDown]).'</a>';
$table->head[1] = __('Name').' '.'<a href="index.php?search_category=users&keywords='.$config['search_keywords'].'&head_search_keywords=abc&offset='.$offset.'&sort_field=name&sort=up">'.html_print_image('images/sort_up.png', true, ['style' => $selectNameUp]).'</a>'.'<a href="index.php?search_category=users&keywords='.$config['search_keywords'].'&head_search_keywords=abc&offset='.$offset.'&sort_field=name&sort=down">'.html_print_image('images/sort_down.png', true, ['style' => $selectNameDown]).'</a>';
@ -38,6 +46,8 @@ if (!$users || !$searchUsers) {
$table->head[4] = __('Profile').' '.'<a href="index.php?search_category=users&keywords='.$config['search_keywords'].'&head_search_keywords=abc&offset='.$offset.'&sort_field=profile&sort=up">'.html_print_image('images/sort_up.png', true, ['style' => $selectProfileUp]).'</a>'.'<a href="index.php?search_category=users&keywords='.$config['search_keywords'].'&head_search_keywords=abc&offset='.$offset.'&sort_field=profile&sort=down">'.html_print_image('images/sort_down.png', true, ['style' => $selectProfileDown]).'</a>';
$table->head[5] = __('Description');
$table->data = [];
foreach ($users as $user) {

View File

@ -33,7 +33,6 @@ $headerTitle = __('User detail editor');
require $config['homedir'].'/operation/users/user_edit_header.php';
if (is_metaconsole() === false) {
date_default_timezone_set('UTC');
include 'include/javascript/timezonepicker/includes/parser.inc';
// Read in options for map builder.
@ -349,7 +348,7 @@ if ($own_info['is_admin'] || check_acl($config['id_user'], 0, 'PM')) {
$usr_groups = (users_get_groups($config['id_user'], 'AR', $display_all_group));
$id_usr = $config['id_user'];
$skin = '';
if (!$meta) {
$home_screen = '<div class="label_select"><p class="edit_user_labels">'.__('Home screen').ui_print_help_tip(__('User can customize the home page. By default, will display \'Agent Detail\'. Example: Select \'Other\' and type index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente=1 to show agent detail view'), true).'</p>';
$values = [
@ -395,10 +394,7 @@ if (!$meta) {
$home_screen .= '</div>';
$home_screen .= html_print_input_text('data_section', $user_info['data_section'], '', 60, 255, true, false);
// User only can change skins if has more than one group.
$skin = '';
if (function_exists('skins_print_select')) {
if (count($usr_groups) > 1) {
$skin = '<div class="label_select"><p class="edit_user_labels">'.__('Skin').': </p>';
@ -407,7 +403,16 @@ if (!$meta) {
}
} else {
$home_screen = '';
$skin = '';
// User only can change skins if has more than one group.
if (function_exists('skins_print_select')) {
if (count($usr_groups) > 1) {
$skin = '<div class="label_select"><p class="edit_user_labels">'.__('Skin').ui_print_help_tip(
__('This change will only apply to nodes'),
true
).'</p>';
$skin .= skins_print_select($id_usr, 'skin', $user_info['id_skin'], '', __('None'), 0, true).'</div>';
}
}
}
$timezone = '<div class="label_select"><p class="edit_user_labels">'.__('Timezone').ui_print_help_tip(__('The timezone must be that of the associated server.'), true).'</p>';

View File

@ -97,7 +97,7 @@ $visualConsoleData = $visualConsole->toArray();
$visualConsoleName = $visualConsoleData['name'];
$bg_color = '';
if ($config['style'] === 'pandora_black') {
if ($config['style'] === 'pandora_black' && !is_metaconsole()) {
$bg_color = 'style="background-color: #222"';
}

View File

@ -269,7 +269,7 @@ if ($pure === false) {
$class_basic_chart = 'basic_chart_min link-create-item';
$class_delete = 'delete_item delete_min';
$class_copy = 'copy_item';
if ($config['style'] === 'pandora_black') {
if ($config['style'] === 'pandora_black' && !is_metaconsole()) {
$class_camera = 'camera_min_white link-create-item';
$class_percentile = 'percentile_item_min_white link-create-item';
$class_module_graph = 'graph_min_white link-create-item';
@ -417,7 +417,7 @@ if ($pure === false) {
}
$bg_color = '';
if ($config['style'] === 'pandora_black') {
if ($config['style'] === 'pandora_black' && !is_metaconsole()) {
$bg_color = 'style="background-color: #222"';
}

View File

@ -3,7 +3,7 @@
#
%define name pandorafms_console
%define version 7.0NG.759
%define release 220125
%define release 220126
# User and Group under which Apache is running
%define httpd_name httpd

View File

@ -3,7 +3,7 @@
#
%define name pandorafms_console
%define version 7.0NG.759
%define release 220125
%define release 220126
# User and Group under which Apache is running
%define httpd_name httpd

View File

@ -3,7 +3,7 @@
#
%define name pandorafms_console
%define version 7.0NG.759
%define release 220125
%define release 220126
%define httpd_name httpd
# User and Group under which Apache is running
%define httpd_name apache2

View File

@ -78,11 +78,12 @@ if (empty($options['background']) === true) {
$options['background'] = '#ffffff';
}
if ($config['style'] === 'pandora_black') {
if ($config['style'] === 'pandora_black' && !is_metaconsole()) {
$options['background'] = '#222222';
}
} else if ($options['background'] === '#ffffff'
&& $config['style'] === 'pandora_black'
&& !is_metaconsole()
) {
$options['background'] = '#222222';
} else if ($options['background'] === '#222222'

View File

@ -1,5 +1,5 @@
package: pandorafms-server
Version: 7.0NG.759-220125
Version: 7.0NG.759-220126
Architecture: all
Priority: optional
Section: admin

View File

@ -14,7 +14,7 @@
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
pandora_version="7.0NG.759-220125"
pandora_version="7.0NG.759-220126"
package_cpan=0
package_pandora=1

View File

@ -46,7 +46,7 @@ our @EXPORT = qw(
# version: Defines actual version of Pandora Server for this module only
my $pandora_version = "7.0NG.759";
my $pandora_build = "220125";
my $pandora_build = "220126";
our $VERSION = $pandora_version." ".$pandora_build;
# Setup hash

View File

@ -982,14 +982,17 @@ sub pandora_execute_alert ($$$$$$$$$;$$) {
$threshold = $action->{'action_threshold'} if (defined ($action->{'action_threshold'}) && $action->{'action_threshold'} > 0);
$threshold = $action->{'module_action_threshold'} if (defined ($action->{'module_action_threshold'}) && $action->{'module_action_threshold'} > 0);
if (time () >= ($action->{'last_execution'} + $threshold)) {
my $monitoring_event_custom_data = '';
push(@{$custom_data->{'actions'}}, safe_output($action->{'action_name'}));
# Does the action generate an event?
if (safe_output($action->{'name'}) eq "Monitoring Event") {
$event_generated = 1;
$monitoring_event_custom_data = $custom_data;
}
pandora_execute_action ($pa_config, $data, $agent, $alert, $alert_mode, $action, $module, $dbh, $timestamp, $extra_macros);
push(@{$custom_data->{'actions'}}, safe_output($action->{'action_name'}));
pandora_execute_action ($pa_config, $data, $agent, $alert, $alert_mode, $action, $module, $dbh, $timestamp, $extra_macros, $monitoring_event_custom_data);
} else {
if (defined ($module)) {
logger ($pa_config, "Skipping action " . safe_output($action->{'name'}) . " for alert '" . safe_output($alert->{'name'}) . "' module '" . safe_output($module->{'nombre'}) . "'.", 10);
@ -1082,9 +1085,9 @@ Execute the given action.
=cut
##########################################################################
sub pandora_execute_action ($$$$$$$$$;$) {
sub pandora_execute_action ($$$$$$$$$;$$) {
my ($pa_config, $data, $agent, $alert,
$alert_mode, $action, $module, $dbh, $timestamp, $extra_macros) = @_;
$alert_mode, $action, $module, $dbh, $timestamp, $extra_macros, $custom_data) = @_;
logger($pa_config, "Executing action '" . safe_output($action->{'name'}) . "' for alert '". safe_output($alert->{'name'}) . "' agent '" . (defined ($agent) ? safe_output($agent->{'nombre'}) : 'N/A') . "'.", 10);
@ -1642,25 +1645,30 @@ sub pandora_execute_action ($$$$$$$$$;$) {
if ((! defined($alert->{'disable_event'})) || (defined($alert->{'disable_event'}) && $alert->{'disable_event'} == 0)) {
pandora_event(
$pa_config,
$event_text,
(defined ($agent) ? $agent->{'id_grupo'} : 0),
(defined ($fullagent) ? $fullagent->{'id_agente'} : 0),
$priority,
(defined($alert)
? defined($alert->{'id_template_module'})
? $alert->{'id_template_module'}
: $alert->{'id'}
: 0),
(defined($alert) ? $alert->{'id_agent_module'} : 0),
$event_type,
0,
$dbh,
$source,
'',
$comment,
$id_extra,
$tags);
$pa_config,
$event_text,
(defined ($agent) ? $agent->{'id_grupo'} : 0),
(defined ($fullagent) ? $fullagent->{'id_agente'} : 0),
$priority,
(defined($alert)
? defined($alert->{'id_template_module'})
? $alert->{'id_template_module'}
: $alert->{'id'}
: 0),
(defined($alert) ? $alert->{'id_agent_module'} : 0),
$event_type,
0,
$dbh,
$source,
'',
$comment,
$id_extra,
$tags,
'',
'',
'',
p_encode_json($pa_config, $custom_data)
);
# Validate event (field1: agent name; field2: module name)
}
} elsif ($clean_name eq "Validate Event") {

View File

@ -34,7 +34,7 @@ our @ISA = qw(Exporter);
# version: Defines actual version of Pandora Server for this module only
my $pandora_version = "7.0NG.759";
my $pandora_build = "220125";
my $pandora_build = "220126";
our $VERSION = $pandora_version." ".$pandora_build;
our %EXPORT_TAGS = ( 'all' => [ qw() ] );

View File

@ -3,7 +3,7 @@
#
%define name pandorafms_server
%define version 7.0NG.759
%define release 220125
%define release 220126
Summary: Pandora FMS Server
Name: %{name}

View File

@ -3,7 +3,7 @@
#
%define name pandorafms_server
%define version 7.0NG.759
%define release 220125
%define release 220126
Summary: Pandora FMS Server
Name: %{name}

View File

@ -9,7 +9,7 @@
# **********************************************************************
PI_VERSION="7.0NG.759"
PI_BUILD="220125"
PI_BUILD="220126"
MODE=$1
if [ $# -gt 1 ]; then

View File

@ -35,7 +35,7 @@ use PandoraFMS::Config;
use PandoraFMS::DB;
# version: define current version
my $version = "7.0NG.759 Build 220125";
my $version = "7.0NG.759 Build 220126";
# Pandora server configuration
my %conf;

View File

@ -36,7 +36,7 @@ use Encode::Locale;
Encode::Locale::decode_argv;
# version: define current version
my $version = "7.0NG.759 Build 220125";
my $version = "7.0NG.759 Build 220126";
# save program name for logging
my $progname = basename($0);