Merge remote-tracking branch 'origin/develop' into ent-4822-estado-de-consola-visual-mantenimiento
This commit is contained in:
commit
ace6bcc854
|
@ -1,5 +1,5 @@
|
|||
package: pandorafms-agent-unix
|
||||
Version: 7.0NG.765-221013
|
||||
Version: 7.0NG.765-221014
|
||||
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.765-221013"
|
||||
pandora_version="7.0NG.765-221014"
|
||||
|
||||
echo "Test if you has the tools for to make the packages."
|
||||
whereis dpkg-deb | cut -d":" -f2 | grep dpkg-deb > /dev/null
|
||||
|
|
|
@ -1015,7 +1015,7 @@ my $Sem = undef;
|
|||
my $ThreadSem = undef;
|
||||
|
||||
use constant AGENT_VERSION => '7.0NG.765';
|
||||
use constant AGENT_BUILD => '221013';
|
||||
use constant AGENT_BUILD => '221014';
|
||||
|
||||
# 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.765
|
||||
%define release 221013
|
||||
%define release 221014
|
||||
|
||||
Summary: Pandora FMS Linux agent, PERL version
|
||||
Name: %{name}
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
#
|
||||
%define name pandorafms_agent_unix
|
||||
%define version 7.0NG.765
|
||||
%define release 221013
|
||||
%define release 221014
|
||||
|
||||
Summary: Pandora FMS Linux agent, PERL version
|
||||
Name: %{name}
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
# **********************************************************************
|
||||
|
||||
PI_VERSION="7.0NG.765"
|
||||
PI_BUILD="221013"
|
||||
PI_BUILD="221014"
|
||||
OS_NAME=`uname -s`
|
||||
|
||||
FORCE=0
|
||||
|
|
|
@ -186,7 +186,7 @@ UpgradeApplicationID
|
|||
{}
|
||||
|
||||
Version
|
||||
{221013}
|
||||
{221014}
|
||||
|
||||
ViewReadme
|
||||
{Yes}
|
||||
|
|
|
@ -30,7 +30,7 @@ using namespace Pandora;
|
|||
using namespace Pandora_Strutils;
|
||||
|
||||
#define PATH_SIZE _MAX_PATH+1
|
||||
#define PANDORA_VERSION ("7.0NG.765 Build 221013")
|
||||
#define PANDORA_VERSION ("7.0NG.765 Build 221014")
|
||||
|
||||
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.765(Build 221013))"
|
||||
VALUE "ProductVersion", "(7.0NG.765(Build 221014))"
|
||||
VALUE "FileVersion", "1.0.0.0"
|
||||
END
|
||||
END
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
package: pandorafms-console
|
||||
Version: 7.0NG.765-221013
|
||||
Version: 7.0NG.765-221014
|
||||
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.765-221013"
|
||||
pandora_version="7.0NG.765-221014"
|
||||
|
||||
package_pear=0
|
||||
package_pandora=1
|
||||
|
|
|
@ -358,7 +358,7 @@ if (!is_user_admin($config['id_user'])) {
|
|||
$filter['id_group'] = array_keys(users_get_groups(false, 'LM'));
|
||||
}
|
||||
|
||||
$total_templates = alerts_get_alert_templates($filter, ['COUNT(*) AS total']);
|
||||
$total_templates = alerts_get_alert_templates($filter, ['COUNT(*) AS total'], true);
|
||||
$total_templates = $total_templates[0]['total'];
|
||||
|
||||
$templates = alerts_get_alert_templates(
|
||||
|
|
|
@ -44,7 +44,7 @@ class AuditLog extends HTML
|
|||
*
|
||||
* @var array
|
||||
*/
|
||||
public $AJAXMethods = [ 'draw' ];
|
||||
public $AJAXMethods = ['draw'];
|
||||
|
||||
/**
|
||||
* Ajax page.
|
||||
|
@ -78,7 +78,6 @@ class AuditLog extends HTML
|
|||
|
||||
// Set the ajax controller.
|
||||
$this->ajaxController = $ajaxController;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
@ -232,7 +231,6 @@ class AuditLog extends HTML
|
|||
|
||||
// Load own javascript file.
|
||||
echo $this->loadJS();
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
@ -368,39 +366,38 @@ class AuditLog extends HTML
|
|||
|
||||
// Javascript content.
|
||||
?>
|
||||
<script type="text/javascript">
|
||||
function format ( d ) {
|
||||
var output = '';
|
||||
<script type="text/javascript">
|
||||
function format(d) {
|
||||
var output = '';
|
||||
|
||||
if (d.extendedInfo === '') {
|
||||
output = "<?php echo __('There is no additional information to display'); ?>";
|
||||
} else {
|
||||
output = d.extendedInfo;
|
||||
}
|
||||
|
||||
return output;
|
||||
if (d.extendedInfo === '') {
|
||||
output = "<?php echo __('There is no additional information to display'); ?>";
|
||||
} else {
|
||||
output = d.extendedInfo;
|
||||
}
|
||||
|
||||
$(document).ready(function() {
|
||||
// Add event listener for opening and closing details
|
||||
$('#audit_logs tbody').on('click', 'td.show_extended_info', function () {
|
||||
var tr = $(this).closest('tr');
|
||||
var table = <?php echo 'dt_'.$this->tableId; ?>;
|
||||
var row = table.row( tr );
|
||||
|
||||
if ( row.child.isShown() ) {
|
||||
// This row is already open - close it
|
||||
row.child.hide();
|
||||
tr.removeClass('shown');
|
||||
}
|
||||
else {
|
||||
// Open this row
|
||||
row.child( format(row.data()) ).show();
|
||||
tr.addClass('shown');
|
||||
}
|
||||
} );
|
||||
} );
|
||||
</script>
|
||||
|
||||
return output;
|
||||
}
|
||||
|
||||
$(document).ready(function() {
|
||||
// Add event listener for opening and closing details
|
||||
$('#audit_logs tbody').on('click', 'td.show_extended_info', function() {
|
||||
var tr = $(this).closest('tr');
|
||||
var table = $("#<?php echo $this->tableId; ?>").DataTable();
|
||||
var row = table.row(tr);
|
||||
|
||||
if (row.child.isShown()) {
|
||||
// This row is already open - close it
|
||||
row.child.hide();
|
||||
tr.removeClass('shown');
|
||||
} else {
|
||||
// Open this row
|
||||
row.child(format(row.data())).show();
|
||||
tr.addClass('shown');
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<?php
|
||||
// EOF Javascript content.
|
||||
return ob_get_clean();
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
/**
|
||||
* Pandora build version and version
|
||||
*/
|
||||
$build_version = 'PC221013';
|
||||
$build_version = 'PC221014';
|
||||
$pandora_version = 'v7.0NG.765';
|
||||
|
||||
// Do not overwrite default timezone set if defined.
|
||||
|
|
|
@ -57,11 +57,17 @@ function mysql_connect_db(
|
|||
$port = $config['dbport'];
|
||||
}
|
||||
|
||||
if ($ssl === null && (bool) $config['dbssl'] === true) {
|
||||
if ($ssl === null
|
||||
&& isset($config['dbssl']) === true
|
||||
&& (bool) $config['dbssl'] === true
|
||||
) {
|
||||
$ssl = $config['dbsslcafile'];
|
||||
}
|
||||
|
||||
if ($verify === null && (bool) $config['sslverifyservercert'] === true) {
|
||||
if ($verify === null
|
||||
&& isset($config['sslverifyservercert']) === true
|
||||
&& (bool) $config['sslverifyservercert'] === true
|
||||
) {
|
||||
$verify = 'verified';
|
||||
}
|
||||
|
||||
|
|
|
@ -795,7 +795,7 @@ function alerts_delete_alert_template($id_alert_template)
|
|||
*
|
||||
* @return mixed Array with selected alert templates or false if something goes wrong.
|
||||
*/
|
||||
function alerts_get_alert_templates($filter=false, $fields=false)
|
||||
function alerts_get_alert_templates($filter=false, $fields=false, $total=false)
|
||||
{
|
||||
global $config;
|
||||
|
||||
|
@ -811,32 +811,17 @@ function alerts_get_alert_templates($filter=false, $fields=false)
|
|||
|
||||
$templates_sql = @db_get_all_rows_filter('talert_templates', $filter, $fields, 'AND', false, true);
|
||||
|
||||
switch ($config['dbtype']) {
|
||||
case 'mysql':
|
||||
case 'postgresql':
|
||||
$limit_sql = '';
|
||||
if (isset($offset) && isset($limit)) {
|
||||
$limit_sql = " LIMIT $offset, $limit ";
|
||||
} else {
|
||||
$limit_sql = '';
|
||||
}
|
||||
|
||||
$sql = sprintf('%s %s', $templates_sql, $limit_sql);
|
||||
|
||||
$alert_templates = db_get_all_rows_sql($sql);
|
||||
break;
|
||||
|
||||
case 'oracle':
|
||||
$set = [];
|
||||
if (isset($offset) && isset($limit)) {
|
||||
$set['limit'] = $limit;
|
||||
$set['offset'] = $offset;
|
||||
}
|
||||
|
||||
$alert_templates = oracle_recode_query($templates_sql, $set, 'AND', false);
|
||||
break;
|
||||
$limit_sql = '';
|
||||
if (isset($offset) && isset($limit) && $total === false) {
|
||||
$limit_sql = " LIMIT $offset, $limit ";
|
||||
} else {
|
||||
$limit_sql = '';
|
||||
}
|
||||
|
||||
$sql = sprintf('%s %s', $templates_sql, $limit_sql);
|
||||
|
||||
$alert_templates = db_get_all_rows_sql($sql);
|
||||
|
||||
return $alert_templates;
|
||||
}
|
||||
|
||||
|
|
|
@ -13298,12 +13298,6 @@ function api_set_add_event_comment($id, $thrash2, $other, $thrash3)
|
|||
{
|
||||
global $config;
|
||||
|
||||
if (defined('METACONSOLE')) {
|
||||
$meta = true;
|
||||
} else {
|
||||
$meta = $other['data'][1];
|
||||
}
|
||||
|
||||
if (!check_acl($config['id_user'], 0, 'EW')) {
|
||||
returnError('forbidden', 'string');
|
||||
return;
|
||||
|
@ -13314,13 +13308,46 @@ function api_set_add_event_comment($id, $thrash2, $other, $thrash3)
|
|||
return;
|
||||
} else if ($other['type'] == 'array') {
|
||||
$comment = $other['data'][0];
|
||||
$history = $other['data'][2];
|
||||
|
||||
$status = events_comment(
|
||||
$id,
|
||||
$comment,
|
||||
'Added comment'
|
||||
);
|
||||
$node_int = 0;
|
||||
if (is_metaconsole() === true) {
|
||||
if (isset($other['data'][1]) === true
|
||||
&& empty($other['data'][1]) === false
|
||||
) {
|
||||
$node_int = $other['data'][1];
|
||||
}
|
||||
}
|
||||
|
||||
try {
|
||||
if (is_metaconsole() === true
|
||||
&& (int) $node_int > 0
|
||||
) {
|
||||
$node = new Node($node_int);
|
||||
$node->connect();
|
||||
}
|
||||
|
||||
$status = events_comment(
|
||||
$id,
|
||||
$comment,
|
||||
'Added comment'
|
||||
);
|
||||
} catch (\Exception $e) {
|
||||
// Unexistent agent.
|
||||
if (is_metaconsole() === true
|
||||
&& $node_int > 0
|
||||
) {
|
||||
$node->disconnect();
|
||||
}
|
||||
|
||||
$status = false;
|
||||
} finally {
|
||||
if (is_metaconsole() === true
|
||||
&& $node_int > 0
|
||||
) {
|
||||
$node->disconnect();
|
||||
}
|
||||
}
|
||||
|
||||
if (is_error($status)) {
|
||||
returnError(
|
||||
'The event comment could not be added.'
|
||||
|
|
|
@ -1664,44 +1664,31 @@ function html_print_select_multiple_modules_filtered(array $data):string
|
|||
]
|
||||
);
|
||||
|
||||
// Show common modules.
|
||||
$selection = [
|
||||
0 => __('Show common modules'),
|
||||
1 => __('Show all modules'),
|
||||
];
|
||||
|
||||
if (true) {
|
||||
$output .= html_print_input(
|
||||
[
|
||||
|
||||
'label' => __('Only common modules'),
|
||||
'type' => 'switch',
|
||||
'value' => 'checked',
|
||||
'id' => 'filtered-module-show-common-modules-'.$uniqId,
|
||||
'return' => true,
|
||||
'onchange' => 'fmModuleChange(\''.$uniqId.'\', '.(int) is_metaconsole().')',
|
||||
]
|
||||
);
|
||||
} else {
|
||||
$output .= html_print_input(
|
||||
[
|
||||
'label' => __('Show common modules'),
|
||||
'type' => 'select',
|
||||
'fields' => $selection,
|
||||
'name' => 'filtered-module-show-common-modules-'.$uniqId,
|
||||
'return' => true,
|
||||
'script' => 'fmModuleChange(\''.$uniqId.'\', '.(int) is_metaconsole().')',
|
||||
]
|
||||
);
|
||||
$commonModules = 0;
|
||||
if (empty($data['mShowCommonModules']) === false) {
|
||||
$commonModules = 1;
|
||||
}
|
||||
|
||||
$output .= html_print_input(
|
||||
[
|
||||
'label' => __('Only common modules'),
|
||||
'type' => 'switch',
|
||||
'checked' => $commonModules,
|
||||
'value' => $commonModules,
|
||||
'name' => 'filtered-module-show-common-modules-'.$uniqId,
|
||||
'id' => 'filtered-module-show-common-modules-'.$uniqId,
|
||||
'return' => true,
|
||||
'onchange' => 'fmModuleChange(\''.$uniqId.'\', '.(int) is_metaconsole().')',
|
||||
]
|
||||
);
|
||||
|
||||
if (empty($data['mAgents']) === false
|
||||
&& empty($data['mModuleGroup'] === false)
|
||||
) {
|
||||
$all_modules = get_modules_agents(
|
||||
$data['mModuleGroup'],
|
||||
explode(',', $data['mAgents']),
|
||||
$data['mShowCommonModules'],
|
||||
!$commonModules,
|
||||
false,
|
||||
true
|
||||
);
|
||||
|
@ -1709,10 +1696,18 @@ function html_print_select_multiple_modules_filtered(array $data):string
|
|||
$all_modules = [];
|
||||
}
|
||||
|
||||
$mModules = $data['mModules'];
|
||||
if (is_array($data['mModules']) === false) {
|
||||
$result = explode(((is_metaconsole() === true) ? SEPARATOR_META_MODULE : ','), $data['mModules']);
|
||||
} else {
|
||||
$result = $data['mModules'];
|
||||
$mModules = explode(
|
||||
',',
|
||||
$data['mModules']
|
||||
);
|
||||
}
|
||||
|
||||
$result = [];
|
||||
// Clean double safe input.
|
||||
foreach ($mModules as $name) {
|
||||
$result[] = io_safe_output($name);
|
||||
}
|
||||
|
||||
$output .= html_print_input(
|
||||
|
@ -4956,7 +4951,7 @@ function html_print_input($data, $wrapper='div', $input_only=false)
|
|||
$output = '';
|
||||
|
||||
if (($data['label'] ?? false) && $input_only === false) {
|
||||
$output = '<'.$wrapper.' id="'.$wrapper.'-'.$data['name'].'" ';
|
||||
$output = '<'.$wrapper.' id="'.$wrapper.'-'.($data['name'] ?? '').'" ';
|
||||
$output .= ' class="'.($data['input_class'] ?? '').'">';
|
||||
$output .= '<label '.$style.' class="'.($data['label_class'] ?? '').'">';
|
||||
$output .= ($data['label'] ?? '');
|
||||
|
@ -4977,7 +4972,7 @@ function html_print_input($data, $wrapper='div', $input_only=false)
|
|||
|
||||
if (isset($data['wrapper']) === true) {
|
||||
$output = '<'.$data['wrapper'].' '.$wrapper_attributes.' id="wr_'.$data['name'].'" ';
|
||||
$output .= ' class="'.$data['input_class'].'">';
|
||||
$output .= ' class="'.($data['input_class'] ?? '').'">';
|
||||
}
|
||||
|
||||
switch (($data['type'] ?? null)) {
|
||||
|
@ -5097,7 +5092,7 @@ function html_print_input($data, $wrapper='div', $input_only=false)
|
|||
$output .= html_print_input_color(
|
||||
$data['name'],
|
||||
$data['value'],
|
||||
$data['id'],
|
||||
($data['id'] ?? ''),
|
||||
((isset($data['class']) === true) ? $data['class'] : false),
|
||||
((isset($data['return']) === true) ? $data['return'] : false)
|
||||
);
|
||||
|
|
|
@ -3656,7 +3656,7 @@ function get_modules_agents($id_module_group, $id_agents, $selection, $select_mo
|
|||
$id_agents,
|
||||
$selection,
|
||||
false,
|
||||
false,
|
||||
$useName,
|
||||
true
|
||||
);
|
||||
|
||||
|
@ -3684,8 +3684,8 @@ function get_modules_agents($id_module_group, $id_agents, $selection, $select_mo
|
|||
if ($occurrences === $nodes_consulted) {
|
||||
// Module already present in ALL nodes.
|
||||
$modules[] = [
|
||||
'id_agente_modulo' => $module_name,
|
||||
'nombre' => $module_name,
|
||||
'id_agente_modulo' => io_safe_output($module_name),
|
||||
'nombre' => io_safe_output($module_name),
|
||||
];
|
||||
}
|
||||
}
|
||||
|
@ -3730,7 +3730,7 @@ function get_modules_agents($id_module_group, $id_agents, $selection, $select_mo
|
|||
function ($carry, $item) use ($useName) {
|
||||
// Only works in select mode.
|
||||
if ($useName === true) {
|
||||
$carry[io_safe_input($item['nombre'])] = $item['nombre'];
|
||||
$carry[$item['id_node'].'|'.$item['nombre']] = $item['nombre'];
|
||||
} else {
|
||||
$carry[$item['id_node'].'|'.$item['id_agente_modulo']] = $item['nombre'];
|
||||
}
|
||||
|
@ -3744,6 +3744,8 @@ function get_modules_agents($id_module_group, $id_agents, $selection, $select_mo
|
|||
$id_module_group,
|
||||
$id_agents,
|
||||
$selection,
|
||||
false,
|
||||
$useName,
|
||||
false
|
||||
);
|
||||
}
|
||||
|
|
|
@ -338,22 +338,6 @@ class AgentModuleWidget extends Widget
|
|||
)
|
||||
);
|
||||
|
||||
if (is_metaconsole() === true) {
|
||||
$values['mModules'] = implode(
|
||||
SEPARATOR_META_MODULE,
|
||||
array_reduce(
|
||||
$values['mModules'],
|
||||
function ($carry, $item) {
|
||||
$d = explode('|', $item);
|
||||
$carry[] = (isset($d[1]) === true) ? $d[1] : $item;
|
||||
|
||||
return $carry;
|
||||
},
|
||||
[]
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
return $values;
|
||||
}
|
||||
|
||||
|
@ -670,64 +654,34 @@ class AgentModuleWidget extends Widget
|
|||
return $output;
|
||||
}
|
||||
|
||||
// Extract info all modules selected.
|
||||
$target_modules = $this->values['mModules'];
|
||||
if (is_metaconsole() === true) {
|
||||
$target_modules = explode(
|
||||
SEPARATOR_META_MODULE,
|
||||
$this->values['mModules']
|
||||
);
|
||||
$reduceAllModules = array_reduce(
|
||||
$this->values['mModules'],
|
||||
function ($carry, $item) {
|
||||
if ($item === null) {
|
||||
return $carry;
|
||||
}
|
||||
|
||||
$all_modules = $target_modules;
|
||||
} else {
|
||||
if (is_array($target_modules) === true
|
||||
|| is_numeric($target_modules) === true
|
||||
) {
|
||||
$target_modules = array_reduce(
|
||||
$target_modules,
|
||||
function ($carry, $item) {
|
||||
$carry[] = io_safe_output($item);
|
||||
|
||||
return $carry;
|
||||
if (is_metaconsole() === true) {
|
||||
$item = explode('|', $item);
|
||||
$serverId = $item[0];
|
||||
$fullname = $item[1];
|
||||
if ($this->values['mShowCommonModules'] !== 'on') {
|
||||
$item = explode(' » ', $fullname);
|
||||
$name = $item[1];
|
||||
$carry['modules_selected'][$serverId][$name] = null;
|
||||
$carry['modules'][$name] = null;
|
||||
} else {
|
||||
$carry['modules'][$fullname] = null;
|
||||
}
|
||||
);
|
||||
} else {
|
||||
$carry['modules'][$item] = null;
|
||||
}
|
||||
|
||||
$all_modules = Module::search(
|
||||
['nombre' => $target_modules]
|
||||
);
|
||||
} else {
|
||||
// From previous definitions.
|
||||
$all_modules = Module::search(
|
||||
['id_agente_modulo' => explode(',', $target_modules)]
|
||||
);
|
||||
return $carry;
|
||||
}
|
||||
}
|
||||
|
||||
if ($all_modules !== null) {
|
||||
if (is_metaconsole() === true
|
||||
&& $this->values['mShowCommonModules'] === '1'
|
||||
) {
|
||||
$reduceAllModules = [];
|
||||
} else {
|
||||
$reduceAllModules = array_reduce(
|
||||
$all_modules,
|
||||
function ($carry, $item) {
|
||||
if ($item === null) {
|
||||
return $carry;
|
||||
}
|
||||
|
||||
if (is_object($item) === true) {
|
||||
$carry[$item->name()] = null;
|
||||
} else {
|
||||
$carry[io_safe_output($item)] = null;
|
||||
}
|
||||
|
||||
return $carry;
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
$allModules = $reduceAllModules['modules'];
|
||||
$visualData = [];
|
||||
// Extract info agents selected.
|
||||
$target_agents = explode(',', $this->values['mAgents']);
|
||||
|
@ -754,54 +708,33 @@ class AgentModuleWidget extends Widget
|
|||
$visualData[$agent_id]['agent_alias'] = $agent->alias();
|
||||
$visualData[$agent_id]['modules'] = [];
|
||||
|
||||
if (is_metaconsole() === true
|
||||
&& $this->values['mShowCommonModules'] === '1'
|
||||
) {
|
||||
// MC should connect to nodes and retrieve information
|
||||
// from targets.
|
||||
$tmpModules = array_reduce(
|
||||
$target_modules,
|
||||
function ($carry, $item) {
|
||||
// In this case, the modules come with '» ' chain.
|
||||
$tmpCarry = explode('» ', $item);
|
||||
$carry[trim($tmpCarry[1])] = null;
|
||||
|
||||
return $carry;
|
||||
}
|
||||
);
|
||||
|
||||
$modules = $agent->searchModules(
|
||||
['nombre' => array_keys($tmpModules)]
|
||||
);
|
||||
|
||||
foreach ($modules as $module) {
|
||||
if ($module === null) {
|
||||
$reduceAllModules[] = null;
|
||||
} else {
|
||||
$reduceAllModules[$module->name()] = null;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (empty($reduceAllModules) === false) {
|
||||
if (empty($allModules) === false) {
|
||||
if (is_metaconsole() === true && $this->values['mShowCommonModules'] !== 'on') {
|
||||
$modules = $agent->searchModules(
|
||||
['nombre' => array_keys($reduceAllModules)]
|
||||
['nombre' => array_keys($reduceAllModules['modules_selected'][$tserver])]
|
||||
);
|
||||
} else {
|
||||
$modules = $agent->searchModules(
|
||||
['nombre' => array_keys($allModules)]
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
$visualData[$agent_id]['modules'] = $reduceAllModules;
|
||||
$visualData[$agent_id]['modules'] = $allModules;
|
||||
foreach ($modules as $module) {
|
||||
if ($module === null) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$key_name_module = $module->name();
|
||||
|
||||
if ($this->values['mTypeShow'] === '1') {
|
||||
$mod = $module->toArray();
|
||||
$mod['datos'] = $module->lastValue();
|
||||
$module_last_value = modules_get_agentmodule_data_for_humans($mod);
|
||||
$visualData[$agent_id]['modules'][$module->name()] = $module_last_value;
|
||||
$visualData[$agent_id]['modules'][$key_name_module] = $module_last_value;
|
||||
} else {
|
||||
$visualData[$agent_id]['modules'][$module->name()] = $module->getStatus()->estado();
|
||||
$visualData[$agent_id]['modules'][$key_name_module] = $module->getStatus()->estado();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -813,17 +746,9 @@ class AgentModuleWidget extends Widget
|
|||
}
|
||||
}
|
||||
|
||||
if (empty($reduceAllModules) === false) {
|
||||
$allModules = array_keys($reduceAllModules);
|
||||
}
|
||||
|
||||
if ($allModules === null) {
|
||||
$allModules = [];
|
||||
}
|
||||
|
||||
$output = $this->generateViewAgentModule(
|
||||
$visualData,
|
||||
$allModules
|
||||
array_keys($allModules)
|
||||
);
|
||||
|
||||
return $output;
|
||||
|
|
|
@ -749,6 +749,10 @@ class Module extends Entity
|
|||
$updates = $this->fields;
|
||||
$updates['id_tipo_modulo'] = $this->moduleType()->id_tipo();
|
||||
|
||||
if (empty($updates['debug_content']) === false) {
|
||||
$updates['debug_content'] = str_replace("'", '"', $updates['debug_content']);
|
||||
}
|
||||
|
||||
// In the case of the webserver modules, debug_content special characters must be handled.
|
||||
if ($updates['id_tipo_modulo'] >= MODULE_TYPE_WEB_ANALYSIS
|
||||
&& $updates['id_tipo_modulo'] <= MODULE_TYPE_WEB_CONTENT_STRING
|
||||
|
|
|
@ -129,7 +129,7 @@
|
|||
<div style='height: 10px'>
|
||||
<?php
|
||||
$version = '7.0NG.765';
|
||||
$build = '221013';
|
||||
$build = '221014';
|
||||
$banner = "v$version Build $build";
|
||||
|
||||
error_reporting(0);
|
||||
|
|
|
@ -222,9 +222,16 @@ if (is_ajax()) {
|
|||
$id_group,
|
||||
$id_agents,
|
||||
$selection,
|
||||
$select_mode
|
||||
$select_mode,
|
||||
true
|
||||
);
|
||||
echo json_encode($modules);
|
||||
|
||||
// Clean double safe input.
|
||||
foreach ($modules as $id => $name) {
|
||||
$result[$id] = io_safe_output($name);
|
||||
}
|
||||
|
||||
echo json_encode($result);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
#
|
||||
%define name pandorafms_console
|
||||
%define version 7.0NG.765
|
||||
%define release 221013
|
||||
%define release 221014
|
||||
|
||||
# User and Group under which Apache is running
|
||||
%define httpd_name httpd
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
#
|
||||
%define name pandorafms_console
|
||||
%define version 7.0NG.765
|
||||
%define release 221013
|
||||
%define release 221014
|
||||
|
||||
# User and Group under which Apache is running
|
||||
%define httpd_name httpd
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
#
|
||||
%define name pandorafms_console
|
||||
%define version 7.0NG.765
|
||||
%define release 221013
|
||||
%define release 221014
|
||||
%define httpd_name httpd
|
||||
# User and Group under which Apache is running
|
||||
%define httpd_name apache2
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
package: pandorafms-server
|
||||
Version: 7.0NG.765-221013
|
||||
Version: 7.0NG.765-221014
|
||||
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.765-221013"
|
||||
pandora_version="7.0NG.765-221014"
|
||||
|
||||
package_cpan=0
|
||||
package_pandora=1
|
||||
|
|
|
@ -46,7 +46,7 @@ our @EXPORT = qw(
|
|||
|
||||
# version: Defines actual version of Pandora Server for this module only
|
||||
my $pandora_version = "7.0NG.765";
|
||||
my $pandora_build = "221013";
|
||||
my $pandora_build = "221014";
|
||||
our $VERSION = $pandora_version." ".$pandora_build;
|
||||
|
||||
# Setup hash
|
||||
|
|
|
@ -34,7 +34,7 @@ our @ISA = qw(Exporter);
|
|||
|
||||
# version: Defines actual version of Pandora Server for this module only
|
||||
my $pandora_version = "7.0NG.765";
|
||||
my $pandora_build = "221013";
|
||||
my $pandora_build = "221014";
|
||||
our $VERSION = $pandora_version." ".$pandora_build;
|
||||
|
||||
our %EXPORT_TAGS = ( 'all' => [ qw() ] );
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
#
|
||||
%define name pandorafms_server
|
||||
%define version 7.0NG.765
|
||||
%define release 221013
|
||||
%define release 221014
|
||||
|
||||
Summary: Pandora FMS Server
|
||||
Name: %{name}
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
#
|
||||
%define name pandorafms_server
|
||||
%define version 7.0NG.765
|
||||
%define release 221013
|
||||
%define release 221014
|
||||
|
||||
Summary: Pandora FMS Server
|
||||
Name: %{name}
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
# **********************************************************************
|
||||
|
||||
PI_VERSION="7.0NG.765"
|
||||
PI_BUILD="221013"
|
||||
PI_BUILD="221014"
|
||||
|
||||
MODE=$1
|
||||
if [ $# -gt 1 ]; then
|
||||
|
|
|
@ -35,7 +35,7 @@ use PandoraFMS::Config;
|
|||
use PandoraFMS::DB;
|
||||
|
||||
# version: define current version
|
||||
my $version = "7.0NG.765 Build 221013";
|
||||
my $version = "7.0NG.765 Build 221014";
|
||||
|
||||
# Pandora server configuration
|
||||
my %conf;
|
||||
|
|
|
@ -36,7 +36,7 @@ use Encode::Locale;
|
|||
Encode::Locale::decode_argv;
|
||||
|
||||
# version: define current version
|
||||
my $version = "7.0NG.765 Build 221013";
|
||||
my $version = "7.0NG.765 Build 221014";
|
||||
|
||||
# save program name for logging
|
||||
my $progname = basename($0);
|
||||
|
@ -142,7 +142,7 @@ sub help_screen{
|
|||
help_screen_line('--get_cluster_status', '<id_cluster>', 'Getting cluster status');
|
||||
help_screen_line('--set_disabled_and_standby', '<id_agent> <id_node> <value>', 'Overwrite and disable and standby status');
|
||||
help_screen_line('--reset_agent_counts', '<id_agent>', 'Resets module counts and alert counts in the agents');
|
||||
help_screen_line('--update_agent_custom_fields', '<id_agent> <type_field> <field_to_change> <new_value>', "Update an agent custom field. The fields can be \n\t the following: Serial number, Department ... and types can be 0 text and 1 combo ");
|
||||
help_screen_line('--agent_update_custom_fields', '<id_agent> <type_field> <field_to_change> <new_value>', "Update an agent custom field. The fields can be \n\t the following: Serial number, Department ... and types can be 0 text and 1 combo ");
|
||||
|
||||
print "\nMODULES:\n\n" unless $param ne '';
|
||||
help_screen_line('--create_data_module', "<module_name> <module_type> <agent_name> [<description> <module_group> \n\t <min> <max> <post_process> <interval> <warning_min> <warning_max> <critical_min> <critical_max> \n\t <history_data> <definition_file> <warning_str> <critical_str>\n\t <unknown_events> <ff_threshold> <each_ff> <ff_threshold_normal>\n\t <ff_threshold_warning> <ff_threshold_critical> <ff_timeout> <warning_inverse> <critical_inverse>\n\t <critical_instructions> <warning_instructions> <unknown_instructions> <use_alias>]", 'Add data server module to agent');
|
||||
|
@ -3135,7 +3135,7 @@ sub cli_user_update() {
|
|||
|
||||
##############################################################################
|
||||
# Update an agent customs field.
|
||||
# Related option: --update_agent_custom_fields
|
||||
# Related option: --agent_update_custom_fields
|
||||
##############################################################################
|
||||
|
||||
sub cli_agent_update_custom_fields() {
|
||||
|
@ -3149,6 +3149,7 @@ sub cli_agent_update_custom_fields() {
|
|||
|
||||
if($agent_name eq '') {
|
||||
print_log "[ERROR] Agent '$id_agent' doesn't exist\n\n";
|
||||
print "--agent_update_custom_fields, <id_agent> <type_field> <field_to_change> <new_value>, Updates an agent custom field. The fields can be \n\t the following: Serial number, Department ... and types can be 0 text and 1 combo )\n\n";
|
||||
exit;
|
||||
}
|
||||
|
||||
|
@ -3158,6 +3159,7 @@ sub cli_agent_update_custom_fields() {
|
|||
|
||||
if($custom_field eq '') {
|
||||
print_log "[ERROR] Field '$field' doesn't exist\n\n";
|
||||
print "--agent_update_custom_fields, <id_agent> <type_field> <field_to_change> <new_value>, Updates an agent custom field. The fields can be \n\t the following: Serial number, Department ... and types can be 0 text and 1 combo )\n\n";
|
||||
exit;
|
||||
}
|
||||
|
||||
|
@ -3178,7 +3180,7 @@ sub cli_agent_update_custom_fields() {
|
|||
|
||||
print_log "\n[INFO] Updating field '$field' in agent with ID '$id_agent'\n\n";
|
||||
|
||||
my $result = pandora_update_agent_custom_field ($dbh, $new_value, $custom_field, $id_agent);
|
||||
my $result = pandora_agent_update_custom_field ($dbh, $new_value, $custom_field, $id_agent);
|
||||
|
||||
if($result == "0E0"){
|
||||
print_log "[ERROR] Error updating field '$field'\n\n";
|
||||
|
|
Loading…
Reference in New Issue