|
|
|
@ -37,12 +37,35 @@ enterprise_include_once('include/functions_metaconsole.php');
|
|
|
|
|
$isFunctionPolicies = enterprise_include_once('include/functions_policies.php');
|
|
|
|
|
|
|
|
|
|
if (! defined('METACONSOLE')) {
|
|
|
|
|
// Header
|
|
|
|
|
ui_print_page_header(
|
|
|
|
|
__('Monitor detail'),
|
|
|
|
|
'images/brick.png',
|
|
|
|
|
false
|
|
|
|
|
);
|
|
|
|
|
$section = (string) get_parameter ("section", "view");
|
|
|
|
|
|
|
|
|
|
$buttons['fields'] = array('active' => false,
|
|
|
|
|
'text' => '<a href="index.php?sec=view&sec2=operation/agentes/status_monitor&section=fields">' .
|
|
|
|
|
html_print_image("images/custom_columns.png", true, array("title" => __('Custom fields'))) . '</a>',
|
|
|
|
|
'operation' => true);
|
|
|
|
|
|
|
|
|
|
$buttons['view'] = array('active' => false,
|
|
|
|
|
'text' => '<a href="index.php?sec=view&sec2=operation/agentes/status_monitor">' .
|
|
|
|
|
html_print_image("images/list.png", true, array("title" => __('View'))) . '</a>',
|
|
|
|
|
'operation' => true);
|
|
|
|
|
|
|
|
|
|
switch ($section) {
|
|
|
|
|
case 'fields':
|
|
|
|
|
$buttons['fields']['active'] = true;
|
|
|
|
|
$subpage = ' - ' . __('Custom fields');
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
$buttons['view']['active'] = true;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
ui_print_page_header (__("Monitor detail") . $subpage, "", false, "", true, $buttons);
|
|
|
|
|
|
|
|
|
|
if ($section == 'fields') {
|
|
|
|
|
require_once($config["homedir"] . '/godmode/agentes/status_monitor_custom_fields.php');
|
|
|
|
|
exit();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
ui_meta_print_header(__('Monitor view'));
|
|
|
|
|
}
|
|
|
|
@ -1040,75 +1063,103 @@ if (!empty($result)) {
|
|
|
|
|
$table->cellspacing = 0;
|
|
|
|
|
$table->width = '100%';
|
|
|
|
|
$table->class = 'databox data';
|
|
|
|
|
$table->head = [];
|
|
|
|
|
$table->data = [];
|
|
|
|
|
$table->size = [];
|
|
|
|
|
$table->align = [];
|
|
|
|
|
$table->head = array ();
|
|
|
|
|
$table->data = array ();
|
|
|
|
|
$table->size = array ();
|
|
|
|
|
$table->align = array ();
|
|
|
|
|
|
|
|
|
|
if ($isFunctionPolicies !== ENTERPRISE_NOT_HOOK) {
|
|
|
|
|
$show_fields = explode (',', $config['status_monitor_fields']);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (in_array('policy', $show_fields)) {
|
|
|
|
|
if ($isFunctionPolicies !== ENTERPRISE_NOT_HOOK)
|
|
|
|
|
$table->head[0] = '<span title=\'' . __('Policy') . '\'>' . __('P.') . '</span>';
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (in_array('agent', $show_fields) || is_metaconsole()) {
|
|
|
|
|
$table->head[1] = __('Agent');
|
|
|
|
|
$table->head[1] .= ' <a href="index.php?sec=view&sec2=operation/agentes/status_monitor&refr='.$refr.'&datatype='.$datatype.'&moduletype='.$moduletype.'&modulegroup='.$modulegroup.'&offset='.$offset.'&ag_group='.$ag_group.'&ag_freestring='.$ag_freestring.'&ag_modulename='.$ag_modulename.'&status='.$status.$ag_custom_fields_params.'&sort_field=agent_alias&sort=up">'.html_print_image('images/sort_up.png', true, ['style' => $selectAgentNameUp, 'alt' => 'up']).'</a>'.'<a href="index.php?sec=view&sec2=operation/agentes/status_monitor&refr='.$refr.'&datatype='.$datatype.'&moduletype='.$moduletype.'&modulegroup='.$modulegroup.'&offset='.$offset.'&ag_group='.$ag_group.'&ag_freestring='.$ag_freestring.'&ag_modulename='.$ag_modulename.'&status='.$status.$ag_custom_fields_params.'&sort_field=agent_alias&sort=down">'.html_print_image('images/sort_down.png', true, ['style' => $selectAgentNameDown, 'alt' => 'down']).'</a>';
|
|
|
|
|
$table->head[1] .=' <a href="index.php?sec=view&sec2=operation/agentes/status_monitor&refr=' . $refr . '&datatype='.$datatype . '&moduletype='.$moduletype . '&modulegroup='.$modulegroup . '&offset=' . $offset . '&ag_group=' . $ag_group . '&ag_freestring=' . $ag_freestring . '&ag_modulename=' . $ag_modulename . '&status=' . $status . $ag_custom_fields_params . '&sort_field=agent_alias&sort=up">' . html_print_image('images/sort_up.png', true, array('style' => $selectAgentNameUp, 'alt' => 'up')) . '</a>' .
|
|
|
|
|
'<a href="index.php?sec=view&sec2=operation/agentes/status_monitor&refr=' . $refr . '&datatype='.$datatype . '&moduletype='.$moduletype . '&modulegroup='.$modulegroup . '&offset=' . $offset . '&ag_group=' . $ag_group . '&ag_freestring=' . $ag_freestring . '&ag_modulename=' . $ag_modulename . '&status=' . $status . $ag_custom_fields_params . '&sort_field=agent_alias&sort=down">' . html_print_image('images/sort_down.png', true, array('style' => $selectAgentNameDown, 'alt' => 'down')) . '</a>';
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (in_array('data_type', $show_fields) || is_metaconsole()) {
|
|
|
|
|
$table->head[2] = __('Data Type');
|
|
|
|
|
$table->head[2] .= ' <a href="index.php?sec=view&sec2=operation/agentes/status_monitor&datatype='.$datatype.'&moduletype='.$moduletype.'&refr='.$refr.'&modulegroup='.$modulegroup.'&offset='.$offset.'&ag_group='.$ag_group.'&ag_freestring='.$ag_freestring.'&ag_modulename='.$ag_modulename.'&status='.$status.$ag_custom_fields_params.'&sort_field=type&sort=up">'.html_print_image('images/sort_up.png', true, ['style' => $selectTypeUp, 'alt' => 'up']).'</a>'.'<a href="index.php?sec=view&sec2=operation/agentes/status_monitor&datatype='.$datatype.'&moduletype='.$moduletype.'&refr='.$refr.'&modulegroup='.$modulegroup.'&offset='.$offset.'&ag_group='.$ag_group.'&ag_freestring='.$ag_freestring.'&ag_modulename='.$ag_modulename.'&status='.$status.$ag_custom_fields_params.'&sort_field=type&sort=down">'.html_print_image('images/sort_down.png', true, ['style' => $selectTypeDown, 'alt' => 'down']).'</a>';
|
|
|
|
|
$table->head[2] .= ' <a href="index.php?sec=view&sec2=operation/agentes/status_monitor&datatype='.$datatype . '&moduletype='.$moduletype . '&refr=' . $refr . '&modulegroup='.$modulegroup . '&offset=' . $offset . '&ag_group=' . $ag_group . '&ag_freestring=' . $ag_freestring . '&ag_modulename=' . $ag_modulename . '&status=' . $status . $ag_custom_fields_params . '&sort_field=type&sort=up">' . html_print_image('images/sort_up.png', true, array('style' => $selectTypeUp, 'alt' => 'up')) . '</a>' .
|
|
|
|
|
'<a href="index.php?sec=view&sec2=operation/agentes/status_monitor&datatype='.$datatype . '&moduletype='.$moduletype . '&refr=' . $refr . '&modulegroup='.$modulegroup . '&offset=' . $offset . '&ag_group=' . $ag_group . '&ag_freestring=' . $ag_freestring . '&ag_modulename=' . $ag_modulename . '&status=' . $status . $ag_custom_fields_params . '&sort_field=type&sort=down">' . html_print_image('images/sort_down.png', true, array('style' => $selectTypeDown, 'alt' => 'down')) . '</a>';
|
|
|
|
|
|
|
|
|
|
$table->align[2] = 'left';
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (in_array('module_name', $show_fields) || is_metaconsole()) {
|
|
|
|
|
$table->head[3] = __('Module name');
|
|
|
|
|
$table->head[3] .= ' <a href="index.php?sec=view&sec2=operation/agentes/status_monitor&datatype='.$datatype.'&moduletype='.$moduletype.'&refr='.$refr.'&modulegroup='.$modulegroup.'&offset='.$offset.'&ag_group='.$ag_group.'&ag_freestring='.$ag_freestring.'&ag_modulename='.$ag_modulename.'&status='.$status.$ag_custom_fields_params.'&sort_field=module_name&sort=up">'.html_print_image('images/sort_up.png', true, ['style' => $selectModuleNameUp, 'alt' => 'up']).'</a>'.'<a href="index.php?sec=view&sec2=operation/agentes/status_monitor&datatype='.$datatype.'&moduletype='.$moduletype.'&refr='.$refr.'&modulegroup='.$modulegroup.'&offset='.$offset.'&ag_group='.$ag_group.'&ag_freestring='.$ag_freestring.'&ag_modulename='.$ag_modulename.'&status='.$status.$ag_custom_fields_params.'&sort_field=module_name&sort=down">'.html_print_image('images/sort_down.png', true, ['style' => $selectModuleNameDown, 'alt' => 'down']).'</a>';
|
|
|
|
|
$table->head[3] .= ' <a href="index.php?sec=view&sec2=operation/agentes/status_monitor&datatype='.$datatype . '&moduletype='.$moduletype . '&refr=' . $refr . '&modulegroup='.$modulegroup . '&offset=' . $offset . '&ag_group=' . $ag_group . '&ag_freestring=' . $ag_freestring . '&ag_modulename=' . $ag_modulename . '&status=' . $status . $ag_custom_fields_params . '&sort_field=module_name&sort=up">' . html_print_image('images/sort_up.png', true, array('style' => $selectModuleNameUp, 'alt' => 'up')) . '</a>' .
|
|
|
|
|
'<a href="index.php?sec=view&sec2=operation/agentes/status_monitor&datatype='.$datatype . '&moduletype='.$moduletype . '&refr=' . $refr . '&modulegroup='.$modulegroup . '&offset=' . $offset . '&ag_group=' . $ag_group . '&ag_freestring=' . $ag_freestring . '&ag_modulename=' . $ag_modulename . '&status=' . $status . $ag_custom_fields_params . '&sort_field=module_name&sort=down">' . html_print_image('images/sort_down.png', true, array('style' => $selectModuleNameDown, 'alt' => 'down')) . '</a>';
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (in_array('server_type', $show_fields) || is_metaconsole()) {
|
|
|
|
|
$table->head[4] = __('Server type');
|
|
|
|
|
$table->head[4] .= ' <a href="index.php?sec=view&sec2=operation/agentes/status_monitor&datatype='.$datatype.'&moduletype='.$moduletype.'&refr='.$refr.'&modulegroup='.$modulegroup.'&offset='.$offset.'&ag_group='.$ag_group.'&ag_freestring='.$ag_freestring.'&ag_modulename='.$ag_modulename.'&status='.$status.$ag_custom_fields_params.'&sort_field=moduletype&sort=up">'.html_print_image('images/sort_up.png', true, ['style' => $selectModuleNameUp, 'alt' => 'up']).'</a>'.'<a href="index.php?sec=view&sec2=operation/agentes/status_monitor&datatype='.$datatype.'&moduletype='.$moduletype.'&refr='.$refr.'&modulegroup='.$modulegroup.'&offset='.$offset.'&ag_group='.$ag_group.'&ag_freestring='.$ag_freestring.'&ag_modulename='.$ag_modulename.'&status='.$status.$ag_custom_fields_params.'&sort_field=moduletype&sort=down">'.html_print_image('images/sort_down.png', true, ['style' => $selectModuleNameDown, 'alt' => 'down']).'</a>';
|
|
|
|
|
$table->head[4] .= ' <a href="index.php?sec=view&sec2=operation/agentes/status_monitor&datatype='.$datatype . '&moduletype='.$moduletype . '&refr=' . $refr . '&modulegroup='.$modulegroup . '&offset=' . $offset . '&ag_group=' . $ag_group . '&ag_freestring=' . $ag_freestring . '&ag_modulename=' . $ag_modulename . '&status=' . $status . $ag_custom_fields_params . '&sort_field=moduletype&sort=up">' . html_print_image('images/sort_up.png', true, array('style' => $selectModuleNameUp, 'alt' => 'up')) . '</a>' .
|
|
|
|
|
'<a href="index.php?sec=view&sec2=operation/agentes/status_monitor&datatype='.$datatype . '&moduletype='.$moduletype . '&refr=' . $refr . '&modulegroup='.$modulegroup . '&offset=' . $offset . '&ag_group=' . $ag_group . '&ag_freestring=' . $ag_freestring . '&ag_modulename=' . $ag_modulename . '&status=' . $status . $ag_custom_fields_params . '&sort_field=moduletype&sort=down">' . html_print_image('images/sort_down.png', true, array('style' => $selectModuleNameDown, 'alt' => 'down')) . '</a>';
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (in_array('interval', $show_fields) || is_metaconsole()) {
|
|
|
|
|
$table->head[5] = __('Interval');
|
|
|
|
|
$table->head[5] .= ' <a href="index.php?sec=view&sec2=operation/agentes/status_monitor&datatype='.$datatype.'&moduletype='.$moduletype.'&refr='.$refr.'&modulegroup='.$modulegroup.'&offset='.$offset.'&ag_group='.$ag_group.'&ag_freestring='.$ag_freestring.'&ag_modulename='.$ag_modulename.'&status='.$status.$ag_custom_fields_params.'&sort_field=interval&sort=up">'.html_print_image('images/sort_up.png', true, ['style' => $selectIntervalUp, 'alt' => 'up']).'</a>'.'<a href="index.php?sec=view&sec2=operation/agentes/status_monitor&datatype='.$datatype.'&moduletype='.$moduletype.'&refr='.$refr.'&modulegroup='.$modulegroup.'&offset='.$offset.'&ag_group='.$ag_group.'&ag_freestring='.$ag_freestring.'&ag_modulename='.$ag_modulename.'&status='.$status.$ag_custom_fields_params.'&sort_field=interval&sort=down">'.html_print_image('images/sort_down.png', true, ['style' => $selectIntervalDown, 'alt' => 'down']).'</a>';
|
|
|
|
|
$table->head[5] .= ' <a href="index.php?sec=view&sec2=operation/agentes/status_monitor&datatype='.$datatype . '&moduletype='.$moduletype . '&refr=' . $refr . '&modulegroup='.$modulegroup . '&offset=' . $offset . '&ag_group=' . $ag_group . '&ag_freestring=' . $ag_freestring . '&ag_modulename=' . $ag_modulename . '&status=' . $status . $ag_custom_fields_params . '&sort_field=interval&sort=up">' . html_print_image('images/sort_up.png', true, array('style' => $selectIntervalUp, 'alt' => 'up')) . '</a>' .
|
|
|
|
|
'<a href="index.php?sec=view&sec2=operation/agentes/status_monitor&datatype='.$datatype . '&moduletype='.$moduletype . '&refr=' . $refr . '&modulegroup='.$modulegroup . '&offset=' . $offset . '&ag_group=' . $ag_group . '&ag_freestring=' . $ag_freestring . '&ag_modulename=' . $ag_modulename . '&status=' . $status . $ag_custom_fields_params . '&sort_field=interval&sort=down">' . html_print_image('images/sort_down.png', true, array('style' => $selectIntervalDown, 'alt' => 'down')) . '</a>';
|
|
|
|
|
$table->align[5] = 'left';
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (in_array('status', $show_fields) || is_metaconsole()) {
|
|
|
|
|
$table->head[6] = __('Status');
|
|
|
|
|
$table->head[6] .= ' <a href="index.php?sec=view&sec2=operation/agentes/status_monitor&datatype='.$datatype.'&moduletype='.$moduletype.'&refr='.$refr.'&modulegroup='.$modulegroup.'&offset='.$offset.'&ag_group='.$ag_group.'&ag_freestring='.$ag_freestring.'&ag_modulename='.$ag_modulename.'&status='.$status.$ag_custom_fields_params.'&sort_field=status&sort=up">'.html_print_image('images/sort_up.png', true, ['style' => $selectStatusUp, 'alt' => 'up']).'</a>'.'<a href="index.php?sec=view&sec2=operation/agentes/status_monitor&datatype='.$datatype.'&moduletype='.$moduletype.'&refr='.$refr.'&modulegroup='.$modulegroup.'&offset='.$offset.'&ag_group='.$ag_group.'&ag_freestring='.$ag_freestring.'&ag_modulename='.$ag_modulename.'&status='.$status.$ag_custom_fields_params.'&sort_field=status&sort=down">'.html_print_image('images/sort_down.png', true, ['style' => $selectStatusDown, 'alt' => 'down']).'</a>';
|
|
|
|
|
$table->head[6] .= ' <a href="index.php?sec=view&sec2=operation/agentes/status_monitor&datatype='.$datatype . '&moduletype='.$moduletype . '&refr=' . $refr . '&modulegroup='.$modulegroup . '&offset=' . $offset . '&ag_group=' . $ag_group . '&ag_freestring=' . $ag_freestring . '&ag_modulename=' . $ag_modulename . '&status=' . $status . $ag_custom_fields_params . '&sort_field=status&sort=up">' . html_print_image('images/sort_up.png', true, array('style' => $selectStatusUp, 'alt' => 'up')) . '</a>' .
|
|
|
|
|
'<a href="index.php?sec=view&sec2=operation/agentes/status_monitor&datatype='.$datatype . '&moduletype='.$moduletype . '&refr=' . $refr . '&modulegroup='.$modulegroup . '&offset=' . $offset . '&ag_group=' . $ag_group . '&ag_freestring=' . $ag_freestring . '&ag_modulename=' . $ag_modulename . '&status=' . $status . $ag_custom_fields_params . '&sort_field=status&sort=down">' . html_print_image('images/sort_down.png', true, array('style' => $selectStatusDown, 'alt' => 'down')) . '</a>';
|
|
|
|
|
|
|
|
|
|
$table->align[6] = 'left';
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (in_array('graph', $show_fields) || is_metaconsole()) {
|
|
|
|
|
$table->head[7] = __('Graph');
|
|
|
|
|
$table->align[7] = 'left';
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (in_array('warn', $show_fields) || is_metaconsole()) {
|
|
|
|
|
$table->head[8] = __('Warn');
|
|
|
|
|
$table->align[8] = 'left';
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (in_array('data', $show_fields) || is_metaconsole()) {
|
|
|
|
|
$table->head[9] = __('Data');
|
|
|
|
|
$table->align[9] = 'left';
|
|
|
|
|
if ( is_metaconsole() ) {
|
|
|
|
|
$table->head[9] .= ' <a href="index.php?sec=view&sec2=operation/agentes/status_monitor&datatype='.$datatype.'&moduletype='.$moduletype.'&refr='.$refr.'&modulegroup='.$modulegroup.'&offset='.$offset.'&ag_group='.$ag_group.'&ag_freestring='.$ag_freestring.'&ag_modulename='.$ag_modulename.'&status='.$status.$ag_custom_fields_params.'&sort_field=data&sort=up">'.html_print_image('images/sort_up.png', true, ['style' => $selectStatusUp, 'alt' => 'up']).'</a>'.'<a href="index.php?sec=view&sec2=operation/agentes/status_monitor&datatype='.$datatype.'&moduletype='.$moduletype.'&refr='.$refr.'&modulegroup='.$modulegroup.'&offset='.$offset.'&ag_group='.$ag_group.'&ag_freestring='.$ag_freestring.'&ag_modulename='.$ag_modulename.'&status='.$status.$ag_custom_fields_params.'&sort_field=data&sort=down">'.html_print_image('images/sort_down.png', true, ['style' => $selectStatusDown, 'alt' => 'down']).'</a>';
|
|
|
|
|
$table->head[9] .= ' <a href="index.php?sec=view&sec2=operation/agentes/status_monitor&datatype='.$datatype . '&moduletype='.$moduletype . '&refr=' . $refr . '&modulegroup='.$modulegroup . '&offset=' . $offset . '&ag_group=' . $ag_group . '&ag_freestring=' . $ag_freestring . '&ag_modulename=' . $ag_modulename . '&status=' . $status . $ag_custom_fields_params . '&sort_field=data&sort=up">' . html_print_image('images/sort_up.png', true, array('style' => $selectStatusUp, 'alt' => 'up')) . '</a>' .
|
|
|
|
|
'<a href="index.php?sec=view&sec2=operation/agentes/status_monitor&datatype='.$datatype . '&moduletype='.$moduletype . '&refr=' . $refr . '&modulegroup='.$modulegroup . '&offset=' . $offset . '&ag_group=' . $ag_group . '&ag_freestring=' . $ag_freestring . '&ag_modulename=' . $ag_modulename . '&status=' . $status . $ag_custom_fields_params . '&sort_field=data&sort=down">' . html_print_image('images/sort_down.png', true, array('style' => $selectStatusDown, 'alt' => 'down')) . '</a>';
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (in_array('timestamp', $show_fields) || is_metaconsole()) {
|
|
|
|
|
$table->head[10] = __('Timestamp');
|
|
|
|
|
$table->head[10] .= ' <a href="index.php?sec=view&sec2=operation/agentes/status_monitor&datatype='.$datatype.'&moduletype='.$moduletype.'&refr='.$refr.'&offset='.$offset.'&ag_group='.$ag_group.'&ag_freestring='.$ag_freestring.'&ag_modulename='.$ag_modulename.'&status='.$status.$ag_custom_fields_params.'&sort_field=timestamp&sort=up">'.html_print_image('images/sort_up.png', true, ['style' => $selectTimestampUp, 'alt' => 'up']).'</a>'.'<a href="index.php?sec=view&sec2=operation/agentes/status_monitor&datatype='.$datatype.'&moduletype='.$moduletype.'&refr='.$refr.'&modulegroup='.$modulegroup.'&offset='.$offset.'&ag_group='.$ag_group.'&ag_freestring='.$ag_freestring.'&ag_modulename='.$ag_modulename.'&status='.$status.$ag_custom_fields_params.'&sort_field=timestamp&sort=down">'.html_print_image('images/sort_down.png', true, ['style' => $selectTimestampDown, 'alt' => 'down']).'</a>';
|
|
|
|
|
$table->head[10] .= ' <a href="index.php?sec=view&sec2=operation/agentes/status_monitor&datatype='.$datatype . '&moduletype='.$moduletype . '&refr=' . $refr . '&offset=' . $offset . '&ag_group=' . $ag_group . '&ag_freestring=' . $ag_freestring . '&ag_modulename=' . $ag_modulename . '&status=' . $status . $ag_custom_fields_params . '&sort_field=timestamp&sort=up">' . html_print_image('images/sort_up.png', true, array('style' => $selectTimestampUp, 'alt' => 'up')) . '</a>' .
|
|
|
|
|
'<a href="index.php?sec=view&sec2=operation/agentes/status_monitor&datatype='.$datatype . '&moduletype='.$moduletype . '&refr=' . $refr . '&modulegroup='.$modulegroup . '&offset=' . $offset . '&ag_group=' . $ag_group . '&ag_freestring=' . $ag_freestring . '&ag_modulename=' . $ag_modulename . '&status=' . $status . $ag_custom_fields_params . '&sort_field=timestamp&sort=down">' . html_print_image('images/sort_down.png', true, array('style' => $selectTimestampDown, 'alt' => 'down')) . '</a>';
|
|
|
|
|
$table->align[10] = 'left';
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$id_type_web_content_string = db_get_value(
|
|
|
|
|
'id_tipo',
|
|
|
|
|
'ttipo_modulo',
|
|
|
|
|
'nombre',
|
|
|
|
|
'web_content_string'
|
|
|
|
|
);
|
|
|
|
|
if (in_array('to_critical', $show_fields)) {
|
|
|
|
|
$table->head[11] = __('Last status change');
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$id_type_web_content_string = db_get_value('id_tipo', 'ttipo_modulo',
|
|
|
|
|
'nombre', 'web_content_string');
|
|
|
|
|
|
|
|
|
|
foreach ($result as $row) {
|
|
|
|
|
// Avoid unset, null and false value
|
|
|
|
|
if (empty($row['server_name'])) {
|
|
|
|
|
$row['server_name'] = '';
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$is_web_content_string = (bool) db_get_value_filter(
|
|
|
|
|
'id_agente_modulo',
|
|
|
|
|
//Avoid unset, null and false value
|
|
|
|
|
if (empty($row['server_name']))
|
|
|
|
|
$row['server_name'] = "";
|
|
|
|
|
|
|
|
|
|
$is_web_content_string = (bool)db_get_value_filter('id_agente_modulo',
|
|
|
|
|
'tagente_modulo',
|
|
|
|
|
[
|
|
|
|
|
'id_agente_modulo' => $row['id_agente_modulo'],
|
|
|
|
|
'id_tipo_modulo' => $id_type_web_content_string,
|
|
|
|
|
]
|
|
|
|
|
);
|
|
|
|
|
array('id_agente_modulo' => $row['id_agente_modulo'],
|
|
|
|
|
'id_tipo_modulo' => $id_type_web_content_string));
|
|
|
|
|
|
|
|
|
|
//Fixed the goliat sends the strings from web
|
|
|
|
|
//without HTML entities
|
|
|
|
@ -1121,7 +1172,9 @@ if (!empty($result)) {
|
|
|
|
|
$row['datos'] = io_safe_input($row['datos']);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$data = [];
|
|
|
|
|
$data = array ();
|
|
|
|
|
|
|
|
|
|
if (in_array('policy', $show_fields) || is_metaconsole()) {
|
|
|
|
|
if ($isFunctionPolicies !== ENTERPRISE_NOT_HOOK) {
|
|
|
|
|
if(is_metaconsole()){
|
|
|
|
|
$node = metaconsole_get_connection_by_id($row['server_id']);
|
|
|
|
@ -1135,9 +1188,9 @@ if (!empty($result)) {
|
|
|
|
|
|
|
|
|
|
$policyInfo = policies_info_module_policy($row['id_agente_modulo']);
|
|
|
|
|
|
|
|
|
|
if ($policyInfo === false) {
|
|
|
|
|
if ($policyInfo === false)
|
|
|
|
|
$data[0] = '';
|
|
|
|
|
} else {
|
|
|
|
|
else {
|
|
|
|
|
$linked = policies_is_module_linked($row['id_agente_modulo']);
|
|
|
|
|
|
|
|
|
|
$adopt = false;
|
|
|
|
@ -1149,24 +1202,31 @@ if (!empty($result)) {
|
|
|
|
|
if ($adopt) {
|
|
|
|
|
$img = 'images/policies_brick.png';
|
|
|
|
|
$title = __('(Adopt) ') . $policyInfo['name_policy'];
|
|
|
|
|
} else {
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
$img = 'images/policies.png';
|
|
|
|
|
$title = $policyInfo['name_policy'];
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
if ($adopt) {
|
|
|
|
|
$img = 'images/policies_not_brick.png';
|
|
|
|
|
$title = __('(Unlinked) (Adopt) ') . $policyInfo['name_policy'];
|
|
|
|
|
} else {
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
$img = 'images/unlinkpolicy.png';
|
|
|
|
|
$title = __('(Unlinked) ') . $policyInfo['name_policy'];
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(is_metaconsole()){
|
|
|
|
|
$data[0] = '<a href="?sec=gmodules&sec2=advanced/policymanager&id='.$policyInfo['id_policy'].'">'.html_print_image($img, true, ['title' => $title]).'</a>';
|
|
|
|
|
} else {
|
|
|
|
|
$data[0] = '<a href="?sec=gmodules&sec2=enterprise/godmode/policies/policies&id='.$policyInfo['id_policy'].'">'.html_print_image($img, true, ['title' => $title]).'</a>';
|
|
|
|
|
$data[0] = '<a href="?sec=gmodules&sec2=advanced/policymanager&id=' . $policyInfo['id_policy'] . '">' .
|
|
|
|
|
html_print_image($img,true, array('title' => $title)) .
|
|
|
|
|
'</a>';
|
|
|
|
|
}
|
|
|
|
|
else{
|
|
|
|
|
$data[0] = '<a href="?sec=gmodules&sec2=enterprise/godmode/policies/policies&id=' . $policyInfo['id_policy'] . '">' .
|
|
|
|
|
html_print_image($img,true, array('title' => $title)) .
|
|
|
|
|
'</a>';
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -1174,35 +1234,43 @@ if (!empty($result)) {
|
|
|
|
|
metaconsole_restore_db();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (in_array('agent', $show_fields) || is_metaconsole()) {
|
|
|
|
|
$agent_alias = !empty($row['agent_alias']) ? $row['agent_alias'] : $row['agent_name'];
|
|
|
|
|
|
|
|
|
|
// TODO: Calculate hash access before to use it more simply like other sections. I.E. Events view
|
|
|
|
|
if (defined('METACONSOLE')) {
|
|
|
|
|
$agent_link = '<a href="'.$row['server_url'].'index.php?'.'sec=estado&'.'sec2=operation/agentes/ver_agente&'.'id_agente='.$row['id_agent'].'&'.'loginhash=auto&'.'loginhash_data='.$row['hashdata'].'&'.'loginhash_user='.str_rot13($row['user']).'">';
|
|
|
|
|
$agent_alias = ui_print_truncate_text(
|
|
|
|
|
$agent_alias,
|
|
|
|
|
'agent_small',
|
|
|
|
|
false,
|
|
|
|
|
true,
|
|
|
|
|
false,
|
|
|
|
|
'[…]',
|
|
|
|
|
'font-size:7.5pt;'
|
|
|
|
|
);
|
|
|
|
|
$agent_link = '<a href="'.
|
|
|
|
|
$row['server_url'] .'index.php?' .
|
|
|
|
|
'sec=estado&' .
|
|
|
|
|
'sec2=operation/agentes/ver_agente&' .
|
|
|
|
|
'id_agente='. $row['id_agent'] . '&' .
|
|
|
|
|
'loginhash=auto&' .
|
|
|
|
|
'loginhash_data=' . $row['hashdata'] . '&' .
|
|
|
|
|
'loginhash_user=' . str_rot13($row['user']) . '">';
|
|
|
|
|
$agent_alias = ui_print_truncate_text($agent_alias,
|
|
|
|
|
'agent_small', false, true, false, '[…]',
|
|
|
|
|
'font-size:7.5pt;');
|
|
|
|
|
if (can_user_access_node ()) {
|
|
|
|
|
$data[1] = $agent_link . '<b>' . $agent_alias . '</b></a>';
|
|
|
|
|
} else {
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
$data[1] = $agent_alias;
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
$data[1] = '<strong><a href="index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente='.$row['id_agent'].'">';
|
|
|
|
|
$data[1] .= ui_print_truncate_text($agent_alias, 'agent_medium', false, true, false, '[…]', 'font-size:7.5pt;');
|
|
|
|
|
$data[1] .= '</a></strong>';
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (in_array('data_type', $show_fields) || is_metaconsole()) {
|
|
|
|
|
$data[2] = html_print_image('images/' . modules_show_icon_type ($row['module_type']), true);
|
|
|
|
|
$agent_groups = is_metaconsole() ? $row['groups_in_server'] : agents_get_all_groups_agent($row['id_agent'], $row['id_group']);
|
|
|
|
|
$agent_groups = is_metaconsole()
|
|
|
|
|
? $row['groups_in_server']
|
|
|
|
|
: agents_get_all_groups_agent($row['id_agent'], $row['id_group']);
|
|
|
|
|
if (check_acl_one_of_groups ($config['id_user'], $agent_groups, 'AW')) {
|
|
|
|
|
$show_edit_icon = true;
|
|
|
|
|
if (defined('METACONSOLE')) {
|
|
|
|
@ -1210,157 +1278,148 @@ if (!empty($result)) {
|
|
|
|
|
$show_edit_icon = false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$url_edit_module = $row['server_url'].'index.php?'.'sec=gagente&'.'sec2=godmode/agentes/configurar_agente&'.'id_agente='.$row['id_agent'].'&'.'tab=module&'.'id_agent_module='.$row['id_agente_modulo'].'&'.'edit_module=1'.'&loginhash=auto&loginhash_data='.$row['hashdata'].'&loginhash_user='.str_rot13($row['user']);
|
|
|
|
|
} else {
|
|
|
|
|
$url_edit_module = 'index.php?'.'sec=gagente&'.'sec2=godmode/agentes/configurar_agente&'.'id_agente='.$row['id_agent'].'&'.'tab=module&'.'id_agent_module='.$row['id_agente_modulo'].'&'.'edit_module=1';
|
|
|
|
|
$url_edit_module = $row['server_url'] . 'index.php?' .
|
|
|
|
|
'sec=gagente&' .
|
|
|
|
|
'sec2=godmode/agentes/configurar_agente&' .
|
|
|
|
|
'id_agente=' . $row['id_agent'] . '&' .
|
|
|
|
|
'tab=module&' .
|
|
|
|
|
'id_agent_module=' . $row['id_agente_modulo'] . '&' .
|
|
|
|
|
'edit_module=1' .
|
|
|
|
|
'&loginhash=auto&loginhash_data=' . $row['hashdata'] . '&loginhash_user=' . str_rot13($row['user']);
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
$url_edit_module = 'index.php?' .
|
|
|
|
|
'sec=gagente&' .
|
|
|
|
|
'sec2=godmode/agentes/configurar_agente&' .
|
|
|
|
|
'id_agente=' . $row['id_agent'] . '&' .
|
|
|
|
|
'tab=module&' .
|
|
|
|
|
'id_agent_module=' . $row['id_agente_modulo'] . '&' .
|
|
|
|
|
'edit_module=1';
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if ($show_edit_icon) {
|
|
|
|
|
$data[2] .= '<a href="'.$url_edit_module.'">'.html_print_image(
|
|
|
|
|
'images/config.png',
|
|
|
|
|
true,
|
|
|
|
|
[
|
|
|
|
|
'alt' => '0',
|
|
|
|
|
'border' => '',
|
|
|
|
|
'title' => __('Edit'),
|
|
|
|
|
]
|
|
|
|
|
).'</a>';
|
|
|
|
|
$data[2] .= '<a href="' . $url_edit_module . '">' .
|
|
|
|
|
html_print_image('images/config.png', true,
|
|
|
|
|
array('alt' => '0', 'border' => '', 'title' => __('Edit'))) .
|
|
|
|
|
'</a>';
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (in_array('module_name', $show_fields) || is_metaconsole()) {
|
|
|
|
|
$data[3] = ui_print_truncate_text($row['module_name'], 'agent_small', false, true, true);
|
|
|
|
|
if ($row['extended_info'] != '') {
|
|
|
|
|
$data[3] .= ui_print_help_tip ($row['extended_info'], true, '/images/default_list.png');
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if ($row['tags'] != '') {
|
|
|
|
|
$data[3] .= html_print_image(
|
|
|
|
|
'/images/tag_red.png',
|
|
|
|
|
true,
|
|
|
|
|
[
|
|
|
|
|
$data[3] .= html_print_image('/images/tag_red.png', true,
|
|
|
|
|
array(
|
|
|
|
|
'title' => $row['tags'],
|
|
|
|
|
'style' => 'width: 20px; margin-left: 3px;',
|
|
|
|
|
]
|
|
|
|
|
);
|
|
|
|
|
'style' => 'width: 20px; margin-left: 3px;'));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (in_array('server_type', $show_fields) || is_metaconsole())
|
|
|
|
|
$data[4] = servers_show_type ($row['id_modulo']);
|
|
|
|
|
|
|
|
|
|
$data[5] = ($row['module_interval'] == 0) ? human_time_description_raw($row['agent_interval']) : human_time_description_raw($row['module_interval']);
|
|
|
|
|
|
|
|
|
|
if ($row['utimestamp'] == 0 && (($row['module_type'] < 21
|
|
|
|
|
|| $row['module_type'] > 23) && $row['module_type'] != 100)
|
|
|
|
|
) {
|
|
|
|
|
$data[6] = ui_print_status_image(
|
|
|
|
|
STATUS_MODULE_NO_DATA,
|
|
|
|
|
__('NOT INIT'),
|
|
|
|
|
true
|
|
|
|
|
);
|
|
|
|
|
} else if ($row['estado'] == 0) {
|
|
|
|
|
if (is_numeric($row['datos'])) {
|
|
|
|
|
$data[6] = ui_print_status_image(
|
|
|
|
|
STATUS_MODULE_OK,
|
|
|
|
|
__('NORMAL').': '.remove_right_zeros(number_format($row['datos'], $config['graph_precision'])),
|
|
|
|
|
true
|
|
|
|
|
);
|
|
|
|
|
} else {
|
|
|
|
|
$data[6] = ui_print_status_image(
|
|
|
|
|
STATUS_MODULE_OK,
|
|
|
|
|
__('NORMAL').': '.$row['datos'],
|
|
|
|
|
true
|
|
|
|
|
);
|
|
|
|
|
if (in_array('interval', $show_fields) || is_metaconsole()) {
|
|
|
|
|
$data[5] = ($row['module_interval'] == 0) ?
|
|
|
|
|
human_time_description_raw($row['agent_interval'])
|
|
|
|
|
:
|
|
|
|
|
human_time_description_raw($row['module_interval']);
|
|
|
|
|
}
|
|
|
|
|
} else if ($row['estado'] == 1) {
|
|
|
|
|
if (is_numeric($row['datos'])) {
|
|
|
|
|
$data[6] = ui_print_status_image(
|
|
|
|
|
STATUS_MODULE_CRITICAL,
|
|
|
|
|
__('CRITICAL').': '.remove_right_zeros(number_format($row['datos'], $config['graph_precision'])),
|
|
|
|
|
true
|
|
|
|
|
);
|
|
|
|
|
} else {
|
|
|
|
|
$data[6] = ui_print_status_image(
|
|
|
|
|
STATUS_MODULE_CRITICAL,
|
|
|
|
|
__('CRITICAL').': '.$row['datos'],
|
|
|
|
|
true
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
if (in_array('status', $show_fields) || is_metaconsole()) {
|
|
|
|
|
if ($row['utimestamp'] == 0 && (($row['module_type'] < 21 ||
|
|
|
|
|
$row['module_type'] > 23) && $row['module_type'] != 100)) {
|
|
|
|
|
$data[6] = ui_print_status_image(STATUS_MODULE_NO_DATA,
|
|
|
|
|
__('NOT INIT'), true);
|
|
|
|
|
}
|
|
|
|
|
} else if ($row['estado'] == 2) {
|
|
|
|
|
elseif ($row['estado'] == 0) {
|
|
|
|
|
if (is_numeric($row['datos'])) {
|
|
|
|
|
$data[6] = ui_print_status_image(
|
|
|
|
|
STATUS_MODULE_WARNING,
|
|
|
|
|
__('WARNING').': '.remove_right_zeros(number_format($row['datos'], $config['graph_precision'])),
|
|
|
|
|
true
|
|
|
|
|
);
|
|
|
|
|
} else {
|
|
|
|
|
$data[6] = ui_print_status_image(
|
|
|
|
|
STATUS_MODULE_WARNING,
|
|
|
|
|
__('WARNING').': '.$row['datos'],
|
|
|
|
|
true
|
|
|
|
|
);
|
|
|
|
|
$data[6] = ui_print_status_image(STATUS_MODULE_OK,
|
|
|
|
|
__('NORMAL') . ': ' . remove_right_zeros(number_format($row['datos'], $config['graph_precision'])), true);
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
else {
|
|
|
|
|
$data[6] = ui_print_status_image(STATUS_MODULE_OK,
|
|
|
|
|
__('NORMAL') . ': ' . $row['datos'], true);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
elseif ($row['estado'] == 1) {
|
|
|
|
|
if (is_numeric($row['datos'])) {
|
|
|
|
|
$data[6] = ui_print_status_image(STATUS_MODULE_CRITICAL,
|
|
|
|
|
__('CRITICAL') . ': ' . remove_right_zeros(number_format($row['datos'], $config['graph_precision'])), true);
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
$data[6] = ui_print_status_image(STATUS_MODULE_CRITICAL,
|
|
|
|
|
__('CRITICAL') . ': ' . $row['datos'], true);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
elseif ($row['estado'] == 2) {
|
|
|
|
|
if (is_numeric($row['datos'])) {
|
|
|
|
|
$data[6] = ui_print_status_image(STATUS_MODULE_WARNING,
|
|
|
|
|
__('WARNING') . ': ' . remove_right_zeros(number_format($row['datos'], $config['graph_precision'])), true);
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
$data[6] = ui_print_status_image(STATUS_MODULE_WARNING,
|
|
|
|
|
__('WARNING') . ': ' . $row['datos'], true);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
$last_status = modules_get_agentmodule_last_status(
|
|
|
|
|
$row['id_agente_modulo']
|
|
|
|
|
);
|
|
|
|
|
$row['id_agente_modulo']);
|
|
|
|
|
switch($last_status) {
|
|
|
|
|
case 0:
|
|
|
|
|
if (is_numeric($row['datos'])) {
|
|
|
|
|
$data[6] = ui_print_status_image(
|
|
|
|
|
STATUS_MODULE_UNKNOWN,
|
|
|
|
|
__('UNKNOWN').' - '.__('Last status').' '.__('NORMAL').': '.remove_right_zeros(number_format($row['datos'], $config['graph_precision'])),
|
|
|
|
|
true
|
|
|
|
|
);
|
|
|
|
|
} else {
|
|
|
|
|
$data[6] = ui_print_status_image(
|
|
|
|
|
STATUS_MODULE_UNKNOWN,
|
|
|
|
|
__('UNKNOWN').' - '.__('Last status').' '.__('NORMAL').': '.$row['datos'],
|
|
|
|
|
true
|
|
|
|
|
);
|
|
|
|
|
$data[6] = ui_print_status_image(STATUS_MODULE_UNKNOWN,
|
|
|
|
|
__('UNKNOWN') . ' - ' . __('Last status') . " " .
|
|
|
|
|
__('NORMAL') . ': ' . remove_right_zeros(number_format($row['datos'], $config['graph_precision'])), true);
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
$data[6] = ui_print_status_image(STATUS_MODULE_UNKNOWN,
|
|
|
|
|
__('UNKNOWN') . ' - ' . __('Last status') . " " .
|
|
|
|
|
__('NORMAL') . ': ' . $row['datos'], true);
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case 1:
|
|
|
|
|
if (is_numeric($row['datos'])) {
|
|
|
|
|
$data[6] = ui_print_status_image(
|
|
|
|
|
STATUS_MODULE_UNKNOWN,
|
|
|
|
|
__('UNKNOWN').' - '.__('Last status').' '.__('CRITICAL').': '.remove_right_zeros(number_format($row['datos'], $config['graph_precision'])),
|
|
|
|
|
true
|
|
|
|
|
);
|
|
|
|
|
} else {
|
|
|
|
|
$data[6] = ui_print_status_image(
|
|
|
|
|
STATUS_MODULE_UNKNOWN,
|
|
|
|
|
__('UNKNOWN').' - '.__('Last status').' '.__('CRITICAL').': '.$row['datos'],
|
|
|
|
|
true
|
|
|
|
|
);
|
|
|
|
|
$data[6] = ui_print_status_image(STATUS_MODULE_UNKNOWN,
|
|
|
|
|
__('UNKNOWN') . ' - ' . __('Last status') ." " .
|
|
|
|
|
__('CRITICAL') . ': ' . remove_right_zeros(number_format($row['datos'], $config['graph_precision'])), true);
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
$data[6] = ui_print_status_image(STATUS_MODULE_UNKNOWN,
|
|
|
|
|
__('UNKNOWN') . ' - ' . __('Last status') ." " .
|
|
|
|
|
__('CRITICAL') . ': ' . $row['datos'], true);
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case 2:
|
|
|
|
|
if (is_numeric($row['datos'])) {
|
|
|
|
|
$data[6] = ui_print_status_image(
|
|
|
|
|
STATUS_MODULE_UNKNOWN,
|
|
|
|
|
__('UNKNOWN').' - '.__('Last status').' '.__('WARNING').': '.remove_right_zeros(number_format($row['datos'], $config['graph_precision'])),
|
|
|
|
|
true
|
|
|
|
|
);
|
|
|
|
|
} else {
|
|
|
|
|
$data[6] = ui_print_status_image(
|
|
|
|
|
STATUS_MODULE_UNKNOWN,
|
|
|
|
|
__('UNKNOWN').' - '.__('Last status').' '.__('WARNING').': '.$row['datos'],
|
|
|
|
|
true
|
|
|
|
|
);
|
|
|
|
|
$data[6] = ui_print_status_image(STATUS_MODULE_UNKNOWN,
|
|
|
|
|
__('UNKNOWN') . ' - ' . __('Last status') . " " .
|
|
|
|
|
__('WARNING') . ': ' . remove_right_zeros(number_format($row['datos'], $config['graph_precision'])), true);
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
$data[6] = ui_print_status_image(STATUS_MODULE_UNKNOWN,
|
|
|
|
|
__('UNKNOWN') . ' - ' . __('Last status') . " " .
|
|
|
|
|
__('WARNING') . ': ' . $row['datos'], true);
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$data[7] = '';
|
|
|
|
|
if (in_array('graph', $show_fields) || is_metaconsole()) {
|
|
|
|
|
$data[7] = "";
|
|
|
|
|
|
|
|
|
|
$acl_graphs = false;
|
|
|
|
|
|
|
|
|
|
// Avoid the check on the metaconsole. Too slow to show/hide an icon depending on the permissions
|
|
|
|
|
if (!is_metaconsole()) {
|
|
|
|
|
$acl_graphs = check_acl($config['id_user'], $row['id_group'], 'RR');
|
|
|
|
|
} else {
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
$acl_graphs = true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -1371,13 +1430,13 @@ if (!empty($result)) {
|
|
|
|
|
$handle = dechex(crc32($row['id_agente_modulo'].$row['module_name']));
|
|
|
|
|
$win_handle = 'day_'.$handle;
|
|
|
|
|
|
|
|
|
|
$graph_params = [
|
|
|
|
|
$graph_params = array(
|
|
|
|
|
'type' => $graph_type,
|
|
|
|
|
'period' => SECONDS_1DAY,
|
|
|
|
|
'id' => $row['id_agente_modulo'],
|
|
|
|
|
'label' => base64_encode($row['module_name']),
|
|
|
|
|
'refresh' => SECONDS_10MINUTES,
|
|
|
|
|
];
|
|
|
|
|
'refresh' => SECONDS_10MINUTES
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
if (is_metaconsole() && isset($row['server_id'])) {
|
|
|
|
|
// Set the server id
|
|
|
|
@ -1391,30 +1450,28 @@ if (!empty($result)) {
|
|
|
|
|
$data[7] = get_module_realtime_link_graph($row);
|
|
|
|
|
|
|
|
|
|
if(!is_snapshot_data($row['datos'])){
|
|
|
|
|
$data[7] .= '<a href="javascript:'.$link.'">'.html_print_image('images/chart_curve.png', true, ['border' => '0', 'alt' => '']).'</a>';
|
|
|
|
|
$data[7] .= '<a href="javascript:'.$link.'">' . html_print_image('images/chart_curve.png', true, array('border' => '0', 'alt' => '')) . '</a>';
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$data[7] .= '<a href="javascript: '.'show_module_detail_dialog('.$row['id_agente_modulo'].', '.$row['id_agent'].', \''.$row['server_name'].'\', 0, '.SECONDS_1DAY.', \''.$row['module_name'].'\')">'.html_print_image(
|
|
|
|
|
'images/binary.png',
|
|
|
|
|
true,
|
|
|
|
|
[
|
|
|
|
|
'border' => '0',
|
|
|
|
|
'alt' => '',
|
|
|
|
|
]
|
|
|
|
|
).'</a>';
|
|
|
|
|
$data[7] .= '<a href="javascript: ' .
|
|
|
|
|
'show_module_detail_dialog(' .
|
|
|
|
|
$row['id_agente_modulo'] . ', '.
|
|
|
|
|
$row['id_agent'] . ', \'' .
|
|
|
|
|
$row['server_name'] . '\', 0, ' . SECONDS_1DAY . ', \'' . $row['module_name'] . '\')">' .
|
|
|
|
|
html_print_image ('images/binary.png', true,
|
|
|
|
|
array ('border' => '0', 'alt' => '')) . '</a>';
|
|
|
|
|
|
|
|
|
|
$data[7] .= '<span id=\'hidden_name_module_' . $row['id_agente_modulo'] . '\'
|
|
|
|
|
style=\'display: none;\'>'.$row['module_name'].'</span>';
|
|
|
|
|
style=\'display: none;\'>' .
|
|
|
|
|
$row['module_name'] .
|
|
|
|
|
'</span>';
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$data[8] = ui_print_module_warn_value(
|
|
|
|
|
$row['max_warning'],
|
|
|
|
|
$row['min_warning'],
|
|
|
|
|
$row['str_warning'],
|
|
|
|
|
$row['max_critical'],
|
|
|
|
|
$row['min_critical'],
|
|
|
|
|
$row['str_critical']
|
|
|
|
|
);
|
|
|
|
|
if (in_array('warn', $show_fields) || is_metaconsole()) {
|
|
|
|
|
|
|
|
|
|
$data[8] = ui_print_module_warn_value($row['max_warning'],
|
|
|
|
|
$row['min_warning'], $row['str_warning'], $row['max_critical'],
|
|
|
|
|
$row['min_critical'], $row['str_critical']);
|
|
|
|
|
|
|
|
|
|
if (is_numeric($row['datos']) && !modules_is_string_type($row['module_type'])) {
|
|
|
|
|
if ( $config['render_proc'] ) {
|
|
|
|
@ -1425,41 +1482,36 @@ if (!empty($result)) {
|
|
|
|
|
case 18:
|
|
|
|
|
case 21:
|
|
|
|
|
case 31:
|
|
|
|
|
if ($row['datos'] >= 1) {
|
|
|
|
|
if ( $row['datos'] >= 1 )
|
|
|
|
|
$salida = $config['render_proc_ok'];
|
|
|
|
|
} else {
|
|
|
|
|
else
|
|
|
|
|
$salida = $config['render_proc_fail'];
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
default:
|
|
|
|
|
switch($row['module_type']) {
|
|
|
|
|
case 15:
|
|
|
|
|
$value = db_get_value('snmp_oid', 'tagente_modulo', 'id_agente_modulo', $row['id_agente_modulo']);
|
|
|
|
|
if ($value == '.1.3.6.1.2.1.1.3.0' || $value == '.1.3.6.1.2.1.25.1.1.0') {
|
|
|
|
|
if ($value == '.1.3.6.1.2.1.1.3.0' || $value == '.1.3.6.1.2.1.25.1.1.0')
|
|
|
|
|
$salida = human_milliseconds_to_string($row['datos']);
|
|
|
|
|
} else {
|
|
|
|
|
else
|
|
|
|
|
$salida = remove_right_zeros(number_format($row['datos'], $config['graph_precision']));
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
default:
|
|
|
|
|
$salida = remove_right_zeros(number_format($row['datos'], $config['graph_precision']));
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
switch($row['module_type']) {
|
|
|
|
|
case 15:
|
|
|
|
|
$value = db_get_value('snmp_oid', 'tagente_modulo', 'id_agente_modulo', $row['id_agente_modulo']);
|
|
|
|
|
if ($value == '.1.3.6.1.2.1.1.3.0' || $value == '.1.3.6.1.2.1.25.1.1.0') {
|
|
|
|
|
if ($value == '.1.3.6.1.2.1.1.3.0' || $value == '.1.3.6.1.2.1.25.1.1.0')
|
|
|
|
|
$salida = human_milliseconds_to_string($row['datos']);
|
|
|
|
|
} else {
|
|
|
|
|
else
|
|
|
|
|
$salida = remove_right_zeros(number_format($row['datos'], $config['graph_precision']));
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
default:
|
|
|
|
|
$salida = remove_right_zeros(number_format($row['datos'], $config['graph_precision']));
|
|
|
|
|
break;
|
|
|
|
@ -1477,19 +1529,21 @@ if (!empty($result)) {
|
|
|
|
|
$salida = ui_print_truncate_text($salida, 'agent_small', true, true, false, '[…]', 'font-size:7.5pt;');
|
|
|
|
|
//clean tag <i>
|
|
|
|
|
$text_aux = explode('<a',$salida);
|
|
|
|
|
$match = preg_replace('/(<i>|<\/i>|<i|<\/i|i>|\/i>|<|>)/', '', $text_aux[0]);
|
|
|
|
|
$match = preg_replace('/(<i>|<\/i>|<i|<\/i|i>|\/i>|<|>)/', "", $text_aux[0]);
|
|
|
|
|
$salida = $match.'<a'.$text_aux[1];
|
|
|
|
|
} else {
|
|
|
|
|
$salida = ui_print_truncate_text($salida, 'agent_small', true, true, false, '[…]', 'font-size:7.5pt;');
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
//Fixed the goliat sends the strings from web
|
|
|
|
|
//without HTML entities
|
|
|
|
|
if ($is_web_content_string) {
|
|
|
|
|
$module_value = $row['datos'];
|
|
|
|
|
} else {
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
$module_value = io_safe_output($row['datos']);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -1497,21 +1551,20 @@ if (!empty($result)) {
|
|
|
|
|
$is_large_image = is_text_to_black_string ( $module_value );
|
|
|
|
|
|
|
|
|
|
if (($config['command_snapshot']) && ($is_snapshot || $is_large_image)) {
|
|
|
|
|
$link = ui_get_snapshot_link(
|
|
|
|
|
[
|
|
|
|
|
$link = ui_get_snapshot_link( array(
|
|
|
|
|
'id_module' => $row['id_agente_modulo'],
|
|
|
|
|
'interval' => $row['current_interval'],
|
|
|
|
|
'module_name' => $row['module_name'],
|
|
|
|
|
'id_node' => $row['server_id'],
|
|
|
|
|
]
|
|
|
|
|
);
|
|
|
|
|
'id_node' => $row['server_id']
|
|
|
|
|
));
|
|
|
|
|
$salida = ui_get_snapshot_image($link, $is_snapshot) . ' ';
|
|
|
|
|
} else {
|
|
|
|
|
$sub_string = substr(io_safe_output($row['datos']), 0, 12);
|
|
|
|
|
if ($module_value == $sub_string) {
|
|
|
|
|
if ($module_value == 0 && !$sub_string) {
|
|
|
|
|
$salida = 0;
|
|
|
|
|
} else {
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
$data_macro = modules_get_unit_macro($row['datos'],$row['unit']);
|
|
|
|
|
if($data_macro) {
|
|
|
|
|
$salida = $data_macro;
|
|
|
|
@ -1519,50 +1572,70 @@ if (!empty($result)) {
|
|
|
|
|
$salida = $row['datos'];
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
//Fixed the goliat sends the strings from web
|
|
|
|
|
//without HTML entities
|
|
|
|
|
if ($is_web_content_string) {
|
|
|
|
|
$sub_string = substr($row['datos'], 0, 12);
|
|
|
|
|
} else {
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
//Fixed the data from Selenium Plugin
|
|
|
|
|
if ($module_value != strip_tags($module_value)) {
|
|
|
|
|
$module_value = io_safe_input($module_value);
|
|
|
|
|
$sub_string = substr($row['datos'], 0, 12);
|
|
|
|
|
} else {
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
$sub_string = substr(io_safe_output($row['datos']),0, 12);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if ($module_value == $sub_string) {
|
|
|
|
|
$salida = $module_value;
|
|
|
|
|
} else {
|
|
|
|
|
$salida = '<span '."id='hidden_value_module_".$row['id_agente_modulo']."'
|
|
|
|
|
style='display: none;'>".$module_value.'</span>'.'<span '."id='value_module_".$row['id_agente_modulo']."'
|
|
|
|
|
title='".$module_value."' "."style='white-space: nowrap;'>".'<span id="value_module_text_'.$row['id_agente_modulo'].'">'.$sub_string.'</span> '."<a href='javascript: toggle_full_value(".$row['id_agente_modulo'].")'>".html_print_image('images/rosette.png', true).'</a></span>';
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
$salida = "<span " .
|
|
|
|
|
"id='hidden_value_module_" . $row['id_agente_modulo'] . "'
|
|
|
|
|
style='display: none;'>" .
|
|
|
|
|
$module_value .
|
|
|
|
|
"</span>" .
|
|
|
|
|
"<span " .
|
|
|
|
|
"id='value_module_" . $row['id_agente_modulo'] . "'
|
|
|
|
|
title='" . $module_value . "' " .
|
|
|
|
|
"style='white-space: nowrap;'>" .
|
|
|
|
|
'<span id="value_module_text_' . $row['id_agente_modulo'] . '">' .
|
|
|
|
|
$sub_string . '</span> ' .
|
|
|
|
|
"<a href='javascript: toggle_full_value(" . $row['id_agente_modulo'] . ")'>" .
|
|
|
|
|
html_print_image('images/rosette.png', true) . '</a></span>';
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (in_array('data', $show_fields) || is_metaconsole())
|
|
|
|
|
$data[9] = $salida;
|
|
|
|
|
|
|
|
|
|
if ($row['module_interval'] > 0) {
|
|
|
|
|
if (in_array('timestamp', $show_fields) || is_metaconsole()) {
|
|
|
|
|
if ($row['module_interval'] > 0)
|
|
|
|
|
$interval = $row['module_interval'];
|
|
|
|
|
} else {
|
|
|
|
|
else
|
|
|
|
|
$interval = $row['agent_interval'];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if ($row['estado'] == 3) {
|
|
|
|
|
$option = [
|
|
|
|
|
'html_attr' => 'class="redb"',
|
|
|
|
|
'style' => 'font-size:7pt;',
|
|
|
|
|
];
|
|
|
|
|
} else {
|
|
|
|
|
$option = ['style' => 'font-size:7pt;'];
|
|
|
|
|
$option = array ('html_attr' => 'class="redb"','style' => 'font-size:7pt;');
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
$option = array ('style' => 'font-size:7pt;');
|
|
|
|
|
}
|
|
|
|
|
$data[10] = ui_print_timestamp ($row['utimestamp'], true, $option);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$data[10] = ui_print_timestamp($row['utimestamp'], true, $option);
|
|
|
|
|
if (in_array('to_critical', $show_fields)) {
|
|
|
|
|
|
|
|
|
|
$change_status_timestamp = db_get_sql ('SELECT utimestamp FROM tevento WHERE id_agentmodule=' . $row['id_agente_modulo'] . ' ORDER BY utimestamp DESC');
|
|
|
|
|
$data[11] = ui_print_timestamp ($change_status_timestamp, true, $option);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
array_push ($table->data, $data);
|
|
|
|
|
}
|
|
|
|
|