Merge branch 'develop' of https://192.168.50.5:8081/artica/pandorafms into develop
This commit is contained in:
commit
a89eb4ecf9
|
@ -1,5 +1,5 @@
|
|||
package: pandorafms-agent-unix
|
||||
Version: 6.1dev-161114
|
||||
Version: 6.1dev-161116
|
||||
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="6.1dev-161114"
|
||||
pandora_version="6.1dev-161116"
|
||||
|
||||
echo "Test if you has the tools for to make the packages."
|
||||
whereis dpkg-deb | cut -d":" -f2 | grep dpkg-deb > /dev/null
|
||||
|
|
|
@ -41,7 +41,7 @@ my $Sem = undef;
|
|||
my $ThreadSem = undef;
|
||||
|
||||
use constant AGENT_VERSION => '6.1dev';
|
||||
use constant AGENT_BUILD => '161114';
|
||||
use constant AGENT_BUILD => '161116';
|
||||
|
||||
# Agent log default file size maximum and instances
|
||||
use constant DEFAULT_MAX_LOG_SIZE => 600000;
|
||||
|
@ -2346,12 +2346,15 @@ while (1) {
|
|||
if(defined($Conf{'address'})) {
|
||||
# Check if address is auto to get the local ip
|
||||
if ($Conf{'address'} eq 'auto') {
|
||||
# Tested on Ubuntu, debian, Suse, Solaris 10 and AIX 5.1
|
||||
my @address_list = `ifconfig -a 2>$DevNull | grep -v '127.0.0' | grep '[0-9]*\\.[0-9]*\\.[0-9]*' | awk '{ print \$2 }' | awk -F':' '{ print \$2 }'`;
|
||||
if ($#address_list < 0) {
|
||||
# Tested on Red Hat 7
|
||||
@address_list = `ip addr show 2>$DevNull | grep -v '127.0.0' | grep '[0-9]*\\.[0-9]*\\.[0-9]*' | awk '{print \$2}' | cut -d/ -f1`;
|
||||
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/\\/.*//'`;
|
||||
}
|
||||
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/.*://'`;
|
||||
}
|
||||
|
||||
for (my $i = 0; $i <= $#address_list; $i++) {
|
||||
chomp($address_list[$i]);
|
||||
if ($i > 0) {
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
#
|
||||
%define name pandorafms_agent_unix
|
||||
%define version 6.1dev
|
||||
%define release 161114
|
||||
%define release 161116
|
||||
|
||||
Summary: Pandora FMS Linux agent, PERL version
|
||||
Name: %{name}
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
#
|
||||
%define name pandorafms_agent_unix
|
||||
%define version 6.1dev
|
||||
%define release 161114
|
||||
%define release 161116
|
||||
|
||||
Summary: Pandora FMS Linux agent, PERL version
|
||||
Name: %{name}
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
# **********************************************************************
|
||||
|
||||
PI_VERSION="6.1dev"
|
||||
PI_BUILD="161114"
|
||||
PI_BUILD="161116"
|
||||
OS_NAME=`uname -s`
|
||||
|
||||
FORCE=0
|
||||
|
|
|
@ -186,7 +186,7 @@ UpgradeApplicationID
|
|||
{}
|
||||
|
||||
Version
|
||||
{161114}
|
||||
{161116}
|
||||
|
||||
ViewReadme
|
||||
{Yes}
|
||||
|
|
|
@ -30,7 +30,7 @@ using namespace Pandora;
|
|||
using namespace Pandora_Strutils;
|
||||
|
||||
#define PATH_SIZE _MAX_PATH+1
|
||||
#define PANDORA_VERSION ("6.1dev(Build 161114)")
|
||||
#define PANDORA_VERSION ("6.1dev(Build 161116)")
|
||||
|
||||
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", "(6.1dev(Build 161114))"
|
||||
VALUE "ProductVersion", "(6.1dev(Build 161116))"
|
||||
VALUE "FileVersion", "1.0.0.0"
|
||||
END
|
||||
END
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
package: pandorafms-console
|
||||
Version: 6.1dev-161114
|
||||
Version: 6.1dev-161116
|
||||
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="6.1dev-161114"
|
||||
pandora_version="6.1dev-161116"
|
||||
|
||||
package_pear=0
|
||||
package_pandora=1
|
||||
|
|
|
@ -32,12 +32,12 @@ require_once ("../include/functions_html.php");
|
|||
|
||||
$id = get_parameter ('id');
|
||||
|
||||
if (! isset($_SESSION['id_usuario'])) {
|
||||
if (! isset($_SESSION[$config['homeurl_static']]['id_usuario'])) {
|
||||
session_start();
|
||||
session_write_close();
|
||||
}
|
||||
|
||||
$user_language = get_user_language ($_SESSION['id_usuario']);
|
||||
$user_language = get_user_language ($_SESSION[$config['homeurl_static']]['id_usuario']);
|
||||
|
||||
if (file_exists ('../include/languages/'.$user_language.'.mo')) {
|
||||
$l10n = new gettext_reader (new CachedFileReader ('../include/languages/'.$user_language.'.mo'));
|
||||
|
|
|
@ -140,6 +140,7 @@ switch ($action) {
|
|||
case 'general':
|
||||
case 'network_interfaces_report':
|
||||
case 'availability':
|
||||
case 'agent_module':
|
||||
$get_data_editor = true;
|
||||
break;
|
||||
|
||||
|
@ -514,8 +515,18 @@ switch ($action) {
|
|||
break;
|
||||
case 'agent_module':
|
||||
$description = $item['description'];
|
||||
$es = json_decode($item['external_source'], true);
|
||||
$agents_id = get_parameter('id_agents');
|
||||
|
||||
if ((count($es['module']) == 1) && ($es['module'][0] == 0)) {
|
||||
$module = "";
|
||||
}
|
||||
else {
|
||||
$module = $es['module'];
|
||||
}
|
||||
$group = $item['id_group'];
|
||||
$modulegroup = $item ['id_module_group'];
|
||||
$modulegroup = $item['id_module_group'];
|
||||
$idAgentModule = $module;
|
||||
break;
|
||||
case 'inventory':
|
||||
$description = $item['description'];
|
||||
|
@ -981,6 +992,39 @@ You can of course remove the warnings, that's why we include the source and do n
|
|||
?>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr id="agents_row" style="" class="datos">
|
||||
<td style="font-weight:bold;"><?php echo __('Agents'); ?></td>
|
||||
<td>
|
||||
<?php
|
||||
$agents = agents_get_group_agents($group);
|
||||
if ((empty($agents)) || $agents == -1) $agents = array();
|
||||
|
||||
$agents_select = array();
|
||||
foreach ($id_agents as $id) {
|
||||
foreach ($agents as $key => $a) {
|
||||
if ($key == (int)$id) {
|
||||
$agents_select[$key] = $key;
|
||||
}
|
||||
}
|
||||
}
|
||||
html_print_select($agents, 'id_agents[]', $agents_id, $script = '', "", 0, false, true, true, '', false, "min-width: 180px");
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr id="modules_row" style="" class="datos">
|
||||
<td style="font-weight:bold;"><?php echo __('Modules'); ?></td>
|
||||
<td>
|
||||
<?php
|
||||
$all_modules = array();
|
||||
foreach ($module as $id_modul) {
|
||||
$all_modules[] = modules_get_agentmodule_name($id_modul);
|
||||
}
|
||||
html_print_select($all_modules, 'module[]', $module, $script = '', __('None'), 0, false, true, true, '', false, "min-width: 180px");
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr id="row_agent_multi" style="" class="datos">
|
||||
<td style="font-weight:bold;"><?php echo __('Agents'); ?></td>
|
||||
|
@ -1789,7 +1833,79 @@ ui_require_javascript_file ('pandora_inventory', ENTERPRISE_DIR.'/include/javasc
|
|||
$(document).ready (function () {
|
||||
chooseType();
|
||||
chooseSQLquery();
|
||||
|
||||
|
||||
$("#id_agents").change(agent_changed_by_multiple_agents);
|
||||
|
||||
$("#combo_group").change (
|
||||
function () {
|
||||
jQuery.post ("ajax.php",
|
||||
{"page" : "operation/agentes/ver_agente",
|
||||
"get_agents_group_json" : 1,
|
||||
"id_group" : this.value,
|
||||
"privilege" : "AW",
|
||||
"keys_prefix" : "_"
|
||||
},
|
||||
function (data, status) {
|
||||
$("#id_agents").html('');
|
||||
jQuery.each (data, function (id, value) {
|
||||
// Remove keys_prefix from the index
|
||||
id = id.substring(1);
|
||||
|
||||
option = $("<option></option>")
|
||||
.attr ("value", value["id_agente"])
|
||||
.html (value["nombre"]);
|
||||
$("#id_agents").append (option);
|
||||
});
|
||||
},
|
||||
"json"
|
||||
);
|
||||
}
|
||||
);
|
||||
|
||||
$("#combo_modulegroup").change (
|
||||
function () {
|
||||
jQuery.post ("ajax.php",
|
||||
{"page" : "operation/agentes/ver_agente",
|
||||
"get_modules_group_json" : 1,
|
||||
"id_module_group" : this.value,
|
||||
"id_agents" : $("#id_agents").val()
|
||||
},
|
||||
function (data, status) {
|
||||
$("#module").html('');
|
||||
jQuery.each (data, function (id, value) {
|
||||
option = $("<option></option>")
|
||||
.attr ("value", value["id_agente_modulo"])
|
||||
.html (value["nombre"]);
|
||||
$("#module").append (option);
|
||||
});
|
||||
},
|
||||
"json"
|
||||
);
|
||||
}
|
||||
);
|
||||
|
||||
$("#id_agents").change (
|
||||
function () {
|
||||
jQuery.post ("ajax.php",
|
||||
{"page" : "operation/agentes/ver_agente",
|
||||
"get_modules_group_json" : 1,
|
||||
"id_module_group" : $("#combo_modulegroup").val(),
|
||||
"id_agents" : $("#id_agents").val()
|
||||
},
|
||||
function (data, status) {
|
||||
$("#module").html('');
|
||||
jQuery.each (data, function (id, value) {
|
||||
option = $("<option></option>")
|
||||
.attr ("value", value["id_agente_modulo"])
|
||||
.html (value["nombre"]);
|
||||
$("#module").append (option);
|
||||
});
|
||||
},
|
||||
"json"
|
||||
);
|
||||
}
|
||||
);
|
||||
|
||||
$("#text-time_to, #text-time_from").timepicker({
|
||||
showSecond: true,
|
||||
timeFormat: '<?php echo TIME_FORMAT_JS; ?>',
|
||||
|
@ -1817,7 +1933,6 @@ $(document).ready (function () {
|
|||
async: false,
|
||||
timeout: 10000,
|
||||
success: function (data) {
|
||||
console.log(data);
|
||||
switch (data) {
|
||||
case 'boolean':
|
||||
case 'sparse':
|
||||
|
@ -1831,7 +1946,6 @@ $(document).ready (function () {
|
|||
});
|
||||
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
function create_custom_graph() {
|
||||
|
@ -2328,6 +2442,8 @@ function chooseType() {
|
|||
$("#row_last_value").hide();
|
||||
$("#row_filter_search").hide();
|
||||
$("#row_percentil").hide();
|
||||
$("#agents_row").hide();
|
||||
$("#modules_row").hide();
|
||||
|
||||
// SLA list default state
|
||||
$("#sla_list").hide();
|
||||
|
@ -2717,6 +2833,8 @@ function chooseType() {
|
|||
$("#row_description").show();
|
||||
$("#row_group").show();
|
||||
$("#row_module_group").show();
|
||||
$("#agents_row").show();
|
||||
$("#modules_row").show();
|
||||
break;
|
||||
|
||||
case 'inventory_changes':
|
||||
|
|
|
@ -944,6 +944,12 @@ switch ($action) {
|
|||
$values['text'] = get_parameter('text');
|
||||
$values['show_graph'] = get_parameter('combo_graph_options');
|
||||
|
||||
$good_format = true;
|
||||
break;
|
||||
case 'agent_module':
|
||||
$es['id_agents'] = get_parameter('id_agents');
|
||||
$es['module'] = get_parameter('module', "");
|
||||
$values['external_source'] = json_encode($es);
|
||||
$good_format = true;
|
||||
break;
|
||||
case 'inventory':
|
||||
|
@ -1259,6 +1265,12 @@ switch ($action) {
|
|||
$values['external_source'] = json_encode($es);
|
||||
$good_format = true;
|
||||
break;
|
||||
case 'agent_module':
|
||||
$es['id_agents'] = get_parameter('id_agents');
|
||||
$es['module'] = get_parameter('module', "");
|
||||
$values['external_source'] = json_encode($es);
|
||||
$good_format = true;
|
||||
break;
|
||||
case 'inventory_changes':
|
||||
$values['period'] = get_parameter('period');
|
||||
$es['id_agents'] = get_parameter('id_agents');
|
||||
|
|
|
@ -447,6 +447,14 @@ $table_chars->data[$row][1] .= __('Line').' ' .
|
|||
$config["type_module_charts"] != 'area', true);
|
||||
$row++;
|
||||
|
||||
$table_chars->data[$row][0] = __('Show only average');
|
||||
$table_chars->data[$row][0] .= ui_print_help_tip(__('Allows only show the average in graphs'), true);
|
||||
$table_chars->data[$row][1] = __('Yes').' ' .
|
||||
html_print_radio_button ('only_average', 1, '', $config["only_average"], true).' ';
|
||||
$table_chars->data[$row][1] .= __('No').' ' .
|
||||
html_print_radio_button ('only_average', 0, '', $config["only_average"], true);
|
||||
$row++;
|
||||
|
||||
echo "<fieldset>";
|
||||
echo "<legend>" . __('Charts configuration') . "</legend>";
|
||||
html_print_table ($table_chars);
|
||||
|
|
|
@ -783,9 +783,6 @@ if ($list_modules) {
|
|||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
$data[0] = '';
|
||||
}
|
||||
|
||||
if ($isFunctionPolicies !== ENTERPRISE_NOT_HOOK) {
|
||||
if ($module["id_policy_module"] != 0) {
|
||||
|
|
|
@ -341,15 +341,17 @@ switch ($action) {
|
|||
break;
|
||||
}
|
||||
|
||||
$returnValue_value = explode(' ', $returnValue);
|
||||
//~ $returnValue_value = explode(' ', $returnValue);
|
||||
|
||||
$return = array();
|
||||
if ($returnValue_value[1] != "") {
|
||||
$return['value'] = remove_right_zeros(number_format($returnValue_value[0], $config['graph_precision'])) . " " . $returnValue_value[1];
|
||||
//~ $return['value'] = remove_right_zeros(number_format($returnValue_value[0], $config['graph_precision'])) . " " . $returnValue_value[1];
|
||||
}
|
||||
else {
|
||||
$return['value'] = remove_right_zeros(number_format($returnValue_value[0], $config['graph_precision']));
|
||||
//~ $return['value'] = remove_right_zeros(number_format($returnValue_value[0], $config['graph_precision']));
|
||||
}
|
||||
|
||||
$return['value'] = $returnValue;
|
||||
$return['max_percentile'] = $layoutData['height'];
|
||||
$return['width_percentile'] = $layoutData['width'];
|
||||
$return['unit_text'] = $unit_text;
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
/**
|
||||
* Pandora build version and version
|
||||
*/
|
||||
$build_version = 'PC161114';
|
||||
$build_version = 'PC161116';
|
||||
$pandora_version = 'v6.1dev';
|
||||
|
||||
// Do not overwrite default timezone set if defined.
|
||||
|
@ -112,6 +112,9 @@ require_once ($ownDir. 'functions_config.php');
|
|||
// We need a timezone BEFORE calling config_process_config.
|
||||
// If not we will get ugly warnings. Set Europe/Madrid by default
|
||||
// Later will be replaced by the good one.
|
||||
if (!isset($config["homeurl_static"])) {
|
||||
$config["homeurl_static"] = $config["homeurl"];
|
||||
}
|
||||
|
||||
date_default_timezone_set("Europe/Madrid");
|
||||
|
||||
|
@ -124,11 +127,6 @@ if(session_id() == '') {
|
|||
$resultado = session_start();
|
||||
}
|
||||
|
||||
|
||||
if (!isset($config["homeurl_static"])) {
|
||||
$config["homeurl_static"] = $config["homeurl"];
|
||||
}
|
||||
|
||||
// Set a the system timezone default
|
||||
if ((!isset($config["timezone"])) OR ($config["timezone"] == "")) {
|
||||
$config["timezone"] = "Europe/Berlin";
|
||||
|
|
|
@ -244,7 +244,7 @@ function format_for_graph ($number , $decimals = 1, $dec_point = ".", $thousands
|
|||
$number = $number / 1000;
|
||||
}
|
||||
|
||||
return format_numeric ($number, $decimals). $shorts[$pos]; //This will actually do the rounding and the decimals
|
||||
return remove_right_zeros(format_numeric ($number, $decimals)). $shorts[$pos]; //This will actually do the rounding and the decimals
|
||||
}
|
||||
|
||||
function human_milliseconds_to_string($seconds) {
|
||||
|
|
|
@ -514,6 +514,8 @@ function config_update_config () {
|
|||
$error_update[] = __('Default line thickness for the Custom Graph.');
|
||||
if (!config_update_value ('type_module_charts', (string) get_parameter('type_module_charts', 'area')))
|
||||
$error_update[] = __('Default type of module charts.');
|
||||
if (!config_update_value ('only_average', (bool) get_parameter('only_average', false)))
|
||||
$error_update[] = __('Default show only average or min and max');
|
||||
if (!config_update_value ('render_proc', (bool) get_parameter('render_proc', false)))
|
||||
$error_update[] = __('Display data of proc modules in other format');
|
||||
if (!config_update_value ('render_proc_ok', (string) get_parameter('render_proc_ok', __('Ok') )))
|
||||
|
|
|
@ -30,7 +30,7 @@ function post_process_get_custom_values() {
|
|||
}
|
||||
else {
|
||||
$return = json_decode(
|
||||
$config['post_process_custom_values'], true);
|
||||
io_safe_output($config['post_process_custom_values']), true);
|
||||
}
|
||||
|
||||
if (empty($return)) {
|
||||
|
|
|
@ -1505,13 +1505,15 @@ function reporting_inventory($report, $content, $type) {
|
|||
|
||||
function reporting_agent_module($report, $content) {
|
||||
global $config;
|
||||
|
||||
$agents_and_modules = json_decode($content['external_source'], true);
|
||||
$agents = array();
|
||||
$agents = $agents_and_modules['id_agents'];
|
||||
$modules = $agents_and_modules['module'];
|
||||
$id_group = $content['id_group'];
|
||||
$id_module_group = $content['id_module_group'];
|
||||
|
||||
$return['type'] = 'agent_module';
|
||||
|
||||
|
||||
if (empty($content['name'])) {
|
||||
$content['name'] = __('Agent/Modules');
|
||||
}
|
||||
|
@ -1532,54 +1534,25 @@ function reporting_agent_module($report, $content) {
|
|||
|
||||
$return["data"] = array();
|
||||
|
||||
$agents = array();
|
||||
if ($id_group > 0) {
|
||||
$agents = agents_get_group_agents($id_group);
|
||||
$agents = array_keys($agents);
|
||||
}
|
||||
|
||||
$filter_module_groups = false;
|
||||
if ($id_module_group > 0) {
|
||||
$filter_module_groups['id_module_group'] = $id_module_group;
|
||||
}
|
||||
|
||||
$all_modules = agents_get_modules($agents, false,
|
||||
$filter_module_groups, true, false);
|
||||
|
||||
$modules_by_name = array();
|
||||
$name = '';
|
||||
$cont = 0;
|
||||
|
||||
foreach ($all_modules as $key => $module) {
|
||||
if ($module == $name) {
|
||||
$modules_by_name[$cont - 1]['id'][] = $key;
|
||||
}
|
||||
else {
|
||||
$name = $module;
|
||||
$modules_by_name[$cont]['name'] = $name;
|
||||
$modules_by_name[$cont]['id'][] = $key;
|
||||
$cont ++;
|
||||
}
|
||||
foreach ($modules as $modul_id) {
|
||||
$modules_by_name[$cont]['name'] = io_safe_output(modules_get_agentmodule_name($modul_id));
|
||||
$modules_by_name[$cont]['id'][] = $modul_id;
|
||||
$cont ++;
|
||||
}
|
||||
|
||||
$filter_groups = array();
|
||||
if ($id_group > 0) {
|
||||
$filter_groups['id_grupo'] = $id_group;
|
||||
}
|
||||
$agents = agents_get_agents ($filter_groups);
|
||||
$nagents = count($agents);
|
||||
|
||||
if ($all_modules == false || $agents == false) {
|
||||
if ($modules_by_name == false || $agents == false) {
|
||||
$return['failed'] = __('There are no agents with modules');
|
||||
}
|
||||
else {
|
||||
foreach ($agents as $agent) {
|
||||
$row = array();
|
||||
$row['agent_status'][$agent['id_agente']] =
|
||||
agents_get_status($agent['id_agente']);
|
||||
$row['agent_name'] = $agent['nombre'];
|
||||
$row['agent_status'][$agent] =
|
||||
agents_get_status($agent);
|
||||
$row['agent_name'] = agents_get_name($agent);
|
||||
|
||||
$agent_modules = agents_get_modules($agent['id_agente']);
|
||||
$agent_modules = agents_get_modules($agent);
|
||||
|
||||
$row['modules'] = array();
|
||||
foreach ($modules_by_name as $module) {
|
||||
|
|
|
@ -815,7 +815,6 @@ function ui_format_alert_row ($alert, $agent = true, $url = '', $agent_style = f
|
|||
|
||||
if (!defined('METACONSOLE')) {
|
||||
// Force alert execution
|
||||
$data[$index['force_execution']] = '';
|
||||
if (check_acl ($config["id_user"], $id_group, "AW") || check_acl ($config["id_user"], $id_group, "LM")) {
|
||||
if ($alert["force_execution"] == 0) {
|
||||
$data[$index['force_execution']] =
|
||||
|
|
|
@ -1013,19 +1013,20 @@ function visual_map_print_item($mode = "read", $layoutData,
|
|||
global $config;
|
||||
|
||||
if ($type == SIMPLE_VALUE) {
|
||||
$returnValue_value = explode(' ', $value);
|
||||
//~ $returnValue_value = explode(' ', $value);
|
||||
|
||||
//~ if ($returnValue_value[1] != "") {
|
||||
//~ $value = remove_right_zeros(number_format($returnValue_value[0], $config['graph_precision'])) . " " . $returnValue_value[1];
|
||||
//~ }
|
||||
//~ else {
|
||||
//~ $value = remove_right_zeros(number_format($returnValue_value[0], $config['graph_precision']));
|
||||
//~ }
|
||||
|
||||
if ($returnValue_value[1] != "") {
|
||||
$value = remove_right_zeros(number_format($returnValue_value[0], $config['graph_precision'])) . " " . $returnValue_value[1];
|
||||
}
|
||||
else {
|
||||
$value = remove_right_zeros(number_format($returnValue_value[0], $config['graph_precision']));
|
||||
}
|
||||
}
|
||||
else {
|
||||
// If the value is a string, dont format it
|
||||
if (!is_string($value)) {
|
||||
$value = remove_right_zeros(format_for_graph($value, $config['graph_precision']));
|
||||
//~ $value = remove_right_zeros(format_for_graph($value, $config['graph_precision']));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1144,6 +1145,8 @@ function visual_map_get_simple_value_type($process_simple_value) {
|
|||
* @return string value retrieved with units
|
||||
*/
|
||||
function visual_map_get_simple_value($type, $id_module, $period = SECONDS_1DAY) {
|
||||
global $config;
|
||||
|
||||
$unit_text = db_get_sql ('SELECT unit
|
||||
FROM tagente_modulo WHERE id_agente_modulo = ' . $id_module);
|
||||
$unit_text = trim(io_safe_output($unit_text));
|
||||
|
@ -1157,7 +1160,7 @@ function visual_map_get_simple_value($type, $id_module, $period = SECONDS_1DAY)
|
|||
}
|
||||
else {
|
||||
if ( is_numeric($value) )
|
||||
$value = format_for_graph($value, 2);
|
||||
$value = format_for_graph($value, $config['graph_precision']);
|
||||
if (!empty($unit_text)) {
|
||||
$value .= " " . $unit_text;
|
||||
}
|
||||
|
|
|
@ -1703,6 +1703,16 @@ function pandoraFlotArea(graph_id, values, labels, labels_long, legend,
|
|||
|
||||
var y = series.data[j][1];
|
||||
|
||||
var how_bigger = "";
|
||||
if (y > 1000000) {
|
||||
how_bigger = "M";
|
||||
y = y / 1000000;
|
||||
}
|
||||
else if (y > 1000) {
|
||||
how_bigger = "K";
|
||||
y = y / 1000;
|
||||
}
|
||||
|
||||
if (currentRanges == null || (currentRanges.xaxis.from < j && j < currentRanges.xaxis.to)) {
|
||||
$('#timestamp_'+graph_id).show();
|
||||
// If no legend, the timestamp labels are short and with value
|
||||
|
@ -1741,7 +1751,7 @@ function pandoraFlotArea(graph_id, values, labels, labels_long, legend,
|
|||
// The graphs of points type and unknown graphs will dont be updated
|
||||
if (serie_types[i] != 'points' && series.label != $('#hidden-unknown_text').val()) {
|
||||
$('#legend_' + graph_id + ' .legendLabel')
|
||||
.eq(i).html(label_aux + '= ' + parseFloat(y).toFixed(2) + ' ' + unit);
|
||||
.eq(i).html(label_aux + '= ' + parseFloat(y).toFixed(precision_graph) + how_bigger + ' ' + unit);
|
||||
console.log($('#legend_' + graph_id + ' .legendLabel'));
|
||||
}
|
||||
|
||||
|
|
|
@ -71,7 +71,7 @@
|
|||
<div style='height: 10px'>
|
||||
<?php
|
||||
$version = '6.1dev';
|
||||
$build = '161114';
|
||||
$build = '161116';
|
||||
$banner = "v$version Build $build";
|
||||
|
||||
error_reporting(0);
|
||||
|
|
|
@ -91,11 +91,11 @@ $id = get_parameter('id');
|
|||
};
|
||||
|
||||
function show_others() {
|
||||
if (!$("#checkbox-avg_only").attr('checked')) {
|
||||
$("#hidden-show_other").val(0);
|
||||
if ($('#checkbox-avg_only').is(":checked") == true) {
|
||||
$("#hidden-show_other").val(1);
|
||||
}
|
||||
else {
|
||||
$("#hidden-show_other").val(1);
|
||||
$("#hidden-show_other").val(0);
|
||||
}
|
||||
}
|
||||
//-->
|
||||
|
@ -134,11 +134,19 @@ $id = get_parameter('id');
|
|||
}
|
||||
|
||||
$draw_alerts = get_parameter("draw_alerts", 0);
|
||||
$avg_only = get_parameter ("avg_only", 1);
|
||||
$show_other = (bool)get_parameter('show_other', false);
|
||||
if ($show_other) {
|
||||
|
||||
if(isset($config['only_average'])){
|
||||
$avg_only = 1;
|
||||
}
|
||||
else {
|
||||
$avg_only = 0;
|
||||
}
|
||||
|
||||
$show_other = get_parameter('show_other');
|
||||
if (isset($show_other)) {
|
||||
$avg_only = $show_other;
|
||||
}
|
||||
|
||||
$period = get_parameter ("period", SECONDS_1DAY);
|
||||
$id = get_parameter ("id", 0);
|
||||
$width = get_parameter ("width", STATWIN_DEFAULT_CHART_WIDTH);
|
||||
|
|
|
@ -60,6 +60,7 @@ $sort = get_parameter('sort', 'none');
|
|||
//When the previous page was a visualmap and show only one module
|
||||
$id_module = (int) get_parameter('id_module', 0);
|
||||
$ag_custom_fields = (array) get_parameter('ag_custom_fields', array());
|
||||
$module_option = (int) get_parameter('module_option', 0);
|
||||
|
||||
if (!is_metaconsole()) {
|
||||
$ag_group = (int) get_parameter ('ag_group', 0);
|
||||
|
@ -95,7 +96,7 @@ $sql_from = ' FROM ttipo_modulo,tagente, tagente_modulo, tagente_estado,tmodule
|
|||
$sql_conditions_base = ' WHERE tagente.id_agente = tagente_modulo.id_agente
|
||||
AND tagente_estado.id_agente_modulo = tagente_modulo.id_agente_modulo AND tagente_modulo.id_tipo_modulo = ttipo_modulo.id_tipo AND tmodule.id_module = tagente_modulo.id_modulo';
|
||||
|
||||
$sql_conditions = ' AND tagente_modulo.disabled = 0 AND tagente.disabled = 0';
|
||||
$sql_conditions = ' AND tagente.disabled = 0';
|
||||
|
||||
if (is_numeric($ag_group)) {
|
||||
$id_ag_group = 0;
|
||||
|
@ -140,6 +141,16 @@ if ($ag_modulename != '') {
|
|||
$ag_modulename);
|
||||
}
|
||||
|
||||
if ($module_option !== 0) {
|
||||
if ($module_option == 1) {
|
||||
// Only enabled
|
||||
$sql_conditions .= sprintf (' AND tagente_modulo.disabled = 0');
|
||||
}
|
||||
else if ($module_option == 2) {
|
||||
// Only disabled
|
||||
$sql_conditions .= sprintf (' AND tagente_modulo.disabled = 1');
|
||||
}
|
||||
}
|
||||
|
||||
if ($datatype != '') {
|
||||
$sql_conditions .= sprintf (' AND ttipo_modulo.id_tipo =' .$datatype);
|
||||
|
@ -383,17 +394,22 @@ else {
|
|||
|
||||
$table->data[2][1] = html_print_select ($typemodules, 'moduletype',$moduletype, '', __('All'),'', true, false, true, '', false, 'width: 150px;');
|
||||
|
||||
$monitor_options = array(0 => __('Everyone'), 1 => __('Only enabled'), 2 => __('Only disabled'));
|
||||
|
||||
$table->data[2][2] = '<span>'.__('Show monitors...').'</span>';
|
||||
|
||||
$table->data[2][2] = '<span id="datatypetittle" ';
|
||||
$table->data[2][3] = html_print_select ($monitor_options, 'module_option', $module_option, '', '','', true, false, true, '', false, 'width: 150px;');
|
||||
|
||||
$table->data[2][4] = '<span id="datatypetittle" ';
|
||||
|
||||
if(!$_GET['sort']){
|
||||
$table->data[2][2] .= 'style="display:none"';
|
||||
$table->data[2][4] .= 'style="display:none"';
|
||||
}
|
||||
|
||||
$table->data[2][2] .= '>'.__('Data type').'</span>';
|
||||
$table->data[2][4] .= '>'.__('Data type').'</span>';
|
||||
|
||||
|
||||
$table->data[2][3] .='<div id="datatypebox">';
|
||||
$table->data[2][5] .='<div id="datatypebox">';
|
||||
|
||||
|
||||
switch ($moduletype)
|
||||
|
@ -435,33 +451,33 @@ else {
|
|||
|
||||
}
|
||||
$a = db_get_all_rows_sql($sql);
|
||||
$table->data[2][3] .= '<select id="datatype" name="datatype" ';
|
||||
$table->data[2][5] .= '<select id="datatype" name="datatype" ';
|
||||
|
||||
if(!$_GET['sort']){
|
||||
$table->data[2][3] .= 'style="display:none"';
|
||||
$table->data[2][5] .= 'style="display:none"';
|
||||
}
|
||||
|
||||
$table->data[2][3] .= '>';
|
||||
$table->data[2][5] .= '>';
|
||||
|
||||
$table->data[2][3] .= '<option name="datatype" value="">'.__("All").'</option>';
|
||||
$table->data[2][5] .= '<option name="datatype" value="">'.__("All").'</option>';
|
||||
|
||||
|
||||
foreach ($a as $valor) {
|
||||
|
||||
$table->data[2][3] .= '<option name="datatype" value="'.$valor['id_tipo'].'" ';
|
||||
$table->data[2][5] .= '<option name="datatype" value="'.$valor['id_tipo'].'" ';
|
||||
|
||||
if($valor['id_tipo'] == $datatype){
|
||||
$table->data[2][3] .= 'selected';
|
||||
$table->data[2][5] .= 'selected';
|
||||
}
|
||||
|
||||
$table->data[2][3] .= '>'.$valor['descripcion'].'</option>';
|
||||
$table->data[2][5] .= '>'.$valor['descripcion'].'</option>';
|
||||
}
|
||||
$table->data[2][3] .= '</select>';
|
||||
$table->data[2][5] .= '</select>';
|
||||
|
||||
|
||||
|
||||
|
||||
$table->data[2][3] .= '</div>';
|
||||
$table->data[2][5] .= '</div>';
|
||||
|
||||
|
||||
$table_custom_fields = new stdClass();
|
||||
|
@ -502,7 +518,7 @@ foreach ($custom_fields as $custom_field) {
|
|||
|
||||
|
||||
$filters = '<form method="post" action="index.php?sec=estado&sec2=operation/agentes/status_monitor&refr=' . $refr . '&ag_group=' .
|
||||
$ag_group . '&ag_freestring=' . $ag_freestring . '&ag_modulename=' . $ag_modulename . '&moduletype=' . $moduletype . '&datatype=' . $datatype . '&status=' . $status . '&sort_field=' .
|
||||
$ag_group . '&ag_freestring=' . $ag_freestring . '&module_option=' . $module_option . '&ag_modulename=' . $ag_modulename . '&moduletype=' . $moduletype . '&datatype=' . $datatype . '&status=' . $status . '&sort_field=' .
|
||||
$sortField . '&sort=' . $sort .'&pure=' . $config['pure'] . $ag_custom_fields_params . '">';
|
||||
if (is_metaconsole()) {
|
||||
$table->colspan[3][0] = 7;
|
||||
|
@ -828,7 +844,6 @@ switch ($config['dbtype']) {
|
|||
break;
|
||||
}
|
||||
|
||||
|
||||
if (! defined ('METACONSOLE')) {
|
||||
$result = db_get_all_rows_sql ($sql);
|
||||
|
||||
|
@ -927,43 +942,31 @@ if (!empty($result)) {
|
|||
$table->head[0] = '<span title=\'' . __('Policy') . '\'>' . __('P.') . '</span>';
|
||||
|
||||
$table->head[1] = __('Agent');
|
||||
if (!is_metaconsole()) {
|
||||
$table->head[1] .=' <a href="index.php?sec=estado&sec2=operation/agentes/status_monitor&refr=' . $refr . '&datatype='.$datatype . '&moduletype='.$moduletype . '&modulegroup='.$modulegroup . '&offset=' . $offset . '&ag_group=' . $ag_group . '&ag_freestring=' . $ag_freestring . '&ag_modulename=' . $ag_modulename . '&status=' . $status . $ag_custom_fields_params . '&sort_field=agent_name&sort=up">' . html_print_image('images/sort_up.png', true, array('style' => $selectAgentNameUp, 'alt' => 'up')) . '</a>' .
|
||||
'<a href="index.php?sec=estado&sec2=operation/agentes/status_monitor&refr=' . $refr . '&datatype='.$datatype . '&moduletype='.$moduletype . '&modulegroup='.$modulegroup . '&offset=' . $offset . '&ag_group=' . $ag_group . '&ag_freestring=' . $ag_freestring . '&ag_modulename=' . $ag_modulename . '&status=' . $status . $ag_custom_fields_params . '&sort_field=agent_name&sort=down">' . html_print_image('images/sort_down.png', true, array('style' => $selectAgentNameDown, 'alt' => 'down')) . '</a>';
|
||||
}
|
||||
$table->head[1] .=' <a href="index.php?sec=estado&sec2=operation/agentes/status_monitor&refr=' . $refr . '&datatype='.$datatype . '&moduletype='.$moduletype . '&modulegroup='.$modulegroup . '&offset=' . $offset . '&ag_group=' . $ag_group . '&ag_freestring=' . $ag_freestring . '&ag_modulename=' . $ag_modulename . '&status=' . $status . $ag_custom_fields_params . '&sort_field=agent_name&sort=up">' . html_print_image('images/sort_up.png', true, array('style' => $selectAgentNameUp, 'alt' => 'up')) . '</a>' .
|
||||
'<a href="index.php?sec=estado&sec2=operation/agentes/status_monitor&refr=' . $refr . '&datatype='.$datatype . '&moduletype='.$moduletype . '&modulegroup='.$modulegroup . '&offset=' . $offset . '&ag_group=' . $ag_group . '&ag_freestring=' . $ag_freestring . '&ag_modulename=' . $ag_modulename . '&status=' . $status . $ag_custom_fields_params . '&sort_field=agent_name&sort=down">' . html_print_image('images/sort_down.png', true, array('style' => $selectAgentNameDown, 'alt' => 'down')) . '</a>';
|
||||
|
||||
$table->head[2] = __('Data Type');
|
||||
if (!is_metaconsole()) {
|
||||
$table->head[2] .= ' <a href="index.php?sec=estado&sec2=operation/agentes/status_monitor&datatype='.$datatype . '&moduletype='.$moduletype . '&refr=' . $refr . '&modulegroup='.$modulegroup . '&offset=' . $offset . '&ag_group=' . $ag_group . '&ag_freestring=' . $ag_freestring . '&ag_modulename=' . $ag_modulename . '&status=' . $status . $ag_custom_fields_params . '&sort_field=type&sort=up">' . html_print_image('images/sort_up.png', true, array('style' => $selectTypeUp, 'alt' => 'up')) . '</a>' .
|
||||
'<a href="index.php?sec=estado&sec2=operation/agentes/status_monitor&datatype='.$datatype . '&moduletype='.$moduletype . '&refr=' . $refr . '&modulegroup='.$modulegroup . '&offset=' . $offset . '&ag_group=' . $ag_group . '&ag_freestring=' . $ag_freestring . '&ag_modulename=' . $ag_modulename . '&status=' . $status . $ag_custom_fields_params . '&sort_field=type&sort=down">' . html_print_image('images/sort_down.png', true, array('style' => $selectTypeDown, 'alt' => 'down')) . '</a>';
|
||||
}
|
||||
$table->head[2] .= ' <a href="index.php?sec=estado&sec2=operation/agentes/status_monitor&datatype='.$datatype . '&moduletype='.$moduletype . '&refr=' . $refr . '&modulegroup='.$modulegroup . '&offset=' . $offset . '&ag_group=' . $ag_group . '&ag_freestring=' . $ag_freestring . '&ag_modulename=' . $ag_modulename . '&status=' . $status . $ag_custom_fields_params . '&sort_field=type&sort=up">' . html_print_image('images/sort_up.png', true, array('style' => $selectTypeUp, 'alt' => 'up')) . '</a>' .
|
||||
'<a href="index.php?sec=estado&sec2=operation/agentes/status_monitor&datatype='.$datatype . '&moduletype='.$moduletype . '&refr=' . $refr . '&modulegroup='.$modulegroup . '&offset=' . $offset . '&ag_group=' . $ag_group . '&ag_freestring=' . $ag_freestring . '&ag_modulename=' . $ag_modulename . '&status=' . $status . $ag_custom_fields_params . '&sort_field=type&sort=down">' . html_print_image('images/sort_down.png', true, array('style' => $selectTypeDown, 'alt' => 'down')) . '</a>';
|
||||
|
||||
$table->align[2] = 'left';
|
||||
|
||||
$table->head[3] = __('Module name');
|
||||
if (!is_metaconsole()) {
|
||||
$table->head[3] .= ' <a href="index.php?sec=estado&sec2=operation/agentes/status_monitor&datatype='.$datatype . '&moduletype='.$moduletype . '&refr=' . $refr . '&modulegroup='.$modulegroup . '&offset=' . $offset . '&ag_group=' . $ag_group . '&ag_freestring=' . $ag_freestring . '&ag_modulename=' . $ag_modulename . '&status=' . $status . $ag_custom_fields_params . '&sort_field=module_name&sort=up">' . html_print_image('images/sort_up.png', true, array('style' => $selectModuleNameUp, 'alt' => 'up')) . '</a>' .
|
||||
'<a href="index.php?sec=estado&sec2=operation/agentes/status_monitor&datatype='.$datatype . '&moduletype='.$moduletype . '&refr=' . $refr . '&modulegroup='.$modulegroup . '&offset=' . $offset . '&ag_group=' . $ag_group . '&ag_freestring=' . $ag_freestring . '&ag_modulename=' . $ag_modulename . '&status=' . $status . $ag_custom_fields_params . '&sort_field=module_name&sort=down">' . html_print_image('images/sort_down.png', true, array('style' => $selectModuleNameDown, 'alt' => 'down')) . '</a>';
|
||||
}
|
||||
$table->head[3] .= ' <a href="index.php?sec=estado&sec2=operation/agentes/status_monitor&datatype='.$datatype . '&moduletype='.$moduletype . '&refr=' . $refr . '&modulegroup='.$modulegroup . '&offset=' . $offset . '&ag_group=' . $ag_group . '&ag_freestring=' . $ag_freestring . '&ag_modulename=' . $ag_modulename . '&status=' . $status . $ag_custom_fields_params . '&sort_field=module_name&sort=up">' . html_print_image('images/sort_up.png', true, array('style' => $selectModuleNameUp, 'alt' => 'up')) . '</a>' .
|
||||
'<a href="index.php?sec=estado&sec2=operation/agentes/status_monitor&datatype='.$datatype . '&moduletype='.$moduletype . '&refr=' . $refr . '&modulegroup='.$modulegroup . '&offset=' . $offset . '&ag_group=' . $ag_group . '&ag_freestring=' . $ag_freestring . '&ag_modulename=' . $ag_modulename . '&status=' . $status . $ag_custom_fields_params . '&sort_field=module_name&sort=down">' . html_print_image('images/sort_down.png', true, array('style' => $selectModuleNameDown, 'alt' => 'down')) . '</a>';
|
||||
|
||||
$table->head[4] = __('Server type');
|
||||
if (!is_metaconsole()) {
|
||||
$table->head[4] .= ' <a href="index.php?sec=estado&sec2=operation/agentes/status_monitor&datatype='.$datatype . '&moduletype='.$moduletype . '&refr=' . $refr . '&modulegroup='.$modulegroup . '&offset=' . $offset . '&ag_group=' . $ag_group . '&ag_freestring=' . $ag_freestring . '&ag_modulename=' . $ag_modulename . '&status=' . $status . $ag_custom_fields_params . '&sort_field=moduletype&sort=up">' . html_print_image('images/sort_up.png', true, array('style' => $selectModuleNameUp, 'alt' => 'up')) . '</a>' .
|
||||
'<a href="index.php?sec=estado&sec2=operation/agentes/status_monitor&datatype='.$datatype . '&moduletype='.$moduletype . '&refr=' . $refr . '&modulegroup='.$modulegroup . '&offset=' . $offset . '&ag_group=' . $ag_group . '&ag_freestring=' . $ag_freestring . '&ag_modulename=' . $ag_modulename . '&status=' . $status . $ag_custom_fields_params . '&sort_field=moduletype&sort=down">' . html_print_image('images/sort_down.png', true, array('style' => $selectModuleNameDown, 'alt' => 'down')) . '</a>';
|
||||
}
|
||||
$table->head[4] = __('Server type');
|
||||
$table->head[4] .= ' <a href="index.php?sec=estado&sec2=operation/agentes/status_monitor&datatype='.$datatype . '&moduletype='.$moduletype . '&refr=' . $refr . '&modulegroup='.$modulegroup . '&offset=' . $offset . '&ag_group=' . $ag_group . '&ag_freestring=' . $ag_freestring . '&ag_modulename=' . $ag_modulename . '&status=' . $status . $ag_custom_fields_params . '&sort_field=moduletype&sort=up">' . html_print_image('images/sort_up.png', true, array('style' => $selectModuleNameUp, 'alt' => 'up')) . '</a>' .
|
||||
'<a href="index.php?sec=estado&sec2=operation/agentes/status_monitor&datatype='.$datatype . '&moduletype='.$moduletype . '&refr=' . $refr . '&modulegroup='.$modulegroup . '&offset=' . $offset . '&ag_group=' . $ag_group . '&ag_freestring=' . $ag_freestring . '&ag_modulename=' . $ag_modulename . '&status=' . $status . $ag_custom_fields_params . '&sort_field=moduletype&sort=down">' . html_print_image('images/sort_down.png', true, array('style' => $selectModuleNameDown, 'alt' => 'down')) . '</a>';
|
||||
|
||||
|
||||
$table->head[5] = __('Interval');
|
||||
if (!is_metaconsole()) {
|
||||
$table->head[5] .= ' <a href="index.php?sec=estado&sec2=operation/agentes/status_monitor&datatype='.$datatype . '&moduletype='.$moduletype . '&refr=' . $refr . '&modulegroup='.$modulegroup . '&offset=' . $offset . '&ag_group=' . $ag_group . '&ag_freestring=' . $ag_freestring . '&ag_modulename=' . $ag_modulename . '&status=' . $status . $ag_custom_fields_params . '&sort_field=interval&sort=up">' . html_print_image('images/sort_up.png', true, array('style' => $selectIntervalUp, 'alt' => 'up')) . '</a>' .
|
||||
'<a href="index.php?sec=estado&sec2=operation/agentes/status_monitor&datatype='.$datatype . '&moduletype='.$moduletype . '&refr=' . $refr . '&modulegroup='.$modulegroup . '&offset=' . $offset . '&ag_group=' . $ag_group . '&ag_freestring=' . $ag_freestring . '&ag_modulename=' . $ag_modulename . '&status=' . $status . $ag_custom_fields_params . '&sort_field=interval&sort=down">' . html_print_image('images/sort_down.png', true, array('style' => $selectIntervalDown, 'alt' => 'down')) . '</a>';
|
||||
$table->align[5] = 'left';
|
||||
}
|
||||
$table->head[5] .= ' <a href="index.php?sec=estado&sec2=operation/agentes/status_monitor&datatype='.$datatype . '&moduletype='.$moduletype . '&refr=' . $refr . '&modulegroup='.$modulegroup . '&offset=' . $offset . '&ag_group=' . $ag_group . '&ag_freestring=' . $ag_freestring . '&ag_modulename=' . $ag_modulename . '&status=' . $status . $ag_custom_fields_params . '&sort_field=interval&sort=up">' . html_print_image('images/sort_up.png', true, array('style' => $selectIntervalUp, 'alt' => 'up')) . '</a>' .
|
||||
'<a href="index.php?sec=estado&sec2=operation/agentes/status_monitor&datatype='.$datatype . '&moduletype='.$moduletype . '&refr=' . $refr . '&modulegroup='.$modulegroup . '&offset=' . $offset . '&ag_group=' . $ag_group . '&ag_freestring=' . $ag_freestring . '&ag_modulename=' . $ag_modulename . '&status=' . $status . $ag_custom_fields_params . '&sort_field=interval&sort=down">' . html_print_image('images/sort_down.png', true, array('style' => $selectIntervalDown, 'alt' => 'down')) . '</a>';
|
||||
$table->align[5] = 'left';
|
||||
|
||||
$table->head[6] = __('Status');
|
||||
if (!is_metaconsole()) {
|
||||
$table->head[6] .= ' <a href="index.php?sec=estado&sec2=operation/agentes/status_monitor&datatype='.$datatype . '&moduletype='.$moduletype . '&refr=' . $refr . '&modulegroup='.$modulegroup . '&offset=' . $offset . '&ag_group=' . $ag_group . '&ag_freestring=' . $ag_freestring . '&ag_modulename=' . $ag_modulename . '&status=' . $status . $ag_custom_fields_params . '&sort_field=status&sort=up">' . html_print_image('images/sort_up.png', true, array('style' => $selectStatusUp, 'alt' => 'up')) . '</a>' .
|
||||
'<a href="index.php?sec=estado&sec2=operation/agentes/status_monitor&datatype='.$datatype . '&moduletype='.$moduletype . '&refr=' . $refr . '&modulegroup='.$modulegroup . '&offset=' . $offset . '&ag_group=' . $ag_group . '&ag_freestring=' . $ag_freestring . '&ag_modulename=' . $ag_modulename . '&status=' . $status . $ag_custom_fields_params . '&sort_field=status&sort=down">' . html_print_image('images/sort_down.png', true, array('style' => $selectStatusDown, 'alt' => 'down')) . '</a>';
|
||||
}
|
||||
$table->head[6] .= ' <a href="index.php?sec=estado&sec2=operation/agentes/status_monitor&datatype='.$datatype . '&moduletype='.$moduletype . '&refr=' . $refr . '&modulegroup='.$modulegroup . '&offset=' . $offset . '&ag_group=' . $ag_group . '&ag_freestring=' . $ag_freestring . '&ag_modulename=' . $ag_modulename . '&status=' . $status . $ag_custom_fields_params . '&sort_field=status&sort=up">' . html_print_image('images/sort_up.png', true, array('style' => $selectStatusUp, 'alt' => 'up')) . '</a>' .
|
||||
'<a href="index.php?sec=estado&sec2=operation/agentes/status_monitor&datatype='.$datatype . '&moduletype='.$moduletype . '&refr=' . $refr . '&modulegroup='.$modulegroup . '&offset=' . $offset . '&ag_group=' . $ag_group . '&ag_freestring=' . $ag_freestring . '&ag_modulename=' . $ag_modulename . '&status=' . $status . $ag_custom_fields_params . '&sort_field=status&sort=down">' . html_print_image('images/sort_down.png', true, array('style' => $selectStatusDown, 'alt' => 'down')) . '</a>';
|
||||
|
||||
$table->align[6] = 'left';
|
||||
|
||||
|
@ -981,11 +984,9 @@ if (!empty($result)) {
|
|||
}
|
||||
|
||||
$table->head[10] = __('Timestamp');
|
||||
if (!is_metaconsole()) {
|
||||
$table->head[10] .= ' <a href="index.php?sec=estado&sec2=operation/agentes/status_monitor&datatype='.$datatype . '&moduletype='.$moduletype . '&refr=' . $refr . '&offset=' . $offset . '&ag_group=' . $ag_group . '&ag_freestring=' . $ag_freestring . '&ag_modulename=' . $ag_modulename . '&status=' . $status . $ag_custom_fields_params . '&sort_field=timestamp&sort=up">' . html_print_image('images/sort_up.png', true, array('style' => $selectTimestampUp, 'alt' => 'up')) . '</a>' .
|
||||
'<a href="index.php?sec=estado&sec2=operation/agentes/status_monitor&datatype='.$datatype . '&moduletype='.$moduletype . '&refr=' . $refr . '&modulegroup='.$modulegroup . '&offset=' . $offset . '&ag_group=' . $ag_group . '&ag_freestring=' . $ag_freestring . '&ag_modulename=' . $ag_modulename . '&status=' . $status . $ag_custom_fields_params . '&sort_field=timestamp&sort=down">' . html_print_image('images/sort_down.png', true, array('style' => $selectTimestampDown, 'alt' => 'down')) . '</a>';
|
||||
$table->align[10] = 'left';
|
||||
}
|
||||
$table->head[10] .= ' <a href="index.php?sec=estado&sec2=operation/agentes/status_monitor&datatype='.$datatype . '&moduletype='.$moduletype . '&refr=' . $refr . '&offset=' . $offset . '&ag_group=' . $ag_group . '&ag_freestring=' . $ag_freestring . '&ag_modulename=' . $ag_modulename . '&status=' . $status . $ag_custom_fields_params . '&sort_field=timestamp&sort=up">' . html_print_image('images/sort_up.png', true, array('style' => $selectTimestampUp, 'alt' => 'up')) . '</a>' .
|
||||
'<a href="index.php?sec=estado&sec2=operation/agentes/status_monitor&datatype='.$datatype . '&moduletype='.$moduletype . '&refr=' . $refr . '&modulegroup='.$modulegroup . '&offset=' . $offset . '&ag_group=' . $ag_group . '&ag_freestring=' . $ag_freestring . '&ag_modulename=' . $ag_modulename . '&status=' . $status . $ag_custom_fields_params . '&sort_field=timestamp&sort=down">' . html_print_image('images/sort_down.png', true, array('style' => $selectTimestampDown, 'alt' => 'down')) . '</a>';
|
||||
$table->align[10] = 'left';
|
||||
|
||||
$id_type_web_content_string = db_get_value('id_tipo', 'ttipo_modulo',
|
||||
'nombre', 'web_content_string');
|
||||
|
|
|
@ -35,6 +35,7 @@ if (is_ajax ()) {
|
|||
$get_agent_modules_json = (bool) get_parameter ('get_agent_modules_json');
|
||||
$get_agent_status_tooltip = (bool) get_parameter ("get_agent_status_tooltip");
|
||||
$get_agents_group_json = (bool) get_parameter ("get_agents_group_json");
|
||||
$get_modules_group_json = (bool) get_parameter ("get_modules_group_json");
|
||||
$get_agent_modules_json_for_multiple_agents = (bool) get_parameter("get_agent_modules_json_for_multiple_agents");
|
||||
$get_agent_modules_alerts_json_for_multiple_agents = (bool) get_parameter("get_agent_modules_alerts_json_for_multiple_agents");
|
||||
$get_agents_json_for_multiple_modules = (bool) get_parameter("get_agents_json_for_multiple_modules");
|
||||
|
@ -104,10 +105,14 @@ if (is_ajax ()) {
|
|||
$agents = db_get_all_rows_filter('tagente', $filter, $fields);
|
||||
if (empty($agents)) $agents = array();
|
||||
|
||||
foreach ($agents as $k => $v) {
|
||||
$agents[$k] = io_safe_output($v);
|
||||
}
|
||||
|
||||
// Add keys prefix
|
||||
if ($keys_prefix !== '') {
|
||||
foreach ($agents as $k => $v) {
|
||||
$agents[$keys_prefix . $k] = $v;
|
||||
$agents[$keys_prefix . $k] = io_safe_output($v);
|
||||
unset($agents[$k]);
|
||||
}
|
||||
}
|
||||
|
@ -115,6 +120,34 @@ if (is_ajax ()) {
|
|||
echo json_encode($agents);
|
||||
return;
|
||||
}
|
||||
|
||||
if ($get_modules_group_json) {
|
||||
$id_group = (int) get_parameter('id_module_group');
|
||||
$id_agents = get_parameter('id_agents');
|
||||
|
||||
$agents = implode(",", $id_agents);
|
||||
|
||||
$filter_group = "";
|
||||
$filter_agent = "";
|
||||
|
||||
if ($id_group != 0) {
|
||||
$filter_group = " AND id_module_group = ". $id_group;
|
||||
}
|
||||
if ($agents != null) {
|
||||
$filter_agent = " AND id_agente IN (" . $agents . ")";
|
||||
}
|
||||
|
||||
$modules = db_get_all_rows_sql("SELECT nombre, id_agente_modulo FROM tagente_modulo WHERE 1 = 1" . $filter_agent . $filter_group);
|
||||
|
||||
if (empty($modules)) $modules = array();
|
||||
|
||||
foreach ($modules as $k => $v) {
|
||||
$modules[$k] = io_safe_output($v);
|
||||
}
|
||||
|
||||
echo json_encode($modules);
|
||||
return;
|
||||
}
|
||||
|
||||
if ($get_agent_json) {
|
||||
$id_agent = (int) get_parameter ('id_agent');
|
||||
|
@ -135,7 +168,7 @@ if (is_ajax ()) {
|
|||
|
||||
$return = array();
|
||||
foreach ($modules as $module) {
|
||||
$return[$module['id_agente_modulo']] = $module['nombre'];
|
||||
$return[$module['id_agente_modulo']] = io_safe_output($module['nombre']);
|
||||
}
|
||||
|
||||
echo json_encode($return);
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
#
|
||||
%define name pandorafms_console
|
||||
%define version 6.1dev
|
||||
%define release 161114
|
||||
%define release 161116
|
||||
|
||||
# User and Group under which Apache is running
|
||||
%define httpd_name httpd
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
#
|
||||
%define name pandorafms_console
|
||||
%define version 6.1dev
|
||||
%define release 161114
|
||||
%define release 161116
|
||||
%define httpd_name httpd
|
||||
# User and Group under which Apache is running
|
||||
%define httpd_name apache2
|
||||
|
|
|
@ -66,7 +66,7 @@ INSERT INTO tconfig (token, value) VALUES ('graph_res','5');
|
|||
INSERT INTO tconfig (token, value) VALUES ('step_compact','1');
|
||||
INSERT INTO tconfig (token, value) VALUES ('db_scheme_first_version','6.0orc');
|
||||
INSERT INTO tconfig (token, value) VALUES('db_scheme_version','6.1dev');
|
||||
INSERT INTO tconfig (token, value) VALUES('db_scheme_build','PD161114');
|
||||
INSERT INTO tconfig (token, value) VALUES('db_scheme_build','PD161116');
|
||||
INSERT INTO tconfig (token, value) VALUES ('show_unknown','0');
|
||||
INSERT INTO tconfig (token, value) VALUES ('show_lastalerts','1');
|
||||
INSERT INTO tconfig (token, value) VALUES ('style','pandora');
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
package: pandorafms-server
|
||||
Version: 6.1dev-161114
|
||||
Version: 6.1dev-161116
|
||||
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="6.1dev-161114"
|
||||
pandora_version="6.1dev-161116"
|
||||
|
||||
package_cpan=0
|
||||
package_pandora=1
|
||||
|
|
|
@ -43,7 +43,7 @@ our @EXPORT = qw(
|
|||
|
||||
# version: Defines actual version of Pandora Server for this module only
|
||||
my $pandora_version = "6.1dev";
|
||||
my $pandora_build = "161114";
|
||||
my $pandora_build = "161116";
|
||||
our $VERSION = $pandora_version." ".$pandora_build;
|
||||
|
||||
# Setup hash
|
||||
|
@ -426,6 +426,9 @@ sub pandora_load_config {
|
|||
$pa_config->{"warmup_unknown_on"} = 1; # 6.1
|
||||
|
||||
#$pa_config->{'include_agents'} = 0; #6.1
|
||||
#
|
||||
# External .enc files for XML::Parser.
|
||||
$pa_config->{"enc_dir"} = ""; # > 6.0SP4
|
||||
|
||||
# Check for UID0
|
||||
if ($pa_config->{"quiet"} != 0){
|
||||
|
@ -956,6 +959,9 @@ sub pandora_load_config {
|
|||
#elsif ($parametro =~ m/^include_agents\s+([0-1])/i) {
|
||||
# $pa_config->{'include_agents'}= clean_blank($1);
|
||||
#}
|
||||
elsif ($parametro =~ m/^enc_dir\s+(.*)/i) {
|
||||
$pa_config->{'enc_dir'} = clean_blank($1);
|
||||
}
|
||||
} # end of loop for parameter #
|
||||
|
||||
# Set to RDBMS' standard port
|
||||
|
|
|
@ -2697,6 +2697,9 @@ sub pandora_create_module_from_hash ($$$) {
|
|||
if (defined $parameters->{'id_network_component_group'}) {
|
||||
delete $parameters->{'id_network_component_group'};
|
||||
}
|
||||
if (defined $parameters->{'timestamp'}) {
|
||||
delete $parameters->{'timestamp'};
|
||||
}
|
||||
|
||||
# Encrypt plug-in passwords.
|
||||
if (defined($parameters->{'plugin_pass'})) {
|
||||
|
|
|
@ -25,6 +25,7 @@ use threads::shared;
|
|||
use Thread::Semaphore;
|
||||
|
||||
use Time::Local;
|
||||
use XML::Parser::Expat;
|
||||
use XML::Simple;
|
||||
use POSIX qw(setsid strftime);
|
||||
|
||||
|
@ -71,6 +72,29 @@ sub new ($$;$) {
|
|||
# Call the constructor of the parent class
|
||||
my $self = $class->SUPER::new($config, DATASERVER, \&PandoraFMS::DataServer::data_producer, \&PandoraFMS::DataServer::data_consumer, $dbh);
|
||||
|
||||
# Load external .enc files for XML::Parser.
|
||||
if ($config->{'enc_dir'} ne '') {
|
||||
if (opendir(my $dh, $config->{'enc_dir'})) {
|
||||
while (my $enc_file = readdir($dh)) {
|
||||
|
||||
# Ignore unknown files.
|
||||
next unless ($enc_file =~ m/.enc$/);
|
||||
|
||||
# Load the .enc file.
|
||||
eval {
|
||||
local $SIG{__DIE__} = {};
|
||||
XML::Parser::Expat::load_encoding($config->{'enc_dir'} . '/' . $enc_file);
|
||||
};
|
||||
if ($@) {
|
||||
print_message ($config, " [WARNING] Error loading encoding file: $enc_file", 1);
|
||||
}
|
||||
}
|
||||
closedir($dh);
|
||||
} else {
|
||||
print_message($config, " [WARNING] Error opening directory " . $config->{'enc_dir'} . ": $!", 1);
|
||||
}
|
||||
}
|
||||
|
||||
bless $self, $class;
|
||||
return $self;
|
||||
}
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
#
|
||||
%define name pandorafms_server
|
||||
%define version 6.1dev
|
||||
%define release 161114
|
||||
%define release 161116
|
||||
|
||||
Summary: Pandora FMS Server
|
||||
Name: %{name}
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
#
|
||||
%define name pandorafms_server
|
||||
%define version 6.1dev
|
||||
%define release 161114
|
||||
%define release 161116
|
||||
|
||||
Summary: Pandora FMS Server
|
||||
Name: %{name}
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
# **********************************************************************
|
||||
|
||||
PI_VERSION="6.1dev"
|
||||
PI_BUILD="161114"
|
||||
PI_BUILD="161116"
|
||||
|
||||
MODE=$1
|
||||
if [ $# -gt 1 ]; then
|
||||
|
|
|
@ -33,7 +33,7 @@ use PandoraFMS::Tools;
|
|||
use PandoraFMS::DB;
|
||||
|
||||
# version: define current version
|
||||
my $version = "6.1dev PS161114";
|
||||
my $version = "6.1dev PS161116";
|
||||
|
||||
# Pandora server configuration
|
||||
my %conf;
|
||||
|
|
|
@ -35,7 +35,7 @@ use Encode::Locale;
|
|||
Encode::Locale::decode_argv;
|
||||
|
||||
# version: define current version
|
||||
my $version = "6.1dev PS161114";
|
||||
my $version = "6.1dev PS161116";
|
||||
|
||||
# save program name for logging
|
||||
my $progname = basename($0);
|
||||
|
|
Loading…
Reference in New Issue