Merge remote-tracking branch 'origin/develop' into ent-3295-revision-comportamiento-metaconsola-con-nodo-multi-servidor
|
@ -1,5 +1,5 @@
|
|||
package: pandorafms-agent-unix
|
||||
Version: 7.0NG.735-190603
|
||||
Version: 7.0NG.735-190619
|
||||
Architecture: all
|
||||
Priority: optional
|
||||
Section: admin
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
|
||||
pandora_version="7.0NG.735-190603"
|
||||
pandora_version="7.0NG.735-190619"
|
||||
|
||||
echo "Test if you has the tools for to make the packages."
|
||||
whereis dpkg-deb | cut -d":" -f2 | grep dpkg-deb > /dev/null
|
||||
|
|
|
@ -42,7 +42,7 @@ my $Sem = undef;
|
|||
my $ThreadSem = undef;
|
||||
|
||||
use constant AGENT_VERSION => '7.0NG.735';
|
||||
use constant AGENT_BUILD => '190603';
|
||||
use constant AGENT_BUILD => '190619';
|
||||
|
||||
# Agent log default file size maximum and instances
|
||||
use constant DEFAULT_MAX_LOG_SIZE => 600000;
|
||||
|
@ -3038,10 +3038,10 @@ while (1) {
|
|||
my @address_list;
|
||||
|
||||
if( -x "/bin/ip" || -x "/sbin/ip" || -x "/usr/sbin/ip" ) {
|
||||
@address_list = `ip addr show 2>$DevNull | sed -e '/127.0.0/d' -e '/[0-9]*\\.[0-9]*\\.[0-9]*/!d' -e 's/^[ \\t]*\\([^ \\t]*\\)[ \\t]*\\([^ \\t]*\\)[ \\t].*/\\2/' -e 's/\\/.*//'`;
|
||||
@address_list = `ip addr show 2>$DevNull | sed -e '/127.0.0/d' -e '/\\([0-9][0-9]*\\.\\)\\{3\\}[0-9][0-9]*/!d' -e 's/^[ \\t]*\\([^ \\t]*\\)[ \\t]*\\([^ \\t]*\\)[ \\t].*/\\2/' -e 's/\\/.*//'`;
|
||||
}
|
||||
else {
|
||||
@address_list = `ifconfig -a 2>$DevNull | sed -e '/127.0.0/d' -e '/[0-9]*\\.[0-9]*\\.[0-9]*/!d' -e 's/^[ \\t]*\\([^ \\t]*\\)[ \\t]*\\([^ \\t]*\\)[ \\t].*/\\2/' -e 's/.*://'`;
|
||||
@address_list = `ifconfig -a 2>$DevNull | sed -e '/127.0.0/d' -e '/\\([0-9][0-9]*\\.\\)\\{3\\}[0-9][0-9]*/!d' -e 's/^[ \\t]*\\([^ \\t]*\\)[ \\t]*\\([^ \\t]*\\)[ \\t].*/\\2/' -e 's/.*://'`;
|
||||
}
|
||||
|
||||
for (my $i = 0; $i <= $#address_list; $i++) {
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
#
|
||||
%define name pandorafms_agent_unix
|
||||
%define version 7.0NG.735
|
||||
%define release 190603
|
||||
%define release 190619
|
||||
|
||||
Summary: Pandora FMS Linux agent, PERL version
|
||||
Name: %{name}
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
#
|
||||
%define name pandorafms_agent_unix
|
||||
%define version 7.0NG.735
|
||||
%define release 190603
|
||||
%define release 190619
|
||||
|
||||
Summary: Pandora FMS Linux agent, PERL version
|
||||
Name: %{name}
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
# **********************************************************************
|
||||
|
||||
PI_VERSION="7.0NG.735"
|
||||
PI_BUILD="190603"
|
||||
PI_BUILD="190619"
|
||||
OS_NAME=`uname -s`
|
||||
|
||||
FORCE=0
|
||||
|
|
|
@ -6,17 +6,17 @@
|
|||
#
|
||||
# grep_log Perl script to search log files for a matching pattern. The last
|
||||
# searched position is saved in an index file so that consecutive
|
||||
# runs do not return the same results. The log file inode number is
|
||||
# runs do not return the same results. The log file inode number is
|
||||
# also saved to detect log rotation.
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; version 2 of the License.
|
||||
#
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
###############################################################################
|
||||
use strict;
|
||||
|
@ -30,7 +30,7 @@ my $Output = 'module';
|
|||
my $Verbose = 0;
|
||||
|
||||
# Index file storage directory, with a trailing '/'
|
||||
my $Idx_dir=($^O =~ /win/i)?'.\\':'/tmp/';
|
||||
my $Idx_dir=($^O =~ /win/i)?"$ENV{'TMP'}\\":"/tmp/";
|
||||
|
||||
# Log file
|
||||
my $Log_file = '';
|
||||
|
@ -64,7 +64,7 @@ if ( (defined ($ENV{GREP_LOG_TMP})) && (-d $ENV{GREP_LOG_TMP}) ) {
|
|||
}
|
||||
|
||||
########################################################################################
|
||||
# Erase blank spaces before and after the string
|
||||
# Erase blank spaces before and after the string
|
||||
########################################################################################
|
||||
sub trim($){
|
||||
my $string = shift;
|
||||
|
@ -226,7 +226,7 @@ sub parse_log (;$$) {
|
|||
open(LOGFILE, $Log_file) || error_msg("Error opening file $Log_file: " .
|
||||
$!);
|
||||
|
||||
# Go to starting position.
|
||||
# Go to starting position.
|
||||
seek(LOGFILE, $Idx_pos, 0);
|
||||
|
||||
# Parse log file
|
||||
|
@ -318,7 +318,7 @@ sub print_log ($) {
|
|||
print_summary() if ($summary_flag == 1);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
# Log module
|
||||
if ($Output eq 'log_module') {
|
||||
my $output = "<log_module>\n";
|
||||
|
|
|
@ -186,7 +186,7 @@ UpgradeApplicationID
|
|||
{}
|
||||
|
||||
Version
|
||||
{190603}
|
||||
{190619}
|
||||
|
||||
ViewReadme
|
||||
{Yes}
|
||||
|
|
|
@ -30,7 +30,7 @@ using namespace Pandora;
|
|||
using namespace Pandora_Strutils;
|
||||
|
||||
#define PATH_SIZE _MAX_PATH+1
|
||||
#define PANDORA_VERSION ("7.0NG.735(Build 190603)")
|
||||
#define PANDORA_VERSION ("7.0NG.735(Build 190619)")
|
||||
|
||||
string pandora_path;
|
||||
string pandora_dir;
|
||||
|
|
|
@ -11,7 +11,7 @@ BEGIN
|
|||
VALUE "LegalCopyright", "Artica ST"
|
||||
VALUE "OriginalFilename", "PandoraAgent.exe"
|
||||
VALUE "ProductName", "Pandora FMS Windows Agent"
|
||||
VALUE "ProductVersion", "(7.0NG.735(Build 190603))"
|
||||
VALUE "ProductVersion", "(7.0NG.735(Build 190619))"
|
||||
VALUE "FileVersion", "1.0.0.0"
|
||||
END
|
||||
END
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
package: pandorafms-console
|
||||
Version: 7.0NG.735-190603
|
||||
Version: 7.0NG.735-190619
|
||||
Architecture: all
|
||||
Priority: optional
|
||||
Section: admin
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
|
||||
pandora_version="7.0NG.735-190603"
|
||||
pandora_version="7.0NG.735-190619"
|
||||
|
||||
package_pear=0
|
||||
package_pandora=1
|
||||
|
|
|
@ -1,23 +1,24 @@
|
|||
<?php
|
||||
/**
|
||||
* Pandora FMS - http://pandorafms.com
|
||||
* ==================================================
|
||||
* Copyright (c) 2005-2011 Artica Soluciones Tecnologicas
|
||||
* Please see http://pandorafms.org for full contribution list
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; version 2
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*/
|
||||
|
||||
|
||||
// Pandora FMS - http://pandorafms.com
|
||||
// ==================================================
|
||||
// Copyright (c) 2005-2011 Artica Soluciones Tecnologicas
|
||||
// Please see http://pandorafms.org for full contribution list
|
||||
// This program is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License
|
||||
// as published by the Free Software Foundation; version 2
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
$refr = (int) get_parameter('refresh', 0);
|
||||
// By default 30 seconds
|
||||
function mainAgentsModules()
|
||||
{
|
||||
global $config;
|
||||
|
||||
// Load global vars
|
||||
// Load global vars.
|
||||
include_once 'include/config.php';
|
||||
include_once 'include/functions_reporting.php';
|
||||
include_once $config['homedir'].'/include/functions_agents.php';
|
||||
|
@ -25,7 +26,7 @@ function mainAgentsModules()
|
|||
include_once $config['homedir'].'/include/functions_users.php';
|
||||
|
||||
check_login();
|
||||
// ACL Check
|
||||
// ACL Check.
|
||||
if (! check_acl($config['id_user'], 0, 'AR')) {
|
||||
db_pandora_audit(
|
||||
'ACL Violation',
|
||||
|
@ -37,7 +38,7 @@ function mainAgentsModules()
|
|||
|
||||
// Update network modules for this group
|
||||
// Check for Network FLAG change request
|
||||
// Made it a subquery, much faster on both the database and server side
|
||||
// Made it a subquery, much faster on both the database and server side.
|
||||
if (isset($_GET['update_netgroup'])) {
|
||||
$group = get_parameter_get('update_netgroup', 0);
|
||||
if (check_acl($config['id_user'], $group, 'AW')) {
|
||||
|
@ -62,7 +63,7 @@ function mainAgentsModules()
|
|||
|
||||
$modulegroup = get_parameter('modulegroup', 0);
|
||||
$refr = (int) get_parameter('refresh', 0);
|
||||
// By default 30 seconds
|
||||
// By default 30 seconds.
|
||||
$recursion = get_parameter('recursion', 0);
|
||||
$group_id = (int) get_parameter('group_id', 0);
|
||||
$offset = (int) get_parameter('offset', 0);
|
||||
|
@ -79,7 +80,8 @@ function mainAgentsModules()
|
|||
$full_modules_selected = explode(';', get_parameter('full_modules_selected', 0));
|
||||
$full_agents_id = explode(';', get_parameter('full_agents_id', 0));
|
||||
|
||||
if ($save_serialize && $update_item == '') {
|
||||
// In full screen there is no pagination neither filters.
|
||||
if (( ($config['pure'] == 0 && $save_serialize) && $update_item == '' ) || ( ($config['pure'] == 1 && $save_serialize == 0) && $update_item == '' )) {
|
||||
$unserialize_modules_selected = unserialize_in_temp($config['id_user'].'_agent_module', true, 1);
|
||||
$unserialize_agents_id = unserialize_in_temp($config['id_user'].'_agents', true, 1);
|
||||
if ($unserialize_modules_selected) {
|
||||
|
@ -102,7 +104,6 @@ function mainAgentsModules()
|
|||
serialize_in_temp($agents_id, $config['id_user'].'_agents', 1);
|
||||
}
|
||||
|
||||
// if($agents_id != -1) $agents_id = null;
|
||||
if ($config['pure'] == 0) {
|
||||
if ($modules_selected[0] && $agents_id[0]) {
|
||||
$full_modules = urlencode(implode(';', $modules_selected));
|
||||
|
@ -124,13 +125,13 @@ function mainAgentsModules()
|
|||
}
|
||||
}
|
||||
|
||||
// groups
|
||||
// Groups.
|
||||
$filter_groups_label = '<b>'.__('Group').'</b>';
|
||||
$filter_groups = html_print_select_groups(false, 'AR', true, 'group_id', $group_id, '', '', '', true, false, true, '', false, 'width: auto;');
|
||||
|
||||
$filter_recursion_label = '<b>'.__('Recursion').'</b>';
|
||||
$filter_recursion = html_print_checkbox('recursion', 1, 0, true);
|
||||
// groups module
|
||||
// Groups module.
|
||||
$filter_module_groups_label = '<b>'.__('Module group').'</b>';
|
||||
$filter_module_groups = html_print_select_from_sql(
|
||||
'SELECT * FROM tmodule_group ORDER BY name',
|
||||
|
@ -146,7 +147,7 @@ function mainAgentsModules()
|
|||
'width: auto;'
|
||||
);
|
||||
|
||||
// agent
|
||||
// Agent.
|
||||
$agents = agents_get_group_agents($group_id);
|
||||
if ((empty($agents)) || $agents == -1) {
|
||||
$agents = [];
|
||||
|
@ -155,7 +156,7 @@ function mainAgentsModules()
|
|||
$filter_agents_label = '<b>'.__('Agents').'</b>';
|
||||
$filter_agents = html_print_select($agents, 'id_agents2[]', $agents_id, '', '', 0, true, true, true, '', false, 'min-width: 180px; max-width: 200px;');
|
||||
|
||||
// type show
|
||||
// Type show.
|
||||
$selection = [
|
||||
0 => __('Show common modules'),
|
||||
1 => __('Show all modules'),
|
||||
|
@ -163,12 +164,12 @@ function mainAgentsModules()
|
|||
$filter_type_show_label = '<b>'.__('Show common modules').'</b>';
|
||||
$filter_type_show = html_print_select($selection, 'selection_agent_module', $selection_a_m, '', '', 0, true, false, true, '', false, 'min-width: 180px;');
|
||||
|
||||
// modules
|
||||
// Modules.
|
||||
$all_modules = select_modules_for_agent_group($group_id, $agents_id, $selection_a_m, false);
|
||||
$filter_modules_label = '<b>'.__('Module').'</b>';
|
||||
$filter_modules = html_print_select($all_modules, 'module[]', $modules_selected, '', '', 0, true, true, false, '', false, 'min-width: 180px; max-width: 200px;');
|
||||
|
||||
// update
|
||||
// Update.
|
||||
$filter_update = html_print_submit_button(__('Update item'), 'edit_item', false, 'class="sub upd"', true);
|
||||
|
||||
$onheader = [
|
||||
|
@ -178,8 +179,11 @@ function mainAgentsModules()
|
|||
'combo_groups' => $filter_groups,
|
||||
];
|
||||
|
||||
// Old style table, we need a lot of special formatting,don't use table function
|
||||
// Prepare old-style table
|
||||
/*
|
||||
* Old style table, we need a lot of special formatting,don't use table function.
|
||||
* Prepare old-style table.
|
||||
*/
|
||||
|
||||
if ($config['pure'] == 0) {
|
||||
// Header.
|
||||
ui_print_page_header(
|
||||
|
@ -200,38 +204,51 @@ function mainAgentsModules()
|
|||
$full_modules = urlencode(implode(';', $full_modules_selected));
|
||||
$full_agents = urlencode(implode(';', $full_agents_id));
|
||||
|
||||
$url = " index.php?sec=view&sec2=extensions/agents_modules&pure=0&offset=$offset
|
||||
$url = 'index.php?sec=view&sec2=extensions/agents_modules&pure=0&offset=$offset
|
||||
&group_id=$group_id&modulegroup=$modulegroup&refresh=$refr&full_modules_selected=$full_modules
|
||||
&full_agents_id=$full_agents&selection_agent_module=$selection_a_m";
|
||||
&full_agents_id=$full_agents&selection_agent_module=$selection_a_m';
|
||||
} else {
|
||||
$url = " index.php?sec=view&sec2=extensions/agents_modules&pure=0&offset=$offset&group_id=$group_id&modulegroup=$modulegroup&refresh=$refr";
|
||||
$url = 'index.php?sec=view&sec2=extensions/agents_modules&pure=0&offset=$offset&group_id=$group_id&modulegroup=$modulegroup&refresh=$refr';
|
||||
}
|
||||
|
||||
// Floating menu - Start
|
||||
// Floating menu - Start.
|
||||
echo '<div id="vc-controls" style="z-index: 999">';
|
||||
|
||||
echo '<div id="menu_tab">';
|
||||
echo '<ul class="mn">';
|
||||
|
||||
// Quit fullscreen
|
||||
// Quit fullscreen.
|
||||
echo '<li class="nomn">';
|
||||
echo '<a target="_top" href="'.$url.'">';
|
||||
echo html_print_image('images/normal_screen.png', true, ['title' => __('Back to normal mode')]);
|
||||
echo '</a>';
|
||||
echo '</li>';
|
||||
|
||||
// Countdown
|
||||
// Countdown.
|
||||
echo '<li class="nomn">';
|
||||
echo '<div class="vc-refr">';
|
||||
echo '<div class="vc-countdown"></div>';
|
||||
echo '<div class="vc-countdown style="display: inline;"></div>';
|
||||
echo '<div id="vc-refr-form">';
|
||||
echo __('Refresh').':';
|
||||
echo html_print_select(get_refresh_time_array(), 'refresh', $refr, '', '', 0, true, false, false);
|
||||
echo html_print_select(
|
||||
get_refresh_time_array(),
|
||||
'refresh',
|
||||
$refr,
|
||||
'',
|
||||
'',
|
||||
0,
|
||||
true,
|
||||
false,
|
||||
false,
|
||||
'',
|
||||
false,
|
||||
'margin-top: 3px;'
|
||||
);
|
||||
echo '</div>';
|
||||
echo '</div>';
|
||||
echo '</li>';
|
||||
|
||||
// Console name
|
||||
// Console name.
|
||||
echo '<li class="nomn">';
|
||||
echo '<div class="vc-title">'.__('Agent/module view').'</div>';
|
||||
echo '</li>';
|
||||
|
@ -240,35 +257,35 @@ function mainAgentsModules()
|
|||
echo '</div>';
|
||||
|
||||
echo '</div>';
|
||||
// Floating menu - End
|
||||
// Floating menu - End.
|
||||
ui_require_jquery_file('countdown');
|
||||
}
|
||||
|
||||
if ($config['pure'] != 1) {
|
||||
echo '<form method="post" action="'.ui_get_url_refresh(['offset' => $offset, 'hor_offset' => $offset, 'group_id' => $group_id, 'modulegroup' => $modulegroup]).'">';
|
||||
|
||||
echo '<table class="databox filters" cellpadding="0" cellspacing="0" border="0" style="width:100%;">';
|
||||
echo '<tr>';
|
||||
echo '<td>'.$filter_groups_label.'</td>';
|
||||
echo '<td>'.$filter_groups.' '.$filter_recursion_label.$filter_recursion.'</td>';
|
||||
echo '<td></td>';
|
||||
echo '<td></td>';
|
||||
echo '<td>'.$filter_module_groups_label.'</td>';
|
||||
echo '<td>'.$filter_module_groups.'</td>';
|
||||
echo '</tr>';
|
||||
echo '<tr>';
|
||||
echo '<td>'.$filter_agents_label.'</td>';
|
||||
echo '<td>'.$filter_agents.'</td>';
|
||||
echo '<td>'.$filter_type_show_label.'</td>';
|
||||
echo '<td>'.$filter_type_show.'</td>';
|
||||
echo '<td>'.$filter_modules_label.'</td>';
|
||||
echo '<td>'.$filter_modules.'</td>';
|
||||
echo '</tr>';
|
||||
echo '<tr>';
|
||||
echo "<td colspan=6 ><span style='float: right; padding-right: 20px;'>".$filter_update.'</sapn></td>';
|
||||
echo '</tr>';
|
||||
echo '</table>';
|
||||
echo '</form>';
|
||||
$show_filters = '<form method="post" action="'.ui_get_url_refresh(['offset' => $offset, 'hor_offset' => $offset, 'group_id' => $group_id, 'modulegroup' => $modulegroup]).'" style="width:100%;">';
|
||||
$show_filters .= '<table class="white_table" cellpadding="0" cellspacing="0" border="0" style="width:100%; border:none;">';
|
||||
$show_filters .= '<tr>';
|
||||
$show_filters .= '<td>'.$filter_groups_label.'</td>';
|
||||
$show_filters .= '<td>'.$filter_groups.' '.$filter_recursion_label.$filter_recursion.'</td>';
|
||||
$show_filters .= '<td></td>';
|
||||
$show_filters .= '<td></td>';
|
||||
$show_filters .= '<td>'.$filter_module_groups_label.'</td>';
|
||||
$show_filters .= '<td>'.$filter_module_groups.'</td>';
|
||||
$show_filters .= '</tr>';
|
||||
$show_filters .= '<tr>';
|
||||
$show_filters .= '<td>'.$filter_agents_label.'</td>';
|
||||
$show_filters .= '<td>'.$filter_agents.'</td>';
|
||||
$show_filters .= '<td>'.$filter_type_show_label.'</td>';
|
||||
$show_filters .= '<td>'.$filter_type_show.'</td>';
|
||||
$show_filters .= '<td>'.$filter_modules_label.'</td>';
|
||||
$show_filters .= '<td>'.$filter_modules.'</td>';
|
||||
$show_filters .= '</tr>';
|
||||
$show_filters .= '<tr>';
|
||||
$show_filters .= "<td colspan=6 ><span style='float: right; padding-right: 20px;'>".$filter_update.'</sapn></td>';
|
||||
$show_filters .= '</tr>';
|
||||
$show_filters .= '</table>';
|
||||
$show_filters .= '</form>';
|
||||
ui_toggle($show_filters, __('Filters'));
|
||||
}
|
||||
|
||||
if ($agents_id[0] != -1) {
|
||||
|
@ -291,7 +308,7 @@ function mainAgentsModules()
|
|||
|
||||
$count = 0;
|
||||
foreach ($agents as $agent) {
|
||||
// TODO TAGS agents_get_modules
|
||||
// TODO TAGS agents_get_modules.
|
||||
$module = agents_get_modules(
|
||||
$agent,
|
||||
false,
|
||||
|
@ -339,7 +356,7 @@ function mainAgentsModules()
|
|||
}
|
||||
}
|
||||
} else {
|
||||
// TODO TAGS agents_get_modules
|
||||
// TODO TAGS agents_get_modules.
|
||||
$all_modules = agents_get_modules(
|
||||
$agents,
|
||||
false,
|
||||
|
@ -414,11 +431,11 @@ function mainAgentsModules()
|
|||
|
||||
if ($hor_offset > 0) {
|
||||
$new_hor_offset = ($hor_offset - $block);
|
||||
echo "<th width='20px' "."style='vertical-align:top; padding-top: 35px;' "."rowspan='".($nagents + 1)."'>"."<a href='index.php?".'extension_in_menu=estado&'.'sec=extensions&'.'sec2=extensions/agents_modules&'.'refr=0&'.'save_serialize=1&'.'selection_a_m='.$selection_a_m.'&'.'hor_offset='.$new_hor_offset.'&'.'offset='.$offset."'>".html_print_image(
|
||||
'images/arrow_left.png',
|
||||
echo "<th width='20px' style='vertical-align: middle; text-align: center;' rowspan='".($nagents + 1)."'><a href='index.php?".'extension_in_menu=estado&sec=extensions&sec2=extensions/agents_modules&refr=0&save_serialize=1&selection_a_m='.$selection_a_m.'&hor_offset='.$new_hor_offset.'&offset='.$offset."'>".html_print_image(
|
||||
'images/arrow_left_green.png',
|
||||
true,
|
||||
['title' => __('Previous modules')]
|
||||
).'</a>'.'</th>';
|
||||
).'</a></th>';
|
||||
}
|
||||
|
||||
$nmodules = 0;
|
||||
|
@ -440,11 +457,11 @@ function mainAgentsModules()
|
|||
|
||||
if (($hor_offset + $block) < $nmodules) {
|
||||
$new_hor_offset = ($hor_offset + $block);
|
||||
echo "<th width='20px' "."style='vertical-align:top; padding-top: 35px;' "."rowspan='".($nagents + 1)."'>"."<a href='index.php?".'extension_in_menu=estado&'.'sec=extensions&'.'sec2=extensions/agents_modules&'.'save_serialize=1&'.'selection_a_m='.$selection_a_m.'&'.'hor_offset='.$new_hor_offset.'&'.'offset='.$offset."'>".html_print_image(
|
||||
'images/arrow.png',
|
||||
echo "<th width='20px' style='vertical-align: middle; text-align: center;' rowspan='".($nagents + 1)."'><a href='index.php?".'extension_in_menu=estado&sec=extensions&sec2=extensions/agents_modules&save_serialize=1&selection_a_m='.$selection_a_m.'&hor_offset='.$new_hor_offset.'&offset='.$offset."'>".html_print_image(
|
||||
'images/arrow_right_green.png',
|
||||
true,
|
||||
['title' => __('More modules')]
|
||||
).'</a>'.'</th>';
|
||||
).'</a></th>';
|
||||
}
|
||||
|
||||
echo '</tr>';
|
||||
|
@ -457,12 +474,12 @@ function mainAgentsModules()
|
|||
$filter_agents['id_grupo'] = $group_id;
|
||||
}
|
||||
|
||||
// Prepare pagination
|
||||
$url = 'index.php?extension_in_menu=estado&sec=extensions&sec2=extensions/agents_modules&save_serialize=1&'.'hor_offset='.$hor_offset.'&selection_a_m='.$selection_a_m;
|
||||
// Prepare pagination.
|
||||
$url = 'index.php?extension_in_menu=estado&sec=extensions&sec2=extensions/agents_modules&save_serialize=1&hor_offset='.$hor_offset.'&selection_a_m='.$selection_a_m;
|
||||
ui_pagination($total_pagination, $url);
|
||||
|
||||
foreach ($agents as $agent) {
|
||||
// Get stats for this group
|
||||
// Get stats for this group.
|
||||
$agent_status = agents_get_status($agent['id_agente']);
|
||||
$alias = db_get_row('tagente', 'id_agente', $agent['id_agente']);
|
||||
if (empty($alias['alias'])) {
|
||||
|
@ -471,29 +488,29 @@ function mainAgentsModules()
|
|||
|
||||
switch ($agent_status) {
|
||||
case 4:
|
||||
// Alert fired status
|
||||
// Alert fired status.
|
||||
$rowcolor = 'group_view_alrm';
|
||||
break;
|
||||
|
||||
case 1:
|
||||
// Critical status
|
||||
// Critical status.
|
||||
$rowcolor = 'group_view_crit';
|
||||
break;
|
||||
|
||||
case 2:
|
||||
// Warning status
|
||||
// Warning status.
|
||||
$rowcolor = 'group_view_warn';
|
||||
break;
|
||||
|
||||
case 0:
|
||||
// Normal status
|
||||
// Normal status.
|
||||
$rowcolor = 'group_view_ok';
|
||||
break;
|
||||
|
||||
case 3:
|
||||
case -1:
|
||||
default:
|
||||
// Unknown status
|
||||
// Unknown status.
|
||||
$rowcolor = 'group_view_unk';
|
||||
break;
|
||||
}
|
||||
|
@ -502,7 +519,7 @@ function mainAgentsModules()
|
|||
|
||||
echo "<td class='$rowcolor'>
|
||||
<a class='$rowcolor' href='index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente=".$agent['id_agente']."'>".$alias['alias'].'</a></td>';
|
||||
// TODO TAGS agents_get_modules
|
||||
// TODO TAGS agents_get_modules.
|
||||
$agent_modules = agents_get_modules($agent['id_agente'], false, $filter_module_group, true, true);
|
||||
|
||||
$nmodules = 0;
|
||||
|
@ -572,18 +589,23 @@ function mainAgentsModules()
|
|||
|
||||
echo '</table>';
|
||||
|
||||
echo "<div class='legend_basic' style='width: 96%'>";
|
||||
$show_legend = "<div class='legend_white'>";
|
||||
$show_legend .= "<div style='display: flex;align-items: center;'>
|
||||
<div class='legend_square_simple'><div style='background-color: ".COL_ALERTFIRED.";'></div></div>".__('Orange cell when the module has fired alerts').'</div>';
|
||||
$show_legend .= "<div style='display: flex;align-items: center;'>
|
||||
<div class='legend_square_simple'><div style='background-color: ".COL_CRITICAL.";'></div></div>".__('Red cell when the module has a critical status').'
|
||||
</div>';
|
||||
$show_legend .= "<div style='display: flex;align-items: center;'>
|
||||
<div class='legend_square_simple'><div style='background-color: ".COL_WARNING.";'></div></div>".__('Yellow cell when the module has a warning status').'</div>';
|
||||
$show_legend .= "<div style='display: flex;align-items: center;'>
|
||||
<div class='legend_square_simple'><div style='background-color: ".COL_NORMAL.";'></div></div>".__('Green cell when the module has a normal status').'</div>';
|
||||
$show_legend .= "<div style='display: flex;align-items: center;'>
|
||||
<div class='legend_square_simple'><div style='background-color: ".COL_UNKNOWN.";'></div></div>".__('Grey cell when the module has an unknown status').'</div>';
|
||||
$show_legend .= "<div style='display: flex;align-items: center;'>
|
||||
<div class='legend_square_simple'><div style='background-color: ".COL_NOTINIT.";'></div></div>".__("Cell turns blue when the module is in 'not initialize' status").'</div>';
|
||||
$show_legend .= '</div>';
|
||||
ui_toggle($show_legend, __('Legend'));
|
||||
|
||||
echo '<table>';
|
||||
echo "<tr><td colspan='2' style='padding-bottom: 10px;'><b>".__('Legend').'</b></td></tr>';
|
||||
echo "<tr><td class='legend_square_simple'><div style='background-color: ".COL_ALERTFIRED.";'></div></td><td>".__('Orange cell when the module has fired alerts').'</td></tr>';
|
||||
echo "<tr><td class='legend_square_simple'><div style='background-color: ".COL_CRITICAL.";'></div></td><td>".__('Red cell when the module has a critical status').'</td></tr>';
|
||||
echo "<tr><td class='legend_square_simple'><div style='background-color: ".COL_WARNING.";'></div></td><td>".__('Yellow cell when the module has a warning status').'</td></tr>';
|
||||
echo "<tr><td class='legend_square_simple'><div style='background-color: ".COL_NORMAL.";'></div></td><td>".__('Green cell when the module has a normal status').'</td></tr>';
|
||||
echo "<tr><td class='legend_square_simple'><div style='background-color: ".COL_UNKNOWN.";'></div></td><td>".__('Grey cell when the module has an unknown status').'</td></tr>';
|
||||
echo "<tr><td class='legend_square_simple'><div style='background-color: ".COL_NOTINIT.";'></div></td><td>".__("Cell turns blue when the module is in 'not initialize' status").'</td></tr>';
|
||||
echo '</table>';
|
||||
echo '</div>';
|
||||
$pure_var = $config['pure'];
|
||||
if ($pure_var) {
|
||||
$pure_var = 1;
|
||||
|
@ -627,16 +649,14 @@ $ignored_params['refresh'] = '';
|
|||
$.each($('.th_class_module_r'), function (i, elem) {
|
||||
id = $(elem).attr('id').replace('th_module_r_', '');
|
||||
$("#th_module_r_" + id).height(($("#div_module_r_" + id).width() + 10) + 'px');
|
||||
|
||||
//$("#div_module_r_" + id).css('margin-top', (max_width - $("#div_module_r_" + id).width()) + 'px');
|
||||
$("#div_module_r_" + id).css('margin-top', (max_width - 20) + 'px');
|
||||
$("#div_module_r_" + id).show();
|
||||
});
|
||||
|
||||
var refr =" . $refr . ";
|
||||
var pure =" . $pure_var . ";
|
||||
var href ='" . ui_get_url_refresh ($ignored_params) . "';
|
||||
|
||||
var refr = '<?php echo get_parameter('refresh', 0); ?>';
|
||||
var pure = '<?php echo get_parameter('pure', 0); ?>';
|
||||
var href =' <?php echo ui_get_url_refresh($ignored_params); ?>';
|
||||
|
||||
if (pure) {
|
||||
var startCountDown = function (duration, cb) {
|
||||
$('div.vc-countdown').countdown('destroy');
|
||||
|
@ -646,7 +666,7 @@ $ignored_params['refresh'] = '';
|
|||
$('div.vc-countdown').countdown({
|
||||
until: t,
|
||||
format: 'MS',
|
||||
layout: '(%M%nn%M:%S%nn%S Until refresh)',
|
||||
layout: '(%M%nn%M:%S%nn%S <?php echo __('Until next'); ?>) ',
|
||||
alwaysExpire: true,
|
||||
onExpiry: function () {
|
||||
$('div.vc-countdown').countdown('destroy');
|
||||
|
@ -655,8 +675,11 @@ $ignored_params['refresh'] = '';
|
|||
}
|
||||
});
|
||||
}
|
||||
|
||||
startCountDown(refr, false);
|
||||
|
||||
if(refr>0){
|
||||
startCountDown(refr, false);
|
||||
}
|
||||
|
||||
var controls = document.getElementById('vc-controls');
|
||||
autoHideElement(controls, 1000);
|
||||
|
||||
|
|
|
@ -215,7 +215,7 @@ function extension_db_check_tables_differences(
|
|||
$diff_tables = array_diff($tables_test, $tables_system);
|
||||
|
||||
ui_print_result_message(
|
||||
!empty($diff_tables),
|
||||
empty($diff_tables),
|
||||
__('Success! %s DB contains all tables', get_product_name()),
|
||||
__(
|
||||
'%s DB could not retrieve all tables. The missing tables are (%s)',
|
||||
|
|
|
@ -1,3 +0,0 @@
|
|||
/general/login_identification_wizard.php
|
||||
/general/login_required.php
|
||||
/godmode/update_manager/update_manager.messages.php
|
|
@ -0,0 +1,6 @@
|
|||
START TRANSACTION;
|
||||
|
||||
DELETE FROM `ttipo_modulo` WHERE `nombre` LIKE 'log4x';
|
||||
|
||||
|
||||
COMMIT;
|
|
@ -139,8 +139,9 @@ function get_logs_size($file)
|
|||
function get_status_logs($path)
|
||||
{
|
||||
$status_server_log = '';
|
||||
$size_server_log = get_logs_size($path);
|
||||
if ($size_server_log <= 1048576) {
|
||||
$size_server_log = number_format(get_logs_size($path));
|
||||
$size_server_log = (0 + str_replace(',', '', $size_server_log));
|
||||
if ($size_server_log <= 10485760) {
|
||||
$status_server_log = "<a style ='color: green;text-decoration: none;'>Normal Status</a><a style ='text-decoration: none;'>   You have less than 10 MB of logs</a>";
|
||||
} else {
|
||||
$status_server_log = "<a class= 'content' style= 'color: red;text-decoration: none;'>Warning Status</a><a style ='text-decoration: none;'>   You have more than 10 MB of logs</a>";
|
||||
|
|
|
@ -1989,6 +1989,33 @@ CREATE TABLE IF NOT EXISTS `tnetwork_matrix` (
|
|||
UNIQUE (`source`, `destination`, `utimestamp`)
|
||||
) ENGINE = InnoDB DEFAULT CHARSET=utf8 ;
|
||||
|
||||
-- ---------------------------------------------------------------------
|
||||
-- Table `user_task`
|
||||
-- ---------------------------------------------------------------------
|
||||
CREATE TABLE IF NOT EXISTS `tuser_task` (
|
||||
`id` int(20) unsigned NOT NULL auto_increment,
|
||||
`function_name` varchar(80) NOT NULL default '',
|
||||
`parameters` text NOT NULL default '',
|
||||
`name` varchar(60) NOT NULL default '',
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
|
||||
-- ---------------------------------------------------------------------
|
||||
-- Table `user_task_scheduled`
|
||||
-- ---------------------------------------------------------------------
|
||||
CREATE TABLE IF NOT EXISTS `tuser_task_scheduled` (
|
||||
`id` int(20) unsigned NOT NULL auto_increment,
|
||||
`id_usuario` varchar(60) NOT NULL default '0',
|
||||
`id_user_task` int(20) unsigned NOT NULL default '0',
|
||||
`args` TEXT NOT NULL,
|
||||
`scheduled` enum('no','hourly','daily','weekly','monthly','yearly','custom') default 'no',
|
||||
`last_run` int(20) unsigned default '0',
|
||||
`custom_data` int(10) NULL default '0',
|
||||
`flag_delete` tinyint(1) UNSIGNED NOT NULL default 0,
|
||||
`id_grupo` int(10) unsigned NOT NULL default 0,
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
|
||||
-- -----------------------------------------------------
|
||||
-- Table `tnotification_source`
|
||||
-- -----------------------------------------------------
|
||||
|
|
|
@ -322,7 +322,7 @@ if ($create_modules) {
|
|||
} else if (preg_match('/ifAdminStatus/', $name_array[1])) {
|
||||
$module_type = 2;
|
||||
} else if (preg_match('/ifOperStatus/', $name_array[1])) {
|
||||
$module_type = 18;
|
||||
$module_type = 2;
|
||||
} else {
|
||||
$module_type = 4;
|
||||
}
|
||||
|
@ -608,11 +608,11 @@ ui_require_jquery_file('bgiframe');
|
|||
|
||||
$(document).ready (function () {
|
||||
var inputActive = true;
|
||||
|
||||
|
||||
$(document).data('text_for_module', $("#none_text").html());
|
||||
|
||||
|
||||
$("#id_snmp").change(snmp_changed_by_multiple_snmp);
|
||||
|
||||
|
||||
$("#snmp_version").change(function () {
|
||||
if (this.value == "3") {
|
||||
$("#snmp3_options").css("display", "");
|
||||
|
@ -621,7 +621,7 @@ $(document).ready (function () {
|
|||
$("#snmp3_options").css("display", "none");
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
$("#walk_form").submit(function() {
|
||||
$("#submit-snmp_walk").disable ();
|
||||
$("#oid_loading").show ();
|
||||
|
@ -632,15 +632,15 @@ $(document).ready (function () {
|
|||
|
||||
function snmp_changed_by_multiple_snmp (event, id_snmp, selected) {
|
||||
var idSNMP = Array();
|
||||
|
||||
|
||||
jQuery.each ($("#id_snmp option:selected"), function (i, val) {
|
||||
idSNMP.push($(val).val());
|
||||
});
|
||||
$('#module').attr ('disabled', 1);
|
||||
$('#module').empty ();
|
||||
$('#module').append ($('<option></option>').html ("Loading...").attr ("value", 0));
|
||||
|
||||
jQuery.post ('ajax.php',
|
||||
|
||||
jQuery.post ('ajax.php',
|
||||
{"page" : "godmode/agentes/agent_manager",
|
||||
"get_modules_json_for_multiple_snmp": 1,
|
||||
"id_snmp[]": idSNMP,
|
||||
|
@ -655,7 +655,7 @@ function snmp_changed_by_multiple_snmp (event, id_snmp, selected) {
|
|||
$('#module').fadeIn ('normal');
|
||||
c++;
|
||||
});
|
||||
|
||||
|
||||
if (c == 0) {
|
||||
if (typeof($(document).data('text_for_module')) != 'undefined') {
|
||||
$('#module').append ($('<option></option>').html ($(document).data('text_for_module')).attr("value", 0).prop('selected', true));
|
||||
|
@ -666,11 +666,11 @@ function snmp_changed_by_multiple_snmp (event, id_snmp, selected) {
|
|||
}
|
||||
else {
|
||||
var anyText = $("#any_text").html(); //Trick for catch the translate text.
|
||||
|
||||
|
||||
if (anyText == null) {
|
||||
anyText = 'Any';
|
||||
}
|
||||
|
||||
|
||||
$('#module').append ($('<option></option>').html (anyText).attr ("value", 0).prop('selected', true));
|
||||
}
|
||||
}
|
||||
|
@ -684,4 +684,3 @@ function snmp_changed_by_multiple_snmp (event, id_snmp, selected) {
|
|||
|
||||
/* ]]> */
|
||||
</script>
|
||||
|
||||
|
|
|
@ -118,7 +118,7 @@ if ($enable_agent) {
|
|||
enterprise_include_once('include/functions_agents.php');
|
||||
$values = ['disabled' => 0];
|
||||
enterprise_hook('agent_update_from_cache', [$enable_agent, $values, $server_name]);
|
||||
|
||||
config_agents_update_config_token($enable_agent, 'standby', 0);
|
||||
db_pandora_audit('Agent management', 'Enable '.$alias);
|
||||
} else {
|
||||
db_pandora_audit('Agent management', 'Fail to enable '.$alias);
|
||||
|
@ -140,6 +140,7 @@ if ($disable_agent) {
|
|||
enterprise_include_once('include/functions_agents.php');
|
||||
$values = ['disabled' => 1];
|
||||
enterprise_hook('agent_update_from_cache', [$disable_agent, $values, $server_name]);
|
||||
config_agents_update_config_token($disable_agent, 'standby', 1);
|
||||
|
||||
db_pandora_audit('Agent management', 'Disable '.$alias);
|
||||
} else {
|
||||
|
|
|
@ -83,8 +83,8 @@ $data[3] = html_print_input_password(
|
|||
true,
|
||||
$disabledBecauseInPolicy,
|
||||
false,
|
||||
'',
|
||||
$classdisabledBecauseInPolicy
|
||||
$classdisabledBecauseInPolicy,
|
||||
'new-password'
|
||||
);
|
||||
|
||||
push_table_simple($data, 'user_pass');
|
||||
|
|
|
@ -357,8 +357,8 @@ function addConnectionMap() {
|
|||
for (var index in connectionMaps) {
|
||||
if (isInt(index)) {
|
||||
if (connectionMaps[index] == idConnectionMap) {
|
||||
alert("<?php echo __('The connection'); ?> "' + connectionMapName + '" <?php echo __('just added previously.'); ?>");
|
||||
|
||||
alert("<?php echo __('The connection'); ?> " + connectionMapName + " <?php echo __('just added previously.'); ?>");
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -725,7 +725,6 @@ echo '</form>';
|
|||
}
|
||||
});
|
||||
|
||||
$modulesSelect.change();
|
||||
}
|
||||
|
||||
var processGet = function (params, callback) {
|
||||
|
|
|
@ -221,7 +221,7 @@ switch ($action) {
|
|||
$server_name = $item['server_name'];
|
||||
|
||||
// Metaconsole db connection.
|
||||
if ($meta && $server_name != '') {
|
||||
if ($meta && !empty($server_name)) {
|
||||
$connection = metaconsole_get_connection($server_name);
|
||||
if (metaconsole_load_external_db($connection) != NOERR) {
|
||||
continue;
|
||||
|
@ -547,8 +547,43 @@ switch ($action) {
|
|||
break;
|
||||
|
||||
case 'event_report_agent':
|
||||
case 'event_report_group':
|
||||
$description = $item['description'];
|
||||
$period = $item['period'];
|
||||
$group = $item['id_group'];
|
||||
$recursion = $item['recursion'];
|
||||
$idAgent = $item['id_agent'];
|
||||
$idAgentModule = $item['id_agent_module'];
|
||||
|
||||
|
||||
$show_summary_group = $style['show_summary_group'];
|
||||
$filter_event_severity = json_decode($style['filter_event_severity'], true);
|
||||
$filter_event_status = json_decode($style['filter_event_status'], true);
|
||||
$filter_event_type = json_decode($style['filter_event_type'], true);
|
||||
|
||||
$event_graph_by_user_validator = $style['event_graph_by_user_validator'];
|
||||
$event_graph_by_criticity = $style['event_graph_by_criticity'];
|
||||
$event_graph_validated_vs_unvalidated = $style['event_graph_validated_vs_unvalidated'];
|
||||
$include_extended_events = $item['show_extended_events'];
|
||||
|
||||
$filter_search = $style['event_filter_search'];
|
||||
|
||||
break;
|
||||
|
||||
case 'event_report_group':
|
||||
$description = $item['description'];
|
||||
$period = $item['period'];
|
||||
$group = $item['id_group'];
|
||||
$recursion = $item['recursion'];
|
||||
|
||||
$event_graph_by_agent = $style['event_graph_by_agent'];
|
||||
$event_graph_by_user_validator = $style['event_graph_by_user_validator'];
|
||||
$event_graph_by_criticity = $style['event_graph_by_criticity'];
|
||||
$event_graph_validated_vs_unvalidated = $style['event_graph_validated_vs_unvalidated'];
|
||||
|
||||
$filter_search = $style['event_filter_search'];
|
||||
|
||||
|
||||
|
||||
$include_extended_events = $item['show_extended_events'];
|
||||
break;
|
||||
|
||||
|
@ -2805,7 +2840,7 @@ function print_SLA_list($width, $action, $idItem=null)
|
|||
foreach ($itemsSLA as $item) {
|
||||
$server_name = $item['server_name'];
|
||||
// Metaconsole db connection.
|
||||
if ($meta && $server_name != '') {
|
||||
if ($meta && !empty($server_name)) {
|
||||
$connection = metaconsole_get_connection(
|
||||
$server_name
|
||||
);
|
||||
|
@ -3133,7 +3168,7 @@ function print_General_list($width, $action, $idItem=null, $type='general')
|
|||
foreach ($itemsGeneral as $item) {
|
||||
$server_name = $item['server_name'];
|
||||
// Metaconsole db connection.
|
||||
if ($meta && $server_name != '') {
|
||||
if ($meta && !empty($server_name)) {
|
||||
$connection = metaconsole_get_connection(
|
||||
$server_name
|
||||
);
|
||||
|
@ -3491,6 +3526,7 @@ $(document).ready (function () {
|
|||
|
||||
$("#submit-create_item").click(function () {
|
||||
var type = $('#type').val();
|
||||
var name = $('#text-name').val();
|
||||
switch (type){
|
||||
case 'alert_report_module':
|
||||
case 'alert_report_agent':
|
||||
|
@ -3521,6 +3557,13 @@ $(document).ready (function () {
|
|||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
if($('#text-name').val() == ''){
|
||||
alert( <?php echo "'".__('Please insert a name')."'"; ?> );
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
});
|
||||
|
||||
$("#submit-edit_item").click(function () {
|
||||
|
|
|
@ -45,6 +45,9 @@
|
|||
.parent()
|
||||
.addClass('checkselected');
|
||||
$(".check_delete").prop("checked", true);
|
||||
$('.check_delete').each(function(){
|
||||
$('#hidden-id_report_'+$(this).val()).prop("disabled", false);
|
||||
});
|
||||
}
|
||||
else{
|
||||
$('[id^=checkbox-massive_report_check]')
|
||||
|
@ -1345,6 +1348,8 @@ switch ($action) {
|
|||
$values['description'] = get_parameter('description');
|
||||
$values['type'] = get_parameter('type', null);
|
||||
$values['recursion'] = get_parameter('recursion', null);
|
||||
$values['show_extended_events'] = get_parameter('include_extended_events', null);
|
||||
|
||||
$label = get_parameter('label', '');
|
||||
|
||||
// Add macros name.
|
||||
|
@ -1900,8 +1905,8 @@ switch ($action) {
|
|||
$style['event_graph_by_user_validator'] = $event_graph_by_user_validator;
|
||||
$style['event_graph_by_criticity'] = $event_graph_by_criticity;
|
||||
$style['event_graph_validated_vs_unvalidated'] = $event_graph_validated_vs_unvalidated;
|
||||
|
||||
$style['event_filter_search'] = $event_filter_search;
|
||||
|
||||
if ($label != '') {
|
||||
$style['label'] = $label;
|
||||
} else {
|
||||
|
@ -2007,6 +2012,7 @@ switch ($action) {
|
|||
);
|
||||
$name_it = (string) get_parameter('name');
|
||||
$values['recursion'] = get_parameter('recursion', null);
|
||||
$values['show_extended_events'] = get_parameter('include_extended_events', null);
|
||||
$values['name'] = reporting_label_macro(
|
||||
$items_label,
|
||||
$name_it
|
||||
|
@ -2418,6 +2424,7 @@ switch ($action) {
|
|||
case 'event_report_agent':
|
||||
case 'event_report_group':
|
||||
case 'event_report_module':
|
||||
|
||||
$show_summary_group = get_parameter(
|
||||
'show_summary_group',
|
||||
0
|
||||
|
@ -2473,22 +2480,11 @@ switch ($action) {
|
|||
$style['event_graph_by_user_validator'] = $event_graph_by_user_validator;
|
||||
$style['event_graph_by_criticity'] = $event_graph_by_criticity;
|
||||
$style['event_graph_validated_vs_unvalidated'] = $event_graph_validated_vs_unvalidated;
|
||||
|
||||
|
||||
switch ($values['type']) {
|
||||
case 'event_report_group':
|
||||
case 'event_report_agent':
|
||||
$style['event_filter_search'] = $event_filter_search;
|
||||
if ($label != '') {
|
||||
$style['label'] = $label;
|
||||
} else {
|
||||
$style['label'] = '';
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
// Default.
|
||||
break;
|
||||
$style['event_filter_search'] = $event_filter_search;
|
||||
if ($label != '') {
|
||||
$style['label'] = $label;
|
||||
} else {
|
||||
$style['label'] = '';
|
||||
}
|
||||
break;
|
||||
|
||||
|
|
|
@ -254,7 +254,12 @@ function update_button_palette_callback() {
|
|||
var values = {};
|
||||
|
||||
values = readFields();
|
||||
|
||||
if (values["map_linked"] == 0) {
|
||||
if (values["agent"] == "" || values["agent"] == "none") {
|
||||
dialog_message("#message_alert_no_agent");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
// TODO VALIDATE DATA
|
||||
switch (selectedItem) {
|
||||
case "background":
|
||||
|
@ -1260,6 +1265,7 @@ function create_button_palette_callback() {
|
|||
dialog_message("#message_alert_max_height");
|
||||
validate = false;
|
||||
}
|
||||
|
||||
break;
|
||||
case "group_item":
|
||||
if (values["height"] == "") {
|
||||
|
@ -1323,6 +1329,12 @@ function create_button_palette_callback() {
|
|||
dialog_message("#message_alert_no_image");
|
||||
validate = false;
|
||||
}
|
||||
if (values["map_linked"] == 0) {
|
||||
if (values["agent"] == "" || values["agent"] == "none") {
|
||||
dialog_message("#message_alert_no_agent");
|
||||
validate = false;
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
case "auto_sla_graph":
|
||||
|
|
|
@ -135,7 +135,9 @@ $table->data[9][0] = '<strong>'.__('Licensed to').'</strong>';
|
|||
$table->data[9][1] = html_print_input_text('licensed_to', $license['licensed_to'], '', 64, 255, true, true);
|
||||
|
||||
html_print_table($table);
|
||||
if (enterprise_installed()) {
|
||||
|
||||
// If DESTDIR is defined the enterprise license is expired.
|
||||
if (enterprise_installed() || defined('DESTDIR')) {
|
||||
echo '<div class="action-buttons" style="width: '.$table->width.'">';
|
||||
html_print_input_hidden('update_settings', 1);
|
||||
html_print_submit_button(__('Validate'), 'update_button', false, 'class="sub upd"');
|
||||
|
|
|
@ -659,18 +659,18 @@ class Wizard
|
|||
if ($input['arguments']['inline'] != 'true') {
|
||||
$output .= '<div class="edit_discovery_input">';
|
||||
} else {
|
||||
$output .= '<div style="display: flex; margin-bottom: 25px;">';
|
||||
$output .= '<div style="display: flex; margin-bottom: 25px; flex-wrap: wrap;">';
|
||||
if (!isset($input['extra'])) {
|
||||
$output .= '<div style="width: 50%;">';
|
||||
}
|
||||
|
||||
if (isset($input['extra'])) {
|
||||
$output .= '<div style="width: 50%; display: flex;">';
|
||||
$output .= '<div style="display: flex; margin-right:10px;">';
|
||||
}
|
||||
}
|
||||
|
||||
if ($input['arguments']['inline'] == 'true' && isset($input['extra'])) {
|
||||
$output .= '<div style="width: 50%">';
|
||||
$output .= '<div style="margin-right:10px;">';
|
||||
}
|
||||
|
||||
$output .= '<div class="label_select">';
|
||||
|
@ -690,11 +690,11 @@ class Wizard
|
|||
$output .= $this->printInput($input['arguments']);
|
||||
$output .= '</div>';
|
||||
} else if ($input['arguments']['inline'] == 'true') {
|
||||
$output .= '<div style="width: 50%;">';
|
||||
|
||||
if (isset($input['extra'])) {
|
||||
$output .= '<div style="float: center;">';
|
||||
$output .= '<div style="">';
|
||||
$output .= '<div style="float: left;">';
|
||||
} else {
|
||||
$output .= '<div style="width:50%;">';
|
||||
$output .= '<div style="float: right;">';
|
||||
}
|
||||
|
||||
|
|
After Width: | Height: | Size: 276 B |
After Width: | Height: | Size: 241 B |
After Width: | Height: | Size: 274 B |
After Width: | Height: | Size: 371 B |
After Width: | Height: | Size: 460 B |
After Width: | Height: | Size: 403 B |
After Width: | Height: | Size: 529 B |
After Width: | Height: | Size: 309 B |
After Width: | Height: | Size: 363 B |
After Width: | Height: | Size: 362 B |
After Width: | Height: | Size: 437 B |
After Width: | Height: | Size: 331 B |
After Width: | Height: | Size: 396 B |
After Width: | Height: | Size: 391 B |
After Width: | Height: | Size: 340 B |
After Width: | Height: | Size: 349 B |
After Width: | Height: | Size: 444 B |
After Width: | Height: | Size: 281 B |
After Width: | Height: | Size: 424 B |
After Width: | Height: | Size: 382 B |
After Width: | Height: | Size: 382 B |
After Width: | Height: | Size: 347 B |
After Width: | Height: | Size: 429 B |
After Width: | Height: | Size: 447 B |
After Width: | Height: | Size: 335 B |
After Width: | Height: | Size: 450 B |
|
@ -299,6 +299,7 @@ if (check_login()) {
|
|||
'status' => "<div id='reload_status_agent_".$values['id_tmetaconsole_setup'].'_'.$values['id_tagente']."'>".$image_status.'</div>',
|
||||
'id_agent' => $values['id_tagente'],
|
||||
'id_server' => $values['id_tmetaconsole_setup'],
|
||||
'status_value' => $values['status'],
|
||||
];
|
||||
}
|
||||
|
||||
|
|
|
@ -392,11 +392,16 @@ if (check_login()) {
|
|||
switch ($row['module_type']) {
|
||||
case 15:
|
||||
$value = db_get_value('snmp_oid', 'tagente_modulo', 'id_agente_modulo', $module_id);
|
||||
// System Uptime:
|
||||
// In case of System Uptime module, shows data in format "Days hours minutes seconds" if and only if
|
||||
// selected module unit is "_timeticks_"
|
||||
// Take notice that selected unit may not be postrocess unit
|
||||
if ($value == '.1.3.6.1.2.1.1.3.0' || $value == '.1.3.6.1.2.1.25.1.1.0') {
|
||||
if ($post_process > 0) {
|
||||
$data[] = human_milliseconds_to_string(($row['data'] / $post_process));
|
||||
$data_macro = modules_get_unit_macro($row[$attr[0]], $unit);
|
||||
if ($data_macro) {
|
||||
$data[] = $data_macro;
|
||||
} else {
|
||||
$data[] = human_milliseconds_to_string($row['data']);
|
||||
$data[] = remove_right_zeros(number_format($row[$attr[0]], $config['graph_precision']));
|
||||
}
|
||||
} else {
|
||||
$data[] = remove_right_zeros(number_format($row[$attr[0]], $config['graph_precision']));
|
||||
|
|
|
@ -282,39 +282,42 @@ function process_user_login_remote($login, $pass, $api=false)
|
|||
}
|
||||
}
|
||||
} else if ($config['auth'] === 'ldap') {
|
||||
if ($config['ldap_save_password']) {
|
||||
$update_credentials = change_local_user_pass_ldap($login, $pass);
|
||||
// Check if autocreate remote users is active.
|
||||
if ($config['autocreate_remote_users'] == 1) {
|
||||
if ($config['ldap_save_password']) {
|
||||
$update_credentials = change_local_user_pass_ldap($login, $pass);
|
||||
|
||||
if ($update_credentials) {
|
||||
$config['auth_error'] = __('Your permissions have changed. Please, login again.');
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
delete_user_pass_ldap($login);
|
||||
}
|
||||
|
||||
$permissions = fill_permissions_ldap($sr);
|
||||
if (empty($permissions)) {
|
||||
$config['auth_error'] = __('User not found in database or incorrect password');
|
||||
return false;
|
||||
} else {
|
||||
// check permissions
|
||||
$result = check_permission_ad(
|
||||
$login,
|
||||
$pass,
|
||||
false,
|
||||
$permissions,
|
||||
defined('METACONSOLE')
|
||||
);
|
||||
|
||||
if ($return === 'error_permissions') {
|
||||
$config['auth_error'] = __('Problems with configuration permissions. Please contact with Administrator');
|
||||
return false;
|
||||
} else {
|
||||
if ($return === 'permissions_changed') {
|
||||
if ($update_credentials) {
|
||||
$config['auth_error'] = __('Your permissions have changed. Please, login again.');
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
delete_user_pass_ldap($login);
|
||||
}
|
||||
|
||||
$permissions = fill_permissions_ldap($sr);
|
||||
if (empty($permissions)) {
|
||||
$config['auth_error'] = __('User not found in database or incorrect password');
|
||||
return false;
|
||||
} else {
|
||||
// check permissions
|
||||
$result = check_permission_ad(
|
||||
$login,
|
||||
$pass,
|
||||
false,
|
||||
$permissions,
|
||||
defined('METACONSOLE')
|
||||
);
|
||||
|
||||
if ($return === 'error_permissions') {
|
||||
$config['auth_error'] = __('Problems with configuration permissions. Please contact with Administrator');
|
||||
return false;
|
||||
} else {
|
||||
if ($return === 'permissions_changed') {
|
||||
$config['auth_error'] = __('Your permissions have changed. Please, login again.');
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1337,8 +1340,9 @@ function fill_permissions_ldap($sr)
|
|||
'tags' => implode(',', $ldap_adv_perm['tags']),
|
||||
'no_hierarchy' => (bool) $ldap_adv_perm['no_hierarchy'] ? 1 : 0,
|
||||
];
|
||||
return $permissions;
|
||||
}
|
||||
|
||||
return $permissions;
|
||||
}
|
||||
|
||||
foreach ($result as $perms) {
|
||||
|
@ -1468,7 +1472,10 @@ function local_ldap_search($ldap_host, $ldap_port=389, $ldap_version=3, $dn, $ac
|
|||
$tls = ' -ZZ ';
|
||||
}
|
||||
|
||||
if (stripos($ldap_host, 'ldap') !== false) {
|
||||
if (stripos($ldap_host, 'ldap://') !== false
|
||||
|| stripos($ldap_host, 'ldaps://') !== false
|
||||
|| stripos($ldap_host, 'ldapi://') !== false
|
||||
) {
|
||||
$ldap_host = ' -H '.$ldap_host.':'.$ldap_port;
|
||||
} else {
|
||||
$ldap_host = ' -h '.$ldap_host.' -p '.$ldap_port;
|
||||
|
|
|
@ -72,6 +72,8 @@ class TreeService extends Tree
|
|||
|
||||
protected function getFirstLevel()
|
||||
{
|
||||
global $config;
|
||||
|
||||
$processed_items = $this->getProcessedServices();
|
||||
$ids = array_keys($processed_items);
|
||||
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
/**
|
||||
* Pandora build version and version
|
||||
*/
|
||||
$build_version = 'PC190603';
|
||||
$build_version = 'PC190619';
|
||||
$pandora_version = 'v7.0NG.735';
|
||||
|
||||
// Do not overwrite default timezone set if defined.
|
||||
|
|
|
@ -1392,6 +1392,11 @@ function enterprise_installed()
|
|||
{
|
||||
$return = false;
|
||||
|
||||
// Load enterprise extensions.
|
||||
if (defined('DESTDIR')) {
|
||||
return $return;
|
||||
}
|
||||
|
||||
if (defined('PANDORA_ENTERPRISE')) {
|
||||
if (PANDORA_ENTERPRISE) {
|
||||
$return = true;
|
||||
|
@ -1444,7 +1449,7 @@ function enterprise_include($filename)
|
|||
{
|
||||
global $config;
|
||||
|
||||
// Load enterprise extensions
|
||||
// Load enterprise extensions.
|
||||
if (defined('DESTDIR')) {
|
||||
$destdir = DESTDIR;
|
||||
} else {
|
||||
|
@ -1481,9 +1486,13 @@ function enterprise_include_once($filename)
|
|||
{
|
||||
global $config;
|
||||
|
||||
defined('ENTERPRISE_DIR') || define('ENTERPRISE_DIR', 'enterprise');
|
||||
|
||||
// Load enterprise extensions.
|
||||
if (defined('DESTDIR')) {
|
||||
$destdir = DESTDIR;
|
||||
} else {
|
||||
$destdir = '';
|
||||
}
|
||||
|
||||
$filepath = realpath($config['homedir'].'/'.ENTERPRISE_DIR.'/'.$filename);
|
||||
|
||||
if ($filepath === false) {
|
||||
|
|
|
@ -11519,7 +11519,7 @@ function api_set_create_event($id, $trash1, $other, $returnType)
|
|||
|
||||
if ($other['data'][18] != '') {
|
||||
$values['id_extra'] = $other['data'][18];
|
||||
$sql_validation = 'SELECT id_evento FROM tevento where estado=0 and id_extra ="'.$other['data'][18].'";';
|
||||
$sql_validation = 'SELECT id_evento FROM tevento where estado IN (0,2) and id_extra ="'.$other['data'][18].'";';
|
||||
$validation = db_get_all_rows_sql($sql_validation);
|
||||
if ($validation) {
|
||||
foreach ($validation as $val) {
|
||||
|
|
|
@ -180,7 +180,7 @@ function config_update_config()
|
|||
$error_update[] = __('Automatic check for updates');
|
||||
}
|
||||
|
||||
if (!config_update_value('cert_path', (bool) get_parameter('cert_path'))) {
|
||||
if (!config_update_value('cert_path', get_parameter('cert_path'))) {
|
||||
$error_update[] = __('SSL cert path');
|
||||
}
|
||||
|
||||
|
@ -270,7 +270,7 @@ function config_update_config()
|
|||
$error_update[] = __('Referer security');
|
||||
}
|
||||
|
||||
if (!config_update_value('event_storm_protection', get_parameter('event_storm_protection'))) {
|
||||
if (!config_update_value('event_storm_protection', get_parameter('event_storm_protection', 0))) {
|
||||
$error_update[] = __('Event storm protection');
|
||||
}
|
||||
|
||||
|
@ -2167,9 +2167,9 @@ function config_process_config()
|
|||
if (!isset($config['ad_adv_perms'])) {
|
||||
config_update_value('ad_adv_perms', '');
|
||||
} else {
|
||||
$temp_ad_adv_perms = [];
|
||||
if (!json_decode(io_safe_output($config['ad_adv_perms']))) {
|
||||
$temp_ad_adv_perms = [];
|
||||
if (!isset($config['ad_adv_perms']) && $config['ad_adv_perms'] != '') {
|
||||
if ($config['ad_adv_perms'] != '') {
|
||||
$perms = explode(';', io_safe_output($config['ad_adv_perms']));
|
||||
foreach ($perms as $ad_adv_perm) {
|
||||
if (preg_match('/[\[\]]/', $ad_adv_perm)) {
|
||||
|
@ -2232,22 +2232,26 @@ function config_process_config()
|
|||
if (!empty($new_ad_adv_perms)) {
|
||||
$temp_ad_adv_perms = json_encode($new_ad_adv_perms);
|
||||
}
|
||||
} else {
|
||||
$temp_ad_adv_perms = '';
|
||||
}
|
||||
|
||||
config_update_value('ad_adv_perms', $temp_ad_adv_perms);
|
||||
} else {
|
||||
$temp_ad_adv_perms = $config['ad_adv_perms'];
|
||||
}
|
||||
|
||||
config_update_value('ad_adv_perms', $temp_ad_adv_perms);
|
||||
}
|
||||
|
||||
if (!isset($config['ldap_adv_perms'])) {
|
||||
config_update_value('ldap_adv_perms', '');
|
||||
} else {
|
||||
$temp_ldap_adv_perms = [];
|
||||
if (!json_decode(io_safe_output($config['ldap_adv_perms']))) {
|
||||
$temp_ldap_adv_perms = [];
|
||||
if (!isset($config['ad_adv_perms']) && $config['ldap_adv_perms'] != '') {
|
||||
if ($config['ldap_adv_perms'] != '') {
|
||||
$perms = explode(';', io_safe_output($config['ldap_adv_perms']));
|
||||
foreach ($perms as $ad_adv_perm) {
|
||||
if (preg_match('/[\[\]]/', $ad_adv_perm)) {
|
||||
$all_data = explode(',', io_safe_output($ad_adv_perm));
|
||||
foreach ($perms as $ldap_adv_perm) {
|
||||
if (preg_match('/[\[\]]/', $ldap_adv_perm)) {
|
||||
$all_data = explode(',', io_safe_output($ldap_adv_perm));
|
||||
$profile = $all_data[0];
|
||||
$group_pnd = $all_data[1];
|
||||
$groups_ad = str_replace(['[', ']'], '', $all_data[2]);
|
||||
|
@ -2277,7 +2281,7 @@ function config_process_config()
|
|||
'groups_ldap' => $groups_ldap,
|
||||
];
|
||||
} else {
|
||||
$all_data = explode(',', io_safe_output($ad_adv_perm));
|
||||
$all_data = explode(',', io_safe_output($ldap_adv_perm));
|
||||
$profile = $all_data[0];
|
||||
$group_pnd = $all_data[1];
|
||||
$groups_ad = $all_data[2];
|
||||
|
@ -2306,10 +2310,14 @@ function config_process_config()
|
|||
if (!empty($new_ldap_adv_perms)) {
|
||||
$temp_ldap_adv_perms = json_encode($new_ldap_adv_perms);
|
||||
}
|
||||
} else {
|
||||
$temp_ldap_adv_perms = '';
|
||||
}
|
||||
|
||||
config_update_value('ldap_adv_perms', $temp_ldap_adv_perms);
|
||||
} else {
|
||||
$temp_ldap_adv_perms = $config['ldap_adv_perms'];
|
||||
}
|
||||
|
||||
config_update_value('ldap_adv_perms', $temp_ldap_adv_perms);
|
||||
}
|
||||
|
||||
if (!isset($config['rpandora_server'])) {
|
||||
|
|
|
@ -188,10 +188,16 @@ function get_custom_fields_data($custom_field_name)
|
|||
}
|
||||
|
||||
$array_result = [];
|
||||
if (isset($result_meta) && is_array($result_meta)) {
|
||||
if (isset($result_meta) === true
|
||||
&& is_array($result_meta) === true
|
||||
) {
|
||||
foreach ($result_meta as $result) {
|
||||
foreach ($result as $k => $v) {
|
||||
$array_result[$v['description']] = $v['description'];
|
||||
if (isset($result) === true
|
||||
&& is_array($result) === true
|
||||
) {
|
||||
foreach ($result as $k => $v) {
|
||||
$array_result[$v['description']] = $v['description'];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -385,9 +391,13 @@ function agent_counters_custom_fields($filters)
|
|||
|
||||
// Filter custom data.
|
||||
$custom_data_and = '';
|
||||
if (!in_array(-1, $filters['id_custom_fields_data'])) {
|
||||
$custom_data_array = implode("', '", $filters['id_custom_fields_data']);
|
||||
$custom_data_and = "AND tcd.description IN ('".$custom_data_array."')";
|
||||
if (isset($filters['id_custom_fields_data']) === true
|
||||
&& is_array($filters['id_custom_fields_data']) === true
|
||||
) {
|
||||
if (!in_array(-1, $filters['id_custom_fields_data'])) {
|
||||
$custom_data_array = implode("', '", $filters['id_custom_fields_data']);
|
||||
$custom_data_and = "AND tcd.description IN ('".$custom_data_array."')";
|
||||
}
|
||||
}
|
||||
|
||||
// Filter custom name.
|
||||
|
@ -693,3 +703,123 @@ function print_counters_cfv(
|
|||
$html_result .= '</form>';
|
||||
return $html_result;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Function for export a csv file from Custom Fields View
|
||||
*
|
||||
* @param array $filters Status counters for agents and modules.
|
||||
* @param array $id_status Agent status.
|
||||
* @param array $module_status Module status.
|
||||
*
|
||||
* @return array Returns the data that will be saved in the csv file
|
||||
*/
|
||||
function export_custom_fields_csv($filters, $id_status, $module_status)
|
||||
{
|
||||
$data = agent_counters_custom_fields($filters);
|
||||
$indexed_descriptions = $data['indexed_descriptions'];
|
||||
|
||||
// Table temporary for save array in table
|
||||
// by order and search custom_field data.
|
||||
$table_temporary = 'CREATE TEMPORARY TABLE temp_custom_fields (
|
||||
id_server int(10),
|
||||
id_agent int(10),
|
||||
name_custom_fields varchar(2048),
|
||||
critical_count int,
|
||||
warning_count int,
|
||||
unknown_count int,
|
||||
notinit_count int,
|
||||
normal_count int,
|
||||
total_count int,
|
||||
`status` int(2),
|
||||
KEY `data_index_temp_1` (`id_server`, `id_agent`)
|
||||
)';
|
||||
db_process_sql($table_temporary);
|
||||
|
||||
// Insert values array in table temporary.
|
||||
$values_insert = [];
|
||||
foreach ($indexed_descriptions as $key => $value) {
|
||||
$values_insert[] = '('.$value['id_server'].', '.$value['id_agente'].", '".$value['description']."', '".$value['critical_count']."', '".$value['warning_count']."', '".$value['unknown_count']."', '".$value['notinit_count']."', '".$value['normal_count']."', '".$value['total_count']."', ".$value['status'].')';
|
||||
}
|
||||
|
||||
$values_insert_implode = implode(',', $values_insert);
|
||||
$query_insert = 'INSERT INTO temp_custom_fields VALUES '.$values_insert_implode;
|
||||
db_process_sql($query_insert);
|
||||
|
||||
// Search for status module.
|
||||
$status_agent_search = '';
|
||||
if (isset($id_status) === true && is_array($id_status) === true) {
|
||||
if (in_array(-1, $id_status) === false) {
|
||||
if (in_array(AGENT_MODULE_STATUS_NOT_NORMAL, $id_status) === false) {
|
||||
$status_agent_search = ' AND temp.status IN ('.implode(',', $id_status).')';
|
||||
} else {
|
||||
// Not normal statuses.
|
||||
$status_agent_search = ' AND temp.status IN (1,2,3,4,5)';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Search for status module.
|
||||
$status_module_search = '';
|
||||
if (isset($module_status) === true && is_array($module_status) === true) {
|
||||
if (in_array(-1, $module_status) === false) {
|
||||
if (in_array(AGENT_MODULE_STATUS_NOT_NORMAL, $module_status) === false) {
|
||||
if (count($module_status) > 0) {
|
||||
$status_module_search = ' AND ( ';
|
||||
foreach ($module_status as $key => $value) {
|
||||
$status_module_search .= ($key != 0) ? ' OR (' : ' (';
|
||||
switch ($value) {
|
||||
default:
|
||||
case AGENT_STATUS_NORMAL:
|
||||
$status_module_search .= ' temp.normal_count > 0) ';
|
||||
break;
|
||||
case AGENT_STATUS_CRITICAL:
|
||||
$status_module_search .= ' temp.critical_count > 0) ';
|
||||
break;
|
||||
|
||||
case AGENT_STATUS_WARNING:
|
||||
$status_module_search .= ' temp.warning_count > 0) ';
|
||||
break;
|
||||
|
||||
case AGENT_STATUS_UNKNOWN:
|
||||
$status_module_search .= ' temp.unknown_count > 0) ';
|
||||
break;
|
||||
|
||||
case AGENT_STATUS_NOT_INIT:
|
||||
$status_module_search .= ' temp.notinit_count > 0) ';
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
$status_module_search .= ' ) ';
|
||||
}
|
||||
} else {
|
||||
// Not normal.
|
||||
$status_module_search = ' AND ( temp.critical_count > 0 OR temp.warning_count > 0 OR temp.unknown_count > 0 AND temp.notinit_count > 0 )';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Query all fields result.
|
||||
$query = sprintf(
|
||||
'SELECT
|
||||
temp.name_custom_fields,
|
||||
tma.alias,
|
||||
tma.direccion,
|
||||
tma.server_name,
|
||||
temp.status
|
||||
FROM tmetaconsole_agent tma
|
||||
INNER JOIN temp_custom_fields temp
|
||||
ON temp.id_agent = tma.id_tagente
|
||||
AND temp.id_server = tma.id_tmetaconsole_setup
|
||||
WHERE tma.disabled = 0
|
||||
%s
|
||||
%s
|
||||
',
|
||||
$status_agent_search,
|
||||
$status_module_search
|
||||
);
|
||||
|
||||
$result = db_get_all_rows_sql($query);
|
||||
return $result;
|
||||
}
|
||||
|
|
|
@ -2258,7 +2258,7 @@ function events_get_response_target(
|
|||
global $config;
|
||||
|
||||
// If server_id > 0, it's a metaconsole query.
|
||||
$meta = $server_id > 0;
|
||||
$meta = $server_id > 0 || is_metaconsole();
|
||||
$event_table = events_get_events_table($meta, $history);
|
||||
$event = db_get_row($event_table, 'id_evento', $event_id);
|
||||
|
||||
|
@ -4551,7 +4551,7 @@ function events_list_events_grouped_agents($sql)
|
|||
$sql = sprintf(
|
||||
'SELECT * FROM %s
|
||||
LEFT JOIN tagent_secondary_group
|
||||
ON tagent_secondary_group.id_agent = tevento.id_agente
|
||||
ON tagent_secondary_group.id_agent = id_agente
|
||||
WHERE %s',
|
||||
$table,
|
||||
$sql
|
||||
|
|
|
@ -289,7 +289,7 @@ function grafico_modulo_sparse_data(
|
|||
}
|
||||
}
|
||||
|
||||
if ($array_data === false || (!$params['graph_combined']
|
||||
if ($array_data === false && (!$params['graph_combined']
|
||||
&& !isset($array_data['sum1']['data'][0][1]) && !$params['baseline'])
|
||||
) {
|
||||
return false;
|
||||
|
@ -2235,6 +2235,7 @@ function combined_graph_summatory_average(
|
|||
$data_array_pop[$key_reverse] = array_pop(
|
||||
$data_array_reverse[$key_reverse]
|
||||
);
|
||||
$count_data_array_reverse--;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1233,7 +1233,7 @@ function html_print_extended_select_for_cron($hour='*', $minute='*', $mday='*',
|
|||
*
|
||||
* @return string HTML code if return parameter is true.
|
||||
*/
|
||||
function html_print_input_text_extended($name, $value, $id, $alt, $size, $maxlength, $disabled, $script, $attributes, $return=false, $password=false, $function='')
|
||||
function html_print_input_text_extended($name, $value, $id, $alt, $size, $maxlength, $disabled, $script, $attributes, $return=false, $password=false, $function='', $autocomplete='off')
|
||||
{
|
||||
static $idcounter = 0;
|
||||
|
||||
|
@ -1283,7 +1283,7 @@ function html_print_input_text_extended($name, $value, $id, $alt, $size, $maxlen
|
|||
'autocomplete',
|
||||
];
|
||||
|
||||
$output = '<input '.($password ? 'type="password" autocomplete="off" ' : 'type="text" ');
|
||||
$output = '<input '.($password ? 'type="password" autocomplete="'.$autocomplete.'" ' : 'type="text" ');
|
||||
|
||||
if ($disabled && (!is_array($attributes) || !array_key_exists('disabled', $attributes))) {
|
||||
$output .= 'readonly="readonly" ';
|
||||
|
@ -1435,7 +1435,8 @@ function html_print_input_password(
|
|||
$return=false,
|
||||
$disabled=false,
|
||||
$required=false,
|
||||
$class=''
|
||||
$class='',
|
||||
$autocomplete='off'
|
||||
) {
|
||||
if ($maxlength == 0) {
|
||||
$maxlength = 255;
|
||||
|
@ -1454,7 +1455,7 @@ function html_print_input_password(
|
|||
$attr['class'] = $class;
|
||||
}
|
||||
|
||||
return html_print_input_text_extended($name, $value, 'password-'.$name, $alt, $size, $maxlength, $disabled, '', $attr, $return, true);
|
||||
return html_print_input_text_extended($name, $value, 'password-'.$name, $alt, $size, $maxlength, $disabled, '', $attr, $return, true, '', $autocomplete);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -2230,6 +2230,7 @@ function modules_get_agentmodule_data(
|
|||
'module_name' => $values[$key]['module_name'],
|
||||
'agent_id' => $values[$key]['agent_id'],
|
||||
'agent_name' => $values[$key]['agent_name'],
|
||||
'module_type' => $values[$key]['module_type'],
|
||||
];
|
||||
}
|
||||
|
||||
|
|
|
@ -1383,7 +1383,7 @@ function reporting_event_top_n(
|
|||
foreach ($tops as $key => $row) {
|
||||
// Metaconsole connection.
|
||||
$server_name = $row['server_name'];
|
||||
if (($config['metaconsole'] == 1) && $server_name != '' && defined('METACONSOLE')) {
|
||||
if (($config['metaconsole'] == 1) && $server_name != '' && is_metaconsole()) {
|
||||
$connection = metaconsole_get_connection($server_name);
|
||||
if (metaconsole_load_external_db($connection) != NOERR) {
|
||||
// ui_print_error_message ("Error connecting to ".$server_name);
|
||||
|
@ -1426,7 +1426,7 @@ function reporting_event_top_n(
|
|||
}
|
||||
|
||||
// Restore dbconnection.
|
||||
if (($config['metaconsole'] == 1) && $server_name != '' && defined('METACONSOLE')) {
|
||||
if (($config['metaconsole'] == 1) && $server_name != '' && is_metaconsole()) {
|
||||
metaconsole_restore_db();
|
||||
}
|
||||
}
|
||||
|
@ -2330,7 +2330,7 @@ function reporting_exception(
|
|||
do {
|
||||
// Metaconsole connection.
|
||||
$server_name = $exceptions[$i]['server_name'];
|
||||
if (($config['metaconsole'] == 1) && $server_name != '' && defined('METACONSOLE')) {
|
||||
if (($config['metaconsole'] == 1) && $server_name != '' && is_metaconsole()) {
|
||||
$connection = metaconsole_get_connection($server_name);
|
||||
if (metaconsole_load_external_db($connection) != NOERR) {
|
||||
// ui_print_error_message ("Error connecting to ".$server_name);
|
||||
|
@ -2372,7 +2372,7 @@ function reporting_exception(
|
|||
$i++;
|
||||
|
||||
// Restore dbconnection.
|
||||
if (($config['metaconsole'] == 1) && $server_name != '' && defined('METACONSOLE')) {
|
||||
if (($config['metaconsole'] == 1) && $server_name != '' && is_metaconsole()) {
|
||||
metaconsole_restore_db();
|
||||
}
|
||||
} while ($min === false && $i < count($exceptions));
|
||||
|
@ -2385,7 +2385,7 @@ function reporting_exception(
|
|||
foreach ($exceptions as $exc) {
|
||||
// Metaconsole connection.
|
||||
$server_name = $exc['server_name'];
|
||||
if (($config['metaconsole'] == 1) && $server_name != '' && defined('METACONSOLE')) {
|
||||
if (($config['metaconsole'] == 1) && $server_name != '' && is_metaconsole()) {
|
||||
$connection = metaconsole_get_connection($server_name);
|
||||
if (metaconsole_load_external_db($connection) != NOERR) {
|
||||
// ui_print_error_message ("Error connecting to ".$server_name);
|
||||
|
@ -2499,7 +2499,7 @@ function reporting_exception(
|
|||
}
|
||||
|
||||
// Restore dbconnection
|
||||
if (($config['metaconsole'] == 1) && $server_name != '' && defined('METACONSOLE')) {
|
||||
if (($config['metaconsole'] == 1) && $server_name != '' && is_metaconsole()) {
|
||||
metaconsole_restore_db();
|
||||
}
|
||||
}
|
||||
|
@ -2693,7 +2693,7 @@ function reporting_group_report($report, $content)
|
|||
{
|
||||
global $config;
|
||||
|
||||
$metaconsole_on = ($config['metaconsole'] == 1) && defined('METACONSOLE');
|
||||
$metaconsole_on = ($config['metaconsole'] == 1) && is_metaconsole();
|
||||
|
||||
$return['type'] = 'group_report';
|
||||
|
||||
|
@ -6173,7 +6173,7 @@ function reporting_availability($report, $content, $date=false, $time=false)
|
|||
foreach ($items as $item) {
|
||||
// aaMetaconsole connection
|
||||
$server_name = $item['server_name'];
|
||||
if (($config['metaconsole'] == 1) && $server_name != '' && defined('METACONSOLE')) {
|
||||
if (($config['metaconsole'] == 1) && $server_name != '' && is_metaconsole()) {
|
||||
$connection = metaconsole_get_connection($server_name);
|
||||
if (metaconsole_load_external_db($connection) != NOERR) {
|
||||
// ui_print_error_message ("Error connecting to ".$server_name);
|
||||
|
@ -6185,7 +6185,7 @@ function reporting_availability($report, $content, $date=false, $time=false)
|
|||
|| modules_is_not_init($item['id_agent_module'])
|
||||
) {
|
||||
// Restore dbconnection
|
||||
if (($config['metaconsole'] == 1) && $server_name != '' && defined('METACONSOLE')) {
|
||||
if (($config['metaconsole'] == 1) && $server_name != '' && is_metaconsole()) {
|
||||
metaconsole_restore_db();
|
||||
}
|
||||
|
||||
|
@ -6242,7 +6242,7 @@ function reporting_availability($report, $content, $date=false, $time=false)
|
|||
$text = $row['data']['agent'].' ('.$text.')';
|
||||
|
||||
// Restore dbconnection
|
||||
if (($config['metaconsole'] == 1) && $server_name != '' && defined('METACONSOLE')) {
|
||||
if (($config['metaconsole'] == 1) && $server_name != '' && is_metaconsole()) {
|
||||
metaconsole_restore_db();
|
||||
}
|
||||
|
||||
|
@ -6807,7 +6807,7 @@ function reporting_increment($report, $content)
|
|||
|
||||
$return['data'] = [];
|
||||
|
||||
if (defined('METACONSOLE')) {
|
||||
if (is_metaconsole()) {
|
||||
$sql1 = 'SELECT datos FROM tagente_datos WHERE id_agente_modulo = '.$id_agent_module.'
|
||||
AND utimestamp <= '.(time() - $period).' ORDER BY utimestamp DESC';
|
||||
$sql2 = 'SELECT datos FROM tagente_datos WHERE id_agente_modulo = '.$id_agent_module.' ORDER BY utimestamp DESC';
|
||||
|
@ -6845,7 +6845,7 @@ function reporting_increment($report, $content)
|
|||
$last_data = db_get_value_sql('SELECT datos FROM tagente_datos WHERE id_agente_modulo = '.$id_agent_module.' ORDER BY utimestamp DESC');
|
||||
}
|
||||
|
||||
if (!defined('METACONSOLE')) {
|
||||
if (!is_metaconsole()) {
|
||||
}
|
||||
|
||||
if ($old_data === false || $last_data === false) {
|
||||
|
@ -6934,7 +6934,7 @@ function reporting_general($report, $content)
|
|||
foreach ($generals as $row) {
|
||||
// Metaconsole connection
|
||||
$server_name = $row['server_name'];
|
||||
if (($config['metaconsole'] == 1) && $server_name != '' && defined('METACONSOLE')) {
|
||||
if (($config['metaconsole'] == 1) && $server_name != '' && is_metaconsole()) {
|
||||
$connection = metaconsole_get_connection($server_name);
|
||||
if (metaconsole_load_external_db($connection) != NOERR) {
|
||||
// ui_print_error_message ("Error connecting to ".$server_name);
|
||||
|
@ -7085,7 +7085,7 @@ function reporting_general($report, $content)
|
|||
$i++;
|
||||
|
||||
// Restore dbconnection
|
||||
if (($config['metaconsole'] == 1) && $server_name != '' && defined('METACONSOLE')) {
|
||||
if (($config['metaconsole'] == 1) && $server_name != '' && is_metaconsole()) {
|
||||
metaconsole_restore_db();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -261,138 +261,47 @@ function snmp_browser_get_tree(
|
|||
) {
|
||||
global $config;
|
||||
|
||||
if ($target_ip == '') {
|
||||
return __('Target IP cannot be blank.');
|
||||
}
|
||||
$output = get_snmpwalk(
|
||||
$target_ip,
|
||||
$version,
|
||||
$community,
|
||||
$snmp3_auth_user,
|
||||
$snmp3_security_level,
|
||||
$snmp3_auth_method,
|
||||
$snmp3_auth_pass,
|
||||
$snmp3_privacy_method,
|
||||
$snmp3_privacy_pass,
|
||||
0,
|
||||
$starting_oid,
|
||||
'',
|
||||
$server_to_exec,
|
||||
'',
|
||||
''
|
||||
);
|
||||
|
||||
// Call snmpwalk
|
||||
if (empty($config['snmpwalk'])) {
|
||||
switch (PHP_OS) {
|
||||
case 'FreeBSD':
|
||||
$snmpwalk_bin = '/usr/local/bin/snmpwalk';
|
||||
break;
|
||||
|
||||
case 'NetBSD':
|
||||
$snmpwalk_bin = '/usr/pkg/bin/snmpwalk';
|
||||
break;
|
||||
|
||||
default:
|
||||
$snmpwalk_bin = 'snmpwalk';
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
$snmpwalk_bin = $config['snmpwalk'];
|
||||
}
|
||||
|
||||
switch (PHP_OS) {
|
||||
case 'WIN32':
|
||||
case 'WINNT':
|
||||
case 'Windows':
|
||||
$error_redir_dir = 'NUL';
|
||||
break;
|
||||
|
||||
default:
|
||||
$error_redir_dir = '/dev/null';
|
||||
break;
|
||||
}
|
||||
|
||||
if ($server_to_exec != 0) {
|
||||
$sql = sprintf('SELECT ip_address FROM tserver WHERE id_server = %d', $server_to_exec);
|
||||
$server_data = db_get_row_sql($sql);
|
||||
|
||||
if (enterprise_installed()) {
|
||||
enterprise_include_once('include/functions_satellite.php');
|
||||
|
||||
$oid_tree = ['__LEAVES__' => []];
|
||||
if ($version == '3') {
|
||||
switch ($snmp3_security_level) {
|
||||
case 'authPriv':
|
||||
$command = $snmpwalk_bin.' -m ALL -v 3 -u '.escapeshellarg($snmp3_auth_user).' -A '.escapeshellarg($snmp3_auth_pass).' -l '.escapeshellarg($snmp3_security_level).' -a '.escapeshellarg($snmp3_auth_method).' -x '.escapeshellarg($snmp3_privacy_method).' -X '.escapeshellarg($snmp3_privacy_pass).' '.escapeshellarg($target_ip).' '.escapeshellarg($starting_oid).' 2> '.$error_redir_dir;
|
||||
break;
|
||||
|
||||
case 'authNoPriv':
|
||||
$command = $snmpwalk_bin.' -m ALL -v 3 -u '.escapeshellarg($snmp3_auth_user).' -A '.escapeshellarg($snmp3_auth_pass).' -l '.escapeshellarg($snmp3_security_level).' -a '.escapeshellarg($snmp3_auth_method).' '.escapeshellarg($target_ip).' '.escapeshellarg($starting_oid).' 2> '.$error_redir_dir;
|
||||
break;
|
||||
|
||||
case 'noAuthNoPriv':
|
||||
$command = $snmpwalk_bin.' -m ALL -v 3 -u '.escapeshellarg($snmp3_auth_user).' -l '.escapeshellarg($snmp3_security_level).' '.escapeshellarg($target_ip).' '.escapeshellarg($starting_oid).' 2> '.$error_redir_dir;
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
$command = $snmpwalk_bin.' -m ALL -M +'.escapeshellarg($config['homedir'].'/attachment/mibs').' -Cc -c '.escapeshellarg(io_safe_output($community)).' -v '.escapeshellarg($version).' '.escapeshellarg($target_ip).' '.escapeshellarg($starting_oid).' 2> '.$error_redir_dir;
|
||||
}
|
||||
|
||||
exec('ssh pandora_exec_proxy@'.$server_data['ip_address'].' "'.$command.'"', $output, $rc);
|
||||
} else {
|
||||
$oid_tree = ['__LEAVES__' => []];
|
||||
if ($version == '3') {
|
||||
switch ($snmp3_security_level) {
|
||||
case 'authPriv':
|
||||
exec($snmpwalk_bin.' -m ALL -v 3 -u '.escapeshellarg($snmp3_auth_user).' -A '.escapeshellarg($snmp3_auth_pass).' -l '.escapeshellarg($snmp3_security_level).' -a '.escapeshellarg($snmp3_auth_method).' -x '.escapeshellarg($snmp3_privacy_method).' -X '.escapeshellarg($snmp3_privacy_pass).' '.escapeshellarg($target_ip).' '.escapeshellarg($starting_oid).' 2> '.$error_redir_dir, $output, $rc);
|
||||
break;
|
||||
|
||||
case 'authNoPriv':
|
||||
exec($snmpwalk_bin.' -m ALL -v 3 -u '.escapeshellarg($snmp3_auth_user).' -A '.escapeshellarg($snmp3_auth_pass).' -l '.escapeshellarg($snmp3_security_level).' -a '.escapeshellarg($snmp3_auth_method).' '.escapeshellarg($target_ip).' '.escapeshellarg($starting_oid).' 2> '.$error_redir_dir, $output, $rc);
|
||||
break;
|
||||
|
||||
case 'noAuthNoPriv':
|
||||
exec($snmpwalk_bin.' -m ALL -v 3 -u '.escapeshellarg($snmp3_auth_user).' -l '.escapeshellarg($snmp3_security_level).' '.escapeshellarg($target_ip).' '.escapeshellarg($starting_oid).' 2> '.$error_redir_dir, $output, $rc);
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
exec($snmpwalk_bin.' -m ALL -M +'.escapeshellarg($config['homedir'].'/attachment/mibs').' -Cc -c '.escapeshellarg(io_safe_output($community)).' -v '.escapeshellarg($version).' '.escapeshellarg($target_ip).' '.escapeshellarg($starting_oid).' 2> '.$error_redir_dir, $output, $rc);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$oid_tree = ['__LEAVES__' => []];
|
||||
if ($version == '3') {
|
||||
switch ($snmp3_security_level) {
|
||||
case 'authPriv':
|
||||
exec($snmpwalk_bin.' -m ALL -v 3 -u '.escapeshellarg($snmp3_auth_user).' -A '.escapeshellarg($snmp3_auth_pass).' -l '.escapeshellarg($snmp3_security_level).' -a '.escapeshellarg($snmp3_auth_method).' -x '.escapeshellarg($snmp3_privacy_method).' -X '.escapeshellarg($snmp3_privacy_pass).' '.escapeshellarg($target_ip).' '.escapeshellarg($starting_oid).' 2> '.$error_redir_dir, $output, $rc);
|
||||
break;
|
||||
|
||||
case 'authNoPriv':
|
||||
exec($snmpwalk_bin.' -m ALL -v 3 -u '.escapeshellarg($snmp3_auth_user).' -A '.escapeshellarg($snmp3_auth_pass).' -l '.escapeshellarg($snmp3_security_level).' -a '.escapeshellarg($snmp3_auth_method).' '.escapeshellarg($target_ip).' '.escapeshellarg($starting_oid).' 2> '.$error_redir_dir, $output, $rc);
|
||||
break;
|
||||
|
||||
case 'noAuthNoPriv':
|
||||
exec($snmpwalk_bin.' -m ALL -v 3 -u '.escapeshellarg($snmp3_auth_user).' -l '.escapeshellarg($snmp3_security_level).' '.escapeshellarg($target_ip).' '.escapeshellarg($starting_oid).' 2> '.$error_redir_dir, $output, $rc);
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
exec($snmpwalk_bin.' -m ALL -M +'.escapeshellarg($config['homedir'].'/attachment/mibs').' -Cc -c '.escapeshellarg(io_safe_output($community)).' -v '.escapeshellarg($version).' '.escapeshellarg($target_ip).' '.escapeshellarg($starting_oid).' 2> '.$error_redir_dir, $output, $rc);
|
||||
}
|
||||
}
|
||||
|
||||
foreach ($output as $line) {
|
||||
// Separate the OID from the value
|
||||
$full_oid = explode('=', $line);
|
||||
if (! isset($full_oid[1])) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$oid = trim($full_oid[0]);
|
||||
$value = trim($full_oid[1]);
|
||||
|
||||
// Parse the OID
|
||||
// Build the tree.
|
||||
$oid_tree = ['__LEAVES__' => []];
|
||||
foreach ($output as $oid => $value) {
|
||||
// Parse the OID.
|
||||
$oid_len = strlen($oid);
|
||||
$group = 0;
|
||||
$sub_oid = '';
|
||||
$ptr = &$oid_tree['__LEAVES__'];
|
||||
|
||||
for ($i = 0; $i < strlen($oid); $i++) {
|
||||
for ($i = 0; $i < $oid_len; $i++) {
|
||||
// "X.Y.Z"
|
||||
if ($oid[$i] == '"') {
|
||||
$group = ($group ^ 1);
|
||||
}
|
||||
|
||||
// Move to the next element of the OID
|
||||
// Move to the next element of the OID.
|
||||
if ($group == 0 && ($oid[$i] == '.' || ($oid[$i] == ':' && $oid[($i + 1)] == ':'))) {
|
||||
// Skip the next :
|
||||
// Skip the next ":".
|
||||
if ($oid[$i] == ':') {
|
||||
$i++;
|
||||
}
|
||||
|
||||
// Starting dot
|
||||
// Starting dot.
|
||||
if ($sub_oid == '') {
|
||||
continue;
|
||||
}
|
||||
|
@ -410,7 +319,7 @@ function snmp_browser_get_tree(
|
|||
}
|
||||
}
|
||||
|
||||
// The last element will contain the full OID
|
||||
// The last element will contain the full OID.
|
||||
$ptr[$sub_oid] = [
|
||||
'__OID__' => $oid,
|
||||
'__VALUE__' => $value,
|
||||
|
@ -459,83 +368,27 @@ function snmp_browser_get_oid(
|
|||
return;
|
||||
}
|
||||
|
||||
$output = get_snmpwalk(
|
||||
$target_ip,
|
||||
$version,
|
||||
$community,
|
||||
$snmp3_auth_user,
|
||||
$snmp3_security_level,
|
||||
$snmp3_auth_method,
|
||||
$snmp3_auth_pass,
|
||||
$snmp3_privacy_method,
|
||||
$snmp3_privacy_pass,
|
||||
0,
|
||||
$target_oid,
|
||||
'',
|
||||
$server_to_exec,
|
||||
'',
|
||||
'-On'
|
||||
);
|
||||
|
||||
$oid_data['oid'] = $target_oid;
|
||||
if (empty($config['snmpget'])) {
|
||||
switch (PHP_OS) {
|
||||
case 'FreeBSD':
|
||||
$snmpget_bin = '/usr/local/bin/snmpget';
|
||||
break;
|
||||
|
||||
case 'NetBSD':
|
||||
$snmpget_bin = '/usr/pkg/bin/snmpget';
|
||||
break;
|
||||
|
||||
default:
|
||||
$snmpget_bin = 'snmpget';
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
$snmpget_bin = $config['snmpget'];
|
||||
}
|
||||
|
||||
switch (PHP_OS) {
|
||||
case 'WIN32':
|
||||
case 'WINNT':
|
||||
case 'Windows':
|
||||
$error_redir_dir = 'NUL';
|
||||
break;
|
||||
|
||||
default:
|
||||
$error_redir_dir = '/dev/null';
|
||||
break;
|
||||
}
|
||||
|
||||
if ($server_to_exec != 0) {
|
||||
$sql = sprintf(
|
||||
'SELECT ip_address FROM tserver WHERE id_server = %d',
|
||||
$server_to_exec
|
||||
);
|
||||
$server_data = db_get_row_sql($sql);
|
||||
|
||||
if ($version == '3') {
|
||||
$command = $snmpget_bin.' -m ALL -v 3 -u '.escapeshellarg($snmp3_auth_user).' -A '.escapeshellarg($snmp3_auth_pass).' -l '.escapeshellarg($snmp3_security_level).' -a '.escapeshellarg($snmp3_auth_method).' -x '.escapeshellarg($snmp3_privacy_method).' -X '.escapeshellarg($snmp3_privacy_pass).' '.escapeshellarg($target_ip).' '.escapeshellarg($target_oid).' 2> '.$error_redir_dir;
|
||||
} else {
|
||||
$command = $snmpget_bin.' -m ALL -M +'.escapeshellarg($config['homedir'].'/attachment/mibs').' -On -c '.escapeshellarg(io_safe_output($community)).' -v '.escapeshellarg($version).' '.escapeshellarg($target_ip).' '.escapeshellarg($target_oid).' 2> '.$error_redir_dir;
|
||||
}
|
||||
|
||||
exec(
|
||||
'ssh pandora_exec_proxy@'.$server_data['ip_address'].' "'.$command.'"',
|
||||
$output,
|
||||
$rc
|
||||
);
|
||||
} else {
|
||||
if ($version == '3') {
|
||||
exec(
|
||||
$snmpget_bin.' -m ALL -v 3 -u '.escapeshellarg($snmp3_auth_user).' -A '.escapeshellarg($snmp3_auth_pass).' -l '.escapeshellarg($snmp3_security_level).' -a '.escapeshellarg($snmp3_auth_method).' -x '.escapeshellarg($snmp3_privacy_method).' -X '.escapeshellarg($snmp3_privacy_pass).' '.escapeshellarg($target_ip).' '.escapeshellarg($target_oid).' 2> '.$error_redir_dir,
|
||||
$output,
|
||||
$rc
|
||||
);
|
||||
} else {
|
||||
exec(
|
||||
$snmpget_bin.' -m ALL -M +'.escapeshellarg($config['homedir'].'/attachment/mibs').' -On -c '.escapeshellarg(io_safe_output($community)).' -v '.escapeshellarg($version).' '.escapeshellarg($target_ip).' '.escapeshellarg($target_oid).' 2> '.$error_redir_dir,
|
||||
$output,
|
||||
$rc
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
if ($rc != 0) {
|
||||
return $oid_data;
|
||||
}
|
||||
|
||||
foreach ($output as $line) {
|
||||
// Separate the OID from the value.
|
||||
$full_oid = explode('=', $line);
|
||||
if (! isset($full_oid[1])) {
|
||||
break;
|
||||
}
|
||||
|
||||
$oid = trim($full_oid[0]);
|
||||
foreach ($output as $oid => $value) {
|
||||
$oid = trim($oid);
|
||||
$oid_data['numeric_oid'] = $oid;
|
||||
|
||||
// Translate the OID.
|
||||
|
@ -594,16 +447,19 @@ function snmp_browser_get_oid(
|
|||
$oid_data['description'] = $custom_data['description'];
|
||||
}
|
||||
|
||||
$full_value = explode(':', trim($full_oid[1]));
|
||||
$full_value = explode(':', trim($value));
|
||||
if (! isset($full_value[1])) {
|
||||
$oid_data['value'] = trim($full_oid[1]);
|
||||
$oid_data['value'] = trim($value);
|
||||
} else {
|
||||
$oid_data['type'] = trim($full_value[0]);
|
||||
$oid_data['value'] = trim($full_value[1]);
|
||||
}
|
||||
|
||||
return $oid_data;
|
||||
// There should only be one OID.
|
||||
break;
|
||||
}
|
||||
|
||||
return $oid_data;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -4364,7 +4364,7 @@ function ui_print_agent_autocomplete_input($parameters)
|
|||
function '.$javascript_on_blur_function_name.'() {
|
||||
input_value = $("#'.$input_id.'").val();
|
||||
|
||||
if (input_value.length == 0) {
|
||||
if (input_value.length < 2) {
|
||||
if (('.((int) $print_hidden_input_idagent).')
|
||||
|| ('.((int) $use_hidden_input_idagent).')) {
|
||||
$("#'.$hidden_input_idagent_id.'").val(0);
|
||||
|
@ -4415,7 +4415,7 @@ function ui_print_agent_autocomplete_input($parameters)
|
|||
url: action="'.$javascript_ajax_page.'",
|
||||
dataType: "json",
|
||||
success: function (data) {
|
||||
if (data.length == 0) {
|
||||
if (data.length < 2) {
|
||||
//Set icon
|
||||
$("#'.$input_id.'")
|
||||
.css("background",
|
||||
|
|
|
@ -0,0 +1,45 @@
|
|||
/*!
|
||||
Buttons for DataTables 1.5.6
|
||||
©2016-2019 SpryMedia Ltd - datatables.net/license
|
||||
*/
|
||||
var $jscomp=$jscomp||{};$jscomp.scope={};$jscomp.findInternal=function(d,q,n){d instanceof String&&(d=String(d));for(var l=d.length,u=0;u<l;u++){var p=d[u];if(q.call(n,p,u,d))return{i:u,v:p}}return{i:-1,v:void 0}};$jscomp.ASSUME_ES5=!1;$jscomp.ASSUME_NO_NATIVE_MAP=!1;$jscomp.ASSUME_NO_NATIVE_SET=!1;$jscomp.SIMPLE_FROUND_POLYFILL=!1;
|
||||
$jscomp.defineProperty=$jscomp.ASSUME_ES5||"function"==typeof Object.defineProperties?Object.defineProperty:function(d,q,n){d!=Array.prototype&&d!=Object.prototype&&(d[q]=n.value)};$jscomp.getGlobal=function(d){return"undefined"!=typeof window&&window===d?d:"undefined"!=typeof global&&null!=global?global:d};$jscomp.global=$jscomp.getGlobal(this);
|
||||
$jscomp.polyfill=function(d,q,n,l){if(q){n=$jscomp.global;d=d.split(".");for(l=0;l<d.length-1;l++){var u=d[l];u in n||(n[u]={});n=n[u]}d=d[d.length-1];l=n[d];q=q(l);q!=l&&null!=q&&$jscomp.defineProperty(n,d,{configurable:!0,writable:!0,value:q})}};$jscomp.polyfill("Array.prototype.find",function(d){return d?d:function(d,n){return $jscomp.findInternal(this,d,n).v}},"es6","es3");
|
||||
(function(d){"function"===typeof define&&define.amd?define(["jquery","datatables.net"],function(q){return d(q,window,document)}):"object"===typeof exports?module.exports=function(q,n){q||(q=window);n&&n.fn.dataTable||(n=require("datatables.net")(q,n).$);return d(n,q,q.document)}:d(jQuery,window,document)})(function(d,q,n,l){function u(a){a=new p.Api(a);var b=a.init().buttons||p.defaults.buttons;return(new t(a,b)).container()}var p=d.fn.dataTable,B=0,C=0,r=p.ext.buttons,t=function(a,b){if(!(this instanceof
|
||||
t))return function(b){return(new t(b,a)).container()};"undefined"===typeof b&&(b={});!0===b&&(b={});d.isArray(b)&&(b={buttons:b});this.c=d.extend(!0,{},t.defaults,b);b.buttons&&(this.c.buttons=b.buttons);this.s={dt:new p.Api(a),buttons:[],listenKeys:"",namespace:"dtb"+B++};this.dom={container:d("<"+this.c.dom.container.tag+"/>").addClass(this.c.dom.container.className)};this._constructor()};d.extend(t.prototype,{action:function(a,b){a=this._nodeToButton(a);if(b===l)return a.conf.action;a.conf.action=
|
||||
b;return this},active:function(a,b){var c=this._nodeToButton(a);a=this.c.dom.button.active;c=d(c.node);if(b===l)return c.hasClass(a);c.toggleClass(a,b===l?!0:b);return this},add:function(a,b){var c=this.s.buttons;if("string"===typeof b){b=b.split("-");c=this.s;for(var d=0,f=b.length-1;d<f;d++)c=c.buttons[1*b[d]];c=c.buttons;b=1*b[b.length-1]}this._expandButton(c,a,!1,b);this._draw();return this},container:function(){return this.dom.container},disable:function(a){a=this._nodeToButton(a);d(a.node).addClass(this.c.dom.button.disabled);
|
||||
return this},destroy:function(){d("body").off("keyup."+this.s.namespace);var a=this.s.buttons.slice(),b;var c=0;for(b=a.length;c<b;c++)this.remove(a[c].node);this.dom.container.remove();a=this.s.dt.settings()[0];c=0;for(b=a.length;c<b;c++)if(a.inst===this){a.splice(c,1);break}return this},enable:function(a,b){if(!1===b)return this.disable(a);a=this._nodeToButton(a);d(a.node).removeClass(this.c.dom.button.disabled);return this},name:function(){return this.c.name},node:function(a){if(!a)return this.dom.container;
|
||||
a=this._nodeToButton(a);return d(a.node)},processing:function(a,b){a=this._nodeToButton(a);if(b===l)return d(a.node).hasClass("processing");d(a.node).toggleClass("processing",b);return this},remove:function(a){var b=this._nodeToButton(a),c=this._nodeToHost(a),e=this.s.dt;if(b.buttons.length)for(var f=b.buttons.length-1;0<=f;f--)this.remove(b.buttons[f].node);b.conf.destroy&&b.conf.destroy.call(e.button(a),e,d(a),b.conf);this._removeKey(b.conf);d(b.node).remove();a=d.inArray(b,c);c.splice(a,1);return this},
|
||||
text:function(a,b){var c=this._nodeToButton(a);a=this.c.dom.collection.buttonLiner;a=c.inCollection&&a&&a.tag?a.tag:this.c.dom.buttonLiner.tag;var e=this.s.dt,f=d(c.node),g=function(a){return"function"===typeof a?a(e,f,c.conf):a};if(b===l)return g(c.conf.text);c.conf.text=b;a?f.children(a).html(g(b)):f.html(g(b));return this},_constructor:function(){var a=this,b=this.s.dt,c=b.settings()[0],e=this.c.buttons;c._buttons||(c._buttons=[]);c._buttons.push({inst:this,name:this.c.name});for(var f=0,g=e.length;f<
|
||||
g;f++)this.add(e[f]);b.on("destroy",function(b,d){d===c&&a.destroy()});d("body").on("keyup."+this.s.namespace,function(b){if(!n.activeElement||n.activeElement===n.body){var c=String.fromCharCode(b.keyCode).toLowerCase();-1!==a.s.listenKeys.toLowerCase().indexOf(c)&&a._keypress(c,b)}})},_addKey:function(a){a.key&&(this.s.listenKeys+=d.isPlainObject(a.key)?a.key.key:a.key)},_draw:function(a,b){a||(a=this.dom.container,b=this.s.buttons);a.children().detach();for(var c=0,d=b.length;c<d;c++)a.append(b[c].inserter),
|
||||
a.append(" "),b[c].buttons&&b[c].buttons.length&&this._draw(b[c].collection,b[c].buttons)},_expandButton:function(a,b,c,e){var f=this.s.dt,g=0;b=d.isArray(b)?b:[b];for(var h=0,k=b.length;h<k;h++){var v=this._resolveExtends(b[h]);if(v)if(d.isArray(v))this._expandButton(a,v,c,e);else{var m=this._buildButton(v,c);if(m){e!==l?(a.splice(e,0,m),e++):a.push(m);if(m.conf.buttons){var y=this.c.dom.collection;m.collection=d("<"+y.tag+"/>").addClass(y.className).attr("role","menu");m.conf._collection=m.collection;
|
||||
this._expandButton(m.buttons,m.conf.buttons,!0,e)}v.init&&v.init.call(f.button(m.node),f,d(m.node),v);g++}}}},_buildButton:function(a,b){var c=this.c.dom.button,e=this.c.dom.buttonLiner,f=this.c.dom.collection,g=this.s.dt,h=function(b){return"function"===typeof b?b(g,m,a):b};b&&f.button&&(c=f.button);b&&f.buttonLiner&&(e=f.buttonLiner);if(a.available&&!a.available(g,a))return!1;var k=function(a,b,c,e){e.action.call(b.button(c),a,b,c,e);d(b.table().node()).triggerHandler("buttons-action.dt",[b.button(c),
|
||||
b,c,e])};f=a.tag||c.tag;var v=a.clickBlurs===l?!0:a.clickBlurs,m=d("<"+f+"/>").addClass(c.className).attr("tabindex",this.s.dt.settings()[0].iTabIndex).attr("aria-controls",this.s.dt.table().node().id).on("click.dtb",function(b){b.preventDefault();!m.hasClass(c.disabled)&&a.action&&k(b,g,m,a);v&&m.blur()}).on("keyup.dtb",function(b){13===b.keyCode&&!m.hasClass(c.disabled)&&a.action&&k(b,g,m,a)});"a"===f.toLowerCase()&&m.attr("href","#");"button"===f.toLowerCase()&&m.attr("type","button");e.tag?(f=
|
||||
d("<"+e.tag+"/>").html(h(a.text)).addClass(e.className),"a"===e.tag.toLowerCase()&&f.attr("href","#"),m.append(f)):m.html(h(a.text));!1===a.enabled&&m.addClass(c.disabled);a.className&&m.addClass(a.className);a.titleAttr&&m.attr("title",h(a.titleAttr));a.attr&&m.attr(a.attr);a.namespace||(a.namespace=".dt-button-"+C++);e=(e=this.c.dom.buttonContainer)&&e.tag?d("<"+e.tag+"/>").addClass(e.className).append(m):m;this._addKey(a);this.c.buttonCreated&&(e=this.c.buttonCreated(a,e));return{conf:a,node:m.get(0),
|
||||
inserter:e,buttons:[],inCollection:b,collection:null}},_nodeToButton:function(a,b){b||(b=this.s.buttons);for(var c=0,d=b.length;c<d;c++){if(b[c].node===a)return b[c];if(b[c].buttons.length){var f=this._nodeToButton(a,b[c].buttons);if(f)return f}}},_nodeToHost:function(a,b){b||(b=this.s.buttons);for(var c=0,d=b.length;c<d;c++){if(b[c].node===a)return b;if(b[c].buttons.length){var f=this._nodeToHost(a,b[c].buttons);if(f)return f}}},_keypress:function(a,b){if(!b._buttonsHandled){var c=function(e){for(var f=
|
||||
0,g=e.length;f<g;f++){var h=e[f].conf,k=e[f].node;h.key&&(h.key===a?(b._buttonsHandled=!0,d(k).click()):!d.isPlainObject(h.key)||h.key.key!==a||h.key.shiftKey&&!b.shiftKey||h.key.altKey&&!b.altKey||h.key.ctrlKey&&!b.ctrlKey||h.key.metaKey&&!b.metaKey||(b._buttonsHandled=!0,d(k).click()));e[f].buttons.length&&c(e[f].buttons)}};c(this.s.buttons)}},_removeKey:function(a){if(a.key){var b=d.isPlainObject(a.key)?a.key.key:a.key;a=this.s.listenKeys.split("");b=d.inArray(b,a);a.splice(b,1);this.s.listenKeys=
|
||||
a.join("")}},_resolveExtends:function(a){var b=this.s.dt,c,e=function(c){for(var e=0;!d.isPlainObject(c)&&!d.isArray(c);){if(c===l)return;if("function"===typeof c){if(c=c(b,a),!c)return!1}else if("string"===typeof c){if(!r[c])throw"Unknown button type: "+c;c=r[c]}e++;if(30<e)throw"Buttons: Too many iterations";}return d.isArray(c)?c:d.extend({},c)};for(a=e(a);a&&a.extend;){if(!r[a.extend])throw"Cannot extend unknown button type: "+a.extend;var f=e(r[a.extend]);if(d.isArray(f))return f;if(!f)return!1;
|
||||
var g=f.className;a=d.extend({},f,a);g&&a.className!==g&&(a.className=g+" "+a.className);var h=a.postfixButtons;if(h){a.buttons||(a.buttons=[]);g=0;for(c=h.length;g<c;g++)a.buttons.push(h[g]);a.postfixButtons=null}if(h=a.prefixButtons){a.buttons||(a.buttons=[]);g=0;for(c=h.length;g<c;g++)a.buttons.splice(g,0,h[g]);a.prefixButtons=null}a.extend=f.extend}return a}});t.background=function(a,b,c,e){c===l&&(c=400);e||(e=n.body);a?d("<div/>").addClass(b).css("display","none").insertAfter(e).stop().fadeIn(c):
|
||||
d("div."+b).stop().fadeOut(c,function(){d(this).removeClass(b).remove()})};t.instanceSelector=function(a,b){if(!a)return d.map(b,function(a){return a.inst});var c=[],e=d.map(b,function(a){return a.name}),f=function(a){if(d.isArray(a))for(var g=0,k=a.length;g<k;g++)f(a[g]);else"string"===typeof a?-1!==a.indexOf(",")?f(a.split(",")):(a=d.inArray(d.trim(a),e),-1!==a&&c.push(b[a].inst)):"number"===typeof a&&c.push(b[a].inst)};f(a);return c};t.buttonSelector=function(a,b){for(var c=[],e=function(a,b,c){for(var d,
|
||||
f,g=0,k=b.length;g<k;g++)if(d=b[g])f=c!==l?c+g:g+"",a.push({node:d.node,name:d.conf.name,idx:f}),d.buttons&&e(a,d.buttons,f+"-")},f=function(a,b){var g,h=[];e(h,b.s.buttons);var k=d.map(h,function(a){return a.node});if(d.isArray(a)||a instanceof d)for(k=0,g=a.length;k<g;k++)f(a[k],b);else if(null===a||a===l||"*"===a)for(k=0,g=h.length;k<g;k++)c.push({inst:b,node:h[k].node});else if("number"===typeof a)c.push({inst:b,node:b.s.buttons[a].node});else if("string"===typeof a)if(-1!==a.indexOf(","))for(h=
|
||||
a.split(","),k=0,g=h.length;k<g;k++)f(d.trim(h[k]),b);else if(a.match(/^\d+(\-\d+)*$/))k=d.map(h,function(a){return a.idx}),c.push({inst:b,node:h[d.inArray(a,k)].node});else if(-1!==a.indexOf(":name"))for(a=a.replace(":name",""),k=0,g=h.length;k<g;k++)h[k].name===a&&c.push({inst:b,node:h[k].node});else d(k).filter(a).each(function(){c.push({inst:b,node:this})});else"object"===typeof a&&a.nodeName&&(h=d.inArray(a,k),-1!==h&&c.push({inst:b,node:k[h]}))},g=0,h=a.length;g<h;g++)f(b,a[g]);return c};t.defaults=
|
||||
{buttons:["copy","excel","csv","pdf","print"],name:"main",tabIndex:0,dom:{container:{tag:"div",className:"dt-buttons"},collection:{tag:"div",className:"dt-button-collection"},button:{tag:"ActiveXObject"in q?"a":"button",className:"dt-button",active:"active",disabled:"disabled"},buttonLiner:{tag:"span",className:""}}};t.version="1.5.6";d.extend(r,{collection:{text:function(a){return a.i18n("buttons.collection","Collection")},className:"buttons-collection",init:function(a,b,c){b.attr("aria-expanded",
|
||||
!1)},action:function(a,b,c,e){var f=function(){b.buttons('[aria-haspopup="true"][aria-expanded="true"]').nodes().each(function(){var a=d(this).siblings(".dt-button-collection");a.length&&a.stop().fadeOut(e.fade,function(){a.detach()});d(this).attr("aria-expanded","false")});d("div.dt-button-background").off("click.dtb-collection");t.background(!1,e.backgroundClassName,e.fade,l);d("body").off(".dtb-collection");b.off("buttons-action.b-internal")};a="true"===c.attr("aria-expanded");f();if(!a){var g=
|
||||
d(c).parents("div.dt-button-collection");a=c.position();var h=d(b.table().container()),k=!1,l=c;c.attr("aria-expanded","true");g.length&&(k=d(".dt-button-collection").position(),l=g,d("body").trigger("click.dtb-collection"));l.parents("body")[0]!==n.body&&(l=n.body.lastChild);e._collection.find(".dt-button-collection-title").remove();e._collection.prepend('<div class="dt-button-collection-title">'+e.collectionTitle+"</div>");e._collection.addClass(e.collectionLayout).css("display","none").insertAfter(l).stop().fadeIn(e.fade);
|
||||
g=e._collection.css("position");if(k&&"absolute"===g)e._collection.css({top:k.top,left:k.left});else if("absolute"===g){e._collection.css({top:a.top+c.outerHeight(),left:a.left});k=h.offset().top+h.height();k=a.top+c.outerHeight()+e._collection.outerHeight()-k;g=a.top-e._collection.outerHeight();var m=h.offset().top;(k>m-g||e.dropup)&&e._collection.css("top",a.top-e._collection.outerHeight()-5);e._collection.hasClass(e.rightAlignClassName)&&e._collection.css("left",a.left+c.outerWidth()-e._collection.outerWidth());
|
||||
k=a.left+e._collection.outerWidth();h=h.offset().left+h.width();k>h&&e._collection.css("left",a.left-(k-h));c=c.offset().left+e._collection.outerWidth();c>d(q).width()&&e._collection.css("left",a.left-(c-d(q).width()))}else c=e._collection.height()/2,c>d(q).height()/2&&(c=d(q).height()/2),e._collection.css("marginTop",-1*c);e.background&&t.background(!0,e.backgroundClassName,e.fade,l);setTimeout(function(){d("div.dt-button-background").on("click.dtb-collection",function(){});d("body").on("click.dtb-collection",
|
||||
function(a){var b=d.fn.addBack?"addBack":"andSelf";d(a.target).parents()[b]().filter(e._collection).length||f()}).on("keyup.dtb-collection",function(a){27===a.keyCode&&f()});if(e.autoClose)b.on("buttons-action.b-internal",function(){f()})},10)}},background:!0,collectionLayout:"",collectionTitle:"",backgroundClassName:"dt-button-background",rightAlignClassName:"dt-button-right",autoClose:!1,fade:400,attr:{"aria-haspopup":!0}},copy:function(a,b){if(r.copyHtml5)return"copyHtml5";if(r.copyFlash&&r.copyFlash.available(a,
|
||||
b))return"copyFlash"},csv:function(a,b){if(r.csvHtml5&&r.csvHtml5.available(a,b))return"csvHtml5";if(r.csvFlash&&r.csvFlash.available(a,b))return"csvFlash"},excel:function(a,b){if(r.excelHtml5&&r.excelHtml5.available(a,b))return"excelHtml5";if(r.excelFlash&&r.excelFlash.available(a,b))return"excelFlash"},pdf:function(a,b){if(r.pdfHtml5&&r.pdfHtml5.available(a,b))return"pdfHtml5";if(r.pdfFlash&&r.pdfFlash.available(a,b))return"pdfFlash"},pageLength:function(a){a=a.settings()[0].aLengthMenu;var b=d.isArray(a[0])?
|
||||
a[0]:a,c=d.isArray(a[0])?a[1]:a;return{extend:"collection",text:function(a){return a.i18n("buttons.pageLength",{"-1":"Show all rows",_:"Show %d rows"},a.page.len())},className:"buttons-page-length",autoClose:!0,buttons:d.map(b,function(a,b){return{text:c[b],className:"button-page-length",action:function(b,c){c.page.len(a).draw()},init:function(b,c,d){var e=this;c=function(){e.active(b.page.len()===a)};b.on("length.dt"+d.namespace,c);c()},destroy:function(a,b,c){a.off("length.dt"+c.namespace)}}}),
|
||||
init:function(a,b,c){var d=this;a.on("length.dt"+c.namespace,function(){d.text(c.text)})},destroy:function(a,b,c){a.off("length.dt"+c.namespace)}}}});p.Api.register("buttons()",function(a,b){b===l&&(b=a,a=l);this.selector.buttonGroup=a;var c=this.iterator(!0,"table",function(c){if(c._buttons)return t.buttonSelector(t.instanceSelector(a,c._buttons),b)},!0);c._groupSelector=a;return c});p.Api.register("button()",function(a,b){a=this.buttons(a,b);1<a.length&&a.splice(1,a.length);return a});p.Api.registerPlural("buttons().active()",
|
||||
"button().active()",function(a){return a===l?this.map(function(a){return a.inst.active(a.node)}):this.each(function(b){b.inst.active(b.node,a)})});p.Api.registerPlural("buttons().action()","button().action()",function(a){return a===l?this.map(function(a){return a.inst.action(a.node)}):this.each(function(b){b.inst.action(b.node,a)})});p.Api.register(["buttons().enable()","button().enable()"],function(a){return this.each(function(b){b.inst.enable(b.node,a)})});p.Api.register(["buttons().disable()",
|
||||
"button().disable()"],function(){return this.each(function(a){a.inst.disable(a.node)})});p.Api.registerPlural("buttons().nodes()","button().node()",function(){var a=d();d(this.each(function(b){a=a.add(b.inst.node(b.node))}));return a});p.Api.registerPlural("buttons().processing()","button().processing()",function(a){return a===l?this.map(function(a){return a.inst.processing(a.node)}):this.each(function(b){b.inst.processing(b.node,a)})});p.Api.registerPlural("buttons().text()","button().text()",function(a){return a===
|
||||
l?this.map(function(a){return a.inst.text(a.node)}):this.each(function(b){b.inst.text(b.node,a)})});p.Api.registerPlural("buttons().trigger()","button().trigger()",function(){return this.each(function(a){a.inst.node(a.node).trigger("click")})});p.Api.registerPlural("buttons().containers()","buttons().container()",function(){var a=d(),b=this._groupSelector;this.iterator(!0,"table",function(c){if(c._buttons){c=t.instanceSelector(b,c._buttons);for(var d=0,f=c.length;d<f;d++)a=a.add(c[d].container())}});
|
||||
return a});p.Api.register("button().add()",function(a,b){var c=this.context;c.length&&(c=t.instanceSelector(this._groupSelector,c[0]._buttons),c.length&&c[0].add(b,a));return this.button(this._groupSelector,a)});p.Api.register("buttons().destroy()",function(){this.pluck("inst").unique().each(function(a){a.destroy()});return this});p.Api.registerPlural("buttons().remove()","buttons().remove()",function(){this.each(function(a){a.inst.remove(a.node)});return this});var w;p.Api.register("buttons.info()",
|
||||
function(a,b,c){var e=this;if(!1===a)return d("#datatables_buttons_info").fadeOut(function(){d(this).remove()}),clearTimeout(w),w=null,this;w&&clearTimeout(w);d("#datatables_buttons_info").length&&d("#datatables_buttons_info").remove();a=a?"<h2>"+a+"</h2>":"";d('<div id="datatables_buttons_info" class="dt-button-info"/>').html(a).append(d("<div/>")["string"===typeof b?"html":"append"](b)).css("display","none").appendTo("body").fadeIn();c!==l&&0!==c&&(w=setTimeout(function(){e.buttons.info(!1)},c));
|
||||
return this});p.Api.register("buttons.exportData()",function(a){if(this.context.length)return D(new p.Api(this.context[0]),a)});p.Api.register("buttons.exportInfo()",function(a){a||(a={});var b=a;var c="*"===b.filename&&"*"!==b.title&&b.title!==l&&null!==b.title&&""!==b.title?b.title:b.filename;"function"===typeof c&&(c=c());c===l||null===c?c=null:(-1!==c.indexOf("*")&&(c=d.trim(c.replace("*",d("head > title").text()))),c=c.replace(/[^a-zA-Z0-9_\u00A1-\uFFFF\.,\-_ !\(\)]/g,""),(b=x(b.extension))||
|
||||
(b=""),c+=b);b=x(a.title);b=null===b?null:-1!==b.indexOf("*")?b.replace("*",d("head > title").text()||"Exported data"):b;return{filename:c,title:b,messageTop:z(this,a.message||a.messageTop,"top"),messageBottom:z(this,a.messageBottom,"bottom")}});var x=function(a){return null===a||a===l?null:"function"===typeof a?a():a},z=function(a,b,c){b=x(b);if(null===b)return null;a=d("caption",a.table().container()).eq(0);return"*"===b?a.css("caption-side")!==c?null:a.length?a.text():"":b},A=d("<textarea/>")[0],
|
||||
D=function(a,b){var c=d.extend(!0,{},{rows:null,columns:"",modifier:{search:"applied",order:"applied"},orthogonal:"display",stripHtml:!0,stripNewlines:!0,decodeEntities:!0,trim:!0,format:{header:function(a){return e(a)},footer:function(a){return e(a)},body:function(a){return e(a)}},customizeData:null},b),e=function(a){if("string"!==typeof a)return a;a=a.replace(/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,"");a=a.replace(/<!\-\-.*?\-\->/g,"");c.stripHtml&&(a=a.replace(/<[^>]*>/g,""));c.trim&&
|
||||
(a=a.replace(/^\s+|\s+$/g,""));c.stripNewlines&&(a=a.replace(/\n/g," "));c.decodeEntities&&(A.innerHTML=a,a=A.value);return a};b=a.columns(c.columns).indexes().map(function(b){var d=a.column(b).header();return c.format.header(d.innerHTML,b,d)}).toArray();var f=a.table().footer()?a.columns(c.columns).indexes().map(function(b){var d=a.column(b).footer();return c.format.footer(d?d.innerHTML:"",b,d)}).toArray():null,g=d.extend({},c.modifier);a.select&&"function"===typeof a.select.info&&g.selected===l&&
|
||||
a.rows(c.rows,d.extend({selected:!0},g)).any()&&d.extend(g,{selected:!0});g=a.rows(c.rows,g).indexes().toArray();var h=a.cells(g,c.columns);g=h.render(c.orthogonal).toArray();h=h.nodes().toArray();for(var k=b.length,p=[],m=0,n=0,q=0<k?g.length/k:0;n<q;n++){for(var t=[k],r=0;r<k;r++)t[r]=c.format.body(g[m],n,r,h[m]),m++;p[n]=t}b={header:b,footer:f,body:p};c.customizeData&&c.customizeData(b);return b};d.fn.dataTable.Buttons=t;d.fn.DataTable.Buttons=t;d(n).on("init.dt plugin-init.dt",function(a,b){"dt"===
|
||||
a.namespace&&(a=b.oInit.buttons||p.defaults.buttons)&&!b._buttons&&(new t(b,a)).container()});p.ext.feature.push({fnInit:u,cFeature:"B"});p.ext.features&&p.ext.features.register("buttons",u);return t});
|
|
@ -67,6 +67,13 @@ function createVisualConsole(
|
|||
? JSON.parse(data.items)
|
||||
: data.items;
|
||||
|
||||
// Add the datetime when the item was received.
|
||||
var receivedAt = new Date();
|
||||
items.map(function(item) {
|
||||
item["receivedAt"] = receivedAt;
|
||||
return item;
|
||||
});
|
||||
|
||||
var prevProps = visualConsole.props;
|
||||
// Update the data structure.
|
||||
visualConsole.props = props;
|
||||
|
|
|
@ -624,7 +624,10 @@ var TreeController = {
|
|||
'images/tree_service_map.png" /> '
|
||||
);
|
||||
|
||||
if (typeof element.serviceDetail != "undefined") {
|
||||
if (
|
||||
typeof element.serviceDetail != "undefined" &&
|
||||
element.name != null
|
||||
) {
|
||||
$serviceDetailImage
|
||||
.click(function(e) {
|
||||
e.preventDefault();
|
||||
|
@ -634,10 +637,11 @@ var TreeController = {
|
|||
.css("cursor", "pointer");
|
||||
|
||||
$content.append($serviceDetailImage);
|
||||
$content.append(" " + element.name);
|
||||
} else {
|
||||
$content.remove($node);
|
||||
}
|
||||
|
||||
$content.append(" " + element.name);
|
||||
|
||||
break;
|
||||
case "modules":
|
||||
if (
|
||||
|
|
|
@ -319,7 +319,7 @@ final class Container extends Model
|
|||
// Default filter.
|
||||
$filter = ['id_layout' => $layoutId];
|
||||
$fields = [
|
||||
'id',
|
||||
'DISTINCT(id) AS id',
|
||||
'type',
|
||||
'cache_expiration',
|
||||
'id_layout',
|
||||
|
@ -340,8 +340,9 @@ final class Container extends Model
|
|||
// Only true condition if type is GROUP_ITEM.
|
||||
$filter[] = '('.\db_format_array_where_clause_sql(
|
||||
[
|
||||
'type' => GROUP_ITEM,
|
||||
'id_group' => $groupsFilter,
|
||||
'id_layout' => $layoutId,
|
||||
'type' => GROUP_ITEM,
|
||||
'id_group' => $groupsFilter,
|
||||
]
|
||||
).')';
|
||||
}
|
||||
|
|
|
@ -207,11 +207,7 @@ final class ModuleGraph extends Item
|
|||
|
||||
// Custom graph.
|
||||
if (empty($customGraphId) === false) {
|
||||
$customGraph = \db_get_row_filter(
|
||||
'tgraph',
|
||||
'id_graph',
|
||||
$customGraphId
|
||||
);
|
||||
$customGraph = \db_get_row('tgraph', 'id_graph', $customGraphId);
|
||||
|
||||
$params = [
|
||||
'period' => $period,
|
||||
|
|
|
@ -813,6 +813,15 @@ input.datos {
|
|||
* - VISUAL MAPS -
|
||||
* ---------------------------------------------------------------------
|
||||
*/
|
||||
.visual-console-edit-controls {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
}
|
||||
|
||||
.visual-console-edit-controls > span {
|
||||
margin: 4px;
|
||||
}
|
||||
|
||||
input.vs_button_ghost {
|
||||
background-color: transparent !important;
|
||||
border: 1px solid #82b92e;
|
||||
|
@ -3099,6 +3108,15 @@ div.nodata_container {
|
|||
border-radius: 3px;
|
||||
}
|
||||
|
||||
.legend_white {
|
||||
width: 100%;
|
||||
background-color: #fff;
|
||||
padding: 20px 50px;
|
||||
display: grid;
|
||||
grid-gap: 12px;
|
||||
grid-template-columns: repeat(3, 1fr);
|
||||
}
|
||||
|
||||
.legend_basic {
|
||||
background: #f4f4f4;
|
||||
margin-top: 10px;
|
||||
|
@ -3107,12 +3125,13 @@ div.nodata_container {
|
|||
}
|
||||
|
||||
.agents_modules_table th {
|
||||
background: #3f3f3f;
|
||||
border: 1px solid #e2e2e2;
|
||||
background-color: #fff !important;
|
||||
border-right: 1px solid #e2e2e2;
|
||||
color: #000;
|
||||
}
|
||||
|
||||
.agents_modules_table th * {
|
||||
color: #ffffff;
|
||||
color: #000;
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -3416,9 +3435,12 @@ div.div_groups_status {
|
|||
.agents_modules_table {
|
||||
border: 1px solid #e2e2e2;
|
||||
border-spacing: 0px;
|
||||
margin-bottom: 30px;
|
||||
background-color: #fff;
|
||||
}
|
||||
.agents_modules_table td {
|
||||
border: 1px solid #e2e2e2;
|
||||
border-right: 1px solid #e2e2e2;
|
||||
border-top: 1px solid #e2e2e2;
|
||||
}
|
||||
|
||||
.databox.filters,
|
||||
|
@ -6096,3 +6118,30 @@ div#status_pie {
|
|||
.white_table_no_border {
|
||||
border: none !important;
|
||||
}
|
||||
|
||||
/*
|
||||
* ---------------------------------------------------------------------
|
||||
* - SERVICES TABLE VIEW
|
||||
* ---------------------------------------------------------------------
|
||||
*/
|
||||
#table_services {
|
||||
display: grid;
|
||||
grid-gap: 20px;
|
||||
grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
|
||||
grid-template-rows: 1fr;
|
||||
margin-bottom: 30px;
|
||||
}
|
||||
|
||||
.table_services_item_link {
|
||||
font-size: 16px;
|
||||
display: grid;
|
||||
min-height: 80px;
|
||||
box-sizing: border-box;
|
||||
padding: 10px 10px 10px 0;
|
||||
}
|
||||
|
||||
.table_services_item {
|
||||
display: grid;
|
||||
align-items: center;
|
||||
grid-template-columns: 50px auto;
|
||||
}
|
||||
|
|
|
@ -25,6 +25,12 @@
|
|||
user-select: text;
|
||||
}
|
||||
|
||||
.visual-console-item.is-editing {
|
||||
border: 2px dashed #33ccff;
|
||||
-webkit-transform: translateX(-2px) translateY(-2px);
|
||||
transform: translateX(-2px) translateY(-2px);
|
||||
}
|
||||
|
||||
@font-face {
|
||||
font-family: Alarm Clock;
|
||||
src: url(alarm-clock.ttf);
|
||||
|
|
|
@ -1 +1 @@
|
|||
{"version":3,"sources":["webpack:///main.css","webpack:///styles.css"],"names":[],"mappings":"AAAA;EACE,gBAAgB;EAChB,kBAAkB;EAClB,4BAA4B;EAC5B,0BAA0B;EAC1B,2BAA2B;AAC7B;;AAEA;EACE,kBAAkB;EAClB,oBAAa;EAAb,oBAAa;EAAb,aAAa;EACb,2BAAuB;EAAvB,8BAAuB;MAAvB,2BAAuB;UAAvB,uBAAuB;EACvB,qBAAqB;EACrB,yBAAmB;MAAnB,sBAAmB;UAAnB,mBAAmB;EACnB,yBAAiB;KAAjB,sBAAiB;MAAjB,qBAAiB;UAAjB,iBAAiB;AACnB;;ACfA;EACE,wBAAwB;EACxB,0BAA2B;AAC7B;;AAEA,kBAAkB;;AAElB;EACE,oBAAa;EAAb,oBAAa;EAAb,aAAa;EACb,4BAAsB;EAAtB,6BAAsB;MAAtB,0BAAsB;UAAtB,sBAAsB;EACtB,wBAAuB;MAAvB,qBAAuB;UAAvB,uBAAuB;EACvB,qBAAqB;EACrB,0BAAqB;MAArB,qBAAqB;EACrB,yBAAmB;MAAnB,sBAAmB;UAAnB,mBAAmB;AACrB;;AAEA;EACE,6DAA6D;EAC7D,eAAe;;EAEf,0BAA0B;EAC1B,mCAAmC;EACnC,kCAAkC;EAClC,kCAAkC;EAClC,wCAAwC;AAC1C;;AAEA;EACE,eAAe;AACjB;;AAEA;EACE,eAAe;AACjB;;AAEA,iBAAiB;;AAEjB;EACE,kBAAkB;AACpB;;AAEA;EACE,qDAA6C;UAA7C,6CAA6C;AAC/C;;AAEA;EACE,sDAA8C;UAA9C,8CAA8C;AAChD;;AAEA;EACE,oDAA4C;UAA5C,4CAA4C;AAC9C","file":"vc.main.css","sourcesContent":["#visual-console-container {\n margin: 0px auto;\n position: relative;\n background-repeat: no-repeat;\n background-size: 100% 100%;\n background-position: center;\n}\n\n.visual-console-item {\n position: absolute;\n display: flex;\n flex-direction: initial;\n justify-items: center;\n align-items: center;\n user-select: text;\n}\n","@font-face {\n font-family: Alarm Clock;\n src: url(./alarm-clock.ttf);\n}\n\n/* Digital clock */\n\n.visual-console-item .digital-clock {\n display: flex;\n flex-direction: column;\n justify-content: center;\n justify-items: center;\n align-content: center;\n align-items: center;\n}\n\n.visual-console-item .digital-clock > span {\n font-family: \"Alarm Clock\", \"Courier New\", Courier, monospace;\n font-size: 50px;\n\n /* To improve legibility */\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n text-rendering: optimizeLegibility;\n text-shadow: rgba(0, 0, 0, 0.01) 0 0 1px;\n}\n\n.visual-console-item .digital-clock > span.date {\n font-size: 25px;\n}\n\n.visual-console-item .digital-clock > span.timezone {\n font-size: 25px;\n}\n\n/* Analog clock */\n\n.visual-console-item .analogic-clock {\n text-align: center;\n}\n\n.visual-console-item .analogic-clock .hour-hand {\n animation: rotate-hour 43200s infinite linear;\n}\n\n.visual-console-item .analogic-clock .minute-hand {\n animation: rotate-minute 3600s infinite linear;\n}\n\n.visual-console-item .analogic-clock .second-hand {\n animation: rotate-second 60s infinite linear;\n}\n"],"sourceRoot":""}
|
||||
{"version":3,"sources":["webpack:///main.css","webpack:///styles.css"],"names":[],"mappings":"AAAA;EACE,gBAAgB;EAChB,kBAAkB;EAClB,4BAA4B;EAC5B,0BAA0B;EAC1B,2BAA2B;AAC7B;;AAEA;EACE,kBAAkB;EAClB,oBAAa;EAAb,oBAAa;EAAb,aAAa;EACb,2BAAuB;EAAvB,8BAAuB;MAAvB,2BAAuB;UAAvB,uBAAuB;EACvB,qBAAqB;EACrB,yBAAmB;MAAnB,sBAAmB;UAAnB,mBAAmB;EACnB,yBAAiB;KAAjB,sBAAiB;MAAjB,qBAAiB;UAAjB,iBAAiB;AACnB;;AAEA;EACE,0BAA0B;EAC1B,oDAA4C;UAA5C,4CAA4C;AAC9C;;ACpBA;EACE,wBAAwB;EACxB,0BAA2B;AAC7B;;AAEA,kBAAkB;;AAElB;EACE,oBAAa;EAAb,oBAAa;EAAb,aAAa;EACb,4BAAsB;EAAtB,6BAAsB;MAAtB,0BAAsB;UAAtB,sBAAsB;EACtB,wBAAuB;MAAvB,qBAAuB;UAAvB,uBAAuB;EACvB,qBAAqB;EACrB,0BAAqB;MAArB,qBAAqB;EACrB,yBAAmB;MAAnB,sBAAmB;UAAnB,mBAAmB;AACrB;;AAEA;EACE,6DAA6D;EAC7D,eAAe;;EAEf,0BAA0B;EAC1B,mCAAmC;EACnC,kCAAkC;EAClC,kCAAkC;EAClC,wCAAwC;AAC1C;;AAEA;EACE,eAAe;AACjB;;AAEA;EACE,eAAe;AACjB;;AAEA,iBAAiB;;AAEjB;EACE,kBAAkB;AACpB;;AAEA;EACE,qDAA6C;UAA7C,6CAA6C;AAC/C;;AAEA;EACE,sDAA8C;UAA9C,8CAA8C;AAChD;;AAEA;EACE,oDAA4C;UAA5C,4CAA4C;AAC9C","file":"vc.main.css","sourcesContent":["#visual-console-container {\n margin: 0px auto;\n position: relative;\n background-repeat: no-repeat;\n background-size: 100% 100%;\n background-position: center;\n}\n\n.visual-console-item {\n position: absolute;\n display: flex;\n flex-direction: initial;\n justify-items: center;\n align-items: center;\n user-select: text;\n}\n\n.visual-console-item.is-editing {\n border: 2px dashed #33ccff;\n transform: translateX(-2px) translateY(-2px);\n}\n","@font-face {\n font-family: Alarm Clock;\n src: url(./alarm-clock.ttf);\n}\n\n/* Digital clock */\n\n.visual-console-item .digital-clock {\n display: flex;\n flex-direction: column;\n justify-content: center;\n justify-items: center;\n align-content: center;\n align-items: center;\n}\n\n.visual-console-item .digital-clock > span {\n font-family: \"Alarm Clock\", \"Courier New\", Courier, monospace;\n font-size: 50px;\n\n /* To improve legibility */\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n text-rendering: optimizeLegibility;\n text-shadow: rgba(0, 0, 0, 0.01) 0 0 1px;\n}\n\n.visual-console-item .digital-clock > span.date {\n font-size: 25px;\n}\n\n.visual-console-item .digital-clock > span.timezone {\n font-size: 25px;\n}\n\n/* Analog clock */\n\n.visual-console-item .analogic-clock {\n text-align: center;\n}\n\n.visual-console-item .analogic-clock .hour-hand {\n animation: rotate-hour 43200s infinite linear;\n}\n\n.visual-console-item .analogic-clock .minute-hand {\n animation: rotate-minute 3600s infinite linear;\n}\n\n.visual-console-item .analogic-clock .second-hand {\n animation: rotate-second 60s infinite linear;\n}\n"],"sourceRoot":""}
|
|
@ -129,7 +129,7 @@
|
|||
<div style='height: 10px'>
|
||||
<?php
|
||||
$version = '7.0NG.735';
|
||||
$build = '190603';
|
||||
$build = '190619';
|
||||
$banner = "v$version Build $build";
|
||||
|
||||
error_reporting(0);
|
||||
|
|
|
@ -263,7 +263,7 @@ if ($date > $now) {
|
|||
echo '<div class="module_graph_menu_dropdown">
|
||||
<div id="module_graph_menu_header" class="module_graph_menu_header">
|
||||
'.html_print_image('images/arrow_down_green.png', true, ['class' => 'module_graph_menu_arrow', 'float' => 'left'], false, false, true).'
|
||||
<span>'.__('Graph configuration menu').ui_print_help_icon('graphs', true, $config['homeurl'], 'images/help_g.png', true).'</span>
|
||||
<span>'.__('Graph configuration menu').'</span>
|
||||
'.html_print_image('images/config.png', true, ['float' => 'right'], false, false, true).'
|
||||
</div>
|
||||
<div class="module_graph_menu_content module_graph_menu_content_closed" style="display:none;">'.$form_table.'</div>
|
||||
|
|
|
@ -402,7 +402,7 @@ $alias = db_get_value('alias', 'tagente', 'id_agente', $id_agent);
|
|||
echo '<div class="module_graph_menu_dropdown">
|
||||
<div id="module_graph_menu_header" class="module_graph_menu_header">
|
||||
'.html_print_image('images/arrow_down_green.png', true, ['class' => 'module_graph_menu_arrow', 'float' => 'left'], false, false, true).'
|
||||
<span>'.__('Graph configuration menu').ui_print_help_icon('graphs', true, $config['homeurl'], 'images/help_g.png', true).'</span>
|
||||
<span>'.__('Graph configuration menu').'</span>
|
||||
'.html_print_image('images/config.png', true, ['float' => 'right'], false, false, true).'
|
||||
</div>
|
||||
<div class="module_graph_menu_content module_graph_menu_content_closed" style="display:none;">'.$form_table.'</div>
|
||||
|
|
|
@ -1389,6 +1389,34 @@ if (!empty($result)) {
|
|||
true
|
||||
);
|
||||
}
|
||||
} else if ($row['estado'] == 3) {
|
||||
if (is_numeric($row['datos'])) {
|
||||
$data[6] = ui_print_status_image(
|
||||
STATUS_MODULE_UNKNOWN,
|
||||
__('UNKNOWN').': '.remove_right_zeros(number_format($row['datos'], $config['graph_precision'])),
|
||||
true
|
||||
);
|
||||
} else {
|
||||
$data[6] = ui_print_status_image(
|
||||
STATUS_MODULE_UNKNOWN,
|
||||
__('UNKNOWN').': '.$row['datos'],
|
||||
true
|
||||
);
|
||||
}
|
||||
} else if ($row['estado'] == 4) {
|
||||
if (is_numeric($row['datos'])) {
|
||||
$data[6] = ui_print_status_image(
|
||||
STATUS_MODULE_NO_DATA,
|
||||
__('NO DATA').': '.remove_right_zeros(number_format($row['datos'], $config['graph_precision'])),
|
||||
true
|
||||
);
|
||||
} else {
|
||||
$data[6] = ui_print_status_image(
|
||||
STATUS_MODULE_NO_DATA,
|
||||
__('NO DATA').': '.$row['datos'],
|
||||
true
|
||||
);
|
||||
}
|
||||
} else {
|
||||
$last_status = modules_get_agentmodule_last_status(
|
||||
$row['id_agente_modulo']
|
||||
|
|
|
@ -66,7 +66,7 @@ if (check_acl($config['id_user'], 0, 'AR')) {
|
|||
enterprise_hook('inventory_menu');
|
||||
|
||||
if ($config['activate_netflow'] || $config['activate_nta']) {
|
||||
$sub['network'] = [
|
||||
$sub['network_traffic'] = [
|
||||
'text' => __('Network'),
|
||||
'id' => 'Network',
|
||||
'type' => 'direct',
|
||||
|
@ -117,7 +117,7 @@ if (check_acl($config['id_user'], 0, 'AR')) {
|
|||
);
|
||||
}
|
||||
|
||||
$sub['network']['sub2'] = $netflow_sub;
|
||||
$sub['network_traffic']['sub2'] = $netflow_sub;
|
||||
}
|
||||
|
||||
if ($config['log_collector'] == 1) {
|
||||
|
|
|
@ -616,7 +616,11 @@ foreach ($timezones as $timezone_name => $tz) {
|
|||
}
|
||||
}
|
||||
|
||||
echo '<form name="user_mod" method="post" action="'.ui_get_full_url('index.php?sec=workspace&sec2=operation/users/user_edit').'&modified=1&id='.$id.'&pure='.$config['pure'].'">';
|
||||
if (is_metaconsole()) {
|
||||
echo '<form name="user_mod" method="post" action="'.ui_get_full_url('index.php?sec=advanced&sec2=advanced/users_setup').'&tab=user_edit&modified=1&id='.$id.'&pure='.$config['pure'].'">';
|
||||
} else {
|
||||
echo '<form name="user_mod" method="post" action="'.ui_get_full_url('index.php?sec=workspace&sec2=operation/users/user_edit').'&modified=1&id='.$id.'&pure='.$config['pure'].'">';
|
||||
}
|
||||
|
||||
echo '<div id="user_form">
|
||||
<div class="user_edit_first_row">
|
||||
|
|
|
@ -198,6 +198,14 @@ $visualConsoleItems = VisualConsole::getItemsFromDB(
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Add the datetime when the item was received.
|
||||
var receivedAt = new Date();
|
||||
items.map(function(item) {
|
||||
item["receivedAt"] = receivedAt;
|
||||
return item;
|
||||
});
|
||||
|
||||
var visualConsoleManager = createVisualConsole(
|
||||
container,
|
||||
props,
|
||||
|
|
|
@ -155,6 +155,16 @@ if (!is_metaconsole()) {
|
|||
html_print_input_hidden('metaconsole', 1);
|
||||
}
|
||||
|
||||
if ($pure === false) {
|
||||
echo '<div class="visual-console-edit-controls">';
|
||||
echo '<span>'.__('Move and resize mode').'</span>';
|
||||
echo '<span>';
|
||||
echo html_print_checkbox_switch('edit-mode', 1, false, true);
|
||||
echo '</span>';
|
||||
echo '</div>';
|
||||
echo '<br />';
|
||||
}
|
||||
|
||||
echo '<div id="visual-console-container"></div>';
|
||||
|
||||
if ($pure === true) {
|
||||
|
@ -306,6 +316,14 @@ $visualConsoleItems = VisualConsole::getItemsFromDB(
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Add the datetime when the item was received.
|
||||
var receivedAt = new Date();
|
||||
items.map(function(item) {
|
||||
item["receivedAt"] = receivedAt;
|
||||
return item;
|
||||
});
|
||||
|
||||
var visualConsoleManager = createVisualConsole(
|
||||
container,
|
||||
props,
|
||||
|
@ -315,6 +333,17 @@ $visualConsoleItems = VisualConsole::getItemsFromDB(
|
|||
handleUpdate
|
||||
);
|
||||
|
||||
// Enable/disable the edition mode.
|
||||
$('input[name=edit-mode]').change(function(event) {
|
||||
if ($(this).prop('checked')) {
|
||||
visualConsoleManager.visualConsole.enableEditMode();
|
||||
visualConsoleManager.changeUpdateInterval(0);
|
||||
} else {
|
||||
visualConsoleManager.visualConsole.disableEditMode();
|
||||
visualConsoleManager.changeUpdateInterval(<?php echo ($refr * 1000); ?>); // To ms.
|
||||
}
|
||||
});
|
||||
|
||||
// Update the data fetch interval.
|
||||
$('select#vc-refr').change(function(event) {
|
||||
var refr = Number.parseInt(event.target.value);
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
#
|
||||
%define name pandorafms_console
|
||||
%define version 7.0NG.735
|
||||
%define release 190603
|
||||
%define release 190619
|
||||
|
||||
# User and Group under which Apache is running
|
||||
%define httpd_name httpd
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
#
|
||||
%define name pandorafms_console
|
||||
%define version 7.0NG.735
|
||||
%define release 190603
|
||||
%define release 190619
|
||||
|
||||
# User and Group under which Apache is running
|
||||
%define httpd_name httpd
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
#
|
||||
%define name pandorafms_console
|
||||
%define version 7.0NG.735
|
||||
%define release 190603
|
||||
%define release 190619
|
||||
%define httpd_name httpd
|
||||
# User and Group under which Apache is running
|
||||
%define httpd_name apache2
|
||||
|
|
|
@ -270,7 +270,6 @@ INSERT INTO `ttipo_modulo` VALUES
|
|||
(21,'async_proc', 7, 'Asyncronous proc data', 'mod_async_proc.png'),
|
||||
(22,'async_data', 6, 'Asyncronous numeric data', 'mod_async_data.png'),
|
||||
(23,'async_string', 8, 'Asyncronous string data', 'mod_async_string.png'),
|
||||
(24,'log4x',0,'Log4x','mod_log4x.png'),
|
||||
(25,'web_analysis', 8, 'Web analysis data', 'module-wux.png'),
|
||||
(30,'web_data',9,'Remote HTTP module to check latency','mod_web_data.png'),
|
||||
(31,'web_proc',9,'Remote HTTP module to check server response','mod_web_proc.png'),
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
package: pandorafms-server
|
||||
Version: 7.0NG.735-190603
|
||||
Version: 7.0NG.735-190619
|
||||
Architecture: all
|
||||
Priority: optional
|
||||
Section: admin
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
|
||||
pandora_version="7.0NG.735-190603"
|
||||
pandora_version="7.0NG.735-190619"
|
||||
|
||||
package_cpan=0
|
||||
package_pandora=1
|
||||
|
|
|
@ -45,7 +45,7 @@ our @EXPORT = qw(
|
|||
|
||||
# version: Defines actual version of Pandora Server for this module only
|
||||
my $pandora_version = "7.0NG.735";
|
||||
my $pandora_build = "190603";
|
||||
my $pandora_build = "190619";
|
||||
our $VERSION = $pandora_version." ".$pandora_build;
|
||||
|
||||
# Setup hash
|
||||
|
|
|
@ -360,9 +360,12 @@ sub pandora_generate_alerts ($$$$$$$$;$$$) {
|
|||
my ($pa_config, $data, $status, $agent, $module, $utimestamp, $dbh, $timestamp, $extra_macros, $last_data_value, $alert_type) = @_;
|
||||
|
||||
# No alerts when event storm protection is enabled
|
||||
if ($EventStormProtection == 1) {
|
||||
|
||||
if ($EventStormProtection == 1) {
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
# Warmup interval for alerts.
|
||||
if ($pa_config->{'warmup_alert_on'} == 1) {
|
||||
|
@ -3349,7 +3352,7 @@ sub pandora_event ($$$$$$$$$$;$$$$$$$$$$$) {
|
|||
# Validate events with the same event id
|
||||
if (defined ($id_extra) && $id_extra ne '') {
|
||||
logger($pa_config, "Updating events with extended id '$id_extra'.", 10);
|
||||
db_do ($dbh, 'UPDATE ' . $event_table . ' SET estado = 1, ack_utimestamp = ? WHERE estado = 0 AND id_extra=?', $utimestamp, $id_extra);
|
||||
db_do ($dbh, 'UPDATE ' . $event_table . ' SET estado = 1, ack_utimestamp = ? WHERE estado IN (0,2) AND id_extra=?', $utimestamp, $id_extra);
|
||||
}
|
||||
|
||||
# Create the event
|
||||
|
@ -4856,32 +4859,36 @@ sub pandora_process_policy_queue ($) {
|
|||
logger($pa_config, "Starting policy queue patrol process.", 1);
|
||||
|
||||
while($THRRUN == 1) {
|
||||
eval {{
|
||||
local $SIG{__DIE__};
|
||||
|
||||
# If we are not the master server sleep and check again.
|
||||
if (pandora_is_master($pa_config) == 0) {
|
||||
sleep ($pa_config->{'server_threshold'});
|
||||
next;
|
||||
}
|
||||
# If we are not the master server sleep and check again.
|
||||
if (pandora_is_master($pa_config) == 0) {
|
||||
sleep ($pa_config->{'server_threshold'});
|
||||
next;
|
||||
}
|
||||
|
||||
my $operation = enterprise_hook('get_first_policy_queue', [$dbh]);
|
||||
next unless (defined ($operation) && $operation ne '');
|
||||
|
||||
if($operation->{'operation'} eq 'apply' || $operation->{'operation'} eq 'apply_db') {
|
||||
enterprise_hook('pandora_apply_policy', [$dbh, $pa_config, $operation->{'id_policy'}, $operation->{'id_agent'}, $operation->{'id'}, $operation->{'operation'}]);
|
||||
}
|
||||
elsif($operation->{'operation'} eq 'delete') {
|
||||
if($operation->{'id_agent'} == 0) {
|
||||
enterprise_hook('pandora_purge_policy_agents', [$dbh, $pa_config, $operation->{'id_policy'}]);
|
||||
}
|
||||
else {
|
||||
enterprise_hook('pandora_delete_agent_from_policy', [$dbh, $pa_config, $operation->{'id_policy'}, $operation->{'id_agent'}]);
|
||||
}
|
||||
}
|
||||
|
||||
enterprise_hook('pandora_finish_queue_operation', [$dbh, $operation->{'id'}]);
|
||||
}};
|
||||
|
||||
# Check the queue each 5 seconds
|
||||
sleep (5);
|
||||
sleep(5);
|
||||
|
||||
my $operation = enterprise_hook('get_first_policy_queue', [$dbh]);
|
||||
next unless (defined ($operation) && $operation ne '');
|
||||
|
||||
if($operation->{'operation'} eq 'apply' || $operation->{'operation'} eq 'apply_db') {
|
||||
enterprise_hook('pandora_apply_policy', [$dbh, $pa_config, $operation->{'id_policy'}, $operation->{'id_agent'}, $operation->{'id'}, $operation->{'operation'}]);
|
||||
}
|
||||
elsif($operation->{'operation'} eq 'delete') {
|
||||
if($operation->{'id_agent'} == 0) {
|
||||
enterprise_hook('pandora_purge_policy_agents', [$dbh, $pa_config, $operation->{'id_policy'}]);
|
||||
}
|
||||
else {
|
||||
enterprise_hook('pandora_delete_agent_from_policy', [$dbh, $pa_config, $operation->{'id_policy'}, $operation->{'id_agent'}]);
|
||||
}
|
||||
}
|
||||
|
||||
enterprise_hook('pandora_finish_queue_operation', [$dbh, $operation->{'id'}]);
|
||||
}
|
||||
|
||||
db_disconnect($dbh);
|
||||
|
|
|
@ -32,7 +32,7 @@ our @ISA = qw(Exporter);
|
|||
|
||||
# version: Defines actual version of Pandora Server for this module only
|
||||
my $pandora_version = "7.0NG.735";
|
||||
my $pandora_build = "190603";
|
||||
my $pandora_build = "190619";
|
||||
our $VERSION = $pandora_version." ".$pandora_build;
|
||||
|
||||
our %EXPORT_TAGS = ( 'all' => [ qw() ] );
|
||||
|
|