Merge branch 'develop' into '1211-Falta-tabla-de-proceso-de-reseteo-de-contraseñas-en-MR'

# Conflicts:
#   pandora_console/extras/mr/6.sql
This commit is contained in:
Enrique Camargo 2017-08-31 18:21:08 +02:00
commit 6b4a15534d
58 changed files with 720 additions and 353 deletions

View File

@ -1,5 +1,5 @@
package: pandorafms-agent-unix
Version: 7.0NG.711-170828
Version: 7.0NG.711-170831
Architecture: all
Priority: optional
Section: admin

View File

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

View File

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

View File

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

View File

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

View File

@ -10,7 +10,7 @@
# **********************************************************************
PI_VERSION="7.0NG.711"
PI_BUILD="170828"
PI_BUILD="170831"
OS_NAME=`uname -s`
FORCE=0

View File

@ -186,7 +186,7 @@ UpgradeApplicationID
{}
Version
{170828}
{170831}
ViewReadme
{Yes}

View File

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

View File

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

View File

@ -1,5 +1,5 @@
package: pandorafms-console
Version: 7.0NG.711-170828
Version: 7.0NG.711-170831
Architecture: all
Priority: optional
Section: admin

View File

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

View File

@ -9,6 +9,7 @@ CREATE TABLE IF NOT EXISTS treset_pass_history (
success tinyint(1) NOT NULL,
PRIMARY KEY (id)) ENGINE=InnoDB DEFAULT CHARSET=utf8;
ALTER TABLE tserver ADD COLUMN exec_proxy tinyint(1) UNSIGNED NOT NULL default 0;
ALTER TABLE tevent_response ADD COLUMN server_to_exec int(10) unsigned NOT NULL DEFAULT 0;

View File

@ -1416,3 +1416,13 @@ ALTER TABLE tgraph_source ADD COLUMN id_server int(11) UNSIGNED NOT NULL default
-- ---------------------------------------------------------------------
ALTER TABLE tserver_export_data MODIFY `module_name` varchar(600) BINARY NOT NULL default '';
-- ---------------------------------------------------------------------
-- Table `tserver`
-- ---------------------------------------------------------------------
ALTER TABLE tserver ADD COLUMN exec_proxy tinyint(1) UNSIGNED NOT NULL default 0;
-- ---------------------------------------------------------------------
-- Table `tevent_response`
-- ---------------------------------------------------------------------
ALTER TABLE tevent_response ADD COLUMN server_to_exec int(10) unsigned NOT NULL DEFAULT 0;

View File

@ -193,7 +193,16 @@ config_check();
$select = db_process_sql("SELECT autorefresh_white_list FROM tusuario WHERE id_user = '" . $config['id_user'] . "'");
$autorefresh_list = json_decode($select[0]['autorefresh_white_list']);
if ($autorefresh_list !== null && array_search($_GET['sec2'], $autorefresh_list) !== false) {
$do_refresh = true;
if ($_GET['sec2'] == 'operation/agentes/pandora_networkmap') {
if ((!isset($_GET['tab'])) || ($_GET['tab'] != 'view')) {
$do_refresh = false;
}
}
if ($do_refresh) {
$autorefresh_img = html_print_image("images/header_refresh.png", true, array("class" => 'bot', "alt" => 'lightning', 'title' => __('Configure autorefresh')));
if ($_GET['refr']) {
@ -229,6 +238,16 @@ config_check();
$autorefresh_link_open_txt = '';
$autorefresh_link_close = '';
}
}
else {
$autorefresh_img = html_print_image("images/header_refresh_disabled.png", true, array("class" => 'bot autorefresh_disabled', "alt" => 'lightning', 'title' => __('Disabled autorefresh')));
$ignored_params['refr'] = false;
$autorefresh_link_open_img = '';
$autorefresh_link_open_txt = '';
$autorefresh_link_close = '';
}
$table->data[0][1] = $autorefresh_link_open_img . $autorefresh_img . $autorefresh_link_close;
$table->data[0][2] = $autorefresh_link_open_txt . $autorefresh_txt . $autorefresh_link_close . $autorefresh_additional;
@ -357,6 +376,14 @@ config_check();
$(document).ready (function () {
<?php
if (($autorefresh_list !== null) && (array_search($_GET['sec2'], $autorefresh_list) !== false) && (!isset($_GET["refr"]))) {
$do_refresh = true;
if ($_GET['sec2'] == 'operation/agentes/pandora_networkmap') {
if ((!isset($_GET['tab'])) || ($_GET['tab'] != 'view')) {
$do_refresh = false;
}
}
if ($do_refresh) {
?>
$("a.autorefresh_txt").toggle ();
$("#combo_refr").toggle ();
@ -365,9 +392,9 @@ config_check();
$(document).attr ("location", href + "30");
<?php
}
}
?>
if (fixed_header) {
$('div#head').addClass('fixed_header');
$('div#page')

View File

@ -232,7 +232,7 @@ if(!$new_agent){
if ($id_agente) {
$table->data[2][2] =
"<a id='qr_code_agent_view' href='javascript: show_dialog_qrcode(null, \"" .
ui_get_full_url('index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente=' . $id_agente) . "\" );'></a>";
ui_get_full_url('mobile/index.php?page=agent&id=' . $id_agente) . "\" );'></a>";
}
else {
$table->data[2][2] = __("Only it is show when<br />the agent is saved.");
@ -261,6 +261,9 @@ $params['print_hidden_input_idagent'] = true;
$params['hidden_input_idagent_name'] = 'id_agent_parent';
$params['hidden_input_idagent_value'] = $id_parent;
$params['value'] = db_get_value ("alias","tagente","id_agente",$id_parent);
$params['selectbox_id'] = 'cascade_protection_module';
$params['javascript_is_function_select'] = true;
$table->data[3][1] = ui_print_agent_autocomplete_input($params);
$table->data[3][1] .= html_print_checkbox ("cascade_protection", 1, $cascade_protection, true).__('Cascade protection'). "&nbsp;" . ui_print_help_icon("cascade_protection", true);
@ -579,40 +582,9 @@ ui_require_jquery_file('bgiframe');
}
});
$("#text-id_parent").on("autocompletechange", function () {
agent_id=$("#hidden-id_parent").val();
var params = {};
params["get_agent_modules_json_by_name"] = 1;
params["id_agent"] = agent_id;
params["page"] = "include/ajax/module";
jQuery.ajax ({
data: params,
dataType: "json",
type: "POST",
url: "ajax.php",
success: function (data) {
$('#cascade_protection_module').empty();
$('#cascade_protection_module')
.append ($('<option></option>')
.html("Any")
.prop("value", 0)
.prop("selected", 'selected'));
jQuery.each (data, function (i, val) {
$('#cascade_protection_module')
.append ($('<option></option>')
.html(val['name'])
.prop("value", val['id_module'])
.prop("selected", 'selected'));
});
}
});
});
paint_qrcode(
"<?php
echo ui_get_full_url('index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente=' . $id_agente);
echo ui_get_full_url('mobile/index.php?page=agent&id=' . $id_agente);
?>",
"#qr_code_agent_view", 128, 128);
$("#text-agente").prop('disabled', true);

View File

@ -34,6 +34,7 @@ $ip_target = (string) get_parameter ('ip_target', $ipAgent);
$use_agent = get_parameter ('use_agent');
$snmp_community = (string) get_parameter ('snmp_community', 'public');
$snmp_version = get_parameter('snmp_version', '1');
$server_to_exec = get_parameter('server_to_exec', 0);
$snmp3_auth_user = get_parameter('snmp3_auth_user');
$snmp3_security_level = get_parameter('snmp3_security_level');
$snmp3_auth_method = get_parameter('snmp3_auth_method');
@ -87,7 +88,8 @@ if ($snmpwalk) {
// OID Used is for DISKS
$snmpis = get_snmpwalk($ip_target, $snmp_version, $snmp_community, $snmp3_auth_user,
$snmp3_security_level, $snmp3_auth_method, $snmp3_auth_pass,
$snmp3_privacy_method, $snmp3_privacy_pass, 0, ".1.3.6.1.2.1.25.2.3.1.3", $tcp_port);
$snmp3_privacy_method, $snmp3_privacy_pass, 0, ".1.3.6.1.2.1.25.2.3.1.3", $tcp_port,
$server_to_exec);
if (empty($snmpis)) {
$fail = true;
@ -120,7 +122,8 @@ if ($snmpwalk) {
// OID Used is for PROCESSES
$snmpis = get_snmpwalk($ip_target, $snmp_version, $snmp_community, $snmp3_auth_user,
$snmp3_security_level, $snmp3_auth_method, $snmp3_auth_pass,
$snmp3_privacy_method, $snmp3_privacy_pass, 0, ".1.3.6.1.2.1.25.4.2.1.2", $tcp_port);
$snmp3_privacy_method, $snmp3_privacy_pass, 0, ".1.3.6.1.2.1.25.4.2.1.2", $tcp_port,
$server_to_exec);
if ($snmpis === false) {
$snmpis = array();
@ -158,7 +161,8 @@ if ($snmpwalk) {
// OID Used is for SENSOR TEMPERATURES
$snmpis = get_snmpwalk($ip_target, $snmp_version, $snmp_community, $snmp3_auth_user,
$snmp3_security_level, $snmp3_auth_method, $snmp3_auth_pass,
$snmp3_privacy_method, $snmp3_privacy_pass, 0, ".1.3.6.1.4.1.2021.13.16.2.1", $tcp_port);
$snmp3_privacy_method, $snmp3_privacy_pass, 0, ".1.3.6.1.4.1.2021.13.16.2.1", $tcp_port,
$server_to_exec);
if ($snmpis === false) {
$snmpis = array();
@ -196,7 +200,8 @@ if ($snmpwalk) {
// OID Used is for DEVICES
$snmpis = get_snmpwalk($ip_target, $snmp_version, $snmp_community, $snmp3_auth_user,
$snmp3_security_level, $snmp3_auth_method, $snmp3_auth_pass,
$snmp3_privacy_method, $snmp3_privacy_pass, 0, ".1.3.6.1.4.1.2021.13.15.1.1", $tcp_port);
$snmp3_privacy_method, $snmp3_privacy_pass, 0, ".1.3.6.1.4.1.2021.13.15.1.1", $tcp_port,
$server_to_exec);
if ($snmpis === false) {
$snmpis = array();
@ -706,6 +711,19 @@ $table->data[0][3] = html_print_input_text ('tcp_port', $tcp_port, '', 5, 20, tr
$table->data[1][0] = '<b>' . __('Use agent ip') . '</b>';
$table->data[1][1] = html_print_checkbox ('use_agent', 1, $use_agent, true);
$servers_to_exec = array();
$servers_to_exec[0] = __('Local console');
if (enterprise_installed()) {
enterprise_include_once ('include/functions_satellite.php');
$rows = get_proxy_servers();
foreach ($rows as $row) {
$servers_to_exec[$row['id_server']] = $row['name'];
}
}
$table->data[1][2] = '<b>' . __('Server to execute command') . '</b>';
$table->data[1][3] = html_print_select ($servers_to_exec, 'server_to_exec', $server_to_exec, '', '', '', true);
$snmp_versions['1'] = 'v. 1';
$snmp_versions['2'] = 'v. 2';
$snmp_versions['2c'] = 'v. 2c';

View File

@ -30,6 +30,7 @@ check_login ();
$ip_target = (string) get_parameter ('ip_target', $ipAgent);
$use_agent = get_parameter ('use_agent');
$snmp_community = (string) get_parameter ('snmp_community', 'public');
$server_to_exec = get_parameter('server_to_exec', 0);
$snmp_version = get_parameter('snmp_version', '1');
$snmp3_auth_user = get_parameter('snmp3_auth_user');
$snmp3_security_level = get_parameter('snmp3_security_level');
@ -53,16 +54,19 @@ if ($snmpwalk) {
// OID Used is for SNMP MIB-2 Interfaces
$snmpis = get_snmpwalk($ip_target, $snmp_version, $snmp_community, $snmp3_auth_user,
$snmp3_security_level, $snmp3_auth_method, $snmp3_auth_pass,
$snmp3_privacy_method, $snmp3_privacy_pass, 0, ".1.3.6.1.2.1.2", $tcp_port);
$snmp3_privacy_method, $snmp3_privacy_pass, 0, ".1.3.6.1.2.1.2", $tcp_port,
$server_to_exec);
// ifXTable is also used
$ifxitems = get_snmpwalk($ip_target, $snmp_version, $snmp_community, $snmp3_auth_user,
$snmp3_security_level, $snmp3_auth_method, $snmp3_auth_pass,
$snmp3_privacy_method, $snmp3_privacy_pass, 0, ".1.3.6.1.2.1.31.1.1", $tcp_port);
$snmp3_privacy_method, $snmp3_privacy_pass, 0, ".1.3.6.1.2.1.31.1.1", $tcp_port,
$server_to_exec);
// Get the interfaces IPV4/IPV6
$snmp_int_ip = get_snmpwalk($ip_target, $snmp_version, $snmp_community, $snmp3_auth_user,
$snmp3_security_level, $snmp3_auth_method, $snmp3_auth_pass,
$snmp3_privacy_method, $snmp3_privacy_pass, 0, ".1.3.6.1.2.1.4.34.1.3", $tcp_port);
$snmp3_privacy_method, $snmp3_privacy_pass, 0, ".1.3.6.1.2.1.4.34.1.3", $tcp_port,
$server_to_exec);
// Build a [<interface id>] => [<interface ip>] array
if (!empty($snmp_int_ip)) {
@ -345,6 +349,19 @@ $table->data[0][3] = html_print_input_text ('tcp_port', $tcp_port, '', 5, 20, tr
$table->data[1][0] = '<b>' . __('Use agent ip') . '</b>';
$table->data[1][1] = html_print_checkbox ('use_agent', 1, $use_agent, true);
$servers_to_exec = array();
$servers_to_exec[0] = __('Local console');
if (enterprise_installed()) {
enterprise_include_once ('include/functions_satellite.php');
$rows = get_proxy_servers();
foreach ($rows as $row) {
$servers_to_exec[$row['id_server']] = $row['name'];
}
}
$table->data[1][2] = '<b>' . __('Server to execute command') . '</b>';
$table->data[1][3] = html_print_select ($servers_to_exec, 'server_to_exec', $server_to_exec, '', '', '', true);
$snmp_versions['1'] = 'v. 1';
$snmp_versions['2'] = 'v. 2';
$snmp_versions['2c'] = 'v. 2c';

View File

@ -29,6 +29,7 @@ $ip_target = (string) get_parameter ('ip_target', $ipAgent); // Host
$plugin_user = (string) get_parameter ('plugin_user', 'Administrator'); // Username
$plugin_pass = io_safe_output(get_parameter('plugin_pass', '')); // Password
$tcp_send = (string) get_parameter ('tcp_send'); // Namespace
$server_to_exec = get_parameter('server_to_exec', true);
//See if id_agente is set (either POST or GET, otherwise -1
$id_agent = $idAgent;
@ -53,7 +54,18 @@ if ($wmiexplore) {
$wmi_processes = $wmi_command . ' "select Name from Win32_Process"';
$processes_name_field = 1;
if (enterprise_installed()) {
if ($server_to_exec != 0) {
$server_data = db_get_row('tserver','id_server', $server_to_exec);
exec("ssh pandora_exec_proxy@" . $server_data['ip_address'] . " '" . $wmi_processes . "'", $output, $rc);
}
else {
exec($wmi_processes, $output);
}
}
else {
exec($wmi_processes, $output);
}
$fail = false;
if (preg_match('/^Failed/', $output[0])) {
@ -79,7 +91,18 @@ if ($wmiexplore) {
$services_name_field = 0;
$services_check_field = 1;
if (enterprise_installed()) {
if ($server_to_exec != 0) {
$server_data = db_get_row('tserver','id_server', $server_to_exec);
exec("ssh pandora_exec_proxy@" . $server_data['ip_address'] . " '" . $wmi_services . "'", $output, $rc);
}
else {
exec($wmi_services, $output);
}
}
else {
exec($wmi_services, $output);
}
foreach ($output as $index => $row) {
// First and second rows are Class and column names, ignore it
@ -98,7 +121,18 @@ if ($wmiexplore) {
$wmi_disks = $wmi_command . ' "Select DeviceID from Win32_LogicalDisk"';
$disks_name_field = 0;
if (enterprise_installed()) {
if ($server_to_exec != 0) {
$server_data = db_get_row('tserver','id_server', $server_to_exec);
exec("ssh pandora_exec_proxy@" . $server_data['ip_address'] . " '" . $wmi_disks . "'", $output, $rc);
}
else {
exec($wmi_disks, $output);
}
}
else {
exec($wmi_disks, $output);
}
foreach ($output as $index => $row) {
// First and second rows are Class and column names, ignore it
@ -267,6 +301,19 @@ $table->data[1][3] = html_print_input_password ('plugin_pass', $plugin_pass, '',
$table->data[1][3] .= '<div id="spinner_modules" style="float: left; display: none;">' . html_print_image("images/spinner.gif", true) . '</div>';
html_print_input_hidden('wmiexplore', 1);
$servers_to_exec = array();
$servers_to_exec[0] = __('Local console');
if (enterprise_installed()) {
enterprise_include_once ('include/functions_satellite.php');
$rows = get_proxy_servers();
foreach ($rows as $row) {
$servers_to_exec[$row['id_server']] = $row['name'];
}
}
$table->data[2][0] = '<b>' . __('Server to execute command') . '</b>';
$table->data[2][1] = html_print_select ($servers_to_exec, 'server_to_exec', $server_to_exec, '', '', '', true);
html_print_table($table);
echo "<div style='text-align:right; width:".$table->width."'>";

View File

@ -53,6 +53,7 @@ else {
$event_response['modal_width'] = 0;
$event_response['modal_height'] = 0;
$event_response['params'] = '';
$event_response['server_to_exec'] = '';
}
$table = new stdClass();
@ -117,11 +118,25 @@ $data[3] = html_print_select($types,'type',$event_response['type'],'','','',true
$table->data[3] = $data;
$data = array();
$table->colspan[4][1] = 3;
$data[0] = '<span id="command_label" class="labels">'.__('Command').'</span><span id="url_label" style="display:none;" class="labels">'.__('URL').'</span>'.ui_print_help_icon ("response_macros", true);
$data[1] = html_print_input_text('target', $event_response['target'],
'', 100, 255, true);
$types = array('url' => __('URL'), 'command' => __('Command'));
$servers_to_exec = array();
$servers_to_exec[0] = __('Local console');
if (enterprise_installed()) {
enterprise_include_once ('include/functions_satellite.php');
$rows = get_proxy_servers();
foreach ($rows as $row) {
$servers_to_exec[$row['id_server']] = $row['name'];
}
}
$data[2] = '<div id="server_to_exec_label" style="display:none;" class="labels">' . __('Server to execute command') . '</div>';
$data[3] = '<div id="server_to_exec_value" style="display:none;">' . html_print_select($servers_to_exec, 'server_to_exec', $event_response['server_to_exec'], '', '', '', true) . '</div>';
$table->data[4] = $data;
if ($event_response_id == 0) {
@ -158,9 +173,13 @@ $('#type').change(function() {
$('#new_window option[value="0"]')
.prop('selected', true);
$('#new_window').attr('disabled','disabled');
$('#server_to_exec_label').css('display','');
$('#server_to_exec_value').css('display','');
break;
case 'url':
$('#new_window').removeAttr('disabled');
$('#server_to_exec_label').css('display','none');
$('#server_to_exec_value').css('display','none');
break;
}
});

View File

@ -40,6 +40,17 @@ switch($action) {
$values['modal_height'] = get_parameter('modal_height');
$values['new_window'] = get_parameter('new_window');
$values['params'] = get_parameter('params');
if (enterprise_installed()) {
if ($values['type'] == 'command') {
$values['server_to_exec'] = get_parameter('server_to_exec');
}
else {
$values['server_to_exec'] = 0;
}
}
else {
$values['server_to_exec'] = 0;
}
if($values['new_window'] == 1) {
$values['modal_width'] = 0;
@ -67,6 +78,17 @@ switch($action) {
$values['modal_height'] = get_parameter('modal_height');
$values['new_window'] = get_parameter('new_window');
$values['params'] = get_parameter('params');
if (enterprise_installed()) {
if ($values['type'] == 'command') {
$values['server_to_exec'] = get_parameter('server_to_exec');
}
else {
$values['server_to_exec'] = 0;
}
}
else {
$values['server_to_exec'] = 0;
}
if($values['new_window'] == 1) {
$values['modal_width'] = 0;

View File

@ -48,7 +48,7 @@ if (is_ajax ()) {
return;
}
function process_manage_delete ($module_name, $id_agents) {
function process_manage_delete ($module_name, $id_agents, $module_status = 'all') {
global $config;
@ -217,6 +217,20 @@ function process_manage_delete ($module_name, $id_agents) {
}
}
if (($module_status == 'unknown') && ($module_name[0] == "0") && (is_array($module_name)) && (count($module_name) == 1)) {
$modules_to_delete = array();
foreach ($modules as $mod_id) {
$mod_status = (int)db_get_value_filter ('estado', 'tagente_estado', array('id_agente_modulo' => $mod_id));
// Unknown, not init and no data modules
if ($mod_status == 3 || $mod_status == 4 || $mod_status == 5) {
$modules_to_delete[$mod_id] = $mod_id;
}
}
$modules = $modules_to_delete;
}
$count_deleted_modules = count($modules);
if ($config['dbtype'] == "oracle") {
$success = db_process_sql(sprintf("DELETE FROM tagente_modulo WHERE id_agente_modulo IN (%s)", implode(",", $modules)));
@ -251,6 +265,7 @@ $agents_id = get_parameter('id_agents');
$modules_select = get_parameter('module');
$selection_mode = get_parameter('selection_mode', 'modules');
$recursion = get_parameter('recursion');
$modules_selection_mode = get_parameter('modules_selection_mode');
if ($delete) {
switch ($selection_mode) {
@ -299,7 +314,7 @@ if ($delete) {
$module_name = array();
}
foreach ($module_name as $mod_name) {
$result = process_manage_delete ($mod_name['nombre'], $id_agent['id_agente']);
$result = process_manage_delete ($mod_name['nombre'], $id_agent['id_agente'], $modules_selection_mode);
$count ++;
$success += (int)$result;
}
@ -319,7 +334,7 @@ if ($delete) {
$module_name = array();
}
else {
$result = process_manage_delete (array(0 => 0), $id_agent);
$result = process_manage_delete (array(0 => 0), $id_agent, $modules_selection_mode);
}
$success += (int)$result;
}
@ -330,7 +345,8 @@ if ($delete) {
}
if (!$force) {
$result = process_manage_delete ($modules_, $agents_);
$result = false;
$result = process_manage_delete ($modules_, $agents_, $modules_selection_mode);
}
if ($result) {

View File

@ -149,8 +149,13 @@ if ($update_agents) {
array ('id_agente' => $id_agent));
if($group_old || $result){
if ($group_old && $group_old != null) {
$tpolicy_group_old = db_get_all_rows_sql("SELECT id_policy FROM tpolicy_groups
WHERE id_group = ".$group_old);
}
else {
$tpolicy_group_old = db_get_all_rows_sql("SELECT id_policy FROM tpolicy_groups");
}
if($tpolicy_group_old){
foreach ($tpolicy_group_old as $key => $value) {
@ -164,9 +169,13 @@ if ($update_agents) {
}
}
}
if ($values['id_grupo'] && $values['id_grupo'] != null) {
$tpolicy_group_new = db_get_all_rows_sql("SELECT id_policy FROM tpolicy_groups
WHERE id_group = ".$values['id_grupo']);
}
else {
$tpolicy_group_new = db_get_all_rows_sql("SELECT id_policy FROM tpolicy_groups");
}
if($tpolicy_group_new){
foreach ($tpolicy_group_new as $key => $value) {
@ -328,6 +337,8 @@ $params['print_hidden_input_idagent'] = true;
$params['hidden_input_idagent_name'] = 'id_agent_parent';
$params['hidden_input_idagent_value'] = $id_parent;
$params['value'] = db_get_value ("alias","tagente","id_agente",$id_parent);
$params['selectbox_id'] = 'cascade_protection_module';
$params['javascript_is_function_select'] = true;
$table->data[0][1] = ui_print_agent_autocomplete_input($params);
$table->data[0][1] .= "<b>" . __('Cascade protection'). "</b>&nbsp;" .
@ -557,38 +568,6 @@ $(document).ready (function () {
}
});
$("#text-id_parent").on("autocompletechange", function () {
agent_id = $("#hidden-id_parent").val();
var params = {};
params["get_agent_modules_json_by_name"] = 1;
params["id_agent"] = agent_id;
params["page"] = "include/ajax/module";
jQuery.ajax ({
data: params,
dataType: "json",
type: "POST",
url: "ajax.php",
success: function (data) {
$('#cascade_protection_module').empty();
$('#cascade_protection_module')
.append ($('<option></option>')
.html("Any")
.prop("value", 0)
.prop("selected", 'selected'));
jQuery.each (data, function (i, val) {
$('#cascade_protection_module')
.append ($('<option></option>')
.html(val['name'])
.prop("value", val['id_module'])
.prop("selected", 'selected'));
});
}
});
});
$("#form_agent").submit(function() {
var get_parameters_count = window.location.href.slice(
window.location.href.indexOf('?') + 1).split('&').length;

View File

@ -40,6 +40,7 @@ $agents_id = get_parameter('id_agents');
$modules_select = get_parameter('module');
$selection_mode = get_parameter('selection_mode', 'modules');
$recursion = get_parameter('recursion');
$modules_selection_mode = get_parameter('modules_selection_mode');
$update = (bool) get_parameter_post ('update');
@ -105,7 +106,7 @@ if ($update) {
$module_name = array();
foreach ($module_name as $mod_name) {
$result = process_manage_edit($mod_name['nombre'], $id_agent);
$result = process_manage_edit($mod_name['nombre'], $id_agent, $modules_selection_mode);
$count++;
$success += (int)$result;
}
@ -127,7 +128,7 @@ if ($update) {
$module_name = array();
foreach($module_name as $mod_name) {
$result = process_manage_edit($mod_name['nombre'], $id_agent);
$result = process_manage_edit($mod_name['nombre'], $id_agent, $modules_selection_mode);
$count++;
$success += (int)$result;
}
@ -146,7 +147,7 @@ if ($update) {
foreach ($modules_ as $module_) {
$result = process_manage_edit ($module_, $agent_);
$result = process_manage_edit ($module_, $agent_, $modules_selection_mode);
$count++;
$success += (int)$result;
@ -1112,7 +1113,7 @@ function disabled_status () {
/* ]]> */
</script>
<?php
function process_manage_edit ($module_name, $agents_select = null) {
function process_manage_edit ($module_name, $agents_select = null, $module_status = 'all') {
if (is_int ($module_name) && $module_name < 0) {
ui_print_error_message(__('No modules selected'));
@ -1231,6 +1232,19 @@ function process_manage_edit ($module_name, $agents_select = null) {
if ($modules === false)
return false;
if (($module_status == 'unknown') && ($module_name == "0")) {
$modules_to_delete = array();
foreach ($modules as $mod_id) {
$mod_status = (int)db_get_value_filter ('estado', 'tagente_estado', array('id_agente_modulo' => $mod_id));
// Unknown, not init and no data modules
if ($mod_status == 3 || $mod_status == 4 || $mod_status == 5) {
$modules_to_delete[$mod_id] = $mod_id;
}
}
$modules = $modules_to_delete;
}
foreach ($modules as $module) {
$result = modules_update_agent_module(
$module['id_agente_modulo'], $values, true, $update_tags);

View File

@ -33,11 +33,20 @@ if (isset($_GET["server"])) {
$id_server= get_parameter_get ("server");
// Headers
ui_print_page_header (__('Update Server'), "images/gm_servers.png", false, "servers", true);
$sql = sprintf("SELECT name, ip_address, description FROM tserver WHERE id_server = %d",$id_server);
$sql = sprintf("SELECT name, ip_address, description, server_type, exec_proxy FROM tserver WHERE id_server = %d",$id_server);
$row = db_get_row_sql ($sql);
echo '<form name="servers" method="POST" action="index.php?sec=gservers&sec2=godmode/servers/modificar_server&update=1">';
html_print_input_hidden ("server",$id_server);
$server_type = __('Standard');
if ($row["server_type"] == 13) {
$server_type = __('Satellite');
}
$exec_server_enable = __("No");
if ($row["exec_proxy"] == 1) {
$exec_server_enable = __('Yes');
}
$table->cellpadding=4;
$table->cellspacing=4;
$table->width='100%';
@ -46,8 +55,18 @@ if (isset($_GET["server"])) {
$table->data[] = array (__('Name'), $row["name"]);
$table->data[] = array (__('IP Address'), html_print_input_text ('address',$row["ip_address"],'',50,0,true));
$table->data[] = array (__('Description'), html_print_input_text ('description',$row["description"],'',50,0,true));
html_print_table ($table);
if (enterprise_installed()) {
$table->data[] = array (__('Type'), $server_type);
if ($row["server_type"] == 13) {
$table->data[] = array (__('Exec Server'), html_print_checkbox ("exec_proxy", 1, $row["exec_proxy"], true));
if ($row["exec_proxy"]) {
$table->data[] = array (__('Check Exec Server'), '<a id="check_exec_server">' . html_print_image ("images/dot_red.disabled.png", true) . '</a>' . '<div id="check_error_message"></div>');
}
}
}
html_print_table ($table);
echo '<div class="action-buttons" style="width: 100%">';
echo '<input type="submit" class="sub upd" value="'.__('Update').'">';
@ -105,8 +124,9 @@ else {
$address = get_parameter_post ("address");
$description = get_parameter_post ("description");
$id_server = get_parameter_post ("server");
$exec_proxy = get_parameter_post ("exec_proxy");
$values = array('ip_address' => $address, 'description' => $description);
$values = array('ip_address' => $address, 'description' => $description, 'exec_proxy' => $exec_proxy);
$result = db_process_sql_update('tserver', $values, array('id_server' => $id_server));
if ($result !== false) {
ui_print_success_message(__('Server updated successfully'));
@ -141,3 +161,38 @@ else {
require($config['homedir'] . '/godmode/servers/servers.build_table.php');
}
?>
<script language="javascript" type="text/javascript">
$(document).ready (function () {
$("#check_exec_server img").on("click", function () {
$("#check_exec_server img").attr("src", "images/spinner.gif");
check_process("<?php echo $id_server;?>");
});
});
function check_process (id_server) {
var parameters = {};
parameters['page'] = 'enterprise/include/ajax/servers.ajax';
parameters['check_exec_server'] = 1;
parameters['id_server'] = id_server;
jQuery.post(
"ajax.php",
parameters,
function (data) {
if (data['correct']) {
$("#check_exec_server img").attr("src", "images/dot_green.png");
}
else {
$("#check_exec_server img").attr("src", "images/dot_red.png");
$("#check_error_message").empty();
$("#check_error_message").append("<span>" + data['message'] + "</span>");
}
},
"json"
);
}
</script>

View File

@ -122,7 +122,20 @@ if ($perform_event_response) {
global $config;
$command = get_parameter('target','');
$response_id = get_parameter ('response_id');
$event_response = db_get_row('tevent_response','id',$response_id);
if (enterprise_installed()) {
if ($event_response['server_to_exec'] != 0 && $event_response['type'] == 'command') {
$commandExclusions = array ('vi', 'vim', 'nano');
$server_data = db_get_row('tserver','id_server', $event_response['server_to_exec']);
if (in_array(strtolower($command),$commandExclusions)) {
echo "Only stdin/stdout commands are supported";
}
else {
switch (PHP_OS) {
case "FreeBSD":
$timeout_bin = '/usr/local/bin/gtimeout';
@ -134,7 +147,39 @@ if ($perform_event_response) {
$timeout_bin = '/usr/bin/timeout';
break;
}
echo system($timeout_bin . ' 9 '.io_safe_output($command).' 2>&1');
echo system("ssh pandora_exec_proxy@" . $server_data['ip_address'] . " \"" . $timeout_bin . " 90 " . io_safe_output($command) . " 2>&1\"", $ret_val);
}
}
else {
switch (PHP_OS) {
case "FreeBSD":
$timeout_bin = '/usr/local/bin/gtimeout';
break;
case "NetBSD":
$timeout_bin = '/usr/pkg/bin/gtimeout';
break;
default:
$timeout_bin = '/usr/bin/timeout';
break;
}
echo system($timeout_bin . ' 90 '.io_safe_output($command).' 2>&1');
}
}
else {
switch (PHP_OS) {
case "FreeBSD":
$timeout_bin = '/usr/local/bin/gtimeout';
break;
case "NetBSD":
$timeout_bin = '/usr/pkg/bin/gtimeout';
break;
default:
$timeout_bin = '/usr/bin/timeout';
break;
}
echo system($timeout_bin . ' 90 '.io_safe_output($command).' 2>&1');
}
return;
}
@ -162,7 +207,7 @@ if ($dialogue_event_response) {
echo "<br><div id='response_out' style='text-align:left'></div>";
echo "<br><div id='re_exec_command' style='display:none;'>";
html_print_button(__('Execute again'),'btn_str',false,'perform_response(\''.$command.'\');', "class='sub next'");
html_print_button(__('Execute again'),'btn_str',false,'perform_response(\''.$command.'\', ' . $response_id . ');', "class='sub next'");
echo "</div>";
break;
case 'url':

View File

@ -22,7 +22,7 @@
/**
* Pandora build version and version
*/
$build_version = 'PC170828';
$build_version = 'PC170831';
$pandora_version = 'v7.0NG.711';
// Do not overwrite default timezone set if defined.

View File

@ -1506,7 +1506,7 @@ function get_snmpwalk($ip_target, $snmp_version, $snmp_community = '',
$snmp3_auth_user = '', $snmp3_security_level = '',
$snmp3_auth_method = '', $snmp3_auth_pass = '',
$snmp3_privacy_method = '', $snmp3_privacy_pass = '',
$quick_print = 0, $base_oid = "", $snmp_port = '') {
$quick_print = 0, $base_oid = "", $snmp_port = '', $server_to_exec = 0) {
global $config;
@ -1598,7 +1598,18 @@ function get_snmpwalk($ip_target, $snmp_version, $snmp_community = '',
break;
}
if (enterprise_installed()) {
if ($server_to_exec != 0) {
$server_data = db_get_row('tserver','id_server', $server_to_exec);
exec("ssh pandora_exec_proxy@" . $server_data['ip_address'] . " \"" . $command_str . "\"", $output, $rc);
}
else {
exec($command_str, $output, $rc);
}
}
else {
exec($command_str, $output, $rc);
}
// Parse the output of snmpwalk
$snmpwalk = array();

View File

@ -138,7 +138,7 @@ function snmp_browser_print_tree ($tree, $id = 0, $depth = 0, $last = 0, $last_a
*
* @return array The SNMP tree.
*/
function snmp_browser_get_tree ($target_ip, $community, $starting_oid = '.', $version = '2c', $snmp3_auth_user = '', $snmp3_security_level = '', $snmp3_auth_method = '', $snmp3_auth_pass = '', $snmp3_privacy_method = '', $snmp3_privacy_pass = '') {
function snmp_browser_get_tree ($target_ip, $community, $starting_oid = '.', $version = '2c', $snmp3_auth_user = '', $snmp3_security_level = '', $snmp3_auth_method = '', $snmp3_auth_pass = '', $snmp3_privacy_method = '', $snmp3_privacy_pass = '', $server_to_exec = 0) {
global $config;
if ($target_ip == '') {
@ -174,6 +174,33 @@ function snmp_browser_get_tree ($target_ip, $community, $starting_oid = '.', $ve
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 = array('__LEAVES__' => array());
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($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 = array('__LEAVES__' => array());
if ($version == "3") {
switch ($snmp3_security_level) {
@ -191,9 +218,28 @@ function snmp_browser_get_tree ($target_ip, $community, $starting_oid = '.', $ve
else {
exec ($snmpwalk_bin . ' -m ALL -M +' . escapeshellarg($config['homedir'] . '/attachment/mibs') . ' -Cc -c ' . escapeshellarg($community) . ' -v ' . escapeshellarg($version) . ' ' . escapeshellarg($target_ip) . ' ' . escapeshellarg($starting_oid) . ' 2> ' . $error_redir_dir, $output, $rc);
}
//if ($rc != 0) {
// return __('No data');
//}
}
}
else {
$oid_tree = array('__LEAVES__' => array());
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($community) . ' -v ' . escapeshellarg($version) . ' ' . escapeshellarg($target_ip) . ' ' . escapeshellarg($starting_oid) . ' 2> ' . $error_redir_dir, $output, $rc);
}
}
html_debug($output, true);
foreach ($output as $line) {
// Separate the OID from the value
@ -518,7 +564,21 @@ function snmp_browser_print_container ($return = false, $width = '100%', $height
'3' => 'v. 3'),
'snmp_browser_version', '', 'checkSNMPVersion();', '', '', true, false, false, '');
$table->data[0][4] = html_print_button(__('Browse'), 'browse', false, 'snmpBrowse()', 'class="sub search" style="margin-top:0px;"', true);
$servers_to_exec = array();
$servers_to_exec[0] = __('Local console');
if (enterprise_installed()) {
enterprise_include_once ('include/functions_satellite.php');
$rows = get_proxy_servers();
foreach ($rows as $row) {
$servers_to_exec[$row['id_server']] = $row['name'];
}
}
$table->data[0][4] = '<strong>' . __('Server to execute') . '</strong> &nbsp;&nbsp;';
$table->data[0][4] .= html_print_select($servers_to_exec, 'server_to_exec', '', '', '', '', true);
$table->data[0][5] = html_print_button(__('Browse'), 'browse', false, 'snmpBrowse()', 'class="sub search" style="margin-top:0px;"', true);
// SNMP v3 options
$table3 = new stdClass();

View File

@ -3118,7 +3118,6 @@ function ui_print_agent_autocomplete_input($parameters) {
.attr("value", val["id_agente_modulo"]).text (s));
});
$("#' . $selectbox_id . '").enable();
$("#' . $selectbox_id . '").fadeIn ("normal");
}
});

View File

@ -1667,6 +1667,15 @@ function pandoraFlotArea(graph_id, values, labels, labels_long, legend,
how_bigger = "K";
y = y / 1000;
}
else if(y < -1000000) {
how_bigger = "M";
y = y / 1000000;
}
else if (y < -1000) {
console.log('entra por negativo');
how_bigger = "K";
y = y / 1000;
}
if (currentRanges == null || (currentRanges.xaxis.from < j && j < currentRanges.xaxis.to)) {
$('#timestamp_'+graph_id).show();
@ -2090,6 +2099,10 @@ function number_format(number, force_integer, unit) {
pos++; //Position in array starting with 0
number = number / 1000;
}
else if (number <= -1000) {
pos++;
number = number / 1000;
}
else {
break;
}

View File

@ -961,7 +961,17 @@ function pch_vertical_graph ($graph_type, $index, $data, $width, $height,
$chart_size = ($digits_left * $font_size) + 20;
$max_data = max(max($data));
$min_data = 0;
$max_data = 0;
foreach ($data as $k => $v) {
if(min($v) < $min_data){
$min_data = min($v);
}
if(max($v) > $max_data){
$max_data = max($v);
}
}
$default_chart_size = 40;
$rest_chars = strlen($max_data) - 6;
@ -981,7 +991,7 @@ function pch_vertical_graph ($graph_type, $index, $data, $width, $height,
($height - $margin_bottom));
/*Get minimun value to draw axis properly*/
$min_data = min($data['min']);
$ManualScale = array();
$mode = SCALE_MODE_START0;
if ($min_data < 0) {
@ -992,6 +1002,10 @@ function pch_vertical_graph ($graph_type, $index, $data, $width, $height,
$ManualScale = array(0 => array("Min" => $min_data, "Max" => 0));
$mode = SCALE_MODE_MANUAL;
}
else if ($max_data >= 0 && $min_data <= 0){
$ManualScale = array(0 => array("Min" => $min_data, "Max" => $max_data));
$mode = SCALE_MODE_MANUAL;
}
if($graph_threshold){
$sql_treshold = 'select min_critical, max_critical, min_warning, max_warning, critical_inverse, warning_inverse from tagente_modulo where id_agente_modulo =' . $id_module;

View File

@ -54,6 +54,7 @@ Apart from the defined module macros, the following macros are also available:
<li>_event_id_ : (Only event alerts) Id of the event that fired the alert.</li>
<li>_id_agent_ : Id of agent, useful to build direct URL to redirect to a Pandora FMS console webpage.</li>
<li>_id_group_ : Id of agent group.</li>
<li>_id_module_ : Id of module.</li>
<li>_id_alert_ : Numerical ID of the alert (unique), used to correlate on third party software</li>
<li>_policy_ : Name of the policy the module belongs to (if applies).</li>
<li>_interval_ : Execution interval of the module. </li>

View File

@ -47,6 +47,7 @@ Besides the defined module macros, the following macros are available:
<li>_event_id_: (Only event alerts) ID of the event that triggered the alert.</li>
<li>_id_agent_: Agents ID, useful for building a direct URL that redirects to a Pandora FMS console webpage.</li>
<li>_id_group_ : Agent group ID.</li>
<li>_id_module_ : ID of module.</li>
<li>_id_alert_: Alerts numeric ID (unique), used to correlate the alert with third party software.</li>
<li>_policy_: Name of the policy that the module belongs to (if applies).</li>
<li>_interval_: Modules execution interval </li>

View File

@ -56,6 +56,7 @@ Además de las macros de módulo definidas, las siguientes macros están disponi
<li>_event_id_ : (Solo alertas de evento) Id del evento que disparó la alerta.</li>
<li>_id_agent_: ID del agente, util para construir URL de acceso a la consola de Pandora.</li>
<li>_id_group_ : Id del grupo de agente.</li>
<li>_id_module_ : ID del módulo.</li>
<li>_id_alert_: ID de la alerta, util para correlar la alerta en herramientas de terceros.</li>
<li>_policy_: Nombre de la política a la que pertenece el módulo (si aplica).</li>
<li>_interval_ : Intervalo de la ejecución del módulo. </li>

View File

@ -47,6 +47,7 @@ Además de las macros de módulo definidas, las siguientes macros están disponi
<li>_event_id_: (Solo alertas de evento) Id del evento que disparó la alerta.</li>
<li>_id_agent_: ID del agente, util para construir URL de acceso a la consola de Pandora.</li>
<li>_id_group_ : Id del grupo de agente.</li>
<li>_id_module_ : ID del módulo.</li>
<li>_id_alert_: ID de la alerta, util para correlar la alerta en herramientas de terceros.</li>
<li>_policy_: Nombre de la política a la que pertenece el módulo (si aplica).</li>
<li>_interval_: Intervalo de la ejecución del módulo. </li>

View File

@ -177,7 +177,7 @@ function show_response_dialog(event_id, response_id, response) {
draggable: true,
modal: false,
open: function(event, ui) {
perform_response(response['target']);
perform_response(response['target'], response_id);
},
width: response['modal_width'],
height: response['modal_height']
@ -336,7 +336,7 @@ function get_response_target(event_id, response_id, server_id) {
}
// Perform a response and put the output into a div
function perform_response(target) {
function perform_response(target, response_id) {
var ajax_file = $('#hidden-ajax_file').val();
$('#re_exec_command').hide();
@ -351,6 +351,7 @@ function perform_response(target) {
params.push("page=include/ajax/events");
params.push("perform_event_response=1");
params.push("target="+target);
params.push("response_id="+response_id)
jQuery.ajax ({
data: params.join ("&"),

View File

@ -19,6 +19,7 @@ function snmpBrowse () {
var community = $('#text-community').val();
var starting_oid = $('#text-starting_oid').val();
var snmp_version = $('#snmp_browser_version').val();
var server_to_exec = $('#server_to_exec').val();
var snmp3_auth_user = $('#text-snmp3_browser_auth_user').val();
var snmp3_security_level = $('#snmp3_browser_security_level').val();
var snmp3_auth_method = $('#snmp3_browser_auth_method').val();
@ -33,6 +34,7 @@ function snmpBrowse () {
"community=" + community,
"starting_oid=" + starting_oid,
"snmp_browser_version=" + snmp_version,
"server_to_exec=" + server_to_exec,
"snmp3_browser_auth_user=" + snmp3_auth_user,
"snmp3_browser_security_level=" + snmp3_security_level,
"snmp3_browser_auth_method=" + snmp3_auth_method,

View File

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

View File

@ -239,7 +239,7 @@ class User {
$ui->contentAddHtml('<div style="text-align: center;" class="login_logo">' .
$logo_image . '</div>');
$ui->contentAddHtml('<div id="login_container">');
$ui->beginForm();
$ui->beginForm('');
$ui->formAddHtml(html_print_input_hidden('action', 'login', true));
$options = array(
'name' => 'user',

View File

@ -191,6 +191,11 @@ switch ($action) {
$l10n = new gettext_reader (new CachedFileReader('../include/languages/'.$user_language.'.mo'));
$l10n->load_tables();
}
if($_GET['page'] != ''){
header('refresh:0; url=http://'.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']);
}
if (class_exists("HomeEnterprise"))
$home = new HomeEnterprise();
else
@ -211,6 +216,11 @@ switch ($action) {
$l10n = new gettext_reader (new CachedFileReader('../include/languages/'.$user_language.'.mo'));
$l10n->load_tables();
}
if($_GET['page'] != ''){
header('refresh:0; url=http://'.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']);
}
if (class_exists("HomeEnterprise"))
$home = new HomeEnterprise();
else

View File

@ -594,11 +594,8 @@ foreach ($agents as $agent) {
if (enterprise_installed()) {
enterprise_include_once('include/functions_config_agents.php');
if (enterprise_hook('config_agents_has_remote_configuration',array($agent["id_agente"]))) {
$data[10] = html_print_image("images/application_edit.png", true, array("align" => 'middle', "title" => __('Remote config')));
$data[10] = '<a href="index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&tab=remote_configuration&id_agente='.$agent["id_agente"].'&disk_conf=1">'.html_print_image("images/application_edit.png", true, array("align" => 'middle', "title" => __('Remote config'))).'</a>';
}
}

View File

@ -120,7 +120,8 @@ if ($searchModules) {
)
AND
(t1.nombre COLLATE utf8_general_ci LIKE "%' . $stringSearchSQL . '%" OR
t3.nombre LIKE "%' . $stringSearchSQL . '%")';
t3.nombre LIKE "%' . $stringSearchSQL . '%")
AND t1.disabled = 0';
break;
case "postgresql":
$chunk_sql = '

View File

@ -73,7 +73,6 @@ else {
'nombre', 'web_content_string');
foreach ($modules as $module) {
if(!$module['disabled']){
$module["datos"] =
modules_get_last_value($module['id_agente_modulo']);
$module["module_name"] = $module['nombre'];
@ -223,7 +222,6 @@ else {
$timestampCell,
$edit_module));
}
}
echo "<br />";
ui_pagination ($totalModules);

View File

@ -27,6 +27,7 @@ if (is_ajax()) {
$target_ip = (string) get_parameter ("target_ip", '');
$community = (string) get_parameter ("community", '');
$snmp_version = (string) get_parameter ("snmp_browser_version", '');
$server_to_exec = (int) get_parameter ("server_to_exec", 0);
$snmp3_auth_user = get_parameter('snmp3_browser_auth_user');
$snmp3_security_level = get_parameter('snmp3_browser_security_level');
$snmp3_auth_method = get_parameter('snmp3_browser_auth_method');
@ -41,7 +42,8 @@ if (is_ajax()) {
$snmp_tree = snmp_browser_get_tree(
$target_ip, $community, $starting_oid, $snmp_version,
$snmp3_auth_user, $snmp3_security_level, $snmp3_auth_method,
$snmp3_auth_pass, $snmp3_privacy_method, $snmp3_privacy_pass);
$snmp3_auth_pass, $snmp3_privacy_method, $snmp3_privacy_pass,
$server_to_exec);
if (! is_array ($snmp_tree)) {
echo $snmp_tree;
}

View File

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

View File

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

View File

@ -976,6 +976,7 @@ CREATE TABLE IF NOT EXISTS `tserver` (
`my_modules` int(11) NOT NULL default 0,
`server_keepalive` int(11) NOT NULL default 0,
`stat_utimestamp` bigint(20) NOT NULL default '0',
`exec_proxy` tinyint(1) UNSIGNED NOT NULL default 0,
PRIMARY KEY (`id_server`),
KEY `name` (`name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
@ -1844,6 +1845,7 @@ CREATE TABLE IF NOT EXISTS `tevent_response` (
`modal_height` INTEGER NOT NULL DEFAULT 0,
`new_window` TINYINT(4) NOT NULL DEFAULT 0,
`params` TEXT NOT NULL,
`server_to_exec` int(10) unsigned NOT NULL DEFAULT 0,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

View File

@ -1148,7 +1148,7 @@ INSERT INTO `tagent_custom_fields` VALUES (1,'Serial&#x20;Number',0,0),(2,'Depar
INSERT INTO `ttag` VALUES (1,'network','Network&#x20;equipment','http://artica.es','',''),(2,'critical','Critical&#x20;modules','','',''),(3,'dmz','DMZ&#x20;Network&#x20;Zone','','',''),(4,'performance','Performance&#x20;anda&#x20;capacity&#x20;modules','','',''),(5,'configuration','','','','');
INSERT INTO `tevent_response` VALUES (1,'Ping&#x20;to&#x20;host','Ping&#x20;to&#x20;the&#x20;agent&#x20;host','ping&#x20;-c&#x20;5&#x20;_agent_address_','command',0,620,500,0,''),(2,'SSH&#x20;to&#x20;host','Connect&#x20;via&#x20;SSH&#x20;to&#x20;the&#x20;agent','http://localhost:8022/anyterm.html?param=_User_@_agent_address_','url',0,800,450,0,'User'),(3,'Create&#x20;incident&#x20;from&#x20;event','Create&#x20;a&#x20;incident&#x20;from&#x20;the&#x20;event&#x20;with&#x20;the&#x20;standard&#x20;incidents&#x20;system&#x20;of&#x20;Pandora&#x20;FMS','index.php?sec=workspace&amp;sec2=operation/incidents/incident_detail&amp;insert_form&amp;from_event=_event_id_','url',0,0,0,1,''),(4,'Create&#x20;Integria&#x20;IMS&#x20;incident&#x20;from&#x20;event','Create&#x20;a&#x20;incident&#x20;from&#x20;the&#x20;event&#x20;with&#x20;integria&#x20;incidents&#x20;system&#x20;of&#x20;Pandora&#x20;FMS.&#x20;&#x0d;&#x0a;&#x0d;&#x0a;Is&#x20;necessary&#x20;to&#x20;enable&#x20;and&#x20;configure&#x20;the&#x20;Integria&#x20;incidents&#x20;in&#x20;Pandora&#x20;FMS&#x20;setup.','index.php?sec=workspace&amp;sec2=operation/integria_incidents/incident&amp;tab=editor&amp;from_event=_event_id_','url',0,0,0,1,''),(5,'Restart&#x20;agent','Restart&#x20;the&#x20;agent&#x20;with&#x20;using&#x20;UDP&#x20;protocol.&#x0d;&#x0a;&#x0d;&#x0a;To&#x20;use&#x20;this&#x20;response&#x20;is&#x20;necessary&#x20;to&#x20;have&#x20;installed&#x20;Pandora&#x20;FMS&#x20;server&#x20;and&#x20;console&#x20;in&#x20;the&#x20;same&#x20;machine.','/usr/share/pandora_server/util/udp_client.pl&#x20;_agent_address_&#x20;41122&#x20;&quot;REFRESH&#x20;AGENT&quot;','command',0,620,500,0,''),(6,'Ping&#x20;to&#x20;module&#x20;agent&#x20;host','Ping&#x20;to&#x20;the&#x20;module&#x20;agent&#x20;host','ping&#x20;-c&#x20;5&#x20;_module_address_','command',0,620,500,0,'');
INSERT INTO `tevent_response` VALUES (1,'Ping&#x20;to&#x20;host','Ping&#x20;to&#x20;the&#x20;agent&#x20;host','ping&#x20;-c&#x20;5&#x20;_agent_address_','command',0,620,500,0,'',0),(2,'SSH&#x20;to&#x20;host','Connect&#x20;via&#x20;SSH&#x20;to&#x20;the&#x20;agent','http://localhost:8022/anyterm.html?param=_User_@_agent_address_','url',0,800,450,0,'User',0),(3,'Create&#x20;incident&#x20;from&#x20;event','Create&#x20;a&#x20;incident&#x20;from&#x20;the&#x20;event&#x20;with&#x20;the&#x20;standard&#x20;incidents&#x20;system&#x20;of&#x20;Pandora&#x20;FMS','index.php?sec=workspace&amp;sec2=operation/incidents/incident_detail&amp;insert_form&amp;from_event=_event_id_','url',0,0,0,1,'',0),(4,'Create&#x20;Integria&#x20;IMS&#x20;incident&#x20;from&#x20;event','Create&#x20;a&#x20;incident&#x20;from&#x20;the&#x20;event&#x20;with&#x20;integria&#x20;incidents&#x20;system&#x20;of&#x20;Pandora&#x20;FMS.&#x20;&#x0d;&#x0a;&#x0d;&#x0a;Is&#x20;necessary&#x20;to&#x20;enable&#x20;and&#x20;configure&#x20;the&#x20;Integria&#x20;incidents&#x20;in&#x20;Pandora&#x20;FMS&#x20;setup.','index.php?sec=workspace&amp;sec2=operation/integria_incidents/incident&amp;tab=editor&amp;from_event=_event_id_','url',0,0,0,1,'',0),(5,'Restart&#x20;agent','Restart&#x20;the&#x20;agent&#x20;with&#x20;using&#x20;UDP&#x20;protocol.&#x0d;&#x0a;&#x0d;&#x0a;To&#x20;use&#x20;this&#x20;response&#x20;is&#x20;necessary&#x20;to&#x20;have&#x20;installed&#x20;Pandora&#x20;FMS&#x20;server&#x20;and&#x20;console&#x20;in&#x20;the&#x20;same&#x20;machine.','/usr/share/pandora_server/util/udp_client.pl&#x20;_agent_address_&#x20;41122&#x20;&quot;REFRESH&#x20;AGENT&quot;','command',0,620,500,0,'',0),(6,'Ping&#x20;to&#x20;module&#x20;agent&#x20;host','Ping&#x20;to&#x20;the&#x20;module&#x20;agent&#x20;host','ping&#x20;-c&#x20;5&#x20;_module_address_','command',0,620,500,0,'',0);
INSERT INTO `tupdate_settings` VALUES ('current_update', '412'), ('customer_key', 'PANDORA-FREE'), ('updating_binary_path', 'Path where the updated binary files will be stored'), ('updating_code_path', 'Path where the updated code is stored'), ('dbname', ''), ('dbhost', ''), ('dbpass', ''), ('dbuser', ''), ('dbport', ''), ('proxy', ''), ('proxy_port', ''), ('proxy_user', ''), ('proxy_pass', '');

View File

@ -1,5 +1,5 @@
package: pandorafms-server
Version: 7.0NG.711-170828
Version: 7.0NG.711-170831
Architecture: all
Priority: optional
Section: admin

View File

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

View File

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

View File

@ -5051,15 +5051,26 @@ sub pandora_set_event_storm_protection ($) {
##########################################################################
sub pandora_update_agent_module_count ($$$) {
my ($pa_config, $dbh, $agent_id) = @_;
my $total = 0;
my $counts = {
'0' => 0,
'1' => 0,
'2' => 0,
'3' => 0,
'4' => 0,
}; # Module counts by status.
db_do ($dbh, 'UPDATE tagente SET update_module_count=0,
normal_count=(SELECT COUNT(*) FROM tagente_modulo, tagente_estado WHERE tagente_modulo.disabled=0 AND tagente_modulo.id_agente_modulo=tagente_estado.id_agente_modulo AND tagente_modulo.id_agente=' . $agent_id . ' AND estado=0),
critical_count=(SELECT COUNT(*) FROM tagente_modulo, tagente_estado WHERE tagente_modulo.disabled=0 AND tagente_modulo.id_agente_modulo=tagente_estado.id_agente_modulo AND tagente_modulo.id_agente=' . $agent_id . ' AND estado=1),
warning_count=(SELECT COUNT(*) FROM tagente_modulo, tagente_estado WHERE tagente_modulo.disabled=0 AND tagente_modulo.id_agente_modulo=tagente_estado.id_agente_modulo AND tagente_modulo.id_agente=' . $agent_id . ' AND estado=2),
unknown_count=(SELECT COUNT(*) FROM tagente_modulo, tagente_estado WHERE tagente_modulo.disabled=0 AND tagente_modulo.id_agente_modulo=tagente_estado.id_agente_modulo AND tagente_modulo.id_agente=' . $agent_id . ' AND estado=3),
notinit_count=(SELECT COUNT(*) FROM tagente_modulo, tagente_estado WHERE tagente_modulo.disabled=0 AND tagente_modulo.id_agente_modulo=tagente_estado.id_agente_modulo AND tagente_modulo.id_agente=' . $agent_id . ' AND estado=4),
total_count=(SELECT COUNT(*) FROM tagente_modulo, tagente_estado WHERE tagente_modulo.disabled=0 AND tagente_modulo.id_agente_modulo=tagente_estado.id_agente_modulo AND tagente_modulo.id_agente=' . $agent_id .
') WHERE id_agente = ' . $agent_id);
# Retrieve and hash module status counts.
my @rows = get_db_rows ($dbh, 'SELECT estado, COUNT(*) AS total FROM tagente_modulo, tagente_estado WHERE tagente_modulo.disabled=0 AND tagente_modulo.id_agente_modulo=tagente_estado.id_agente_modulo AND tagente_modulo.id_agente=?GROUP BY estado', $agent_id);
foreach my $row (@rows) {
$counts->{$row->{'estado'}} = $row->{'total'};
$total += $row->{'total'};
}
# Update the agent.
db_do ($dbh, 'UPDATE tagente
SET update_module_count=0, normal_count=?, critical_count=?, warning_count=?, unknown_count=?, notinit_count=?, total_count=?
WHERE id_agente = ?', $counts->{'0'}, $counts->{'1'}, $counts->{'2'}, $counts->{'3'}, $counts->{'4'}, $total, $agent_id);
# Sync the agent cache every time the module count is updated.
enterprise_hook('update_agent_cache', [$pa_config, $dbh, $agent_id]) if ($pa_config->{'node_metaconsole'} == 1);

View File

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

View File

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

View File

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

View File

@ -33,7 +33,7 @@ use PandoraFMS::Tools;
use PandoraFMS::DB;
# version: define current version
my $version = "7.0NG.711 PS170828";
my $version = "7.0NG.711 PS170831";
# Pandora server configuration
my %conf;

View File

@ -35,7 +35,7 @@ use Encode::Locale;
Encode::Locale::decode_argv;
# version: define current version
my $version = "7.0NG.711 PS170828";
my $version = "7.0NG.711 PS170831";
# save program name for logging
my $progname = basename($0);

View File

@ -2,7 +2,7 @@ FROM pandorafms/pandorafms-base
MAINTAINER Pandora FMS Team <info@pandorafms.com>
# Pandora FMS Server dependencies
RUN yum install -y fping perl-Test-WWW-Selenium
RUN yum install -y fping perl-Test-WWW-Selenium perl-Crypt-ECB perl-Net-OpenSSH
RUN ln -s /usr/bin/braa /usr/local/bin/braa