Merge remote-tracking branch 'origin/develop' into ent-3875-Report-type-summation-not-working-properly

This commit is contained in:
Luis Calvo 2019-07-12 11:33:27 +02:00
commit a1e2693d4b
57 changed files with 638 additions and 249 deletions

View File

@ -1,5 +1,5 @@
package: pandorafms-agent-unix
Version: 7.0NG.736-190711
Version: 7.0NG.736-190712
Architecture: all
Priority: optional
Section: admin

View File

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

View File

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

View File

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

View File

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

View File

@ -10,7 +10,7 @@
# **********************************************************************
PI_VERSION="7.0NG.736"
PI_BUILD="190711"
PI_BUILD="190712"
OS_NAME=`uname -s`
FORCE=0

View File

@ -186,7 +186,7 @@ UpgradeApplicationID
{}
Version
{190711}
{190712}
ViewReadme
{Yes}

View File

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

View File

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

View File

@ -1,5 +1,5 @@
package: pandorafms-console
Version: 7.0NG.736-190711
Version: 7.0NG.736-190712
Architecture: all
Priority: optional
Section: admin

View File

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

View File

@ -122,7 +122,6 @@ if (is_ajax()) {
exit();
}
ui_require_css_file('register');
$initial = isset($config['initial_wizard']) !== true
@ -150,26 +149,27 @@ if ($initial && users_is_admin()) {
);
}
if ($registration && users_is_admin()) {
// Prepare registration wizard, not launch. leave control to flow.
registration_wiz_modal(
false,
// Launch only if not being launch from 'initial'.
!$initial,
(($show_newsletter === true) ? 'force_run_newsletter()' : null)
);
} else {
if ($show_newsletter) {
// Show newsletter wizard for current user.
newsletter_wiz_modal(
if (!$config['disabled_newsletter']) {
if ($registration && users_is_admin()) {
// Prepare registration wizard, not launch. leave control to flow.
registration_wiz_modal(
false,
// Launch only if not being call from 'registration'.
!$registration && !$initial
// Launch only if not being launch from 'initial'.
!$initial,
(($show_newsletter === true) ? 'force_run_newsletter()' : null)
);
} else {
if ($show_newsletter) {
// Show newsletter wizard for current user.
newsletter_wiz_modal(
false,
// Launch only if not being call from 'registration'.
!$registration && !$initial
);
}
}
}
$newsletter = null;
?>

View File

@ -534,8 +534,8 @@ echo '</div>';
$('#div-extra_1').hide();
$('#div-extra_2').hide();
} else if ($('#product :selected').val() == "AZURE") {
$('#div-username label').text('<?php echo __('Account ID'); ?>');
$('#div-password label').text('<?php echo __('Password'); ?>');
$('#div-username label').text('<?php echo __('Client ID'); ?>');
$('#div-password label').text('<?php echo __('Application secret'); ?>');
$('#div-extra_1 label').text('<?php echo __('Tenant or domain name'); ?>');
$('#div-extra_2 label').text('<?php echo __('Subscription id'); ?>');
$('#div-extra_1').show();

View File

@ -84,7 +84,9 @@ if ($create_profiles) {
);
}
html_print_table($table);
if ($table !== null) {
html_print_table($table);
}
unset($table);

View File

@ -92,7 +92,9 @@ if ($delete_profiles) {
);
}
html_print_table($table);
if ($table !== null) {
html_print_table($table);
}
unset($table);

View File

@ -24,9 +24,23 @@ $menu_godmode['class'] = 'godmode';
if (check_acl($config['id_user'], 0, 'PM')) {
$sub = [];
$sub['godmode/servers/discovery']['text'] = __('Discovery');
$sub['godmode/servers/discovery']['id'] = 'Discovery';
$sub['godmode/servers/discovery']['subsecs'] = ['godmode/servers/discovery'];
$sub['godmode/servers/discovery&wiz=main']['text'] = __('Discovery Main');
$sub['godmode/servers/discovery&wiz=main']['id'] = 'Discovery';
$sub['godmode/servers/discovery&wiz=tasklist']['text'] = __('Task list');
$sub['godmode/servers/discovery&wiz=tasklist']['id'] = 'tasklist';
$sub['godmode/servers/discovery&wiz=app']['text'] = __('Applications');
$sub['godmode/servers/discovery&wiz=app']['id'] = 'app';
$sub['godmode/servers/discovery&wiz=cloud']['text'] = __('Cloud');
$sub['godmode/servers/discovery&wiz=cloud']['id'] = 'cloud';
$sub['godmode/servers/discovery&wiz=ctask']['text'] = __('Console task');
$sub['godmode/servers/discovery&wiz=ctask']['id'] = 'ctask';
$sub['godmode/servers/discovery&wiz=hd']['text'] = __('Host & devices');
$sub['godmode/servers/discovery&wiz=hd']['id'] = 'hd';
// Add to menu.
$menu_godmode['discovery']['text'] = __('Discovery');

View File

@ -774,14 +774,14 @@ switch ($action) {
$table->head[1] = __('Description');
$table->head[2] = __('HTML');
$table->head[3] = __('XML');
$table->size[0] = '60%';
$table->size[0] = '50%';
$table->size[1] = '20%';
$table->size[2] = '2%';
$table->headstyle[2] = 'min-width: 35px;text-align: center;';
$table->headstyle[2] = 'min-width: 35px;text-align: left;';
$table->size[3] = '2%';
$table->headstyle[3] = 'min-width: 35px;text-align: center;';
$table->headstyle[3] = 'min-width: 35px;text-align: left;';
$table->size[4] = '2%';
$table->headstyle[4] = 'min-width: 35px;text-align: center;';
$table->headstyle[4] = 'min-width: 35px;text-align: left;';
$next = 4;
// Calculate dinamically the number of the column.
@ -790,15 +790,16 @@ switch ($action) {
}
$table->size[$next] = '2%';
$table->style[$next] = 'text-align: center;';
$table->style[$next] = 'text-align: left;';
$table->headstyle[($next + 2)] = 'min-width: 100px;';
$table->style[($next + 2)] = 'text-align: center;';
$table->headstyle[($next + 2)] = 'min-width: 130px; text-align:right;';
$table->style[($next + 2)] = 'text-align: right;';
// Admin options only for RM flag.
if (check_acl($config['id_user'], 0, 'RM')) {
$table->head[$next] = __('Private');
$table->headstyle[$next] = 'min-width: 40px;text-align: left;';
$table->size[$next] = '2%';
if (defined('METACONSOLE')) {
$table->align[$next] = '';
@ -808,7 +809,9 @@ switch ($action) {
$next++;
$table->head[$next] = __('Group');
$table->size[$next] = '15%';
$table->headstyle[$next] = 'min-width: 40px;text-align: left;';
$table->size[$next] = '2%';
$table->align[$next] = 'left';
$next++;
$op_column = false;
@ -826,7 +829,7 @@ switch ($action) {
// $table->size = array ();
$table->size[$next] = '10%';
$table->align[$next] = 'left';
$table->align[$next] = 'right';
}
$columnview = false;

View File

@ -1505,7 +1505,7 @@ $(document).ready (function () {
.prop('checked');
display_custom_report_front(custom_report,$(this).parent().parent().parent().parent().parent().attr('id'));
});
$(".databox.filters").css('margin-bottom','-10px');
$(".databox.filters").css('margin-bottom','0px');
});
// Change the favicon preview when is changed

View File

@ -137,6 +137,8 @@ if ($new_user && $config['admin_can_add_user']) {
$user_info['not_login'] = false;
$user_info['strict_acl'] = false;
$user_info['session_time'] = 0;
$user_info['middlename'] = 0;
if ($isFunctionSkins !== ENTERPRISE_NOT_HOOK) {
$user_info['id_skin'] = '';
}
@ -218,6 +220,7 @@ if ($create_user) {
}
$values['not_login'] = (bool) get_parameter('not_login', false);
$values['middlename'] = get_parameter('middlename', 0);
$values['strict_acl'] = (bool) get_parameter('strict_acl', false);
$values['session_time'] = (int) get_parameter('session_time', 0);
@ -317,12 +320,13 @@ if ($update_user) {
$values['timezone'] = (string) get_parameter('timezone');
$values['default_event_filter'] = (int) get_parameter('default_event_filter');
$values['default_custom_view'] = (int) get_parameter('default_custom_view');
// eHorus user level conf
// eHorus user level conf.
$values['ehorus_user_level_enabled'] = (bool) get_parameter('ehorus_user_level_enabled', false);
$values['ehorus_user_level_user'] = (string) get_parameter('ehorus_user_level_user');
$values['ehorus_user_level_pass'] = (string) get_parameter('ehorus_user_level_pass');
$values['middlename'] = get_parameter('middlename', 0);
$dashboard = get_parameter('dashboard', '');
$visual_console = get_parameter('visual_console', '');
@ -869,13 +873,27 @@ foreach ($event_filter_data as $filter) {
$table->data[16][0] = __('Default event filter');
$table->data[16][1] = html_print_select($event_filter, 'default_event_filter', $user_info['default_event_filter'], '', '', __('None'), true, false, false);
$table->data[17][0] = __('Disabled newsletter');
if ($user_info['middlename'] >= 0) {
$middlename = false;
} else {
$middlename = true;
}
$table->data[17][1] = html_print_checkbox(
'middlename',
-1,
$middlename,
true
);
if ($config['ehorus_user_level_conf']) {
$table->data[17][0] = __('eHorus user acces enabled');
$table->data[17][1] = html_print_checkbox('ehorus_user_level_enabled', 1, $user_info['ehorus_user_level_enabled'], true);
$table->data[18][0] = __('eHorus user');
$table->data[19][0] = __('eHorus password');
$table->data[18][1] = html_print_input_text('ehorus_user_level_user', $user_info['ehorus_user_level_user'], '', 15, 45, true);
$table->data[19][1] = html_print_input_password('ehorus_user_level_pass', io_output_password($user_info['ehorus_user_level_pass']), '', 15, 45, true);
$table->data[18][0] = __('eHorus user acces enabled');
$table->data[18][1] = html_print_checkbox('ehorus_user_level_enabled', 1, $user_info['ehorus_user_level_enabled'], true);
$table->data[19][0] = __('eHorus user');
$table->data[20][0] = __('eHorus password');
$table->data[19][1] = html_print_input_text('ehorus_user_level_user', $user_info['ehorus_user_level_user'], '', 15, 45, true);
$table->data[20][1] = html_print_input_password('ehorus_user_level_pass', io_output_password($user_info['ehorus_user_level_pass']), '', 15, 45, true);
}

View File

@ -501,41 +501,60 @@ class DiscoveryTaskList extends Wizard
$data[5] = __('Pending');
}
if ($task['id_recon_script'] == 0) {
// Internal discovery task.
switch ($task['type']) {
case DISCOVERY_CLOUD_AWS_RDS:
// Discovery Applications MySQL.
$data[6] = html_print_image(
'images/network.png',
true,
['title' => __('Discovery Cloud RDS')]
).'&nbsp;&nbsp;';
$data[6] .= __('Discovery.Cloud.Aws.RDS');
break;
switch ($task['type']) {
case DISCOVERY_CLOUD_AZURE_COMPUTE:
// Discovery Applications MySQL.
$data[6] = html_print_image(
'images/plugin.png',
true,
['title' => __('Discovery Cloud Azure Compute')]
).'&nbsp;&nbsp;';
$data[6] .= __('Cloud.Azure.Compute');
break;
case DISCOVERY_APP_MYSQL:
// Discovery Applications MySQL.
$data[6] = html_print_image(
'images/network.png',
true,
['title' => __('Discovery Applications MySQL')]
).'&nbsp;&nbsp;';
$data[6] .= __('Discovery.App.MySQL');
break;
case DISCOVERY_CLOUD_AWS_EC2:
// Discovery Applications MySQL.
$data[6] = html_print_image(
'images/plugin.png',
true,
['title' => __('Discovery Cloud AWS EC2')]
).'&nbsp;&nbsp;';
$data[6] .= __('Cloud.AWS.EC2');
break;
case DISCOVERY_APP_ORACLE:
// Discovery Applications Oracle.
$data[6] = html_print_image(
'images/network.png',
true,
['title' => __('Discovery Applications Oracle')]
).'&nbsp;&nbsp;';
$data[6] .= __('Discovery.App.Oracle');
break;
case DISCOVERY_CLOUD_AWS_RDS:
// Discovery Cloud RDS.
$data[6] = html_print_image(
'images/network.png',
true,
['title' => __('Discovery Cloud RDS')]
).'&nbsp;&nbsp;';
$data[6] .= __('Discovery.Cloud.Aws.RDS');
break;
case DISCOVERY_HOSTDEVICES:
default:
case DISCOVERY_APP_MYSQL:
// Discovery Applications MySQL.
$data[6] = html_print_image(
'images/network.png',
true,
['title' => __('Discovery Applications MySQL')]
).'&nbsp;&nbsp;';
$data[6] .= __('Discovery.App.MySQL');
break;
case DISCOVERY_APP_ORACLE:
// Discovery Applications Oracle.
$data[6] = html_print_image(
'images/network.png',
true,
['title' => __('Discovery Applications Oracle')]
).'&nbsp;&nbsp;';
$data[6] .= __('Discovery.App.Oracle');
break;
case DISCOVERY_HOSTDEVICES:
default:
if ($task['id_recon_script'] == 0) {
// Discovery NetScan.
$data[6] = html_print_image(
'images/network.png',
@ -550,15 +569,15 @@ class DiscoveryTaskList extends Wizard
} else {
$data[6] .= __('Discovery.NetScan');
}
break;
}
} else {
// APP recon task.
$data[6] = html_print_image(
'images/plugin.png',
true
).'&nbsp;&nbsp;';
$data[6] .= $recon_script_name;
} else {
// APP or external script recon task.
$data[6] = html_print_image(
'images/plugin.png',
true
).'&nbsp;&nbsp;';
$data[6] .= $recon_script_name;
}
break;
}
if ($task['status'] <= 0 || $task['status'] > 100) {
@ -699,7 +718,16 @@ class DiscoveryTaskList extends Wizard
if ($script !== false) {
switch ($script['type']) {
case DISCOVERY_SCRIPT_CLOUD_AWS:
return 'wiz=cloud&mode=amazonws&ki='.$task['auth_strings'].'&page=1';
switch ($task['type']) {
case DISCOVERY_CLOUD_AWS_EC2:
return 'wiz=cloud&mode=amazonws&ki='.$task['auth_strings'].'&page=1';
case DISCOVERY_CLOUD_AZURE_COMPUTE:
return 'wiz=cloud&mode=azure&ki='.$task['auth_strings'].'&sub=compute&page=0';
default:
return 'wiz=cloud';
}
case DISCOVERY_SCRIPT_APP_VMWARE:
return 'wiz=app&mode=vmware&page=0';

View File

@ -1139,6 +1139,7 @@ if ($get_extended_event) {
$dialog_page = get_parameter('dialog_page', 'general');
$filter = get_parameter('filter', []);
$similar_ids = get_parameter('similar_ids', $event_id);
$group_rep = $filter['group_rep'];
$event_rep = $event['event_rep'];
$timestamp_first = $event['min_timestamp'];
@ -1146,6 +1147,8 @@ if ($get_extended_event) {
$server_id = $event['server_id'];
$comments = $event['comments'];
$event['similar_ids'] = $similar_ids;
if (!isset($comments)) {
$comments = $event['user_comment'];
}

View File

@ -1976,7 +1976,7 @@ class ConsoleSupervisor
'id_user',
$config['id_user']
);
if (license_free() === true
if (!$config['disabled_newsletter']
&& $newsletter != 1
&& $login === false
) {

View File

@ -20,7 +20,7 @@
/**
* Pandora build version and version
*/
$build_version = 'PC190711';
$build_version = 'PC190712';
$pandora_version = 'v7.0NG.736';
// Do not overwrite default timezone set if defined.

View File

@ -582,6 +582,7 @@ define('DISCOVERY_APP_MYSQL', 4);
define('DISCOVERY_APP_ORACLE', 5);
define('DISCOVERY_CLOUD_AWS_EC2', 6);
define('DISCOVERY_CLOUD_AWS_RDS', 7);
define('DISCOVERY_CLOUD_AZURE_COMPUTE', 8);
// Discovery types matching definition.
@ -594,6 +595,7 @@ define('DISCOVERY_SCRIPT_IPAM_RECON', 3);
define('DISCOVERY_SCRIPT_IPMI_RECON', 4);
// Discovery task descriptions.
define('CLOUDWIZARD_AZURE_DESCRIPTION', 'Discovery.Cloud.Azure.Compute');
define('CLOUDWIZARD_AWS_DESCRIPTION', 'Discovery.Cloud.AWS.EC2');
define('CLOUDWIZARD_VMWARE_DESCRIPTION', 'Discovery.App.VMware');

View File

@ -395,6 +395,10 @@ function config_update_config()
$error_update[] = __('Enable Update Manager');
}
if (!config_update_value('disabled_newsletter', get_parameter('disabled_newsletter'))) {
$error_update[] = __('Disabled newsletter');
}
if (!config_update_value('ipam_ocuppied_critical_treshold', get_parameter('ipam_ocuppied_critical_treshold'))) {
$error_update[] = __('Ipam Ocuppied Manager Critical');
}
@ -1723,6 +1727,10 @@ function config_process_config()
config_update_value('enable_update_manager', 1);
}
if (!isset($config['disabled_newsletter'])) {
config_update_value('disabled_newsletter', 0);
}
if (!isset($config['ipam_ocuppied_critical_treshold'])) {
config_update_value('ipam_ocuppied_critical_treshold', 90);
}

View File

@ -72,6 +72,10 @@ function credentials_get_all(
throw new Exception('[credential_get_all] Fields must be an array or "count".');
}
if (isset($filter['product']) && !empty($filter['product'])) {
$sql_filters[] = sprintf(' AND cs.product = "%s"', $filter['product']);
}
if (isset($filter['free_search']) && !empty($filter['free_search'])) {
$sql_filters[] = vsprintf(
' AND (lower(cs.username) like lower("%%%s%%")
@ -163,7 +167,7 @@ function credentials_get_all(
%s
%s',
join(',', $fields),
join(',', $sql_filters),
join(' ', $sql_filters),
$order_by,
$pagination
);
@ -292,8 +296,8 @@ function print_inputs($values=null)
'script' => 'calculate_inputs()',
'fields' => [
// 'CUSTOM' => __('Custom'),
'AWS' => __('Aws'),
// 'AZURE' => __('Azure'),
'AWS' => __('Aws'),
'AZURE' => __('Azure'),
// 'GOOGLE' => __('Google'),
],
'selected' => $values['product'],
@ -319,7 +323,7 @@ function print_inputs($values=null)
case 'AZURE':
$user_label = __('Account ID');
$pass_label = __('Password');
$pass_label = __('Application secret');
$extra_1_label = __('Tenant or domain name');
$extra_2_label = __('Subscription id');
break;
@ -358,7 +362,7 @@ function print_inputs($values=null)
'label' => $extra_1_label,
'name' => 'extra_1',
'input_class' => 'flex-row',
'type' => 'password',
'type' => 'text',
'value' => $values['extra_1'],
'return' => true,
]
@ -371,7 +375,7 @@ function print_inputs($values=null)
'label' => $extra_2_label,
'name' => 'extra_2',
'input_class' => 'flex-row',
'type' => 'password',
'type' => 'text',
'value' => $values['extra_2'],
'return' => true,
'display' => $extra2,

View File

@ -4398,6 +4398,8 @@ function events_page_general($event)
$data[1] = $user_owner;
}
$table_general->cellclass[3][1] = 'general_owner';
$table_general->data[] = $data;
$data = [];
@ -4465,6 +4467,8 @@ function events_page_general($event)
$data[1] = '<i>'.__('N/A').'</i>';
}
$table_general->cellclass[7][1] = 'general_status';
$table_general->data[] = $data;
$data = [];

View File

@ -2235,7 +2235,6 @@ function combined_graph_summatory_average(
$data_array_pop[$key_reverse] = array_pop(
$data_array_reverse[$key_reverse]
);
$count_data_array_reverse--;
}
}
@ -2287,6 +2286,7 @@ function combined_graph_summatory_average(
}
$count++;
$count_data_array_reverse--;
}
if ($summatory && isset($array_sum_reverse)

View File

@ -52,6 +52,9 @@ function menu_print_menu(&$menu)
$sec2 = (string) get_parameter('sec2');
if ($sec2 == 'operation/agentes/ver_agente') {
$sec2 = 'godmode/agentes/configurar_agente';
} else if ($sec2 == 'godmode/servers/discovery') {
$wiz = (string) get_parameter('wiz');
$sec2 = 'godmode/servers/discovery&wiz='.$wiz;
} else {
$sec2 = (string) get_parameter('sec2');
}

View File

@ -96,7 +96,6 @@ function snmp_browser_get_html_tree(
foreach ($tree['__LEAVES__'] as $level => $sub_level) {
// Id used to expand leafs.
$sub_id = time().rand(0, getrandmax());
// Display the branch.
$output .= '<li id="li_'.$sub_id.'" style="margin: 0; padding: 0;">';
@ -174,7 +173,6 @@ function snmp_browser_get_html_tree(
$last_array,
$sufix,
$checked,
$return,
$descriptive_ids,
$previous_id
);
@ -225,7 +223,6 @@ function snmp_browser_print_tree(
$last_array,
$sufix,
$checked,
$return,
$descriptive_ids,
$previous_id
);

View File

@ -437,19 +437,18 @@ function event_change_status(event_ids) {
var meta = $("#hidden-meta").val();
var history = $("#hidden-history").val();
var params = [];
params.push("page=include/ajax/events");
params.push("change_status=1");
params.push("event_ids=" + event_ids);
params.push("new_status=" + new_status);
params.push("meta=" + meta);
params.push("history=" + history);
$("#button-status_button").attr("disabled", "disabled");
$("#response_loading").show();
jQuery.ajax({
data: params.join("&"),
data: {
page: "include/ajax/events",
change_status: 1,
event_ids: event_ids,
new_status: new_status,
meta: meta,
history: history
},
type: "POST",
url: $("#hidden-ajax_file").val(),
async: true,
@ -457,12 +456,21 @@ function event_change_status(event_ids) {
success: function(data) {
$("#button-status_button").removeAttr("disabled");
$("#response_loading").hide();
show_event_dialog(
event_id,
$("#hidden-group_rep").val(),
"responses",
data
);
if ($("#notification_status_success").length) {
$("#notification_status_success").hide();
}
if ($("#notification_status_error").length) {
$("#notification_status_error").hide();
}
if (data == "status_ok") {
dt_events.draw(false);
$("#notification_status_success").show();
} else {
$("#notification_status_error").show();
}
}
});
return false;
@ -475,19 +483,18 @@ function event_change_owner() {
var meta = $("#hidden-meta").val();
var history = $("#hidden-history").val();
var params = [];
params.push("page=include/ajax/events");
params.push("change_owner=1");
params.push("event_id=" + event_id);
params.push("new_owner=" + new_owner);
params.push("meta=" + meta);
params.push("history=" + history);
$("#button-owner_button").attr("disabled", "disabled");
$("#response_loading").show();
jQuery.ajax({
data: params.join("&"),
data: {
page: "include/ajax/events",
change_owner: 1,
event_id: event_id,
new_owner: new_owner,
meta: meta,
history: history
},
type: "POST",
url: $("#hidden-ajax_file").val(),
async: true,
@ -496,12 +503,29 @@ function event_change_owner() {
$("#button-owner_button").removeAttr("disabled");
$("#response_loading").hide();
show_event_dialog(
event_id,
$("#hidden-group_rep").val(),
"responses",
data
);
if ($("#notification_owner_success").length) {
$("#notification_owner_success").hide();
}
if ($("#notification_owner_error").length) {
$("#notification_owner_error").hide();
}
if (data == "owner_ok") {
dt_events.draw(false);
$("#notification_owner_success").show();
if (new_owner == -1) {
$("#extended_event_general_page table td.general_owner").html(
"<i>N/A</i>"
);
} else {
$("#extended_event_general_page table td.general_owner").text(
new_owner
);
}
} else {
$("#notification_owner_error").show();
}
}
});

View File

@ -94,7 +94,7 @@ function pandora_session_write($session_id, $data)
if (is_ajax()) {
// Avoid session upadte while processing ajax responses - notifications.
if (get_parameter('check_new_notifications', false)) {
return false;
return true;
}
}

View File

@ -271,6 +271,7 @@ ul.ui-tabs-nav.ui-corner-all.ui-helper-reset.ui-helper-clearfix.ui-widget-header
margin: 0;
margin-bottom: -1px;
border: none;
border-bottom: 1px solid #a9a9a9;
}
ul.ui-tabs-nav.ui-corner-all.ui-helper-reset.ui-helper-clearfix.ui-widget-header
@ -298,9 +299,6 @@ li.ui-tabs-tab.ui-corner-top.ui-state-default.ui-tab {
li.ui-tabs-tab.ui-corner-top.ui-state-default.ui-tab.ui-tabs-active.ui-state-active {
border-bottom: 1px solid #fff;
}
div.extended_event_pages.ui-tabs-panel.ui-corner-bottom.ui-widget-content {
border-top: 1px solid #a9a9a9;
}
tr.group {
padding: 5px;

View File

@ -235,11 +235,12 @@ pre {
font-family: courier, serif;
}
fieldset {
background-color: #f9faf9;
background-color: #fff;
border: 1px solid #e2e2e2;
padding: 0.5em;
margin-bottom: 20px;
position: relative;
border-radius: 5px;
}
fieldset legend {
font-size: 1.1em;
@ -5791,7 +5792,6 @@ div#status_pie {
grid-template-columns: 50px auto;
}
/*
* ---------------------------------------------------------------------
* - IMAGES FOR STATUS. This replaces the images of /images/status_sets/default/
@ -5834,7 +5834,6 @@ div#status_pie {
* ---------------------------------------------------------------------
*/
/* Table for show more info in events and config menu in modules graphs. (This class exists in events.css too) */
.table_modal_alternate {
border-spacing: 0;

View File

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

View File

@ -383,14 +383,14 @@ if ($not_found) {
html_print_table($table);
echo "<div style='width: ".$table->width."; text-align: right;'>";
echo "<div style='width: ".$table->width."; text-align: right; margin-top:20px;'>";
if ($new_networkmap) {
html_print_input_hidden('save_networkmap', 1);
html_print_submit_button(
__('Save networkmap'),
'crt',
false,
'class="sub"'
'class="sub next"'
);
}
@ -401,7 +401,7 @@ if ($not_found) {
__('Update networkmap'),
'crt',
false,
'class="sub"'
'class="sub upd"'
);
}

View File

@ -70,7 +70,7 @@ if (is_ajax()) {
if ($id_agente > 0) {
$last_contact = db_get_value_sql(
sprintf(
'SELECT intervalo - (UNIX_TIMESTAMP() - UNIX_TIMESTAMP(IF(ultimo_contacto > ultimo_contacto_remoto, ultimo_contacto, ultimo_contacto_remoto)))
'SELECT format(intervalo,2) - (UNIX_TIMESTAMP() - UNIX_TIMESTAMP(IF(ultimo_contacto > ultimo_contacto_remoto, ultimo_contacto, ultimo_contacto_remoto))) as "val"
FROM `tagente`
WHERE id_agente = %d ',
$id_agente

View File

@ -26,6 +26,7 @@ if ($searchGraphs) {
$usergraphs_id = array_keys($usergraphs);
if (empty($usergraphs_id)) {
$totalGraphs = 0;
return;
}
@ -37,6 +38,7 @@ if ($searchGraphs) {
'id_graph',
'name',
'description',
];
$totalGraphs = (int) db_get_value_filter('COUNT(id_graph) AS count', 'tgraph', $filter);
@ -45,5 +47,7 @@ if ($searchGraphs) {
$filter['limit'] = $config['block_size'];
$filter['offset'] = (int) get_parameter('offset');
$graphs = db_get_all_rows_filter('tgraph', $filter, $columns);
} else {
$totalGraphs = 0;
}
}

View File

@ -20,6 +20,7 @@ $searchGraphs = check_acl($config['id_user'], 0, 'RR');
$searchMaps = check_acl($config['id_user'], 0, 'RR');
$searchReports = check_acl($config['id_user'], 0, 'RR');
$searchUsers = check_acl($config['id_user'], 0, 'UM');
$searchPolicies = check_acl($config['id_user'], 0, 'AW');
$searchHelps = true;
echo '<br><div style="margin:auto; width:90%; padding: 10px;">';
@ -44,8 +45,12 @@ $table->style[9] = 'font-weight: bold; text-align: center;';
$table->style[10] = 'font-weight: bold; text-align: center;';
$table->style[11] = 'font-weight: bold; text-align: center;';
$table->style[13] = 'font-weight: bold; text-align: center;';
$table->style[14] = 'font-weight: bold; text-align: center;';
$table->style[15] = 'font-weight: bold; text-align: center;';
$table->data[0][0] = html_print_image('images/agent.png', true, ['title' => __('Agents found')]);
$table->data[0][1] = "<a href='index.php?search_category=agents&keywords=".$config['search_keywords']."&head_search_keywords=Search'>".sprintf(__('%s Found'), $totalAgents).'</a>';
$table->data[0][2] = html_print_image('images/module.png', true, ['title' => __('Modules found')]);
@ -64,8 +69,10 @@ $table->data[0][10] = html_print_image('images/reporting.png', true, ['title' =>
$table->data[0][11] = "<a href='index.php?search_category=reports&keywords=".$config['search_keywords']."&head_search_keywords=Search'>".sprintf(__('%s Found'), $totalReports).'</a>';
$table->data[0][12] = html_print_image('images/visual_console_green.png', true, ['title' => __('Maps found')]);
$table->data[0][13] = "<a href='index.php?search_category=maps&keywords=".$config['search_keywords']."&head_search_keywords=Search'>".sprintf(__('%s Found'), $totalMaps).'</a>';
$table->data[0][14] = html_print_image('images/help.png', true, ['title' => __('Helps found')]);
$table->data[0][15] = "<a href='index.php?search_category=helps&keywords=".$config['search_keywords']."&head_search_keywords=Search'>".sprintf(__('%s Found'), $totalHelps).'</a>';
if (enterprise_installed()) {
$table->data[0][14] = html_print_image('images/policies.png', true, ['title' => __('Policies')]);
$table->data[0][15] = "<a href='index.php?search_category=policies&keywords=".$config['search_keywords']."&head_search_keywords=Search'>".sprintf(__('%s Found'), $totalPolicies).'</a>';
}
html_print_table($table);
@ -79,4 +86,5 @@ if ($searchAgents && $totalAgents > 0) {
).'</a>';
}
echo '</div>';

View File

@ -0,0 +1,200 @@
<?php
// Pandora FMS - http://pandorafms.com
// ==================================================
// Copyright (c) 2005-2011 Artica Soluciones Tecnologicas
// Please see http://pandorafms.org for full contribution list
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; version 2
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
global $config;
enterprise_include_once('include/functions_policies.php');
$searchpolicies = check_acl($config['id'], 0, 'AW');
$selectpolicieIDUp = '';
$selectpolicieIDDown = '';
$selectNameUp = '';
$selectNameDown = '';
$selectDescriptionUp = '';
$selectDescriptionDown = '';
$selectId_groupUp = '';
$selectId_groupDown = '';
$selectStatusUp = '';
$selectStatusDown = '';
switch ($sortField) {
case 'id':
switch ($sort) {
case 'up':
$selectpolicieIDUp = $selected;
$order = [
'field' => 'id',
'order' => 'ASC',
];
break;
case 'down':
$selectpolicieIDDown = $selected;
$order = [
'field' => 'id',
'order' => 'DESC',
];
break;
}
break;
case 'name':
switch ($sort) {
case 'up':
$selectNameUp = $selected;
$order = [
'field' => 'name',
'order' => 'ASC',
];
break;
case 'down':
$selectNameDown = $selected;
$order = [
'field' => 'name',
'order' => 'DESC',
];
break;
}
break;
case 'description':
switch ($sort) {
case 'up':
$selectId_groupUp = $selected;
$order = [
'field' => 'description',
'order' => 'ASC',
];
break;
case 'down':
$selectDescriptionDown = $selected;
$order = [
'field' => 'description',
'order' => 'DESC',
];
break;
}
break;
case 'last_contact':
switch ($sort) {
case 'up':
$selectId_groupUp = $selected;
$order = [
'field' => 'last_connect',
'order' => 'ASC',
];
break;
case 'down':
$selectId_groupDown = $selected;
$order = [
'field' => 'last_connect',
'order' => 'DESC',
];
break;
}
break;
case 'id_group':
switch ($sort) {
case 'up':
$selectId_groupUp = $selected;
$order = [
'field' => 'last_connect',
'order' => 'ASC',
];
break;
case 'down':
$selectId_groupDown = $selected;
$order = [
'field' => 'last_connect',
'order' => 'DESC',
];
break;
}
break;
case 'status':
switch ($sort) {
case 'up':
$selectStatusUp = $selected;
$order = [
'field' => 'is_admin',
'order' => 'ASC',
];
break;
case 'down':
$selectStatusDown = $selected;
$order = [
'field' => 'is_admin',
'order' => 'DESC',
];
break;
}
break;
default:
$selectpolicieIDUp = $selected;
$selectpolicieIDDown = '';
$selectNameUp = '';
$selectNameDown = '';
$selectDescriptionUp = '';
$selectDescriptionDown = '';
$selectId_groupUp = '';
$selectId_groupDown = '';
$selectStatusUp = '';
$selectStatusDown = '';
$order = [
'field' => 'id',
'order' => 'ASC',
];
break;
}
if ($searchpolicies == 0) {
/*
We take the user groups to get policies that meet the requirements of the search
and which the user have permission on this groups
*/
$user_groups = users_get_groups($config['id_user'], 'AR', false);
$id_user_groups = array_keys($user_groups);
$id_user_groups_str = implode(',', $id_user_groups);
$sql = "SELECT id, name, description, id_group, status
FROM tpolicies
WHERE name LIKE '$stringSearchSQL'
AND id_group IN ($id_user_groups_str)";
}
$sql .= ' LIMIT '.$config['block_size'].' OFFSET '.get_parameter('offset', 0);
$policies = db_process_sql($sql);
if ($policies !== false) {
$totalPolicies = count($policies);
if ($only_count) {
unset($policies);
}
} else {
$totalPolicies = 0;
}

View File

@ -0,0 +1,90 @@
<?php
// Pandora FMS - http://pandorafms.com
// ==================================================
// Copyright (c) 2005-2011 Artica Soluciones Tecnologicas
// Please see http://pandorafms.org for full contribution list
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; version 2
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
global $config;
enterprise_include_once('include/functions_policies.php');
require_once $config['homedir'].'/enterprise/include/functions_groups.php';
$searchpolicies = check_acl($config['id_user'], 0, 'AW');
if (!$policies || !$searchpolicies) {
echo "<br><div class='nf'>".__('Zero results found')."</div>\n";
} else {
$table->cellpadding = 4;
$table->cellspacing = 4;
$table->width = '98%';
$table->class = 'databox';
$table->align = [];
$table->align[4] = 'center';
$table->head = [];
// $table->head[0] = __('ID').' '.'<a href="index.php?search_category=policies&keywords='.$config['search_keywords'].'&head_search_keywords=abc&offset='.$offset.'&sort_field=id_policie&sort=up">'.html_print_image('images/sort_up.png', true, ['style' => $selectpolicieIDUp]).'</a>'.'<a href="index.php?search_category=policies&keywords='.$config['search_keywords'].'&head_search_keywords=abc&offset='.$offset.'&sort_field=id_policie&sort=down">'.html_print_image('images/sort_down.png', true, ['style' => $selectpolicieIDDown]).'</a>';
$table->head[0] = __('Name').' '.'<a href="index.php?search_category=policies&keywords='.$config['search_keywords'].'&head_search_keywords=abc&offset='.$offset.'&sort_field=name&sort=up">'.html_print_image('images/sort_up.png', true, ['style' => $selectNameUp]).'</a>'.'<a href="index.php?search_category=policies&keywords='.$config['search_keywords'].'&head_search_keywords=abc&offset='.$offset.'&sort_field=name&sort=down">'.html_print_image('images/sort_down.png', true, ['style' => $selectNameDown]).'</a>';
$table->head[1] = __('Description').' '.'<a href="index.php?search_category=policies&keywords='.$config['search_keywords'].'&head_search_keywords=abc&offset='.$offset.'&sort_field=description&sort=up">'.html_print_image('images/sort_up.png', true, ['style' => $selectDescriptionUp]).'</a>'.'<a href="index.php?search_category=policies&keywords='.$config['search_keywords'].'&head_search_keywords=abc&offset='.$offset.'&sort_field=description&sort=down">'.html_print_image('images/sort_down.png', true, ['style' => $selectDescriptionDown]).'</a>';
$table->head[2] = __('Id_group').' '.'<a href="index.php?search_category=policies&keywords='.$config['search_keywords'].'&head_search_keywords=abc&offset='.$offset.'&sort_field=last_contact&sort=up">'.html_print_image('images/sort_up.png', true, ['style' => $selectId_groupUp]).'</a>'.'<a href="index.php?search_category=policies&keywords='.$config['search_keywords'].'&head_search_keywords=abc&offset='.$offset.'&sort_field=last_contact&sort=down">'.html_print_image('images/sort_down.png', true, ['style' => $selectId_groupDown]).'</a>';
$table->head[3] = __('Status').' '.'<a href="index.php?search_category=policies&keywords='.$config['search_keywords'].'&head_search_keywords=abc&offset='.$offset.'&sort_field=status&sort=up">'.html_print_image('images/sort_up.png', true, ['style' => $selectStatusUp]).'</a>'.'<a href="index.php?search_category=policies&keywords='.$config['search_keywords'].'&head_search_keywords=abc&offset='.$offset.'&sort_field=status&sort=down">'.html_print_image('images/sort_down.png', true, ['style' => $selectstatusDown]).'</a>';
$table->data = [];
foreach ($policies as $policie) {
$policieIDCell = "<a href='?sec=gmodules&sec2=enterprise/godmode/policies/policies&id=".$policies['id']."'>".$policies['id'].'</a>';
switch ($policie['status']) {
case POLICY_UPDATED:
$status = html_print_image(
'images/policies_ok.png',
true,
['title' => __('Policy updated')]
);
break;
case POLICY_PENDING_DATABASE:
$status = html_print_image(
'images/policies_error_db.png',
true,
['title' => __('Pending update policy only database')]
);
break;
case POLICY_PENDING_ALL:
$status = html_print_image(
'images/policies_error.png',
true,
['title' => __('Pending update policy')]
);
break;
}
$url = $config['homeurl'].'/index.php?'.'sec=gmodules&'.'sec2=enterprise/godmode/policies/policies&id='.$policie['id'].'';
array_push(
$table->data,
[
// $policie['id'],
'<a href= '.$url.'>'.$policie['name'].'',
$policie['description'],
ui_print_group_icon($policie['id_group'], true),
$status,
]
);
}
$totalPolicies = count($policies);
echo '<br />';
html_print_table($table);
unset($table);
ui_pagination($totalPolicies);
}

View File

@ -18,7 +18,7 @@ require_once $config['homedir'].'/include/functions_reporting.php';
enterprise_include('operation/reporting/custom_reporting.php');
$searchAgents = $searchAlerts = $searchModules = check_acl($config['id_user'], 0, 'AR');
$searchUsers = check_acl($config['id_user'], 0, 'UM');
$searchUsers = $searchPolicies = check_acl($config['id_user'], 0, 'AW');
$searchMaps = $searchReports = $searchGraphs = check_acl($config['id_user'], 0, 'IR');
$searchMain = true;
$searchHelps = true;
@ -43,6 +43,7 @@ if ($config['search_category'] == 'all') {
// INI SECURITY ACL
if ((!$searchAgents && !$searchUsers && !$searchMaps)
|| (!$searchUsers && $searchTab == 'users')
|| (!$searchPolicies && $searchTab == 'policies')
|| (!$searchAgents && ($searchTab == 'agents' || $searchTab == 'alerts'))
|| (!$searchGraphs && ($searchTab == 'graphs' || $searchTab == 'maps' || $searchTab == 'reports'))
) {
@ -161,29 +162,29 @@ if ($searchModules) {
$modules_tab = '';
}
if ($searchHelps) {
$helps_tab = [
'text' => "<a href='index.php?search_category=helps&keywords=".$config['search_keywords']."&head_search_keywords=Search'>".html_print_image(
'images/help_w.png',
if ($searchPolicies) {
$policies_tab = [
'text' => "<a href='index.php?search_category=policies&keywords=".$config['search_keywords']."&head_search_keywords=Search'>".html_print_image(
'images/policies.png',
true,
['title' => __('Helps')]
['title' => __('Policies')]
).'</a>',
'active' => $searchTab == 'helps',
'active' => $searchTab == 'policies',
];
} else {
$helps_tab = '';
$policies_tab = '';
}
$onheader = [
'main' => $main_tab,
'agents' => $agents_tab,
'modules' => $modules_tab,
'alerts' => $alerts_tab,
'users' => $users_tab,
'graphs' => $graphs_tab,
'reports' => $reports_tab,
'maps' => $maps_tab,
'helps' => $helps_tab,
'main' => $main_tab,
'agents' => $agents_tab,
'modules' => $modules_tab,
'alerts' => $alerts_tab,
'users' => $users_tab,
'graphs' => $graphs_tab,
'reports' => $reports_tab,
'maps' => $maps_tab,
'policies' => $policies_tab,
];
ui_print_page_header(
@ -212,6 +213,7 @@ switch ($searchTab) {
include_once 'search_maps.getdata.php';
include_once 'search_modules.getdata.php';
include_once 'search_helps.getdata.php';
include_once 'search_policies.getdata.php';
include_once 'search_main.php';
break;
@ -251,8 +253,9 @@ switch ($searchTab) {
include_once 'search_modules.php';
break;
case 'helps':
include_once 'search_helps.getdata.php';
include_once 'search_helps.php';
case 'policies':
include_once 'search_policies.getdata.php';
include_once 'search_policies.php';
break;
}

View File

@ -426,24 +426,25 @@ if (check_acl($config['id_user'], 0, 'ER')) {
).'</div>';
}
if (!$config['disabled_newsletter']) {
$newsletter = '<div class="label_select_simple"><p class="edit_user_labels">'.__('Newsletter Subscribed').': </p>';
if ($user_info['middlename'] > 0) {
$newsletter .= '<span>'.__('Already subscribed to %s newsletter', get_product_name()).'</span>';
} else {
$newsletter .= '<span><a href="javascript: force_run_newsletter();">'.__('Subscribe to our newsletter').'</a></span></div>';
$newsletter_reminder = '<div class="label_select_simple"><p class="edit_user_labels">'.__('Newsletter Reminder').': </p>';
$newsletter_reminder .= html_print_switch(
[
'name' => 'newsletter_reminder',
'value' => $newsletter_reminder_value,
'disabled' => false,
]
);
}
$newsletter = '<div class="label_select_simple"><p class="edit_user_labels">'.__('Newsletter Subscribed').': </p>';
if ($user_info['middlename'] > 0) {
$newsletter .= '<span>'.__('Already subscribed to %s newsletter', get_product_name()).'</span>';
} else {
$newsletter .= '<span><a href="javascript: force_run_newsletter();">'.__('Subscribe to our newsletter').'</a></span></div>';
$newsletter_reminder = '<div class="label_select_simple"><p class="edit_user_labels">'.__('Newsletter Reminder').': </p>';
$newsletter_reminder .= html_print_switch(
[
'name' => 'newsletter_reminder',
'value' => $newsletter_reminder_value,
'disabled' => false,
]
);
$newsletter_reminder .= '</div>';
}
$newsletter_reminder .= '</div>';
$autorefresh_list_out = [];

View File

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

View File

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

View File

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

View File

@ -1,5 +1,5 @@
package: pandorafms-server
Version: 7.0NG.736-190711
Version: 7.0NG.736-190712
Architecture: all
Priority: optional
Section: admin

View File

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

View File

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

View File

@ -56,15 +56,7 @@ my $TaskSem :shared;
use constant {
OS_OTHER => 10,
OS_ROUTER => 17,
OS_SWITCH => 18,
DISCOVERY_HOSTDEVICES => 0,
DISCOVERY_HOSTDEVICES_CUSTOM => 1,
DISCOVERY_CLOUD_AWS => 2,
DISCOVERY_APP_VMWARE => 3,
DISCOVERY_APP_MYSQL => 4,
DISCOVERY_APP_ORACLE => 5,
DISCOVERY_CLOUD_AWS_EC2 => 6,
DISCOVERY_CLOUD_AWS_RDS => 7
OS_SWITCH => 18
};
########################################################################################
@ -196,49 +188,11 @@ sub data_consumer ($$) {
my $main_event = pandora_event($pa_config, "[Discovery] Execution summary",$task->{'id_group'}, 0, 0, 0, 0, 'system', 0, $dbh);
my %cnf_extra;
if ($task->{'type'} == DISCOVERY_CLOUD_AWS_EC2
|| $task->{'type'} == DISCOVERY_CLOUD_AWS_RDS) {
# auth_strings stores the crential identifier to be used.
my $key = pandora_get_credential($dbh, $task->{'auth_strings'});
if (ref($key) eq "HASH") {
$cnf_extra{'aws_access_key_id'} = $key->{'username'};
$cnf_extra{'aws_secret_access_key'} = $key->{'password'};
} else {
# Invalid credential.
return;
}
$cnf_extra{'cloud_util_path'} = pandora_get_config_value($dbh, 'cloud_util_path');
# Pass credentials by file due Perl limitations. We cannot update ENV here.
$cnf_extra{'creds_file'} = $pa_config->{'temporal'} . '/tmp_discovery.' . md5($task->{'id_rt'} . $task->{'name'} . time());
eval {
open(my $__file_cfg, '> '. $cnf_extra{'creds_file'}) or die($!);
print $__file_cfg $cnf_extra{'aws_access_key_id'} . "\n";
print $__file_cfg $cnf_extra{'aws_secret_access_key'} . "\n";
close($__file_cfg);
set_file_permissions(
$pa_config,
$cnf_extra{'creds_file'},
"0600"
);
};
if ($@) {
logger(
$pa_config,
'Cannot instantiate configuration file for task: ' . safe_output($task->{'name'}),
5
);
# A server restart will override ENV definition (see run)
logger(
$pa_config,
'Cannot execute Discovery task: ' . safe_output($task->{'name'}) . '. Please restart the server.',
1
);
# Skip this task.
return;
}
my $r = enterprise_hook('discovery_generate_extra_cnf',[$pa_config, $dbh, $task, \%cnf_extra]);
if (defined($r) && $r eq 'ERR') {
# Could not generate extra cnf, skip this task.
return;
}
my $recon = new PandoraFMS::Recon::Base(

View File

@ -32,7 +32,7 @@ our @ISA = qw(Exporter);
# version: Defines actual version of Pandora Server for this module only
my $pandora_version = "7.0NG.736";
my $pandora_build = "190711";
my $pandora_build = "190712";
our $VERSION = $pandora_version." ".$pandora_build;
our %EXPORT_TAGS = ( 'all' => [ qw() ] );

View File

@ -72,6 +72,15 @@ our @EXPORT = qw(
MIGRATIONSERVER
METACONSOLE_LICENSE
OFFLINE_LICENSE
DISCOVERY_HOSTDEVICES
DISCOVERY_HOSTDEVICES_CUSTOM
DISCOVERY_CLOUD_AWS
DISCOVERY_APP_VMWARE
DISCOVERY_APP_MYSQL
DISCOVERY_APP_ORACLE
DISCOVERY_CLOUD_AWS_EC2
DISCOVERY_CLOUD_AWS_RDS
DISCOVERY_CLOUD_AZURE_COMPUTE
$DEVNULL
$OS
$OS_VERSION
@ -172,6 +181,17 @@ use constant OFFLINE_LICENSE => 0x02;
use constant RECOVERED_ALERT => 0;
use constant FIRED_ALERT => 1;
# Discovery task types
use constant DISCOVERY_HOSTDEVICES => 0;
use constant DISCOVERY_HOSTDEVICES_CUSTOM => 1;
use constant DISCOVERY_CLOUD_AWS => 2;
use constant DISCOVERY_APP_VMWARE => 3;
use constant DISCOVERY_APP_MYSQL => 4;
use constant DISCOVERY_APP_ORACLE => 5;
use constant DISCOVERY_CLOUD_AWS_EC2 => 6;
use constant DISCOVERY_CLOUD_AWS_RDS => 7;
use constant DISCOVERY_CLOUD_AZURE_COMPUTE => 8;
# Set OS, OS version and /dev/null
our $OS = $^O;
our $OS_VERSION = "unknown";

View File

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

View File

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

View File

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

View File

@ -34,7 +34,7 @@ use PandoraFMS::Config;
use PandoraFMS::DB;
# version: define current version
my $version = "7.0NG.736 PS190711";
my $version = "7.0NG.736 PS190712";
# Pandora server configuration
my %conf;

View File

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