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:
commit
6b4a15534d
|
@ -1,5 +1,5 @@
|
|||
package: pandorafms-agent-unix
|
||||
Version: 7.0NG.711-170828
|
||||
Version: 7.0NG.711-170831
|
||||
Architecture: all
|
||||
Priority: optional
|
||||
Section: admin
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
|
||||
pandora_version="7.0NG.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
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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}
|
||||
|
|
|
@ -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}
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
# **********************************************************************
|
||||
|
||||
PI_VERSION="7.0NG.711"
|
||||
PI_BUILD="170828"
|
||||
PI_BUILD="170831"
|
||||
OS_NAME=`uname -s`
|
||||
|
||||
FORCE=0
|
||||
|
|
|
@ -186,7 +186,7 @@ UpgradeApplicationID
|
|||
{}
|
||||
|
||||
Version
|
||||
{170828}
|
||||
{170831}
|
||||
|
||||
ViewReadme
|
||||
{Yes}
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
package: pandorafms-console
|
||||
Version: 7.0NG.711-170828
|
||||
Version: 7.0NG.711-170831
|
||||
Architecture: all
|
||||
Priority: optional
|
||||
Section: admin
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
|
||||
pandora_version="7.0NG.711-170828"
|
||||
pandora_version="7.0NG.711-170831"
|
||||
|
||||
package_pear=0
|
||||
package_pandora=1
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -193,32 +193,51 @@ 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) {
|
||||
$autorefresh_img = html_print_image("images/header_refresh.png", true, array("class" => 'bot', "alt" => 'lightning', 'title' => __('Configure autorefresh')));
|
||||
|
||||
if ($_GET['refr']) {
|
||||
$autorefresh_txt .= ' (<span id="refrcounter">'.date ("i:s", $config["refr"]).'</span>)';
|
||||
$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')));
|
||||
|
||||
$ignored_params['refr'] = '';
|
||||
$values = get_refresh_time_array();
|
||||
$autorefresh_additional = '<span id="combo_refr" style="display: none;">';
|
||||
$autorefresh_additional .= html_print_select ($values, 'ref', '', '', __('Select'), '0', true, false, false);
|
||||
$autorefresh_additional .= '</span>';
|
||||
unset ($values);
|
||||
|
||||
$autorefresh_link_open_img =
|
||||
'<a class="white autorefresh" href="' . ui_get_url_refresh ($ignored_params) . '">';
|
||||
|
||||
if ($_GET['refr']) {
|
||||
$autorefresh_link_open_txt =
|
||||
'<a class="white autorefresh autorefresh_txt" href="' . ui_get_url_refresh ($ignored_params) . '">';
|
||||
if ($_GET['refr']) {
|
||||
$autorefresh_txt .= ' (<span id="refrcounter">'.date ("i:s", $config["refr"]).'</span>)';
|
||||
}
|
||||
|
||||
$ignored_params['refr'] = '';
|
||||
$values = get_refresh_time_array();
|
||||
$autorefresh_additional = '<span id="combo_refr" style="display: none;">';
|
||||
$autorefresh_additional .= html_print_select ($values, 'ref', '', '', __('Select'), '0', true, false, false);
|
||||
$autorefresh_additional .= '</span>';
|
||||
unset ($values);
|
||||
|
||||
$autorefresh_link_open_img =
|
||||
'<a class="white autorefresh" href="' . ui_get_url_refresh ($ignored_params) . '">';
|
||||
|
||||
if ($_GET['refr']) {
|
||||
$autorefresh_link_open_txt =
|
||||
'<a class="white autorefresh autorefresh_txt" href="' . ui_get_url_refresh ($ignored_params) . '">';
|
||||
}
|
||||
else {
|
||||
$autorefresh_link_open_txt = '<a>';
|
||||
}
|
||||
|
||||
$autorefresh_link_close = '</a>';
|
||||
}
|
||||
else {
|
||||
$autorefresh_link_open_txt = '<a>';
|
||||
}
|
||||
$autorefresh_img = html_print_image("images/header_refresh_disabled.png", true, array("class" => 'bot autorefresh_disabled', "alt" => 'lightning', 'title' => __('Disabled autorefresh')));
|
||||
|
||||
$autorefresh_link_close = '</a>';
|
||||
$ignored_params['refr'] = false;
|
||||
|
||||
$autorefresh_link_open_img = '';
|
||||
$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')));
|
||||
|
@ -357,17 +376,25 @@ 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 ();
|
||||
$("#combo_refr").css('padding-right', '9px');
|
||||
href = $("a.autorefresh").attr ("href");
|
||||
$(document).attr ("location", href + "30");
|
||||
$("a.autorefresh_txt").toggle ();
|
||||
$("#combo_refr").toggle ();
|
||||
$("#combo_refr").css('padding-right', '9px');
|
||||
href = $("a.autorefresh").attr ("href");
|
||||
$(document).attr ("location", href + "30");
|
||||
<?php
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
|
||||
if (fixed_header) {
|
||||
$('div#head').addClass('fixed_header');
|
||||
$('div#page')
|
||||
|
|
|
@ -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'). " " . 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);
|
||||
|
|
|
@ -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';
|
||||
|
|
|
@ -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';
|
||||
|
|
|
@ -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;
|
||||
|
||||
exec($wmi_processes, $output);
|
||||
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;
|
||||
|
||||
exec($wmi_services, $output);
|
||||
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;
|
||||
|
||||
exec($wmi_disks, $output);
|
||||
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."'>";
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
});
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -147,10 +147,15 @@ if ($update_agents) {
|
|||
$result = db_process_sql_update ('tagente',
|
||||
$values,
|
||||
array ('id_agente' => $id_agent));
|
||||
|
||||
|
||||
if($group_old || $result){
|
||||
$tpolicy_group_old = db_get_all_rows_sql("SELECT id_policy FROM tpolicy_groups
|
||||
WHERE id_group = ".$group_old);
|
||||
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) {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
$tpolicy_group_new = db_get_all_rows_sql("SELECT id_policy FROM tpolicy_groups
|
||||
WHERE id_group = ".$values['id_grupo']);
|
||||
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> " .
|
||||
|
@ -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;
|
||||
|
|
|
@ -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'));
|
||||
|
@ -1230,6 +1231,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(
|
||||
|
|
|
@ -33,21 +33,40 @@ 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%';
|
||||
$table->class="databox filters";
|
||||
|
||||
$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);
|
||||
$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));
|
||||
|
||||
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>
|
||||
|
|
|
@ -122,19 +122,64 @@ if ($perform_event_response) {
|
|||
global $config;
|
||||
|
||||
$command = get_parameter('target','');
|
||||
|
||||
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;
|
||||
$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';
|
||||
break;
|
||||
case "NetBSD":
|
||||
$timeout_bin = '/usr/pkg/bin/gtimeout';
|
||||
break;
|
||||
default:
|
||||
$timeout_bin = '/usr/bin/timeout';
|
||||
break;
|
||||
}
|
||||
|
||||
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');
|
||||
}
|
||||
echo system($timeout_bin . ' 9 '.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':
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
exec($command_str, $output, $rc);
|
||||
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();
|
||||
|
|
|
@ -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 == '') {
|
||||
|
@ -173,27 +173,73 @@ function snmp_browser_get_tree ($target_ip, $community, $starting_oid = '.', $ve
|
|||
$error_redir_dir = '/dev/null';
|
||||
break;
|
||||
}
|
||||
|
||||
if ($server_to_exec != 0) {
|
||||
$sql = sprintf("SELECT ip_address FROM tserver WHERE id_server = %d", $server_to_exec);
|
||||
$server_data = db_get_row_sql($sql);
|
||||
|
||||
$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;
|
||||
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) {
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
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);
|
||||
$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);
|
||||
}
|
||||
}
|
||||
//if ($rc != 0) {
|
||||
// return __('No data');
|
||||
//}
|
||||
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> ';
|
||||
$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();
|
||||
|
|
|
@ -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");
|
||||
}
|
||||
});
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -961,8 +961,18 @@ 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;
|
||||
$default_chart_size += $rest_chars * 5;
|
||||
|
@ -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;
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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_: Agent’s 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_: Alert’s 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_: Module’s execution interval </li>
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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 ("&"),
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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',
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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>';
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -669,4 +666,4 @@ $(document).ready (function () {
|
|||
$(".agent"+$(this)[0].className).css('visibility', 'hidden');
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</script>
|
|
@ -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 = '
|
||||
|
|
|
@ -73,156 +73,154 @@ 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'];
|
||||
|
||||
//To search the monitor status
|
||||
$status_sql = sprintf('SELECT estado from tagente_estado where id_agente_modulo =' . $module['id_agente_modulo']);
|
||||
$status_sql = db_process_sql($status_sql);
|
||||
$status_sql = $status_sql[0];
|
||||
//To search the monitor utimestamp
|
||||
$utimestamp_sql = sprintf('SELECT utimestamp from tagente_estado where id_agente_modulo =' . $module['id_agente_modulo']);
|
||||
$utimestamp_sql = db_process_sql($utimestamp_sql);
|
||||
$utimestamp_sql = $utimestamp_sql[0];
|
||||
|
||||
|
||||
$agent = db_get_row ('tagente', 'id_agente', $module['id_agente']);
|
||||
$agentCell = '<a title='.$module['agent_name'].' href="index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente=' . $module['id_agente'] . '">' .
|
||||
$agent['alias'] . '</a>';
|
||||
|
||||
$typeCell = ui_print_moduletype_icon($module["id_tipo_modulo"], true);
|
||||
|
||||
$intervalCell = modules_get_interval ($module['id_agente_modulo']);
|
||||
|
||||
if ($utimestamp_sql['utimestamp'] == 0 &&
|
||||
(
|
||||
($module['id_tipo_modulo'] < 21 || $module['id_tipo_modulo'] > 23) &&
|
||||
$module['id_tipo_modulo'] != 100)
|
||||
) {
|
||||
$statusCell = ui_print_status_image(STATUS_MODULE_NO_DATA,
|
||||
__('NOT INIT'), true);
|
||||
}
|
||||
elseif ($status_sql['estado'] == 0) {
|
||||
$statusCell = ui_print_status_image(STATUS_MODULE_OK,
|
||||
__('NORMAL') . ": " . modules_get_last_value($module["id_agente_modulo"]), true);
|
||||
}
|
||||
elseif ($status_sql['estado'] == 1) {
|
||||
$statusCell = ui_print_status_image(STATUS_MODULE_CRITICAL,
|
||||
__('CRITICAL') . ": " . modules_get_last_value($module["id_agente_modulo"]), true);
|
||||
}
|
||||
elseif ($status_sql['estado'] == 2) {
|
||||
$statusCell = ui_print_status_image(STATUS_MODULE_WARNING,
|
||||
__('WARNING') . ": " . modules_get_last_value($module["id_agente_modulo"]), true);
|
||||
}
|
||||
else {
|
||||
$last_status = modules_get_agentmodule_last_status($module['id_agente_modulo']);
|
||||
switch($last_status) {
|
||||
case 0:
|
||||
$statusCell = ui_print_status_image(
|
||||
STATUS_MODULE_OK,
|
||||
__('UNKNOWN') . " - " . __('Last status') .
|
||||
" " . __('NORMAL') .": " . modules_get_last_value($module["id_agente_modulo"]),
|
||||
true);
|
||||
break;
|
||||
case 1:
|
||||
$statusCell = ui_print_status_image(
|
||||
STATUS_MODULE_CRITICAL,
|
||||
__('UNKNOWN') . " - " . __('Last status') .
|
||||
" " . __('CRITICAL') . ": " . modules_get_last_value($module["id_agente_modulo"]),
|
||||
true);
|
||||
break;
|
||||
case 2:
|
||||
$statusCell = ui_print_status_image(
|
||||
STATUS_MODULE_WARNING,
|
||||
__('UNKNOWN') . " - " . __('Last status') .
|
||||
" " . __('WARNING') . ": " . modules_get_last_value($module["id_agente_modulo"]),
|
||||
true);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
$graphCell = "";
|
||||
if ($module['history_data'] == 1) {
|
||||
|
||||
$graph_type = return_graphtype ($module["id_tipo_modulo"]);
|
||||
|
||||
$name_module_type = modules_get_moduletype_name ($module["id_tipo_modulo"]);
|
||||
$handle = "stat" . $name_module_type . "_" . $module["id_agente_modulo"];
|
||||
$url = 'include/procesos.php?agente=' . $module["id_agente_modulo"];
|
||||
$win_handle = dechex(crc32($module["id_agente_modulo"] . $module["module_name"]));
|
||||
|
||||
$link ="winopeng('" .
|
||||
"operation/agentes/stat_win.php?" .
|
||||
"type=$graph_type&" .
|
||||
"period=" . SECONDS_1DAY . "&" .
|
||||
"id=" . $module["id_agente_modulo"] . "&" .
|
||||
"label=" . rawurlencode(
|
||||
urlencode(
|
||||
base64_encode($module["module_name"]))) . "&" .
|
||||
"refresh=" . SECONDS_10MINUTES . "', " .
|
||||
"'day_" . $win_handle . "')";
|
||||
|
||||
$graphCell = '<a href="javascript:'.$link.'">' . html_print_image("images/chart_curve.png", true, array("border" => 0, "alt" => "")) . '</a>';
|
||||
$graphCell .= " " .
|
||||
"<a href='index.php?" .
|
||||
"sec=estado&" .
|
||||
"sec2=operation/agentes/ver_agente&" .
|
||||
"id_agente=" . $module["id_agente"] . "&" .
|
||||
"tab=data_view&" .
|
||||
"period=" . SECONDS_1DAY . "&" .
|
||||
"id=" . $module["id_agente_modulo"] . "'>" .
|
||||
html_print_image('images/binary.png', true,
|
||||
array("border" => "0", "alt" => "")) . "</a>";
|
||||
}
|
||||
|
||||
if (is_numeric(modules_get_last_value($module["id_agente_modulo"]))) {
|
||||
$dataCell = format_numeric(modules_get_last_value($module["id_agente_modulo"]));
|
||||
}
|
||||
else {
|
||||
$dataCell = ui_print_module_string_value(
|
||||
$module["datos"], $module["id_agente_modulo"],
|
||||
$module["current_interval"]);
|
||||
}
|
||||
|
||||
if ($module['estado'] == 3) {
|
||||
$option = array ("html_attr" => 'class="redb"');
|
||||
}
|
||||
else {
|
||||
$option = array ();
|
||||
}
|
||||
$timestampCell = ui_print_timestamp ($utimestamp_sql["utimestamp"], true, $option);
|
||||
|
||||
|
||||
$group_agent = agents_get_agent_group($module['id_agente']);
|
||||
|
||||
if (check_acl ($config['id_user'], $group_agent, "AW")) {
|
||||
$edit_module = 'aaa';
|
||||
|
||||
$url_edit = "index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&id_agente="
|
||||
. $module['id_agente'] . "&tab=module&id_agent_module=" .
|
||||
$module["id_agente_modulo"] . "&edit_module=1";
|
||||
|
||||
$edit_module = '<a href="' . $url_edit . '">' .
|
||||
html_print_image("images/config.png", true) . '</a>';
|
||||
}
|
||||
else {
|
||||
$edit_module = '';
|
||||
}
|
||||
|
||||
|
||||
array_push($table->data, array(
|
||||
$module['module_name'],
|
||||
$agentCell,
|
||||
$typeCell,
|
||||
$intervalCell,
|
||||
$statusCell,
|
||||
$graphCell,
|
||||
$dataCell,
|
||||
$timestampCell,
|
||||
$edit_module));
|
||||
$module["datos"] =
|
||||
modules_get_last_value($module['id_agente_modulo']);
|
||||
$module["module_name"] = $module['nombre'];
|
||||
|
||||
//To search the monitor status
|
||||
$status_sql = sprintf('SELECT estado from tagente_estado where id_agente_modulo =' . $module['id_agente_modulo']);
|
||||
$status_sql = db_process_sql($status_sql);
|
||||
$status_sql = $status_sql[0];
|
||||
//To search the monitor utimestamp
|
||||
$utimestamp_sql = sprintf('SELECT utimestamp from tagente_estado where id_agente_modulo =' . $module['id_agente_modulo']);
|
||||
$utimestamp_sql = db_process_sql($utimestamp_sql);
|
||||
$utimestamp_sql = $utimestamp_sql[0];
|
||||
|
||||
|
||||
$agent = db_get_row ('tagente', 'id_agente', $module['id_agente']);
|
||||
$agentCell = '<a title='.$module['agent_name'].' href="index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente=' . $module['id_agente'] . '">' .
|
||||
$agent['alias'] . '</a>';
|
||||
|
||||
$typeCell = ui_print_moduletype_icon($module["id_tipo_modulo"], true);
|
||||
|
||||
$intervalCell = modules_get_interval ($module['id_agente_modulo']);
|
||||
|
||||
if ($utimestamp_sql['utimestamp'] == 0 &&
|
||||
(
|
||||
($module['id_tipo_modulo'] < 21 || $module['id_tipo_modulo'] > 23) &&
|
||||
$module['id_tipo_modulo'] != 100)
|
||||
) {
|
||||
$statusCell = ui_print_status_image(STATUS_MODULE_NO_DATA,
|
||||
__('NOT INIT'), true);
|
||||
}
|
||||
elseif ($status_sql['estado'] == 0) {
|
||||
$statusCell = ui_print_status_image(STATUS_MODULE_OK,
|
||||
__('NORMAL') . ": " . modules_get_last_value($module["id_agente_modulo"]), true);
|
||||
}
|
||||
elseif ($status_sql['estado'] == 1) {
|
||||
$statusCell = ui_print_status_image(STATUS_MODULE_CRITICAL,
|
||||
__('CRITICAL') . ": " . modules_get_last_value($module["id_agente_modulo"]), true);
|
||||
}
|
||||
elseif ($status_sql['estado'] == 2) {
|
||||
$statusCell = ui_print_status_image(STATUS_MODULE_WARNING,
|
||||
__('WARNING') . ": " . modules_get_last_value($module["id_agente_modulo"]), true);
|
||||
}
|
||||
else {
|
||||
$last_status = modules_get_agentmodule_last_status($module['id_agente_modulo']);
|
||||
switch($last_status) {
|
||||
case 0:
|
||||
$statusCell = ui_print_status_image(
|
||||
STATUS_MODULE_OK,
|
||||
__('UNKNOWN') . " - " . __('Last status') .
|
||||
" " . __('NORMAL') .": " . modules_get_last_value($module["id_agente_modulo"]),
|
||||
true);
|
||||
break;
|
||||
case 1:
|
||||
$statusCell = ui_print_status_image(
|
||||
STATUS_MODULE_CRITICAL,
|
||||
__('UNKNOWN') . " - " . __('Last status') .
|
||||
" " . __('CRITICAL') . ": " . modules_get_last_value($module["id_agente_modulo"]),
|
||||
true);
|
||||
break;
|
||||
case 2:
|
||||
$statusCell = ui_print_status_image(
|
||||
STATUS_MODULE_WARNING,
|
||||
__('UNKNOWN') . " - " . __('Last status') .
|
||||
" " . __('WARNING') . ": " . modules_get_last_value($module["id_agente_modulo"]),
|
||||
true);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
$graphCell = "";
|
||||
if ($module['history_data'] == 1) {
|
||||
|
||||
$graph_type = return_graphtype ($module["id_tipo_modulo"]);
|
||||
|
||||
$name_module_type = modules_get_moduletype_name ($module["id_tipo_modulo"]);
|
||||
$handle = "stat" . $name_module_type . "_" . $module["id_agente_modulo"];
|
||||
$url = 'include/procesos.php?agente=' . $module["id_agente_modulo"];
|
||||
$win_handle = dechex(crc32($module["id_agente_modulo"] . $module["module_name"]));
|
||||
|
||||
$link ="winopeng('" .
|
||||
"operation/agentes/stat_win.php?" .
|
||||
"type=$graph_type&" .
|
||||
"period=" . SECONDS_1DAY . "&" .
|
||||
"id=" . $module["id_agente_modulo"] . "&" .
|
||||
"label=" . rawurlencode(
|
||||
urlencode(
|
||||
base64_encode($module["module_name"]))) . "&" .
|
||||
"refresh=" . SECONDS_10MINUTES . "', " .
|
||||
"'day_" . $win_handle . "')";
|
||||
|
||||
$graphCell = '<a href="javascript:'.$link.'">' . html_print_image("images/chart_curve.png", true, array("border" => 0, "alt" => "")) . '</a>';
|
||||
$graphCell .= " " .
|
||||
"<a href='index.php?" .
|
||||
"sec=estado&" .
|
||||
"sec2=operation/agentes/ver_agente&" .
|
||||
"id_agente=" . $module["id_agente"] . "&" .
|
||||
"tab=data_view&" .
|
||||
"period=" . SECONDS_1DAY . "&" .
|
||||
"id=" . $module["id_agente_modulo"] . "'>" .
|
||||
html_print_image('images/binary.png', true,
|
||||
array("border" => "0", "alt" => "")) . "</a>";
|
||||
}
|
||||
|
||||
if (is_numeric(modules_get_last_value($module["id_agente_modulo"]))) {
|
||||
$dataCell = format_numeric(modules_get_last_value($module["id_agente_modulo"]));
|
||||
}
|
||||
else {
|
||||
$dataCell = ui_print_module_string_value(
|
||||
$module["datos"], $module["id_agente_modulo"],
|
||||
$module["current_interval"]);
|
||||
}
|
||||
|
||||
if ($module['estado'] == 3) {
|
||||
$option = array ("html_attr" => 'class="redb"');
|
||||
}
|
||||
else {
|
||||
$option = array ();
|
||||
}
|
||||
$timestampCell = ui_print_timestamp ($utimestamp_sql["utimestamp"], true, $option);
|
||||
|
||||
|
||||
$group_agent = agents_get_agent_group($module['id_agente']);
|
||||
|
||||
if (check_acl ($config['id_user'], $group_agent, "AW")) {
|
||||
$edit_module = 'aaa';
|
||||
|
||||
$url_edit = "index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&id_agente="
|
||||
. $module['id_agente'] . "&tab=module&id_agent_module=" .
|
||||
$module["id_agente_modulo"] . "&edit_module=1";
|
||||
|
||||
$edit_module = '<a href="' . $url_edit . '">' .
|
||||
html_print_image("images/config.png", true) . '</a>';
|
||||
}
|
||||
else {
|
||||
$edit_module = '';
|
||||
}
|
||||
|
||||
|
||||
array_push($table->data, array(
|
||||
$module['module_name'],
|
||||
$agentCell,
|
||||
$typeCell,
|
||||
$intervalCell,
|
||||
$statusCell,
|
||||
$graphCell,
|
||||
$dataCell,
|
||||
$timestampCell,
|
||||
$edit_module));
|
||||
}
|
||||
|
||||
echo "<br />";
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -1148,7 +1148,7 @@ INSERT INTO `tagent_custom_fields` VALUES (1,'Serial Number',0,0),(2,'Depar
|
|||
|
||||
INSERT INTO `ttag` VALUES (1,'network','Network equipment','http://artica.es','',''),(2,'critical','Critical modules','','',''),(3,'dmz','DMZ Network Zone','','',''),(4,'performance','Performance anda capacity modules','','',''),(5,'configuration','','','','');
|
||||
|
||||
INSERT INTO `tevent_response` VALUES (1,'Ping to host','Ping to the agent host','ping -c 5 _agent_address_','command',0,620,500,0,''),(2,'SSH to host','Connect via SSH to the agent','http://localhost:8022/anyterm.html?param=_User_@_agent_address_','url',0,800,450,0,'User'),(3,'Create incident from event','Create a incident from the event with the standard incidents system of Pandora FMS','index.php?sec=workspace&sec2=operation/incidents/incident_detail&insert_form&from_event=_event_id_','url',0,0,0,1,''),(4,'Create Integria IMS incident from event','Create a incident from the event with integria incidents system of Pandora FMS. 

Is necessary to enable and configure the Integria incidents in Pandora FMS setup.','index.php?sec=workspace&sec2=operation/integria_incidents/incident&tab=editor&from_event=_event_id_','url',0,0,0,1,''),(5,'Restart agent','Restart the agent with using UDP protocol.

To use this response is necessary to have installed Pandora FMS server and console in the same machine.','/usr/share/pandora_server/util/udp_client.pl _agent_address_ 41122 "REFRESH AGENT"','command',0,620,500,0,''),(6,'Ping to module agent host','Ping to the module agent host','ping -c 5 _module_address_','command',0,620,500,0,'');
|
||||
INSERT INTO `tevent_response` VALUES (1,'Ping to host','Ping to the agent host','ping -c 5 _agent_address_','command',0,620,500,0,'',0),(2,'SSH to host','Connect via SSH to the agent','http://localhost:8022/anyterm.html?param=_User_@_agent_address_','url',0,800,450,0,'User',0),(3,'Create incident from event','Create a incident from the event with the standard incidents system of Pandora FMS','index.php?sec=workspace&sec2=operation/incidents/incident_detail&insert_form&from_event=_event_id_','url',0,0,0,1,'',0),(4,'Create Integria IMS incident from event','Create a incident from the event with integria incidents system of Pandora FMS. 

Is necessary to enable and configure the Integria incidents in Pandora FMS setup.','index.php?sec=workspace&sec2=operation/integria_incidents/incident&tab=editor&from_event=_event_id_','url',0,0,0,1,'',0),(5,'Restart agent','Restart the agent with using UDP protocol.

To use this response is necessary to have installed Pandora FMS server and console in the same machine.','/usr/share/pandora_server/util/udp_client.pl _agent_address_ 41122 "REFRESH AGENT"','command',0,620,500,0,'',0),(6,'Ping to module agent host','Ping to the module agent host','ping -c 5 _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', '');
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
package: pandorafms-server
|
||||
Version: 7.0NG.711-170828
|
||||
Version: 7.0NG.711-170831
|
||||
Architecture: all
|
||||
Priority: optional
|
||||
Section: admin
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
|
||||
pandora_version="7.0NG.711-170828"
|
||||
pandora_version="7.0NG.711-170831"
|
||||
|
||||
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 = "7.0NG.711";
|
||||
my $pandora_build = "170828";
|
||||
my $pandora_build = "170831";
|
||||
our $VERSION = $pandora_version." ".$pandora_build;
|
||||
|
||||
# Setup hash
|
||||
|
|
|
@ -5051,15 +5051,26 @@ sub pandora_set_event_storm_protection ($) {
|
|||
##########################################################################
|
||||
sub pandora_update_agent_module_count ($$$) {
|
||||
my ($pa_config, $dbh, $agent_id) = @_;
|
||||
|
||||
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);
|
||||
my $total = 0;
|
||||
my $counts = {
|
||||
'0' => 0,
|
||||
'1' => 0,
|
||||
'2' => 0,
|
||||
'3' => 0,
|
||||
'4' => 0,
|
||||
}; # Module counts by status.
|
||||
|
||||
# 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);
|
||||
|
|
|
@ -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}
|
||||
|
|
|
@ -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}
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
# **********************************************************************
|
||||
|
||||
PI_VERSION="7.0NG.711"
|
||||
PI_BUILD="170828"
|
||||
PI_BUILD="170831"
|
||||
|
||||
MODE=$1
|
||||
if [ $# -gt 1 ]; then
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in New Issue