Merge remote-tracking branch 'origin/develop' into ent-7074-Command-Center
This commit is contained in:
commit
535fd9b235
|
@ -1,5 +1,5 @@
|
|||
package: pandorafms-agent-unix
|
||||
Version: 7.0NG.752-210304
|
||||
Version: 7.0NG.752-210305
|
||||
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.752-210304"
|
||||
pandora_version="7.0NG.752-210305"
|
||||
|
||||
echo "Test if you has the tools for to make the packages."
|
||||
whereis dpkg-deb | cut -d":" -f2 | grep dpkg-deb > /dev/null
|
||||
|
|
|
@ -1016,7 +1016,7 @@ my $Sem = undef;
|
|||
my $ThreadSem = undef;
|
||||
|
||||
use constant AGENT_VERSION => '7.0NG.752';
|
||||
use constant AGENT_BUILD => '210304';
|
||||
use constant AGENT_BUILD => '210305';
|
||||
|
||||
# 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.752
|
||||
%define release 210304
|
||||
%define release 210305
|
||||
|
||||
Summary: Pandora FMS Linux agent, PERL version
|
||||
Name: %{name}
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
#
|
||||
%define name pandorafms_agent_unix
|
||||
%define version 7.0NG.752
|
||||
%define release 210304
|
||||
%define release 210305
|
||||
|
||||
Summary: Pandora FMS Linux agent, PERL version
|
||||
Name: %{name}
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
# **********************************************************************
|
||||
|
||||
PI_VERSION="7.0NG.752"
|
||||
PI_BUILD="210304"
|
||||
PI_BUILD="210305"
|
||||
OS_NAME=`uname -s`
|
||||
|
||||
FORCE=0
|
||||
|
|
|
@ -186,7 +186,7 @@ UpgradeApplicationID
|
|||
{}
|
||||
|
||||
Version
|
||||
{210304}
|
||||
{210305}
|
||||
|
||||
ViewReadme
|
||||
{Yes}
|
||||
|
|
|
@ -30,7 +30,7 @@ using namespace Pandora;
|
|||
using namespace Pandora_Strutils;
|
||||
|
||||
#define PATH_SIZE _MAX_PATH+1
|
||||
#define PANDORA_VERSION ("7.0NG.752(Build 210304)")
|
||||
#define PANDORA_VERSION ("7.0NG.752(Build 210305)")
|
||||
|
||||
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.752(Build 210304))"
|
||||
VALUE "ProductVersion", "(7.0NG.752(Build 210305))"
|
||||
VALUE "FileVersion", "1.0.0.0"
|
||||
END
|
||||
END
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
package: pandorafms-console
|
||||
Version: 7.0NG.752-210304
|
||||
Version: 7.0NG.752-210305
|
||||
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.752-210304"
|
||||
pandora_version="7.0NG.752-210305"
|
||||
|
||||
package_pear=0
|
||||
package_pandora=1
|
||||
|
|
|
@ -98,13 +98,45 @@ function users_extension_main_god($god=true)
|
|||
$table->head = [];
|
||||
|
||||
$table->head[0] = __('User');
|
||||
$table->head[1] = __('Date');
|
||||
$table->head[1] = __('IP');
|
||||
$table->head[2] = __('Last login');
|
||||
$table->head[3] = __('Last contact');
|
||||
|
||||
$rowPair = true;
|
||||
$iterator = 0;
|
||||
|
||||
// Get data
|
||||
foreach ($rows as $row) {
|
||||
// Get data of user's last login.
|
||||
switch ($config['dbtype']) {
|
||||
case 'mysql':
|
||||
case 'postgresql':
|
||||
$last_login_data = db_get_row_sql(
|
||||
sprintf(
|
||||
"SELECT ip_origen, utimestamp
|
||||
FROM tsesion
|
||||
WHERE id_usuario = '%s'
|
||||
AND descripcion = '".io_safe_input('Logged in')."'
|
||||
ORDER BY fecha DESC",
|
||||
$row['id_user']
|
||||
)
|
||||
);
|
||||
break;
|
||||
|
||||
case 'oracle':
|
||||
$last_login_data = db_get_row_sql(
|
||||
sprintf(
|
||||
"SELECT ip_origen, utimestamp
|
||||
FROM tsesion
|
||||
WHERE id_usuario = '%s'
|
||||
AND to_char(descripcion) = '".io_safe_input('Logged in')."'
|
||||
ORDER BY fecha DESC",
|
||||
$row['id_user']
|
||||
)
|
||||
);
|
||||
break;
|
||||
}
|
||||
|
||||
if ($rowPair) {
|
||||
$table->rowclass[$iterator] = 'rowPair';
|
||||
} else {
|
||||
|
@ -116,7 +148,9 @@ function users_extension_main_god($god=true)
|
|||
|
||||
$data = [];
|
||||
$data[0] = '<a href="index.php?sec=gusuarios&sec2=godmode/users/configure_user&id='.$row['id_user'].'">'.$row['id_user'].'</a>';
|
||||
$data[1] = date($config['date_format'], $row['last_connect']);
|
||||
$data[1] = $last_login_data['ip_origin'];
|
||||
$data[2] = date($config['date_format'], $last_login_data['utimestamp']);
|
||||
$data[3] = date($config['date_format'], $row['last_connect']);
|
||||
array_push($table->data, $data);
|
||||
}
|
||||
|
||||
|
@ -125,7 +159,6 @@ function users_extension_main_god($god=true)
|
|||
}
|
||||
|
||||
|
||||
extensions_add_godmode_menu_option(__('Users connected'), 'UM', 'gusuarios', 'users/icon.png', 'v1r1');
|
||||
extensions_add_operation_menu_option(__('Users connected'), 'workspace', 'users/icon.png', 'v1r1', '', 'UM');
|
||||
|
||||
extensions_add_godmode_function('users_extension_main_god');
|
||||
|
|
|
@ -79,6 +79,13 @@ if (check_acl($config['id_user'], 0, 'PM')) {
|
|||
|
||||
$table->data = [];
|
||||
$names_servers = [];
|
||||
$master = 1;
|
||||
// The server with the highest number in master, will be the real master.
|
||||
foreach ($servers as $server) {
|
||||
if ($server['master'] > $master) {
|
||||
$master = $server['master'];
|
||||
}
|
||||
}
|
||||
|
||||
foreach ($servers as $server) {
|
||||
$data = [];
|
||||
|
@ -109,7 +116,7 @@ foreach ($servers as $server) {
|
|||
|
||||
// Type
|
||||
$data[2] = '<span style="white-space:nowrap;">'.$server['img'];
|
||||
if ($server['master'] == 1) {
|
||||
if ($server['master'] == $master) {
|
||||
$data[2] .= ui_print_help_tip(__('This is a master server'), true);
|
||||
}
|
||||
|
||||
|
|
|
@ -138,6 +138,16 @@ class DiscoveryTaskList extends HTML
|
|||
return $this->deleteTask();
|
||||
}
|
||||
|
||||
$disable = (bool) get_parameter('disabled', false);
|
||||
if ($disable === true) {
|
||||
return $this->disableTask();
|
||||
}
|
||||
|
||||
$enable = (bool) get_parameter('enabled', false);
|
||||
if ($enable === true) {
|
||||
return $this->enableTask();
|
||||
}
|
||||
|
||||
if (enterprise_installed()) {
|
||||
// This check only applies to enterprise users.
|
||||
enterprise_hook('tasklist_checkrunning');
|
||||
|
@ -351,6 +361,93 @@ class DiscoveryTaskList extends HTML
|
|||
}
|
||||
|
||||
|
||||
/**
|
||||
* Disable a recon task.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function disableTask()
|
||||
{
|
||||
global $config;
|
||||
|
||||
if (! check_acl($config['id_user'], 0, 'AW')) {
|
||||
db_pandora_audit(
|
||||
'ACL Violation',
|
||||
'Trying to access recon task viewer'
|
||||
);
|
||||
include 'general/noaccess.php';
|
||||
return;
|
||||
}
|
||||
|
||||
$task = get_parameter('task', null);
|
||||
|
||||
if ($task !== null) {
|
||||
$result = db_process_sql_update(
|
||||
'trecon_task',
|
||||
['disabled' => 1],
|
||||
['id_rt' => $task]
|
||||
);
|
||||
|
||||
if ($result == 1) {
|
||||
return [
|
||||
'result' => 0,
|
||||
'msg' => __('Task successfully disabled'),
|
||||
'id' => false,
|
||||
];
|
||||
}
|
||||
|
||||
// Trick to avoid double execution.
|
||||
header('Location: '.$this->url);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Enable a recon task.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function enableTask()
|
||||
{
|
||||
global $config;
|
||||
|
||||
if (! check_acl($config['id_user'], 0, 'AW')) {
|
||||
db_pandora_audit(
|
||||
'ACL Violation',
|
||||
'Trying to access recon task viewer'
|
||||
);
|
||||
include 'general/noaccess.php';
|
||||
return;
|
||||
}
|
||||
|
||||
$task = get_parameter('task', null);
|
||||
|
||||
if ($task !== null) {
|
||||
$result = db_process_sql_update(
|
||||
'trecon_task',
|
||||
[
|
||||
'disabled' => 0,
|
||||
'status' => 0,
|
||||
],
|
||||
['id_rt' => $task]
|
||||
);
|
||||
|
||||
if ($result == 1) {
|
||||
return [
|
||||
'result' => 0,
|
||||
'msg' => __('Task successfully enabled'),
|
||||
'id' => false,
|
||||
];
|
||||
}
|
||||
|
||||
// Trick to avoid double execution.
|
||||
header('Location: '.$this->url);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Show complete list of running tasks.
|
||||
*
|
||||
|
@ -522,7 +619,12 @@ class DiscoveryTaskList extends HTML
|
|||
$data[1] .= '<span class="link" onclick="progress_task_list('.$task['id_rt'].',\''.$task['name'].'\')">';
|
||||
}
|
||||
|
||||
$data[1] .= '<b>'.$task['name'].'</b>';
|
||||
if ($task['disabled'] == 1) {
|
||||
$data[1] .= '<b><em>'.$task['name'].'</em></b>';
|
||||
} else {
|
||||
$data[1] .= '<b>'.$task['name'].'</b>';
|
||||
}
|
||||
|
||||
if ($task['disabled'] != 2) {
|
||||
$data[1] .= '</span>';
|
||||
}
|
||||
|
@ -809,6 +911,24 @@ class DiscoveryTaskList extends HTML
|
|||
['title' => __('Delete task')]
|
||||
).'</a>';
|
||||
}
|
||||
|
||||
if ($task['disabled'] == 1) {
|
||||
$data[9] .= '<a href="'.ui_get_full_url(
|
||||
'index.php?sec=gservers&sec2=godmode/servers/discovery&enabled=1&wiz=tasklist&task='.$task['id_rt']
|
||||
).'" onClick="if (!confirm(\' '.__('Are you sure?').'\')) return false;">'.html_print_image(
|
||||
'images/lightbulb_off.png',
|
||||
true,
|
||||
['title' => __('enable task')]
|
||||
).'</a>';
|
||||
} else if ($task['disabled'] == 0) {
|
||||
$data[9] .= '<a href="'.ui_get_full_url(
|
||||
'index.php?sec=gservers&sec2=godmode/servers/discovery&disabled=1&wiz=tasklist&task='.$task['id_rt']
|
||||
).'" onClick="if (!confirm(\' '.__('Are you sure?').'\')) return false;">'.html_print_image(
|
||||
'images/lightbulb.png',
|
||||
true,
|
||||
['title' => __('Disable task')]
|
||||
).'</a>';
|
||||
}
|
||||
} else {
|
||||
$data[9] = '';
|
||||
}
|
||||
|
|
|
@ -394,6 +394,12 @@ if (check_login()) {
|
|||
$index = 0;
|
||||
foreach ($columns as $col => $attr) {
|
||||
$table->head[$index] = $col;
|
||||
if ($col === 'Data') {
|
||||
$table->head[$index] .= ui_print_help_tip(
|
||||
__('In Pandora FMS, data is stored compressed. The data visualization in database, charts or CSV exported data won\'t match, because is interpreted at runtime. Please check \'Pandora FMS Engineering\' chapter from documentation.'),
|
||||
true
|
||||
);
|
||||
}
|
||||
|
||||
if (isset($attr['align'])) {
|
||||
$table->align[$index] = $attr['align'];
|
||||
|
|
|
@ -342,6 +342,8 @@ class TreeService extends Tree
|
|||
*/
|
||||
protected function getSecondLevel()
|
||||
{
|
||||
global $config;
|
||||
|
||||
$service = new Service($this->id, true);
|
||||
|
||||
$output = [];
|
||||
|
@ -422,7 +424,13 @@ class TreeService extends Tree
|
|||
}
|
||||
|
||||
$tmp['children'] = [];
|
||||
$tmp['searchChildren'] = 1;
|
||||
|
||||
if (check_acl($config['id_user'], $item->agent()->id_grupo(), 'AR')) {
|
||||
$tmp['searchChildren'] = 1;
|
||||
} else {
|
||||
$tmp['searchChildren'] = 0;
|
||||
}
|
||||
|
||||
$tmp['showEventsBtn'] = 1;
|
||||
$tmp['eventAgent'] = $item->agent()->id_agente();
|
||||
break;
|
||||
|
@ -532,7 +540,9 @@ class TreeService extends Tree
|
|||
);
|
||||
}
|
||||
|
||||
$grandchildren = $item->service()->children();
|
||||
if (check_acl($config['id_user'], $item->service()->id_group(), 'AR')) {
|
||||
$grandchildren = $item->service()->children();
|
||||
}
|
||||
|
||||
if ($this->connectedToNode === false
|
||||
&& is_metaconsole() === true
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
/**
|
||||
* Pandora build version and version
|
||||
*/
|
||||
$build_version = 'PC210304';
|
||||
$build_version = 'PC210305';
|
||||
$pandora_version = 'v7.0NG.752';
|
||||
|
||||
// Do not overwrite default timezone set if defined.
|
||||
|
|
|
@ -3746,9 +3746,12 @@ function agents_get_agent_id_by_alias_regex($alias_regex, $flag='i', $limit=0)
|
|||
*/
|
||||
function agents_get_sap_agents($id_agent)
|
||||
{
|
||||
global $config;
|
||||
|
||||
// Available modules.
|
||||
// If you add more modules, please update SAP.pm.
|
||||
$sap_modules = [
|
||||
0 => 'SAP connection',
|
||||
160 => __('SAP Login OK'),
|
||||
109 => __('SAP Dumps'),
|
||||
111 => __('SAP lock entry list'),
|
||||
|
@ -3758,9 +3761,9 @@ function agents_get_sap_agents($id_agent)
|
|||
105 => __('SAP IDOC OK'),
|
||||
150 => __('SAP WP without active restart'),
|
||||
151 => __('SAP WP stopped'),
|
||||
102 => __('Average time of SAPGUI response '),
|
||||
102 => __('Average time of SAPGUI response'),
|
||||
180 => __('Dialog response time'),
|
||||
103 => __('Dialog Logged users '),
|
||||
103 => __('Dialog Logged users'),
|
||||
192 => __('TRFC in error'),
|
||||
195 => __('QRFC in error SMQ2'),
|
||||
116 => __('Number of Update WPs in error'),
|
||||
|
@ -3768,15 +3771,28 @@ function agents_get_sap_agents($id_agent)
|
|||
|
||||
$array_agents = [];
|
||||
foreach ($sap_modules as $module => $key) {
|
||||
$new_ones = db_get_all_rows_sql(
|
||||
'SELECT ta.id_agente,ta.alias
|
||||
FROM tagente ta
|
||||
INNER JOIN tagente_modulo tam
|
||||
ON tam.id_agente = ta.id_agente
|
||||
WHERE tam.nombre
|
||||
LIKE "%SAP%"
|
||||
GROUP BY ta.id_agente'
|
||||
$sql = sprintf(
|
||||
'SELECT ta.id_agente,ta.alias, ta.id_grupo
|
||||
FROM tagente ta
|
||||
INNER JOIN tagente_modulo tam
|
||||
ON tam.id_agente = ta.id_agente
|
||||
WHERE tam.nombre
|
||||
LIKE "%s"
|
||||
GROUP BY ta.id_agente',
|
||||
io_safe_input($key)
|
||||
);
|
||||
|
||||
// ACL groups.
|
||||
$agent_groups = array_keys(users_get_groups($config['id_user']));
|
||||
if (!empty($agent_groups)) {
|
||||
$sql .= sprintf(
|
||||
' HAVING ta.id_grupo IN (%s)',
|
||||
implode(',', $agent_groups)
|
||||
);
|
||||
}
|
||||
|
||||
$new_ones = db_get_all_rows_sql($sql);
|
||||
|
||||
if ($new_ones === false) {
|
||||
continue;
|
||||
}
|
||||
|
|
|
@ -16427,3 +16427,95 @@ function api_set_event_in_progress($event_id, $trash2, $returnType)
|
|||
returnError('id_not_found', 'string');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Enable/Disable discovery task.
|
||||
*
|
||||
* @param string $id_task Integer discovery task ID
|
||||
* @param $thrash2 not used.
|
||||
* @param array $other it's array, $other as param is <enable/disable value> in this order and separator char
|
||||
* (after text ; ) and separator (pass in param othermode as othermode=url_encode_separator_<separator>)
|
||||
* example:
|
||||
*
|
||||
* example 1 (Enable)
|
||||
*
|
||||
* api.php?op=set&op2=enable_disable_discovery_task&id=1&other=0&other_mode=url_encode_separator_|
|
||||
*
|
||||
* example 2 (Disable)
|
||||
*
|
||||
* api.php?op=set&op2=enable_disable_discovery_task&id=1&other=1&other_mode=url_encode_separator_|
|
||||
*
|
||||
* http://localhost/pandora_console/include/api.php?op=set&op2=enable_disable_discovery_task&id=1&other=1&other_mode=url_encode_separator_|&apipass=1234&user=admin&pass=pandora
|
||||
*/
|
||||
function api_set_enable_disable_discovery_task($id_task, $thrash2, $other)
|
||||
{
|
||||
global $config;
|
||||
|
||||
if (defined('METACONSOLE')) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!check_acl($config['id_user'], 0, 'AW')) {
|
||||
returnError('forbidden', 'string');
|
||||
return;
|
||||
}
|
||||
|
||||
if ($id_task == '') {
|
||||
returnError(
|
||||
'error_enable_disable_discovery_task',
|
||||
__('Error enable/disable discovery task. Id_user cannot be left blank.')
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
if ($other['data'][0] != '0' and $other['data'][0] != '1') {
|
||||
returnError(
|
||||
'error_enable_disable_discovery_task',
|
||||
__('Error enable/disable discovery task. Enable/disable value cannot be left blank.')
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
if ($other['data'][0] == '0') {
|
||||
$result = db_process_sql_update(
|
||||
'trecon_task',
|
||||
[
|
||||
'disabled' => $other['data'][0],
|
||||
'status' => 0,
|
||||
],
|
||||
['id_rt' => $id_task]
|
||||
);
|
||||
} else {
|
||||
$result = db_process_sql_update(
|
||||
'trecon_task',
|
||||
['disabled' => $other['data'][0]],
|
||||
['id_rt' => $id_task]
|
||||
);
|
||||
}
|
||||
|
||||
if (is_error($result)) {
|
||||
returnError(
|
||||
'error_enable_disable_discovery_task',
|
||||
__('Error in discovery task enabling/disabling.')
|
||||
);
|
||||
} else {
|
||||
if ($other['data'][0] == '0') {
|
||||
returnData(
|
||||
'string',
|
||||
[
|
||||
'type' => 'string',
|
||||
'data' => __('Enabled discovery task.'),
|
||||
]
|
||||
);
|
||||
} else {
|
||||
returnData(
|
||||
'string',
|
||||
[
|
||||
'type' => 'string',
|
||||
'data' => __('Disabled discovery task.'),
|
||||
]
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,18 +1,32 @@
|
|||
<?php
|
||||
/**
|
||||
* CSV charts.
|
||||
*
|
||||
* @category CSV charts
|
||||
* @package Pandora FMS
|
||||
* @subpackage Community
|
||||
* @version 1.0.0
|
||||
* @license See below
|
||||
*
|
||||
* ______ ___ _______ _______ ________
|
||||
* | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __|
|
||||
* | __/| _ | | _ || _ | _| _ | | ___| |__ |
|
||||
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
|
||||
*
|
||||
* ============================================================================
|
||||
* Copyright (c) 2005-2021 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 for 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.
|
||||
* ============================================================================
|
||||
*/
|
||||
|
||||
// Pandora FMS - http://pandorafms.com
|
||||
// ==================================================
|
||||
// Copyright (c) 2005-2021 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 for 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.
|
||||
// Don't use authentication methods.
|
||||
// This file only uses data retrieved in a request.
|
||||
// Load files.
|
||||
require_once '../../include/config.php';
|
||||
require_once '../../include/functions.php';
|
||||
enterprise_include_once('include/functions_reporting_csv.php');
|
||||
|
@ -21,12 +35,14 @@ global $config;
|
|||
|
||||
$user_language = get_user_language($config['id_user']);
|
||||
$l10n = null;
|
||||
if (file_exists('../languages/'.$user_language.'.mo')) {
|
||||
$l10n = new gettext_reader(new CachedFileReader('../languages/'.$user_language.'.mo'));
|
||||
if (file_exists('../languages/'.$user_language.'.mo') === true) {
|
||||
$l10n = new gettext_reader(
|
||||
new CachedFileReader('../languages/'.$user_language.'.mo')
|
||||
);
|
||||
$l10n->load_tables();
|
||||
}
|
||||
|
||||
// Get data
|
||||
// Get data.
|
||||
$type = (string) get_parameter('type', 'csv');
|
||||
|
||||
$data = (string) get_parameter('data');
|
||||
|
@ -36,10 +52,8 @@ $default_filename = 'data_exported - '.date($config['date_format']);
|
|||
$filename = (string) get_parameter('filename', $default_filename);
|
||||
$filename = io_safe_output($filename);
|
||||
|
||||
// Using first-class functions to avoid namespace conflicts
|
||||
// Type: 'csv'
|
||||
/*
|
||||
$data = array(
|
||||
* $data = array(
|
||||
* 'head' => array(<column>,<column>,...,<column>),
|
||||
* 'data' => array(
|
||||
* array(<data>,<data>,...,<data>),
|
||||
|
@ -49,6 +63,7 @@ $filename = io_safe_output($filename);
|
|||
* )
|
||||
* );
|
||||
*/
|
||||
|
||||
$output_csv = function ($data, $filename) {
|
||||
global $config;
|
||||
|
||||
|
@ -56,20 +71,22 @@ $output_csv = function ($data, $filename) {
|
|||
|
||||
$excel_encoding = (bool) get_parameter('excel_encoding', false);
|
||||
|
||||
// CSV Output
|
||||
// CSV Output.
|
||||
header('Content-Type: text/csv; charset=UTF-8');
|
||||
header('Content-Disposition: attachment; filename="'.$filename.'.csv"');
|
||||
|
||||
// BOM
|
||||
if (!$excel_encoding) {
|
||||
print pack('C*', 0xEF, 0xBB, 0xBF);
|
||||
// BOM.
|
||||
if ($excel_encoding === false) {
|
||||
echo pack('C*', 0xEF, 0xBB, 0xBF);
|
||||
}
|
||||
|
||||
// Header
|
||||
// Item / data
|
||||
// Item / data.
|
||||
foreach ($data as $items) {
|
||||
if (!isset($items['head']) || !isset($items['data'])) {
|
||||
throw new Exception(__('An error occured exporting the data'));
|
||||
if (isset($items['head']) === false
|
||||
|| isset($items['data']) === false
|
||||
) {
|
||||
throw new Exception(__('An error occured exporting the data'));
|
||||
}
|
||||
|
||||
// Get key for item value.
|
||||
|
@ -84,7 +101,7 @@ $output_csv = function ($data, $filename) {
|
|||
$item = str_replace('--> '.__('Selected'), '', $item);
|
||||
$line = implode($separator, $item);
|
||||
|
||||
if ($excel_encoding) {
|
||||
if ($excel_encoding === true) {
|
||||
echo mb_convert_encoding($line, 'UTF-16LE', 'UTF-8')."\n";
|
||||
} else {
|
||||
echo $line."\n";
|
||||
|
@ -93,9 +110,8 @@ $output_csv = function ($data, $filename) {
|
|||
}
|
||||
};
|
||||
|
||||
// Type: 'json'
|
||||
/*
|
||||
$data = array(
|
||||
* $data = array(
|
||||
* array(
|
||||
* 'key' => <value>,
|
||||
* 'key' => <value>,
|
||||
|
@ -117,8 +133,9 @@ $output_csv = function ($data, $filename) {
|
|||
* )
|
||||
* );
|
||||
*/
|
||||
|
||||
$output_json = function ($data, $filename) {
|
||||
// JSON Output
|
||||
// JSON Output.
|
||||
header('Content-Type: application/json; charset=UTF-8');
|
||||
header('Content-Disposition: attachment; filename="'.$filename.'.json"');
|
||||
|
||||
|
@ -134,7 +151,7 @@ $output_json = function ($data, $filename) {
|
|||
};
|
||||
|
||||
try {
|
||||
if (!$data) {
|
||||
if (empty($data) === true) {
|
||||
throw new Exception(__('An error occured exporting the data'));
|
||||
}
|
||||
|
||||
|
|
|
@ -2390,7 +2390,7 @@ function pandoraFlotArea(
|
|||
|
||||
if (series.data[j]) {
|
||||
var y = series.data[j][1];
|
||||
var x = Math.round(series.data[j][0]) - 1;
|
||||
var x = Math.round(series.data[j][0]);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -45,7 +45,7 @@ $(document).ready(function() {
|
|||
jQuery.post(
|
||||
"ajax.php",
|
||||
{
|
||||
page: "operation/messages/message_list",
|
||||
page: "operation/messages/message_list"
|
||||
},
|
||||
function(data, status) {
|
||||
$("#dialog_messages")
|
||||
|
@ -58,10 +58,10 @@ $(document).ready(function() {
|
|||
modal: true,
|
||||
overlay: {
|
||||
opacity: 0.5,
|
||||
background: "black",
|
||||
background: "black"
|
||||
},
|
||||
width: 700,
|
||||
height: 300,
|
||||
height: 300
|
||||
})
|
||||
.show();
|
||||
},
|
||||
|
@ -80,7 +80,7 @@ $(document).ready(function() {
|
|||
jQuery.post(
|
||||
"ajax.php",
|
||||
{
|
||||
page: "operation/system_alert",
|
||||
page: "operation/system_alert"
|
||||
},
|
||||
function(data, status) {
|
||||
$("#alert_messages").show();
|
||||
|
@ -104,7 +104,7 @@ $(document).ready(function() {
|
|||
"ajax.php",
|
||||
{
|
||||
page: "general/alert_enterprise",
|
||||
message: elem,
|
||||
message: elem
|
||||
},
|
||||
function(data, status) {
|
||||
$("#alert_messages").show();
|
||||
|
@ -130,7 +130,7 @@ $(document).ready(function() {
|
|||
"ajax.php",
|
||||
{
|
||||
page: "general/alert_enterprise",
|
||||
message: elem,
|
||||
message: elem
|
||||
},
|
||||
function(data, status) {
|
||||
$("#alert_messages").show();
|
||||
|
@ -155,7 +155,7 @@ $(document).ready(function() {
|
|||
"ajax.php",
|
||||
{
|
||||
page: "general/alert_enterprise",
|
||||
message: elem,
|
||||
message: elem
|
||||
},
|
||||
function(data, status) {
|
||||
$("#alert_messages").show();
|
||||
|
@ -190,7 +190,7 @@ $(document).ready(function() {
|
|||
width: 850,
|
||||
overlay: {
|
||||
opacity: 0.5,
|
||||
background: "black",
|
||||
background: "black"
|
||||
},
|
||||
open: function() {
|
||||
if (hide_counter != 1) {
|
||||
|
@ -212,7 +212,7 @@ $(document).ready(function() {
|
|||
} else {
|
||||
$("#ok_buttom").show();
|
||||
}
|
||||
},
|
||||
}
|
||||
});
|
||||
|
||||
$("#submit-hide-license-error-msg").click(function() {
|
||||
|
@ -230,8 +230,8 @@ $(document).ready(function() {
|
|||
width: 620,
|
||||
overlay: {
|
||||
opacity: 0.5,
|
||||
background: "black",
|
||||
},
|
||||
background: "black"
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -244,8 +244,8 @@ $(document).ready(function() {
|
|||
width: 520,
|
||||
overlay: {
|
||||
opacity: 0.5,
|
||||
background: "black",
|
||||
},
|
||||
background: "black"
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -258,8 +258,8 @@ $(document).ready(function() {
|
|||
width: 520,
|
||||
overlay: {
|
||||
opacity: 0.5,
|
||||
background: "black",
|
||||
},
|
||||
background: "black"
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -327,7 +327,7 @@ $(document).ready(function() {
|
|||
left:
|
||||
+parseInt(screen.width / 2) -
|
||||
parseInt($("#alert_messages").css("width")) / 2 +
|
||||
"px",
|
||||
"px"
|
||||
});
|
||||
});
|
||||
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
var original_command = "";
|
||||
/* globals $ */
|
||||
|
||||
function parse_alert_command(command, classs) {
|
||||
if (classs == "recovery") {
|
||||
classs = "fields_recovery";
|
||||
|
@ -9,16 +10,20 @@ function parse_alert_command(command, classs) {
|
|||
var nfield = 1;
|
||||
$("." + classs).each(function() {
|
||||
// Only render values different from ''
|
||||
if ($(this).val() == "") {
|
||||
nfield++;
|
||||
|
||||
return;
|
||||
}
|
||||
var field = "_field" + nfield + "_";
|
||||
|
||||
var regex = new RegExp(field, "gi");
|
||||
|
||||
if ($(this).css("-webkit-text-security") == "disc") {
|
||||
console.log($(this).val());
|
||||
if ($(this).val() == "") {
|
||||
if (
|
||||
classs == "fields_recovery" &&
|
||||
$($(".fields")[nfield - 1]).val() != ""
|
||||
) {
|
||||
command = command.replace(
|
||||
regex,
|
||||
"[RECOVER]" + $($(".fields")[nfield - 1]).val()
|
||||
);
|
||||
}
|
||||
} else if ($(this).css("-webkit-text-security") == "disc") {
|
||||
var hidden_character = "*";
|
||||
var hidden_string = hidden_character.repeat($(this).val().length);
|
||||
|
||||
|
|
|
@ -3174,6 +3174,12 @@ table.alert_escalation th img {
|
|||
width: 18px;
|
||||
}
|
||||
|
||||
.action_details td.used_field {
|
||||
background: #6eb432;
|
||||
color: #8d8d8d;
|
||||
font-weight: normal;
|
||||
}
|
||||
|
||||
td.used_field {
|
||||
background: #6eb432;
|
||||
color: #ffffff;
|
||||
|
|
|
@ -129,7 +129,7 @@
|
|||
<div style='height: 10px'>
|
||||
<?php
|
||||
$version = '7.0NG.752';
|
||||
$build = '210304';
|
||||
$build = '210305';
|
||||
$banner = "v$version Build $build";
|
||||
|
||||
error_reporting(0);
|
||||
|
|
|
@ -284,14 +284,34 @@ if (empty($server_id) === false) {
|
|||
$menu_form .= html_print_input_hidden('server', $server_id, true);
|
||||
}
|
||||
|
||||
$menu_form .= '<div class="module_graph_menu_dropdown">';
|
||||
$menu_form .= '<div id="module_graph_menu_header" class="module_graph_menu_header">';
|
||||
$menu_form .= html_print_image(
|
||||
'images/arrow_down_green.png',
|
||||
true,
|
||||
[
|
||||
'class' => 'module_graph_menu_arrow',
|
||||
'float' => 'left',
|
||||
],
|
||||
false,
|
||||
false,
|
||||
true
|
||||
);
|
||||
$menu_form .= '<span style="flex: 2; justify-content:center;" class="flex-row">';
|
||||
$menu_form .= '<b>'.__('Graph configuration menu').'</b>';
|
||||
$menu_form .= ui_print_help_tip(
|
||||
__('In Pandora FMS, data is stored compressed. The data visualization in database, charts or CSV exported data won\'t match, because is interpreted at runtime. Please check \'Pandora FMS Engineering\' chapter from documentation.'),
|
||||
true
|
||||
);
|
||||
$menu_form .= '</span>';
|
||||
$menu_form .= '</div>';
|
||||
$menu_form .= '<div class="module_graph_menu_content module_graph_menu_content_closed" style="display:none;">';
|
||||
$menu_form .= $form_table;
|
||||
$menu_form .= '</div>';
|
||||
$menu_form .= '</div>';
|
||||
$menu_form .= '</form>';
|
||||
|
||||
echo $menu_form;
|
||||
echo '<div class="module_graph_menu_dropdown">
|
||||
<div id="module_graph_menu_header" class="module_graph_menu_header">
|
||||
'.html_print_image('images/arrow_down_green.png', true, ['class' => 'module_graph_menu_arrow', 'float' => 'left'], false, false, true).'
|
||||
<span style="flex: 2;">'.__('Graph configuration menu').'</span></div>
|
||||
<div class="module_graph_menu_content module_graph_menu_content_closed" style="display:none;">'.$form_table.'</div>
|
||||
</div>';
|
||||
echo '</form>';
|
||||
|
||||
// Hidden div to forced title.
|
||||
html_print_div(
|
||||
|
|
|
@ -423,8 +423,12 @@ ui_print_message_dialog(
|
|||
false,
|
||||
true
|
||||
);
|
||||
$menu_form .= '<span style="flex: 2;">';
|
||||
$menu_form .= __('Graph configuration menu');
|
||||
$menu_form .= '<span style="flex: 2; justify-content:center;" class="flex-row">';
|
||||
$menu_form .= '<b>'.__('Graph configuration menu').'</b>';
|
||||
$menu_form .= ui_print_help_tip(
|
||||
__('In Pandora FMS, data is stored compressed. The data visualization in database, charts or CSV exported data won\'t match, because is interpreted at runtime. Please check \'Pandora FMS Engineering\' chapter from documentation.'),
|
||||
true
|
||||
);
|
||||
$menu_form .= '</span>';
|
||||
$menu_form .= '</div>';
|
||||
$menu_form .= '<div class="module_graph_menu_content module_graph_menu_content_closed" style="display:none;">';
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
#
|
||||
%define name pandorafms_console
|
||||
%define version 7.0NG.752
|
||||
%define release 210304
|
||||
%define release 210305
|
||||
|
||||
# User and Group under which Apache is running
|
||||
%define httpd_name httpd
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
#
|
||||
%define name pandorafms_console
|
||||
%define version 7.0NG.752
|
||||
%define release 210304
|
||||
%define release 210305
|
||||
|
||||
# User and Group under which Apache is running
|
||||
%define httpd_name httpd
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
#
|
||||
%define name pandorafms_console
|
||||
%define version 7.0NG.752
|
||||
%define release 210304
|
||||
%define release 210305
|
||||
%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.752-210304
|
||||
Version: 7.0NG.752-210305
|
||||
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.752-210304"
|
||||
pandora_version="7.0NG.752-210305"
|
||||
|
||||
package_cpan=0
|
||||
package_pandora=1
|
||||
|
|
|
@ -45,7 +45,7 @@ our @EXPORT = qw(
|
|||
|
||||
# version: Defines actual version of Pandora Server for this module only
|
||||
my $pandora_version = "7.0NG.752";
|
||||
my $pandora_build = "210304";
|
||||
my $pandora_build = "210305";
|
||||
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.752";
|
||||
my $pandora_build = "210304";
|
||||
my $pandora_build = "210305";
|
||||
our $VERSION = $pandora_version." ".$pandora_build;
|
||||
|
||||
our %EXPORT_TAGS = ( 'all' => [ qw() ] );
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
#
|
||||
%define name pandorafms_server
|
||||
%define version 7.0NG.752
|
||||
%define release 210304
|
||||
%define release 210305
|
||||
|
||||
Summary: Pandora FMS Server
|
||||
Name: %{name}
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
#
|
||||
%define name pandorafms_server
|
||||
%define version 7.0NG.752
|
||||
%define release 210304
|
||||
%define release 210305
|
||||
|
||||
Summary: Pandora FMS Server
|
||||
Name: %{name}
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
# **********************************************************************
|
||||
|
||||
PI_VERSION="7.0NG.752"
|
||||
PI_BUILD="210304"
|
||||
PI_BUILD="210305"
|
||||
|
||||
MODE=$1
|
||||
if [ $# -gt 1 ]; then
|
||||
|
|
|
@ -35,7 +35,7 @@ use PandoraFMS::Config;
|
|||
use PandoraFMS::DB;
|
||||
|
||||
# version: define current version
|
||||
my $version = "7.0NG.752 PS210304";
|
||||
my $version = "7.0NG.752 PS210305";
|
||||
|
||||
# Pandora server configuration
|
||||
my %conf;
|
||||
|
|
|
@ -36,7 +36,7 @@ use Encode::Locale;
|
|||
Encode::Locale::decode_argv;
|
||||
|
||||
# version: define current version
|
||||
my $version = "7.0NG.752 PS210304";
|
||||
my $version = "7.0NG.752 PS210305";
|
||||
|
||||
# save program name for logging
|
||||
my $progname = basename($0);
|
||||
|
|
Loading…
Reference in New Issue