mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-09-26 03:19:05 +02:00
Merge remote-tracking branch 'origin/develop' into new-vc-line-element
This commit is contained in:
commit
0c59c89d8f
@ -1,3 +1,4 @@
|
||||
#!/bin/bash
|
||||
docker build --rm=true --pull --no-cache --build-arg BRANCH="develop" --build-arg DB_PASS="pandora" -t pandorafms/pandorafms:7 . && \
|
||||
[ "$QA_ENV" == "" ] && \
|
||||
docker push pandorafms/pandorafms:7
|
||||
|
@ -14,6 +14,7 @@ RUN yum -y install \
|
||||
|
||||
# Install Pandora FMS agent
|
||||
RUN cd /tmp/pandora_agent/unix \
|
||||
&& chmod +x pandora_agent_installer \
|
||||
&& ./pandora_agent_installer --install
|
||||
|
||||
# Set default variables
|
||||
@ -40,7 +41,7 @@ if [ $TIMEZONE != "" ]; then\n \
|
||||
fi\n \
|
||||
/etc/init.d/pandora_agent_daemon start\n \
|
||||
rm -f $0\n \
|
||||
bash' \
|
||||
tail -f /var/log/pandora/pandora_agent.log' \
|
||||
>> /entrypoint.sh && \
|
||||
chmod +x /entrypoint.sh
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
package: pandorafms-agent-unix
|
||||
Version: 7.0NG.738-190821
|
||||
Version: 7.0NG.738-190919
|
||||
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.738-190821"
|
||||
pandora_version="7.0NG.738-190919"
|
||||
|
||||
echo "Test if you has the tools for to make the packages."
|
||||
whereis dpkg-deb | cut -d":" -f2 | grep dpkg-deb > /dev/null
|
||||
|
@ -42,7 +42,7 @@ my $Sem = undef;
|
||||
my $ThreadSem = undef;
|
||||
|
||||
use constant AGENT_VERSION => '7.0NG.738';
|
||||
use constant AGENT_BUILD => '190821';
|
||||
use constant AGENT_BUILD => '190919';
|
||||
|
||||
# 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.738
|
||||
%define release 190821
|
||||
%define release 190919
|
||||
|
||||
Summary: Pandora FMS Linux agent, PERL version
|
||||
Name: %{name}
|
||||
|
@ -3,7 +3,7 @@
|
||||
#
|
||||
%define name pandorafms_agent_unix
|
||||
%define version 7.0NG.738
|
||||
%define release 190821
|
||||
%define release 190919
|
||||
|
||||
Summary: Pandora FMS Linux agent, PERL version
|
||||
Name: %{name}
|
||||
|
@ -10,7 +10,7 @@
|
||||
# **********************************************************************
|
||||
|
||||
PI_VERSION="7.0NG.738"
|
||||
PI_BUILD="190821"
|
||||
PI_BUILD="190919"
|
||||
OS_NAME=`uname -s`
|
||||
|
||||
FORCE=0
|
||||
|
@ -186,7 +186,7 @@ UpgradeApplicationID
|
||||
{}
|
||||
|
||||
Version
|
||||
{190821}
|
||||
{190919}
|
||||
|
||||
ViewReadme
|
||||
{Yes}
|
||||
|
@ -1214,7 +1214,8 @@ Pandora_Module_Factory::getModuleFromDefinition (string definition) {
|
||||
module_source,
|
||||
module_eventtype,
|
||||
module_eventcode,
|
||||
module_pattern);
|
||||
module_pattern,
|
||||
module_application);
|
||||
} else if (module_wmiquery != "") {
|
||||
module = new Pandora_Module_WMIQuery (module_name,
|
||||
module_wmiquery, module_wmicolumn);
|
||||
|
@ -53,7 +53,7 @@ static EvtUpdateBookmarkT EvtUpdateBookmarkF = NULL;
|
||||
* @param name Module name.
|
||||
* @param service_name Service internal name to check.
|
||||
*/
|
||||
Pandora_Module_Logchannel::Pandora_Module_Logchannel (string name, string source, string type, string id, string pattern)
|
||||
Pandora_Module_Logchannel::Pandora_Module_Logchannel (string name, string source, string type, string id, string pattern, string application)
|
||||
: Pandora_Module (name) {
|
||||
int i;
|
||||
vector<wstring> query;
|
||||
@ -93,6 +93,13 @@ Pandora_Module_Logchannel::Pandora_Module_Logchannel (string name, string source
|
||||
query.push_back(ss.str());
|
||||
}
|
||||
|
||||
// Set the application
|
||||
if (application != "") {
|
||||
wstringstream ss;
|
||||
ss << L"*[System/Provider[@Name='" << application.c_str() << L"']]";
|
||||
query.push_back(ss.str());
|
||||
}
|
||||
|
||||
// Fill the filter
|
||||
if (query.size() == 0) {
|
||||
this->filter = L"*";
|
||||
@ -579,4 +586,4 @@ Pandora_Module_Logchannel::GetMessageString(EVT_HANDLE hMetadata, EVT_HANDLE hEv
|
||||
}
|
||||
|
||||
return pBuffer;
|
||||
}
|
||||
}
|
||||
|
@ -75,7 +75,7 @@ namespace Pandora_Modules {
|
||||
LPWSTR GetMessageString(EVT_HANDLE hMetadata, EVT_HANDLE hEvent, EVT_FORMAT_MESSAGE_FLAGS FormatId);
|
||||
|
||||
public:
|
||||
Pandora_Module_Logchannel (string name, string source, string type, string id, string pattern);
|
||||
Pandora_Module_Logchannel (string name, string source, string type, string id, string pattern, string application);
|
||||
void run ();
|
||||
};
|
||||
}
|
||||
|
@ -30,7 +30,7 @@ using namespace Pandora;
|
||||
using namespace Pandora_Strutils;
|
||||
|
||||
#define PATH_SIZE _MAX_PATH+1
|
||||
#define PANDORA_VERSION ("7.0NG.738(Build 190821)")
|
||||
#define PANDORA_VERSION ("7.0NG.738(Build 190919)")
|
||||
|
||||
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.738(Build 190821))"
|
||||
VALUE "ProductVersion", "(7.0NG.738(Build 190919))"
|
||||
VALUE "FileVersion", "1.0.0.0"
|
||||
END
|
||||
END
|
||||
|
@ -1,5 +1,5 @@
|
||||
package: pandorafms-console
|
||||
Version: 7.0NG.738-190821
|
||||
Version: 7.0NG.738-190919
|
||||
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.738-190821"
|
||||
pandora_version="7.0NG.738-190919"
|
||||
|
||||
package_pear=0
|
||||
package_pandora=1
|
||||
|
@ -44,24 +44,16 @@ $groups = groups_get_all();
|
||||
// Add the All group to the beginning to be always the first
|
||||
// Use this instead array_unshift to keep the array keys
|
||||
$groups = ([0 => __('All')] + $groups);
|
||||
$html = '';
|
||||
$style = 'style="padding: 2px 10px; display: inline-block;"';
|
||||
$groups_selected = [];
|
||||
foreach ($groups as $id => $name) {
|
||||
$checked = in_array($id, $file['groups']);
|
||||
$all_checked = false;
|
||||
if ($id === 0) {
|
||||
$checkbox = html_print_checkbox_extended('groups[]', $id, $checked, false, '', 'class="chkb_all"', true);
|
||||
$all_checked = $checked;
|
||||
} else {
|
||||
$checkbox = html_print_checkbox_extended('groups[]', $id, $checked, $all_checked, '', 'class="chkb_group"', true);
|
||||
if (in_array($id, $file['groups'])) {
|
||||
$groups_selected[] = $id;
|
||||
}
|
||||
|
||||
$html .= "<div $style>$name $checkbox</div>";
|
||||
}
|
||||
|
||||
$row = [];
|
||||
$row[0] = __('Groups');
|
||||
$row[1] = $html;
|
||||
$row[1] = html_print_select($groups, 'groups[]', $groups_selected, '', '', '', true, true, '', '', '');
|
||||
$table->data[] = $row;
|
||||
$table->colspan[][1] = 3;
|
||||
|
||||
|
@ -193,7 +193,7 @@ function files_repo_add_file($file_input_name='upfile', $description='', $groups
|
||||
global $config;
|
||||
|
||||
$attachment_path = io_safe_output($config['attachment_store']);
|
||||
$files_repo_path = $attachment_path.'/'.'files_repo';
|
||||
$files_repo_path = $attachment_path.'/files_repo';
|
||||
|
||||
$result = [];
|
||||
$result['status'] = false;
|
||||
|
11
pandora_console/extras/mr/32.sql
Normal file
11
pandora_console/extras/mr/32.sql
Normal file
@ -0,0 +1,11 @@
|
||||
START TRANSACTION;
|
||||
|
||||
UPDATE `tlayout_data` SET `height` = 70 , `width` = 70 WHERE `height` = 0 && `width` = 0 && image NOT LIKE '%dot%' && ((`type` IN (0,5)) ||
|
||||
(`type` = 10 && `image` IS NOT NULL && `image` != '' && `image` != 'none') ||
|
||||
(`type` = 11 && `image` IS NOT NULL && `image` != '' && `image` != 'none' && `show_statistics` = 0));
|
||||
|
||||
ALTER TABLE `treport_content` ADD COLUMN `uncompressed_module` TINYINT DEFAULT '0';
|
||||
ALTER TABLE `treport_content_template` ADD COLUMN `uncompressed_module` TINYINT DEFAULT '0';
|
||||
|
||||
|
||||
COMMIT;
|
@ -726,7 +726,7 @@ render_info_data(
|
||||
echo "<tr><th style='background-color:#b1b1b1;font-weight:bold;font-style:italic;border-radius:2px;' align=center colspan='2'>".__(' Pandora FMS Licence Information').'</th></tr>';
|
||||
|
||||
render_row(html_print_textarea('keys[customer_key]', 10, 255, $settings->customer_key, 'style="height:40px; width:450px;"', true), 'Customer key');
|
||||
render_row($license['expiry_date'], 'Expires');
|
||||
render_row($license['expiry_date'], $license['expiry_caption']);
|
||||
render_row($license['limit'].' agents', 'Platform Limit');
|
||||
render_row($license['count'].' agents', 'Current Platform Count');
|
||||
render_row($license['count_enabled'].' agents', 'Current Platform Count (enabled: items)');
|
||||
|
@ -798,6 +798,7 @@ ALTER TABLE `treport_content_template` ADD COLUMN `agent_min_value` TINYINT(1) D
|
||||
ALTER TABLE `treport_content_template` ADD COLUMN `current_month` TINYINT(1) DEFAULT '1';
|
||||
ALTER TABLE `treport_content_template` ADD COLUMN `failover_mode` tinyint(1) DEFAULT '1';
|
||||
ALTER TABLE `treport_content_template` ADD COLUMN `failover_type` tinyint(1) DEFAULT '1';
|
||||
ALTER TABLE `treport_content_template` ADD COLUMN `uncompressed_module` TINYINT DEFAULT '0';
|
||||
|
||||
-- -----------------------------------------------------
|
||||
-- Table `treport_content_sla_com_temp` (treport_content_sla_combined_template)
|
||||
@ -1243,7 +1244,7 @@ ALTER TABLE titem MODIFY `source_data` int(10) unsigned;
|
||||
INSERT INTO `tconfig` (`token`, `value`) VALUES ('big_operation_step_datos_purge', '100');
|
||||
INSERT INTO `tconfig` (`token`, `value`) VALUES ('small_operation_step_datos_purge', '1000');
|
||||
INSERT INTO `tconfig` (`token`, `value`) VALUES ('days_autodisable_deletion', '30');
|
||||
INSERT INTO `tconfig` (`token`, `value`) VALUES ('MR', 30);
|
||||
INSERT INTO `tconfig` (`token`, `value`) VALUES ('MR', 31);
|
||||
INSERT INTO `tconfig` (`token`, `value`) VALUES ('custom_docs_logo', 'default_docs.png');
|
||||
INSERT INTO `tconfig` (`token`, `value`) VALUES ('custom_support_logo', 'default_support.png');
|
||||
INSERT INTO `tconfig` (`token`, `value`) VALUES ('custom_logo_white_bg_preview', 'pandora_logo_head_white_bg.png');
|
||||
@ -1454,6 +1455,7 @@ ALTER TABLE `treport_content` ADD COLUMN `current_month` TINYINT(1) DEFAULT '1';
|
||||
ALTER TABLE `treport_content` ADD COLUMN `failover_mode` tinyint(1) DEFAULT '0';
|
||||
ALTER TABLE `treport_content` ADD COLUMN `failover_type` tinyint(1) DEFAULT '0';
|
||||
ALTER table `treport_content` MODIFY COLUMN `name` varchar(300) NULL;
|
||||
ALTER TABLE `treport_content` ADD COLUMN `uncompressed_module` TINYINT DEFAULT '0';
|
||||
|
||||
-- ---------------------------------------------------------------------
|
||||
-- Table `tmodule_relationship`
|
||||
|
@ -389,9 +389,12 @@ if (isset($login_failed)) {
|
||||
echo '<h1>'.__('ERROR').'</h1>';
|
||||
echo '<p>'.$config['auth_error'].'</p>';
|
||||
echo '</div>';
|
||||
echo '<div class="text_message_alert">';
|
||||
echo '<p><strong>Remaining attempts: '.$attemps.'</strong></p>';
|
||||
echo '</div>';
|
||||
if ($config['enable_pass_policy']) {
|
||||
echo '<div class="text_message_alert">';
|
||||
echo '<p><strong>Remaining attempts: '.$attemps.'</strong></p>';
|
||||
echo '</div>';
|
||||
}
|
||||
|
||||
echo '<div class="button_message_alert">';
|
||||
html_print_submit_button('Ok', 'hide-login-error', false);
|
||||
echo '</div>';
|
||||
|
@ -172,6 +172,7 @@ unset($table);
|
||||
echo '<div id="right">';
|
||||
|
||||
// News.
|
||||
require_once 'general/news_dialog.php';
|
||||
$options = [];
|
||||
$options['id_user'] = $config['id_user'];
|
||||
$options['modal'] = false;
|
||||
@ -188,6 +189,7 @@ if (!empty($news)) {
|
||||
$comparation_suffix = __('ago');
|
||||
}
|
||||
|
||||
|
||||
$output_news = '<div id="news_board" class="new">';
|
||||
foreach ($news as $article) {
|
||||
$image = false;
|
||||
|
@ -804,20 +804,20 @@ $table_adv_options .= '
|
||||
'.$table_adv_gis.$table_adv_agent_icon.$table_adv_url.$table_adv_quiet.$table_adv_status.$table_adv_remote.$table_adv_safe.'
|
||||
</div>';
|
||||
|
||||
|
||||
echo '<div class="ui_toggle">';
|
||||
ui_toggle(
|
||||
$table_adv_options,
|
||||
__('Advanced options'),
|
||||
'',
|
||||
'',
|
||||
true,
|
||||
false,
|
||||
'white_box white_box_opened',
|
||||
'no-border flex'
|
||||
);
|
||||
echo '</div>';
|
||||
|
||||
if (enterprise_installed()) {
|
||||
echo '<div class="ui_toggle">';
|
||||
ui_toggle(
|
||||
$table_adv_options,
|
||||
__('Advanced options'),
|
||||
'',
|
||||
'',
|
||||
true,
|
||||
false,
|
||||
'white_box white_box_opened',
|
||||
'no-border flex'
|
||||
);
|
||||
echo '</div>';
|
||||
}
|
||||
|
||||
$table = new stdClass();
|
||||
$table->width = '100%';
|
||||
@ -825,7 +825,7 @@ $table->class = 'custom_fields_table';
|
||||
|
||||
$table->head = [
|
||||
0 => __('Click to display').ui_print_help_tip(
|
||||
__('This field allows url insertion using the BBCode\'s url tag').'.<br />'.__('The format is: [url=\'url to navigate\']\'text to show\'[/url]').'.<br /><br />'.__('e.g.: [url=google.com]Google web search[/url]'),
|
||||
__('This field allows url insertion using the BBCode\'s url tag').'.<br />'.__('The format is: [url=\'url to navigate\']\'text to show\'[/url] or [url]\'url to navigate\'[/url] ').'.<br /><br />'.__('e.g.: [url=google.com]Google web search[/url] or [url]www.goole.com[/url]'),
|
||||
true
|
||||
),
|
||||
];
|
||||
@ -931,18 +931,48 @@ foreach ($fields as $field) {
|
||||
$i += 2;
|
||||
}
|
||||
|
||||
if (!empty($fields)) {
|
||||
if (enterprise_installed()) {
|
||||
if (!empty($fields)) {
|
||||
echo '<div class="ui_toggle">';
|
||||
ui_toggle(
|
||||
html_print_table($table, true),
|
||||
__('Custom fields'),
|
||||
'',
|
||||
'',
|
||||
true,
|
||||
false,
|
||||
'white_box white_box_opened',
|
||||
'no-border'
|
||||
);
|
||||
echo '</div>';
|
||||
}
|
||||
} else {
|
||||
echo '<div class="ui_toggle">';
|
||||
ui_toggle(
|
||||
html_print_table($table, true),
|
||||
__('Custom fields'),
|
||||
$table_adv_options,
|
||||
__('Advanced options'),
|
||||
'',
|
||||
'',
|
||||
true,
|
||||
false,
|
||||
'white_box white_box_opened',
|
||||
'no-border'
|
||||
'no-border flex'
|
||||
);
|
||||
if (!empty($fields)) {
|
||||
ui_toggle(
|
||||
html_print_table($table, true),
|
||||
__('Custom fields'),
|
||||
'',
|
||||
'',
|
||||
true,
|
||||
false,
|
||||
'white_box white_box_opened',
|
||||
'no-border'
|
||||
);
|
||||
}
|
||||
|
||||
echo '<div class="action-buttons" style="display: flex; justify-content: flex-end; align-items: center; width: '.$table->width.'">';
|
||||
|
||||
echo '</div>';
|
||||
}
|
||||
|
||||
|
@ -353,7 +353,7 @@ html_print_table($table);
|
||||
echo "<div style='text-align:right; width:".$table->width."'>";
|
||||
echo '<span id="oid_loading" class="invisible">'.html_print_image('images/spinner.gif', true).'</span>';
|
||||
html_print_submit_button(__('WMI Explore'), 'wmi_explore', false, ['class' => 'sub next']);
|
||||
echo '</div>';
|
||||
echo '</div><br>';
|
||||
|
||||
if ($wmiexplore && $fail) {
|
||||
ui_print_error_message(__('Unable to do WMI explorer'));
|
||||
@ -364,7 +364,7 @@ unset($table);
|
||||
echo '</form>';
|
||||
|
||||
if ($wmiexplore && !$fail) {
|
||||
echo '<span id ="none_text" style="display: none;">'.__('None').'</span>';
|
||||
echo '<br><span id ="none_text" style="display: none;">'.__('None').'</span>';
|
||||
echo "<form method='post' action='index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&tab=agent_wizard&wizard_section=wmi_explorer&id_agente=$id_agent'>";
|
||||
echo '<span id="form_interfaces">';
|
||||
|
||||
@ -379,7 +379,7 @@ if ($wmiexplore && !$fail) {
|
||||
// Namespace
|
||||
html_print_input_hidden('server_to_exec', $server_to_exec);
|
||||
|
||||
$table->width = '98%';
|
||||
$table->width = '100%';
|
||||
|
||||
// Mode selector
|
||||
$modes = [];
|
||||
@ -404,7 +404,7 @@ if ($wmiexplore && !$fail) {
|
||||
|
||||
$table->colspan[1][0] = 2;
|
||||
$table->data[1][2] = '<b>'.__('Modules').'</b>';
|
||||
$table->cellstyle[1][2] = 'vertical-align: middle;';
|
||||
$table->cellstyle[1][2] = 'text-align: center;';
|
||||
|
||||
// Components list
|
||||
$table->data[2][0] = '<div class="wizard_mode_form wizard_mode_components">';
|
||||
@ -495,7 +495,7 @@ if ($wmiexplore && !$fail) {
|
||||
'width: 300px;'
|
||||
);
|
||||
$table->data[2][0] .= '</div>';
|
||||
$table->cellstyle[2][0] = 'vertical-align: top; text-align: center;';
|
||||
$table->cellstyle[2][0] = 'vertical-align: bottom; text-align: center;';
|
||||
|
||||
|
||||
// Components arrow
|
||||
|
@ -1358,7 +1358,11 @@ if ($update_module || $create_module) {
|
||||
|
||||
$parent_module_id = (int) get_parameter('parent_module_id');
|
||||
$ip_target = (string) get_parameter('ip_target');
|
||||
if ($ip_target == '') {
|
||||
// No autofill if the module is a webserver module.
|
||||
if ($ip_target == ''
|
||||
&& $id_module_type < MODULE_WEBSERVER_CHECK_LATENCY
|
||||
&& $id_module_type > MODULE_WEBSERVER_RETRIEVE_STRING_DATA
|
||||
) {
|
||||
$ip_target = 'auto';
|
||||
}
|
||||
|
||||
@ -1381,11 +1385,7 @@ if ($update_module || $create_module) {
|
||||
$ff_type = (int) get_parameter('ff_type');
|
||||
$each_ff = (int) get_parameter('each_ff');
|
||||
$ff_timeout = (int) get_parameter('ff_timeout');
|
||||
$unit = (string) get_parameter('unit_select');
|
||||
if ($unit == 'none') {
|
||||
$unit = (string) get_parameter('unit_text');
|
||||
}
|
||||
|
||||
$unit = (string) get_parameter('unit');
|
||||
$id_tag = (array) get_parameter('id_tag_selected');
|
||||
$serialize_ops = (string) get_parameter('serialize_ops');
|
||||
$critical_instructions = (string) get_parameter('critical_instructions');
|
||||
@ -1559,8 +1559,14 @@ if ($update_module) {
|
||||
|
||||
foreach ($plugin_parameter_split as $key => $value) {
|
||||
if ($key == 1) {
|
||||
$values['plugin_parameter'] .= 'http_auth_user '.$http_user.'
';
|
||||
$values['plugin_parameter'] .= 'http_auth_pass '.$http_pass.'
';
|
||||
if ($http_user) {
|
||||
$values['plugin_parameter'] .= 'http_auth_user '.$http_user.'
';
|
||||
}
|
||||
|
||||
if ($http_pass) {
|
||||
$values['plugin_parameter'] .= 'http_auth_pass '.$http_pass.'
';
|
||||
}
|
||||
|
||||
$values['plugin_parameter'] .= $value.'
';
|
||||
} else {
|
||||
$values['plugin_parameter'] .= $value.'
';
|
||||
@ -1757,8 +1763,14 @@ if ($create_module) {
|
||||
|
||||
foreach ($plugin_parameter_split as $key => $value) {
|
||||
if ($key == 1) {
|
||||
$values['plugin_parameter'] .= 'http_auth_user '.$http_user.'
';
|
||||
$values['plugin_parameter'] .= 'http_auth_pass '.$http_pass.'
';
|
||||
if ($http_user) {
|
||||
$values['plugin_parameter'] .= 'http_auth_user '.$http_user.'
';
|
||||
}
|
||||
|
||||
if ($http_pass) {
|
||||
$values['plugin_parameter'] .= 'http_auth_pass '.$http_pass.'
';
|
||||
}
|
||||
|
||||
$values['plugin_parameter'] .= $value.'
';
|
||||
} else {
|
||||
$values['plugin_parameter'] .= $value.'
';
|
||||
@ -2095,8 +2107,7 @@ if ($delete_module) {
|
||||
}
|
||||
}
|
||||
|
||||
// MODULE DUPLICATION
|
||||
// ==================.
|
||||
// MODULE DUPLICATION.
|
||||
if (!empty($duplicate_module)) {
|
||||
// DUPLICATE agent module !
|
||||
$id_duplicate_module = $duplicate_module;
|
||||
@ -2142,8 +2153,46 @@ if (!empty($duplicate_module)) {
|
||||
}
|
||||
}
|
||||
|
||||
// UPDATE GIS
|
||||
// ==========.
|
||||
// MODULE ENABLE/DISABLE.
|
||||
if ($enable_module) {
|
||||
$result = modules_change_disabled($enable_module, 0);
|
||||
$modulo_nombre = db_get_row_sql('SELECT nombre FROM tagente_modulo WHERE id_agente_modulo = '.$enable_module.'');
|
||||
$modulo_nombre = $modulo_nombre['nombre'];
|
||||
|
||||
if ($result === NOERR) {
|
||||
enterprise_hook('config_agents_enable_module_conf', [$id_agente, $enable_module]);
|
||||
db_pandora_audit('Module management', 'Enable #'.$enable_module.' | '.$modulo_nombre.' | '.$agent['alias']);
|
||||
} else {
|
||||
db_pandora_audit('Module management', 'Fail to enable #'.$enable_module.' | '.$modulo_nombre.' | '.$agent['alias']);
|
||||
}
|
||||
|
||||
ui_print_result_message(
|
||||
$result,
|
||||
__('Successfully enabled'),
|
||||
__('Could not be enabled')
|
||||
);
|
||||
}
|
||||
|
||||
if ($disable_module) {
|
||||
$result = modules_change_disabled($disable_module, 1);
|
||||
$modulo_nombre = db_get_row_sql('SELECT nombre FROM tagente_modulo WHERE id_agente_modulo = '.$disable_module.'');
|
||||
$modulo_nombre = $modulo_nombre['nombre'];
|
||||
|
||||
if ($result === NOERR) {
|
||||
enterprise_hook('config_agents_disable_module_conf', [$id_agente, $disable_module]);
|
||||
db_pandora_audit('Module management', 'Disable #'.$disable_module.' | '.$modulo_nombre.' | '.$agent['alias']);
|
||||
} else {
|
||||
db_pandora_audit('Module management', 'Fail to disable #'.$disable_module.' | '.$modulo_nombre.' | '.$agent['alias']);
|
||||
}
|
||||
|
||||
ui_print_result_message(
|
||||
$result,
|
||||
__('Successfully disabled'),
|
||||
__('Could not be disabled')
|
||||
);
|
||||
}
|
||||
|
||||
// UPDATE GIS.
|
||||
$updateGIS = get_parameter('update_gis', 0);
|
||||
if ($updateGIS) {
|
||||
$updateGisData = get_parameter('update_gis_data');
|
||||
@ -2231,8 +2280,11 @@ switch ($tab) {
|
||||
break;
|
||||
|
||||
case 'alert':
|
||||
// Because $id_agente is set, it will show only agent alerts.
|
||||
// This var is for not display create button on alert list.
|
||||
/*
|
||||
* Because $id_agente is set, it will show only agent alerts
|
||||
* This var is for not display create button on alert list
|
||||
*/
|
||||
|
||||
$dont_display_alert_create_bttn = true;
|
||||
include 'godmode/alerts/alert_list.php';
|
||||
break;
|
||||
|
@ -443,6 +443,14 @@ ui_pagination($total_agents, "index.php?sec=gagente&sec2=godmode/agentes/modific
|
||||
|
||||
if ($agents !== false) {
|
||||
// Urls to sort the table.
|
||||
// Agent name size and description for Chinese and Japanese languages are adjusted
|
||||
$agent_font_size = '7';
|
||||
$description_font_size = '6.5';
|
||||
if ($config['language'] == 'ja' || $config['language'] == 'zh_CN' || $own_info['language'] == 'ja' || $own_info['language'] == 'zh_CN') {
|
||||
$agent_font_size = '15';
|
||||
$description_font_size = '11';
|
||||
}
|
||||
|
||||
$url_up_agente = 'index.php?sec=gagente&sec2=godmode/agentes/modificar_agente&group_id='.$ag_group.'&recursion='.$recursion.'&search='.$search.'&os='.$os.'&offset='.$offset.'&sort_field=name&sort=up&disabled=$disabled';
|
||||
$url_down_agente = 'index.php?sec=gagente&sec2=godmode/agentes/modificar_agente&group_id='.$ag_group.'&recursion='.$recursion.'&search='.$search.'&os='.$os.'&offset='.$offset.'&sort_field=name&sort=down&disabled=$disabled';
|
||||
$url_up_remote = 'index.php?sec=gagente&sec2=godmode/agentes/modificar_agente&group_id='.$ag_group.'&recursion='.$recursion.'&search='.$search.'&os='.$os.'&offset='.$offset.'&sort_field=remote&sort=up&disabled=$disabled';
|
||||
@ -529,7 +537,7 @@ if ($agents !== false) {
|
||||
} else {
|
||||
echo '<a alt ='.$agent['nombre']." href='index.php?sec=gagente&
|
||||
sec2=godmode/agentes/configurar_agente&tab=$main_tab&
|
||||
id_agente=".$agent['id_agente']."'>".'<span style="font-size: 7pt" title="'.$agent['nombre'].'">'.$agent['alias'].'</span>'.'</a>';
|
||||
id_agente=".$agent['id_agente']."'>".'<span style="font-size: '.$agent_font_size.'pt" title="'.$agent['nombre'].'">'.$agent['alias'].'</span>'.'</a>';
|
||||
}
|
||||
|
||||
echo '</strong>';
|
||||
@ -629,7 +637,7 @@ if ($agents !== false) {
|
||||
// Group icon and name
|
||||
echo "<td class='$tdcolor' align='left' valign='middle'>".ui_print_group_icon($agent['id_grupo'], true).'</td>';
|
||||
// Description
|
||||
echo "<td class='".$tdcolor."f9'>".ui_print_truncate_text($agent['comentarios'], 'description', true, true, true, '[…]', 'font-size: 6.5pt;').'</td>';
|
||||
echo "<td class='".$tdcolor."f9'>".ui_print_truncate_text($agent['comentarios'], 'description', true, true, true, '[…]', 'font-size: '.$description_font_size.'pt;').'</td>';
|
||||
// Action
|
||||
// When there is only one element in page it's necesary go back page.
|
||||
if ((count($agents) == 1) && ($offset >= $config['block_size'])) {
|
||||
|
@ -232,10 +232,17 @@ $table->data[0][0] = '<b>'.__('Filter name').'</b>';
|
||||
$table->data[0][1] = html_print_input_text('id_name', $id_name, false, 20, 80, true);
|
||||
|
||||
$table->data[1][0] = '<b>'.__('Save in group').'</b>'.ui_print_help_tip(__('This group will be use to restrict the visibility of this filter with ACLs'), true);
|
||||
|
||||
$returnAllGroup = users_can_manage_group_all();
|
||||
// If the user can't manage All group but the filter is for All group, the user should see All group in the select.
|
||||
if ($returnAllGroup === false && $id_group_filter == 0) {
|
||||
$returnAllGroup = true;
|
||||
}
|
||||
|
||||
$table->data[1][1] = html_print_select_groups(
|
||||
$config['id_user'],
|
||||
$access,
|
||||
users_can_manage_group_all(),
|
||||
$returnAllGroup,
|
||||
'id_group_filter',
|
||||
$id_group_filter,
|
||||
'',
|
||||
|
@ -93,10 +93,11 @@ if ($strict_acl) {
|
||||
users_can_manage_group_all()
|
||||
);
|
||||
} else {
|
||||
// All users should see the filters with the All group.
|
||||
$groups_user = users_get_groups(
|
||||
$config['id_user'],
|
||||
$access,
|
||||
users_can_manage_group_all(),
|
||||
true,
|
||||
true
|
||||
);
|
||||
}
|
||||
|
@ -143,12 +143,12 @@ $table->data[3] = $data;
|
||||
|
||||
$data = [];
|
||||
$data[0] = '<span id="command_label" class="labels">'.__('Command').'</span><span id="url_label" style="display:none;" class="labels">'.__('URL').'</span>'.ui_print_help_icon('response_macros', true);
|
||||
$data[1] = html_print_input_text(
|
||||
$data[1] = html_print_textarea(
|
||||
'target',
|
||||
3,
|
||||
1,
|
||||
$event_response['target'],
|
||||
'',
|
||||
100,
|
||||
255,
|
||||
'style="min-height:initial;"',
|
||||
true
|
||||
);
|
||||
|
||||
|
@ -700,7 +700,7 @@ if ($fields === false) {
|
||||
foreach ($fields as $field) {
|
||||
$data[0] = '<b>'.$field['name'].'</b>';
|
||||
$data[0] .= ui_print_help_tip(
|
||||
__('This field allows url insertion using the BBCode\'s url tag').'.<br />'.__('The format is: [url=\'url to navigate\']\'text to show\'[/url]').'.<br /><br />'.__('e.g.: [url=google.com]Google web search[/url]'),
|
||||
__('This field allows url insertion using the BBCode\'s url tag').'.<br />'.__('The format is: [url=\'url to navigate\']\'text to show\'[/url] or [url]\'url to navigate\'[/url] ').'.<br /><br />'.__('e.g.: [url=google.com]Google web search[/url] or [url]www.goole.com[/url]'),
|
||||
true
|
||||
);
|
||||
$combo = [];
|
||||
|
@ -1930,11 +1930,7 @@ function process_manage_edit($module_name, $agents_select=null, $module_status='
|
||||
|
||||
case 'unit_select':
|
||||
if ($value != -1) {
|
||||
if ($value == 'none') {
|
||||
$values['unit'] = (string) get_parameter('unit_text');
|
||||
} else {
|
||||
$values['unit'] = $value;
|
||||
}
|
||||
$values['unit'] = (string) get_parameter('unit');
|
||||
}
|
||||
break;
|
||||
|
||||
|
@ -153,6 +153,7 @@ $checks_in_ok_status = true;
|
||||
$unknown_checks = true;
|
||||
$agent_max_value = true;
|
||||
$agent_min_value = true;
|
||||
$uncompressed_module = true;
|
||||
|
||||
switch ($action) {
|
||||
case 'new':
|
||||
@ -427,6 +428,7 @@ switch ($action) {
|
||||
);
|
||||
$idAgentModule = $item['id_agent_module'];
|
||||
$period = $item['period'];
|
||||
$uncompressed_module = $item['uncompressed_module'];
|
||||
break;
|
||||
|
||||
case 'historical_data':
|
||||
@ -810,7 +812,6 @@ switch ($action) {
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
$urlForm = $config['homeurl'].'index.php?sec=reporting&sec2=godmode/reporting/reporting_builder&tab=item_editor&action='.$actionParameter.'&id_report='.$idReport;
|
||||
|
||||
echo '<form action="'.$urlForm.'" method="post">';
|
||||
@ -1317,7 +1318,7 @@ $class = 'databox filters';
|
||||
|
||||
if (metaconsole_load_external_db($connection) == NOERR) {
|
||||
$agent_name = db_get_value_filter(
|
||||
'nombre',
|
||||
'alias',
|
||||
'tagente',
|
||||
['id_agente' => $idAgent]
|
||||
);
|
||||
@ -1565,10 +1566,8 @@ $class = 'databox filters';
|
||||
$all_modules = '';
|
||||
} else {
|
||||
$all_modules = db_get_all_rows_sql(
|
||||
'SELECT DISTINCT nombre, id_agente_modulo
|
||||
FROM tagente_modulo
|
||||
WHERE id_agente
|
||||
IN ('.implode(',', array_values($id_agents)).')'
|
||||
'SELECT DISTINCT nombre FROM
|
||||
tagente_modulo WHERE id_agente IN ('.implode(',', array_values($id_agents)).')'
|
||||
);
|
||||
}
|
||||
|
||||
@ -2794,6 +2793,23 @@ $class = 'databox filters';
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr id="row_uncompressed_module" style="" class="datos">
|
||||
<td style="font-weight:bold;">
|
||||
<?php
|
||||
echo __('Uncompress module').ui_print_help_tip(
|
||||
__('Use uncompressed module data.'),
|
||||
true
|
||||
);
|
||||
?>
|
||||
</td>
|
||||
<td style="">
|
||||
<?php
|
||||
html_print_checkbox('uncompressed_module', 1, $item['uncompressed_module'], false, false, '', false);
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
@ -3529,6 +3545,9 @@ $(document).ready (function () {
|
||||
|
||||
$("#id_agents").change(agent_changed_by_multiple_agents);
|
||||
|
||||
// Load selected modules by default
|
||||
$("#id_agents2").trigger('click');
|
||||
|
||||
$("#combo_group").change (
|
||||
function () {
|
||||
jQuery.post ("ajax.php",
|
||||
@ -4523,6 +4542,7 @@ function chooseType() {
|
||||
$('#row_select_fields').hide();
|
||||
$("#row_select_fields2").hide();
|
||||
$("#row_select_fields3").hide();
|
||||
$("#row_uncompressed_module").hide();
|
||||
|
||||
// SLA list default state.
|
||||
$("#sla_list").hide();
|
||||
@ -4731,6 +4751,7 @@ function chooseType() {
|
||||
$("#row_module").show();
|
||||
$("#row_period").show();
|
||||
$("#row_historical_db_check").hide();
|
||||
$("#row_uncompressed_module").show();
|
||||
break;
|
||||
|
||||
case 'historical_data':
|
||||
|
@ -267,7 +267,7 @@ if ($moduleFilter != 0) {
|
||||
|
||||
// Filter report items created from metaconsole in normal console list and the opposite
|
||||
if (defined('METACONSOLE') and $config['metaconsole'] == 1) {
|
||||
$where .= ' AND ((server_name IS NOT NULL AND length(server_name) != 0) '.'OR '.$type_escaped.' IN (\'general\', \'SLA\', \'exception\', \'availability\', \'availability_graph\', \'top_n\',\'SLA_monthly\',\'SLA_weekly\',\'SLA_hourly\'))';
|
||||
$where .= ' AND ((server_name IS NOT NULL AND length(server_name) != 0) '.'OR '.$type_escaped.' IN (\'general\', \'SLA\', \'exception\', \'availability\', \'availability_graph\', \'top_n\',\'SLA_monthly\',\'SLA_weekly\',\'SLA_hourly\',\'text\'))';
|
||||
} else {
|
||||
$where .= ' AND ((server_name IS NULL OR length(server_name) = 0) '.'OR '.$type_escaped.' IN (\'general\', \'SLA\', \'exception\', \'availability\', \'top_n\'))';
|
||||
}
|
||||
@ -342,7 +342,7 @@ if ($items) {
|
||||
$table->size[0] = '5px';
|
||||
$table->size[1] = '15%';
|
||||
$table->size[4] = '8%';
|
||||
$table->size[6] = '90px';
|
||||
$table->size[6] = '120px';
|
||||
$table->size[7] = '30px';
|
||||
|
||||
$table->head[0] = '<span title="'.__('Position').'">'.__('P.').'</span>';
|
||||
|
@ -1,4 +1,22 @@
|
||||
<script type="text/javascript">
|
||||
|
||||
function dialog_message(message_id) {
|
||||
$(message_id)
|
||||
.css("display", "inline")
|
||||
.dialog({
|
||||
modal: true,
|
||||
show: "blind",
|
||||
hide: "blind",
|
||||
width: "400px",
|
||||
buttons: {
|
||||
Close: function() {
|
||||
$(this).dialog("close");
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
function check_all_checkboxes() {
|
||||
if ($("input[name=all_delete]").prop("checked")) {
|
||||
$(".check_delete").prop("checked", true);
|
||||
@ -578,7 +596,7 @@ switch ($action) {
|
||||
break;
|
||||
}
|
||||
|
||||
if (! $delete) {
|
||||
if (! $delete && !empty($type_access_selected)) {
|
||||
db_pandora_audit(
|
||||
'ACL Violation',
|
||||
'Trying to access report builder deletion'
|
||||
@ -1890,6 +1908,11 @@ switch ($action) {
|
||||
$values['id_agent'] = get_parameter('group');
|
||||
}
|
||||
|
||||
if ($values['type'] = 'sumatory') {
|
||||
$values['uncompressed_module'] = get_parameter('uncompressed_module', 0);
|
||||
}
|
||||
|
||||
|
||||
$values['header_definition'] = get_parameter('header');
|
||||
$values['column_separator'] = get_parameter('field');
|
||||
$values['line_separator'] = get_parameter('line');
|
||||
@ -2446,6 +2469,10 @@ switch ($action) {
|
||||
$values['id_agent'] = get_parameter('group');
|
||||
}
|
||||
|
||||
if ($values['type'] = 'sumatory') {
|
||||
$values['uncompressed_module'] = get_parameter('uncompressed_module', 0);
|
||||
}
|
||||
|
||||
$values['header_definition'] = get_parameter('header');
|
||||
$values['column_separator'] = get_parameter('field');
|
||||
$values['line_separator'] = get_parameter('line');
|
||||
|
@ -107,7 +107,7 @@ $table->data = [];
|
||||
$table->data[0][0] = '<strong>'.__('Customer key').'</strong>';
|
||||
$table->data[0][1] = html_print_textarea('keys[customer_key]', 10, 255, $settings->customer_key, 'style="height:50px; width:450px;"', true);
|
||||
|
||||
$table->data[1][0] = '<strong>'.__('Expires').'</strong>';
|
||||
$table->data[1][0] = '<strong>'.__($license['expiry_caption']).'</strong>';
|
||||
$table->data[1][1] = html_print_input_text('expires', $license['expiry_date'], '', 10, 255, true, true);
|
||||
|
||||
$table->data[2][0] = '<strong>'.__('Platform Limit').'</strong>';
|
||||
|
@ -100,7 +100,15 @@ if ($update_filter > -2) {
|
||||
'filter' => $filter,
|
||||
'unified_filters_id' => $new_unified_id,
|
||||
];
|
||||
if ($values['description'] == '') {
|
||||
$result = false;
|
||||
$msg = __('Description is empty');
|
||||
} else if ($values['filter'] == '') {
|
||||
$result = false;
|
||||
$msg = __('Filter is empty');
|
||||
} else {
|
||||
$result = db_process_sql_insert('tsnmp_filter', $values);
|
||||
}
|
||||
} else {
|
||||
for ($i = 0; $i < $index_post; $i++) {
|
||||
$filter = get_parameter('filter_'.$i);
|
||||
@ -109,12 +117,28 @@ if ($update_filter > -2) {
|
||||
'filter' => $filter,
|
||||
'unified_filters_id' => $new_unified_id,
|
||||
];
|
||||
$result = db_process_sql_insert('tsnmp_filter', $values);
|
||||
if ($values['filter'] != '' && $values['description'] != '') {
|
||||
$result = db_process_sql_insert('tsnmp_filter', $values);
|
||||
}
|
||||
}
|
||||
|
||||
if ($result === null) {
|
||||
if ($values['description'] != '') {
|
||||
$result = false;
|
||||
$msg = __('Filters are empty');
|
||||
} else {
|
||||
$result = false;
|
||||
$msg = __('Description is empty');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ($result === false) {
|
||||
ui_print_error_message(__('There was a problem creating the filter'));
|
||||
if (!isset($msg)) {
|
||||
$msg = __('There was a problem creating the filter');
|
||||
}
|
||||
|
||||
ui_print_error_message($msg);
|
||||
} else {
|
||||
ui_print_success_message(__('Successfully created'));
|
||||
}
|
||||
@ -215,8 +239,10 @@ if ($edit_filter > -2) {
|
||||
$result_unified = db_get_all_rows_sql('SELECT DISTINCT(unified_filters_id) FROM tsnmp_filter ORDER BY unified_filters_id ASC');
|
||||
|
||||
$aglomerate_result = [];
|
||||
foreach ($result_unified as $res) {
|
||||
$aglomerate_result[$res['unified_filters_id']] = db_get_all_rows_sql('SELECT * FROM tsnmp_filter WHERE unified_filters_id = '.$res['unified_filters_id'].' ORDER BY id_snmp_filter ASC');
|
||||
if (is_array($result_unified) === true) {
|
||||
foreach ($result_unified as $res) {
|
||||
$aglomerate_result[$res['unified_filters_id']] = db_get_all_rows_sql('SELECT * FROM tsnmp_filter WHERE unified_filters_id = '.$res['unified_filters_id'].' ORDER BY id_snmp_filter ASC');
|
||||
}
|
||||
}
|
||||
|
||||
$table = new stdClass();
|
||||
@ -282,7 +308,8 @@ if ($edit_filter > -2) {
|
||||
?>
|
||||
|
||||
<script type="text/javascript">
|
||||
var id = "<?php echo $index; ?>";
|
||||
// +1 because there is already a defined 'filter' field.
|
||||
var id = parseInt("<?php echo $index; ?>")+1;
|
||||
var homeurl = "<?php echo $config['homeurl']; ?>";
|
||||
|
||||
$(document).ready (function () {
|
||||
|
@ -31,6 +31,11 @@ global $config;
|
||||
|
||||
check_login();
|
||||
|
||||
if (!enterprise_installed()) {
|
||||
include 'general/noaccess.php';
|
||||
exit;
|
||||
}
|
||||
|
||||
if (! check_acl($config['id_user'], 0, 'PM')
|
||||
&& ! is_user_admin($config['id_user'])
|
||||
) {
|
||||
|
@ -30,19 +30,21 @@ if ($php_version_array[0] < 7) {
|
||||
|
||||
$tab = get_parameter('tab', 'online');
|
||||
|
||||
$buttons = [
|
||||
'setup' => [
|
||||
'active' => ($tab == 'setup') ? true : false,
|
||||
'text' => '<a href="index.php?sec=gsetup&sec2=godmode/update_manager/update_manager&tab=setup">'.html_print_image('images/gm_setup.png', true, ['title' => __('Options')]).'</a>',
|
||||
],
|
||||
'offline' => [
|
||||
$buttons['setup'] = [
|
||||
'active' => ($tab == 'setup') ? true : false,
|
||||
'text' => '<a href="index.php?sec=gsetup&sec2=godmode/update_manager/update_manager&tab=setup">'.html_print_image('images/gm_setup.png', true, ['title' => __('Options')]).'</a>',
|
||||
];
|
||||
|
||||
if (enterprise_installed()) {
|
||||
$buttons['offline'] = [
|
||||
'active' => ($tab == 'offline') ? true : false,
|
||||
'text' => '<a href="index.php?sec=gsetup&sec2=godmode/update_manager/update_manager&tab=offline">'.html_print_image('images/box.png', true, ['title' => __('Offline update manager')]).'</a>',
|
||||
],
|
||||
'online' => [
|
||||
'active' => ($tab == 'online') ? true : false,
|
||||
'text' => '<a href="index.php?sec=gsetup&sec2=godmode/update_manager/update_manager&tab=online">'.html_print_image('images/op_gis.png', true, ['title' => __('Online update manager')]).'</a>',
|
||||
],
|
||||
];
|
||||
}
|
||||
|
||||
$buttons['online'] = [
|
||||
'active' => ($tab == 'online') ? true : false,
|
||||
'text' => '<a href="index.php?sec=gsetup&sec2=godmode/update_manager/update_manager&tab=online">'.html_print_image('images/op_gis.png', true, ['title' => __('Online update manager')]).'</a>',
|
||||
];
|
||||
|
||||
|
||||
|
@ -256,6 +256,52 @@ if ($create_user) {
|
||||
$password_confirm = '';
|
||||
$new_user = true;
|
||||
} else {
|
||||
$have_number = false;
|
||||
$have_simbols = false;
|
||||
if ($config['enable_pass_policy']) {
|
||||
if ($config['pass_needs_numbers']) {
|
||||
$nums = preg_match('/([[:alpha:]])*(\d)+(\w)*/', $password_confirm);
|
||||
if ($nums == 0) {
|
||||
ui_print_error_message(__('Password must contain numbers'));
|
||||
$user_info = $values;
|
||||
$password_new = '';
|
||||
$password_confirm = '';
|
||||
$new_user = true;
|
||||
} else {
|
||||
$have_number = true;
|
||||
}
|
||||
}
|
||||
|
||||
if ($config['pass_needs_symbols']) {
|
||||
$symbols = preg_match('/(\w)*(\W)+(\w)*/', $password_confirm);
|
||||
if ($symbols == 0) {
|
||||
ui_print_error_message(__('Password must contain symbols'));
|
||||
$user_info = $values;
|
||||
$password_new = '';
|
||||
$password_confirm = '';
|
||||
$new_user = true;
|
||||
} else {
|
||||
$have_simbols = true;
|
||||
}
|
||||
}
|
||||
|
||||
if ($config['pass_needs_symbols'] && $config['pass_needs_numbers']) {
|
||||
if ($have_number && $have_simbols) {
|
||||
$result = create_user($id, $password_new, $values);
|
||||
}
|
||||
} else if ($config['pass_needs_symbols'] && !$config['pass_needs_numbers']) {
|
||||
if ($have_simbols) {
|
||||
$result = create_user($id, $password_new, $values);
|
||||
}
|
||||
} else if (!$config['pass_needs_symbols'] && $config['pass_needs_numbers']) {
|
||||
if ($have_number) {
|
||||
$result = create_user($id, $password_new, $values);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$result = create_user($id, $password_new, $values);
|
||||
}
|
||||
|
||||
$info = '{"Id_user":"'.$values['id_user'].'","FullName":"'.$values['fullname'].'","Firstname":"'.$values['firstname'].'","Lastname":"'.$values['lastname'].'","Email":"'.$values['email'].'","Phone":"'.$values['phone'].'","Comments":"'.$values['comments'].'","Is_admin":"'.$values['is_admin'].'","Language":"'.$values['language'].'","Timezone":"'.$values['timezone'].'","Block size":"'.$values['block_size'].'"';
|
||||
|
||||
if ($isFunctionSkins !== ENTERPRISE_NOT_HOOK) {
|
||||
@ -264,7 +310,10 @@ if ($create_user) {
|
||||
$info .= '}';
|
||||
}
|
||||
|
||||
$result = create_user($id, $password_new, $values);
|
||||
$can_create = false;
|
||||
|
||||
|
||||
|
||||
if ($result) {
|
||||
$res = save_pass_history($id, $password_new);
|
||||
}
|
||||
@ -575,6 +624,10 @@ if ($delete_profile) {
|
||||
);
|
||||
}
|
||||
|
||||
if ($values) {
|
||||
$user_info = $values;
|
||||
}
|
||||
|
||||
$table = new stdClass();
|
||||
$table->id = 'user_configuration_table';
|
||||
$table->width = '100%';
|
||||
|
@ -159,10 +159,10 @@ if ($show_update_action_menu) {
|
||||
$id_action = (int) get_parameter('id_action');
|
||||
|
||||
$actions = alerts_get_alert_agent_module_actions($id_alert);
|
||||
$action_opction = db_get_row(
|
||||
$action_option = db_get_row(
|
||||
'talert_template_module_actions',
|
||||
'id_alert_template_module',
|
||||
$id_alert
|
||||
'id',
|
||||
$id_action
|
||||
);
|
||||
|
||||
$data .= '<form id="update_action-'.$alert['id'].'" method="post">';
|
||||
@ -242,7 +242,7 @@ if ($show_update_action_menu) {
|
||||
$data .= '<td class="datos">';
|
||||
$data .= html_print_input_text(
|
||||
'fires_min_ajax',
|
||||
$action_opction['fires_min'],
|
||||
$action_option['fires_min'],
|
||||
'',
|
||||
4,
|
||||
10,
|
||||
@ -251,7 +251,7 @@ if ($show_update_action_menu) {
|
||||
$data .= ' '.__('to').' ';
|
||||
$data .= html_print_input_text(
|
||||
'fires_max_ajax',
|
||||
$action_opction['fires_max'],
|
||||
$action_option['fires_max'],
|
||||
'',
|
||||
4,
|
||||
10,
|
||||
@ -266,7 +266,7 @@ if ($show_update_action_menu) {
|
||||
$data .= '<td class="datos2">';
|
||||
$data .= html_print_input_text(
|
||||
'module_action_threshold_ajax',
|
||||
$action_opction['module_action_threshold'],
|
||||
$action_option['module_action_threshold'],
|
||||
'',
|
||||
4,
|
||||
10,
|
||||
|
@ -292,7 +292,7 @@ if (check_login()) {
|
||||
|
||||
$data[] = [
|
||||
'ref' => $referencia,
|
||||
'data_custom_field' => $values['name_custom_fields'],
|
||||
'data_custom_field' => ui_bbcode_to_html($values['name_custom_fields']),
|
||||
'server' => $values['server_name'],
|
||||
'agent' => $agent,
|
||||
'IP' => $values['direccion'],
|
||||
|
@ -1290,12 +1290,14 @@ if ($get_extended_event) {
|
||||
|
||||
$details = events_page_details($event, $server);
|
||||
|
||||
if ($meta) {
|
||||
metaconsole_restore_db();
|
||||
}
|
||||
|
||||
if (events_has_extended_info($event['id_evento']) === true) {
|
||||
$related = events_page_related($event, $server);
|
||||
}
|
||||
|
||||
// Juanma (09/05/2014) Fix: Needs to reconnect to node, in previous funct
|
||||
// node connection was lost.
|
||||
if ($meta) {
|
||||
$server = metaconsole_get_connection_by_id($server_id);
|
||||
metaconsole_connect($server);
|
||||
@ -1574,7 +1576,6 @@ if ($get_list_events_agents) {
|
||||
$date_from = get_parameter('date_from');
|
||||
$date_to = get_parameter('date_to');
|
||||
$id_user = $config['id_user'];
|
||||
$server_id = get_parameter('server_id');
|
||||
|
||||
$returned_sql = events_sql_events_grouped_agents(
|
||||
$id_agent,
|
||||
@ -1810,4 +1811,3 @@ if ($get_events_fired) {
|
||||
|
||||
echo io_json_mb_encode($return);
|
||||
}
|
||||
|
||||
|
@ -1151,7 +1151,12 @@ if (check_login()) {
|
||||
}
|
||||
|
||||
$server_name = '';
|
||||
$data[8] .= "<a href='javascript: ".'show_module_detail_dialog('.$module['id_agente_modulo'].', '.$id_agente.', "'.$server_name.'", '.(0).', '.SECONDS_1DAY.', " '.modules_get_agentmodule_name($module['id_agente_modulo'])."\")'>".html_print_image('images/binary.png', true, ['border' => '0', 'alt' => '']).'</a>';
|
||||
|
||||
$modules_get_agentmodule_name = modules_get_agentmodule_name($module['id_agente_modulo']);
|
||||
// Escape the double quotes that may have the name of the module.
|
||||
$modules_get_agentmodule_name = str_replace('"', '\"', $modules_get_agentmodule_name);
|
||||
|
||||
$data[8] .= "<a href='javascript: ".'show_module_detail_dialog('.$module['id_agente_modulo'].', '.$id_agente.', "'.$server_name.'", '.(0).', '.SECONDS_1DAY.', " '.$modules_get_agentmodule_name."\")'>".html_print_image('images/binary.png', true, ['border' => '0', 'alt' => '']).'</a>';
|
||||
}
|
||||
|
||||
if ($module['estado'] == 3) {
|
||||
|
@ -727,7 +727,7 @@ class ConsoleSupervisor
|
||||
'type' => 'NOTIF.LICENSE.LIMITED',
|
||||
'title' => __('Limited mode.'),
|
||||
'message' => io_safe_output($config['limited_mode']),
|
||||
'url' => 'index.php?sec=gsetup&sec2=godmode/setup/license',
|
||||
'url' => ui_get_full_url('index.php?sec=gsetup&sec2=godmode/setup/license'),
|
||||
]
|
||||
);
|
||||
} else {
|
||||
@ -745,7 +745,7 @@ class ConsoleSupervisor
|
||||
'Your license will expire in %d days. Please, contact our sales department.',
|
||||
$days_to_expiry
|
||||
),
|
||||
'url' => 'index.php?sec=gsetup&sec2=godmode/setup/license',
|
||||
'url' => ui_get_full_url('index.php?sec=gsetup&sec2=godmode/setup/license'),
|
||||
]
|
||||
);
|
||||
} else if ($days_to_expiry < 0) {
|
||||
@ -755,7 +755,7 @@ class ConsoleSupervisor
|
||||
'type' => 'NOTIF.LICENSE.EXPIRATION',
|
||||
'title' => __('Expired license'),
|
||||
'message' => __('Your license has expired. Please, contact our sales department.'),
|
||||
'url' => 'index.php?sec=gsetup&sec2=godmode/setup/license',
|
||||
'url' => ui_get_full_url('index.php?sec=gsetup&sec2=godmode/setup/license'),
|
||||
]
|
||||
);
|
||||
return false;
|
||||
@ -832,7 +832,7 @@ class ConsoleSupervisor
|
||||
'Directory %s is not writable. Please, configure corresponding permissions.',
|
||||
$config['attachment_store']
|
||||
),
|
||||
'url' => 'index.php?sec=general&sec2=godmode/setup/setup§ion=general',
|
||||
'url' => ui_get_full_url('index.php?sec=general&sec2=godmode/setup/setup§ion=general'),
|
||||
]
|
||||
);
|
||||
return;
|
||||
@ -854,7 +854,7 @@ class ConsoleSupervisor
|
||||
'There are more than %d files in attachment, consider cleaning up attachment directory manually.',
|
||||
$config['num_files_attachment']
|
||||
),
|
||||
'url' => 'index.php?sec=general&sec2=godmode/setup/setup§ion=perf',
|
||||
'url' => ui_get_full_url('index.php?sec=general&sec2=godmode/setup/setup§ion=perf'),
|
||||
]
|
||||
);
|
||||
} else {
|
||||
@ -886,7 +886,7 @@ class ConsoleSupervisor
|
||||
'Remote configuration directory %s is not readable. Please, adjust configuration.',
|
||||
$config['remote_config']
|
||||
),
|
||||
'url' => 'index.php?sec=general&sec2=godmode/setup/setup§ion=general',
|
||||
'url' => ui_get_full_url('index.php?sec=general&sec2=godmode/setup/setup§ion=general'),
|
||||
]
|
||||
);
|
||||
return;
|
||||
@ -905,7 +905,7 @@ class ConsoleSupervisor
|
||||
'Remote configuration directory %s is not writable. Please, adjust configuration.',
|
||||
$config['remote_config'].'/conf'
|
||||
),
|
||||
'url' => 'index.php?sec=general&sec2=godmode/setup/setup§ion=general',
|
||||
'url' => ui_get_full_url('index.php?sec=general&sec2=godmode/setup/setup§ion=general'),
|
||||
]
|
||||
);
|
||||
} else {
|
||||
@ -923,7 +923,7 @@ class ConsoleSupervisor
|
||||
'Collections directory %s is not writable. Please, adjust configuration.',
|
||||
$config['remote_config'].'/collections'
|
||||
),
|
||||
'url' => 'index.php?sec=general&sec2=godmode/setup/setup§ion=general',
|
||||
'url' => ui_get_full_url('index.php?sec=general&sec2=godmode/setup/setup§ion=general'),
|
||||
]
|
||||
);
|
||||
} else {
|
||||
@ -941,7 +941,7 @@ class ConsoleSupervisor
|
||||
'MD5 directory %s is not writable. Please, adjust configuration.',
|
||||
$config['remote_config'].'/md5'
|
||||
),
|
||||
'url' => 'index.php?sec=general&sec2=godmode/setup/setup§ion=general',
|
||||
'url' => ui_get_full_url('index.php?sec=general&sec2=godmode/setup/setup§ion=general'),
|
||||
]
|
||||
);
|
||||
} else {
|
||||
@ -972,7 +972,7 @@ class ConsoleSupervisor
|
||||
$MAX_FILES_DATA_IN,
|
||||
$config['remote_config']
|
||||
),
|
||||
'url' => 'index.php?sec=general&sec2=godmode/setup/setup§ion=perf',
|
||||
'url' => ui_get_full_url('index.php?sec=general&sec2=godmode/setup/setup§ion=perf'),
|
||||
]
|
||||
);
|
||||
} else {
|
||||
@ -995,7 +995,7 @@ class ConsoleSupervisor
|
||||
$MAX_BADXML_FILES_DATA_IN,
|
||||
$config['remote_config']
|
||||
),
|
||||
'url' => 'index.php?sec=general&sec2=godmode/setup/setup§ion=perf',
|
||||
'url' => ui_get_full_url('index.php?sec=general&sec2=godmode/setup/setup§ion=perf'),
|
||||
]
|
||||
);
|
||||
} else {
|
||||
@ -1081,7 +1081,7 @@ class ConsoleSupervisor
|
||||
$modules_queued,
|
||||
$queue['queued_modules']
|
||||
),
|
||||
'url' => 'index.php?sec=gservers&sec2=godmode/servers/modificar_server&refr=60',
|
||||
'url' => ui_get_full_url('index.php?sec=gservers&sec2=godmode/servers/modificar_server&refr=60'),
|
||||
]
|
||||
);
|
||||
} else {
|
||||
@ -1191,7 +1191,7 @@ class ConsoleSupervisor
|
||||
'type' => 'NOTIF.SERVER.STATUS.'.$server['id_server'],
|
||||
'title' => $msg,
|
||||
'message' => $description,
|
||||
'url' => 'index.php?sec=gservers&sec2=godmode/servers/modificar_server&refr=60',
|
||||
'url' => ui_get_full_url('index.php?sec=gservers&sec2=godmode/servers/modificar_server&refr=60'),
|
||||
]
|
||||
);
|
||||
}
|
||||
@ -1499,7 +1499,7 @@ class ConsoleSupervisor
|
||||
'type' => 'NOTIF.HISTORYDB',
|
||||
'title' => __('Historical database not available'),
|
||||
'message' => __('Historical database is enabled, though not accessible with the current configuration.'),
|
||||
'url' => 'index.php?sec=general&sec2=godmode/setup/setup§ion=hist_db',
|
||||
'url' => ui_get_full_url('index.php?sec=general&sec2=godmode/setup/setup§ion=hist_db'),
|
||||
]
|
||||
);
|
||||
} else {
|
||||
@ -1546,7 +1546,7 @@ class ConsoleSupervisor
|
||||
'Your database hasn\'t been through maintenance for 48hrs. Please, check documentation on how to perform this maintenance process on %s and enable it as soon as possible.',
|
||||
io_safe_output(get_product_name())
|
||||
),
|
||||
'url' => 'index.php?sec=general&sec2=godmode/setup/setup§ion=perf',
|
||||
'url' => ui_get_full_url('index.php?sec=general&sec2=godmode/setup/setup§ion=perf'),
|
||||
]
|
||||
);
|
||||
} else {
|
||||
@ -1606,7 +1606,7 @@ class ConsoleSupervisor
|
||||
'Historical database maintenance problem.'
|
||||
),
|
||||
'message' => __('Your historical database hasn\'t been through maintenance for 48hrs. Please, check documentation on how to perform this maintenance process on %s and enable it as soon as possible.', get_product_name()),
|
||||
'url' => 'index.php?sec=general&sec2=godmode/setup/setup§ion=perf',
|
||||
'url' => ui_get_full_url('index.php?sec=general&sec2=godmode/setup/setup§ion=perf'),
|
||||
]
|
||||
);
|
||||
} else {
|
||||
@ -1645,7 +1645,7 @@ class ConsoleSupervisor
|
||||
'type' => 'NOTIF.HISTORYDB.MR',
|
||||
'title' => __('Historical database MR mismatch'),
|
||||
'message' => __('Your historical database is not using the same schema as the main DB. This could produce anomalies while storing historical data.'),
|
||||
'url' => 'index.php?sec=general&sec2=godmode/setup/setup§ion=hist_db',
|
||||
'url' => ui_get_full_url('index.php?sec=general&sec2=godmode/setup/setup§ion=hist_db'),
|
||||
]
|
||||
);
|
||||
} else {
|
||||
@ -1687,7 +1687,7 @@ class ConsoleSupervisor
|
||||
'type' => 'NOTIF.EXT.ELASTICSEARCH',
|
||||
'title' => __('Log collector cannot connect to ElasticSearch'),
|
||||
'message' => __('ElasticSearch is not available using current configuration.'),
|
||||
'url' => 'index.php?sec=general&sec2=godmode/setup/setup§ion=log',
|
||||
'url' => ui_get_full_url('index.php?sec=general&sec2=godmode/setup/setup§ion=log'),
|
||||
]
|
||||
);
|
||||
} else {
|
||||
@ -1757,7 +1757,7 @@ class ConsoleSupervisor
|
||||
'type' => 'NOTIF.METACONSOLE.DB_CONNECTION',
|
||||
'title' => __('Metaconsole DB is not available.'),
|
||||
'message' => __('Cannot connect with Metaconsole DB using current configuration.'),
|
||||
'url' => 'index.php?sec=general&sec2=godmode/setup/setup§ion=enterprise',
|
||||
'url' => ui_get_full_url('index.php?sec=general&sec2=godmode/setup/setup§ion=enterprise'),
|
||||
]
|
||||
);
|
||||
}
|
||||
@ -1786,7 +1786,7 @@ class ConsoleSupervisor
|
||||
'type' => 'NOTIF.DOWNTIME',
|
||||
'title' => __('Scheduled downtime running.'),
|
||||
'message' => __('A scheduled downtime is running. Some monitoring data won\'t be available while downtime is taking place.'),
|
||||
'url' => 'index.php?sec=gagente&sec2=godmode/agentes/planned_downtime.list',
|
||||
'url' => ui_get_full_url('index.php?sec=gagente&sec2=godmode/agentes/planned_downtime.list'),
|
||||
]
|
||||
);
|
||||
return;
|
||||
@ -1947,7 +1947,7 @@ class ConsoleSupervisor
|
||||
date('M j, G:i:s ', $next_downtime_begin),
|
||||
date('M j, G:i:s ', $next_downtime_end)
|
||||
),
|
||||
'url' => 'index.php?sec=gagente&sec2=godmode/agentes/planned_downtime.list',
|
||||
'url' => ui_get_full_url('index.php?sec=gagente&sec2=godmode/agentes/planned_downtime.list'),
|
||||
]
|
||||
);
|
||||
return;
|
||||
@ -2043,7 +2043,7 @@ class ConsoleSupervisor
|
||||
'type' => 'NOTIF.SECURITY.DEFAULT_PASSWORD',
|
||||
'title' => __('Default password for "Admin" user has not been changed'),
|
||||
'message' => __('Please, change the default password since it is a commonly reported vulnerability.'),
|
||||
'url' => 'index.php?sec=gusuarios&sec2=godmode/users/user_list',
|
||||
'url' => ui_get_full_url('index.php?sec=gusuarios&sec2=godmode/users/user_list'),
|
||||
]
|
||||
);
|
||||
} else {
|
||||
@ -2069,7 +2069,7 @@ class ConsoleSupervisor
|
||||
'type' => 'NOTIF.MISC.FONTPATH',
|
||||
'title' => __('Default font doesn\'t exist'),
|
||||
'message' => __('Your defined font doesn\'t exist or is not defined. Please, check font parameters in your config'),
|
||||
'url' => 'index.php?sec=gsetup&sec2=godmode/setup/setup§ion=vis',
|
||||
'url' => ui_get_full_url('index.php?sec=gsetup&sec2=godmode/setup/setup§ion=vis'),
|
||||
]
|
||||
);
|
||||
} else {
|
||||
@ -2096,7 +2096,7 @@ class ConsoleSupervisor
|
||||
'Your %s has the "develop_bypass" mode enabled. This is a developer mode and should be disabled in a production environment. This value is located in the main index.php file',
|
||||
get_product_name()
|
||||
),
|
||||
'url' => 'index.php',
|
||||
'url' => ui_get_full_url('index.php'),
|
||||
]
|
||||
);
|
||||
} else {
|
||||
@ -2119,7 +2119,7 @@ class ConsoleSupervisor
|
||||
'type' => 'NOTIF.MISC.EVENTSTORMPROTECTION',
|
||||
'title' => __('Event storm protection is enabled.'),
|
||||
'message' => __('Some events may get lost while this mode is enabled. The server must be restarted after altering this setting.'),
|
||||
'url' => 'index.php?sec=gsetup&sec2=godmode/setup/setup§ion=general',
|
||||
'url' => ui_get_full_url('index.php?sec=gsetup&sec2=godmode/setup/setup§ion=general'),
|
||||
]
|
||||
);
|
||||
} else {
|
||||
@ -2146,7 +2146,7 @@ class ConsoleSupervisor
|
||||
'type' => 'NOTIF.UPDATEMANAGER.OPENSETUP',
|
||||
'title' => __('Failed to retrieve updates, please configure utility'),
|
||||
'message' => $message,
|
||||
'url' => 'index.php?sec=gsetup&sec2=godmode/setup/setup§ion=general',
|
||||
'url' => ui_get_full_url('index.php?sec=gsetup&sec2=godmode/setup/setup§ion=general'),
|
||||
]
|
||||
);
|
||||
}
|
||||
@ -2165,8 +2165,8 @@ class ConsoleSupervisor
|
||||
'New %s Console update',
|
||||
get_product_name()
|
||||
),
|
||||
'message' => __('There is a new update available. Please<a style="font-weight:bold;" href="index.php?sec=gsetup&sec2=godmode/update_manager/update_manager&tab=online"> go to Administration:Setup:Update Manager</a> for more details.'),
|
||||
'url' => 'index.php?sec=gsetup&sec2=godmode/update_manager/update_manager&tab=online',
|
||||
'message' => __('There is a new update available. Please<a style="font-weight:bold;" href="'.ui_get_full_url('index.php?sec=gsetup&sec2=godmode/update_manager/update_manager&tab=online').'"> go to Administration:Setup:Update Manager</a> for more details.'),
|
||||
'url' => ui_get_full_url('index.php?sec=gsetup&sec2=godmode/update_manager/update_manager&tab=online'),
|
||||
]
|
||||
);
|
||||
} else {
|
||||
@ -2204,7 +2204,7 @@ class ConsoleSupervisor
|
||||
'There is one or more minor releases available. <a style="font-size:8pt;font-style:italic;" target="blank" href="%s">.About minor release update</a>.',
|
||||
$url
|
||||
),
|
||||
'url' => 'index.php?sec=messages&sec2=godmode/update_manager/update_manager&tab=online',
|
||||
'url' => ui_get_full_url('index.php?sec=messages&sec2=godmode/update_manager/update_manager&tab=online'),
|
||||
]
|
||||
);
|
||||
} else {
|
||||
@ -2253,7 +2253,7 @@ class ConsoleSupervisor
|
||||
'type' => 'NOTIF.CRON.CONFIGURED',
|
||||
'title' => __('DiscoveryConsoleTasks is not configured.'),
|
||||
'message' => __($message_conf_cron),
|
||||
'url' => 'index.php?sec=gservers&sec2=godmode/servers/discovery&wiz=tasklist',
|
||||
'url' => ui_get_full_url('index.php?sec=gservers&sec2=godmode/servers/discovery&wiz=tasklist'),
|
||||
]
|
||||
);
|
||||
} else {
|
||||
|
@ -20,7 +20,7 @@
|
||||
/**
|
||||
* Pandora build version and version
|
||||
*/
|
||||
$build_version = 'PC190821';
|
||||
$build_version = 'PC190919';
|
||||
$pandora_version = 'v7.0NG.738';
|
||||
|
||||
// Do not overwrite default timezone set if defined.
|
||||
|
@ -355,6 +355,12 @@ define('MODULE_PREDICTION_CLUSTER', 5);
|
||||
define('MODULE_PREDICTION_CLUSTER_AA', 6);
|
||||
define('MODULE_PREDICTION_CLUSTER_AP', 7);
|
||||
|
||||
// Type of Webserver Modules.
|
||||
define('MODULE_WEBSERVER_CHECK_LATENCY', 30);
|
||||
define('MODULE_WEBSERVER_CHECK_SERVER_RESPONSE', 31);
|
||||
define('MODULE_WEBSERVER_RETRIEVE_NUMERIC_DATA', 32);
|
||||
define('MODULE_WEBSERVER_RETRIEVE_STRING_DATA', 33);
|
||||
|
||||
// SNMP CONSTANTS.
|
||||
define('SNMP_DIR_MIBS', 'attachment/mibs');
|
||||
|
||||
|
@ -2684,7 +2684,7 @@ function can_user_access_node()
|
||||
|
||||
$userinfo = get_user_info($config['id_user']);
|
||||
|
||||
if (defined('METACONSOLE')) {
|
||||
if (is_metaconsole()) {
|
||||
return $userinfo['is_admin'] == 1 ? 1 : $userinfo['metaconsole_access_node'];
|
||||
} else {
|
||||
return 1;
|
||||
@ -2852,6 +2852,8 @@ function print_audit_csv($data)
|
||||
global $config;
|
||||
global $graphic_type;
|
||||
|
||||
$divider = html_entity_decode($config['csv_divider']);
|
||||
|
||||
if (!$data) {
|
||||
echo __('No data found to export');
|
||||
return 0;
|
||||
@ -2869,9 +2871,9 @@ function print_audit_csv($data)
|
||||
// BOM
|
||||
print pack('C*', 0xEF, 0xBB, 0xBF);
|
||||
|
||||
echo __('User').';'.__('Action').';'.__('Date').';'.__('Source IP').';'.__('Comments')."\n";
|
||||
echo __('User').$divider.__('Action').$divider.__('Date').$divider.__('Source IP').$divider.__('Comments')."\n";
|
||||
foreach ($data as $line) {
|
||||
echo io_safe_output($line['id_usuario']).';'.io_safe_output($line['accion']).';'.date($config['date_format'], $line['utimestamp']).';'.$line['ip_origen'].';'.io_safe_output($line['descripcion'])."\n";
|
||||
echo io_safe_output($line['id_usuario']).$divider.io_safe_output($line['accion']).$divider.io_safe_output(date($config['date_format'], $line['utimestamp'])).$divider.$line['ip_origen'].$divider.io_safe_output($line['descripcion'])."\n";
|
||||
}
|
||||
|
||||
exit;
|
||||
|
@ -878,9 +878,11 @@ function events_get_all(
|
||||
$agent_join_filters = [];
|
||||
$tagente_table = 'tagente';
|
||||
$tagente_field = 'id_agente';
|
||||
$conditionMetaconsole = '';
|
||||
if (is_metaconsole()) {
|
||||
$tagente_table = 'tmetaconsole_agent';
|
||||
$tagente_field = 'id_tagente';
|
||||
$conditionMetaconsole = ' AND ta.id_tmetaconsole_setup = te.server_id ';
|
||||
}
|
||||
|
||||
// Agent alias.
|
||||
@ -1214,12 +1216,12 @@ function events_get_all(
|
||||
|
||||
$server_join = '';
|
||||
if (is_metaconsole()) {
|
||||
$server_join = ' INNER JOIN tmetaconsole_setup ts
|
||||
ON ts.id = te.server_id AND ts.server_name = ta.server_name';
|
||||
$server_join = ' LEFT JOIN tmetaconsole_setup ts
|
||||
ON ts.id = te.server_id';
|
||||
if (!empty($filter['server_id'])) {
|
||||
$server_join = sprintf(
|
||||
' INNER JOIN tmetaconsole_setup ts
|
||||
ON ts.id = te.server_id AND ts.server_name = ta.server_name AND ts.id= %d',
|
||||
ON ts.id = te.server_id AND ts.id= %d',
|
||||
$filter['server_id']
|
||||
);
|
||||
}
|
||||
@ -1254,6 +1256,7 @@ function events_get_all(
|
||||
%s JOIN %s ta
|
||||
ON ta.%s = te.id_agente
|
||||
%s
|
||||
%s
|
||||
%s JOIN tgrupo tg
|
||||
ON te.id_grupo = tg.id_grupo
|
||||
%s
|
||||
@ -1273,6 +1276,7 @@ function events_get_all(
|
||||
$tagente_join,
|
||||
$tagente_table,
|
||||
$tagente_field,
|
||||
$conditionMetaconsole,
|
||||
join(' ', $agent_join_filters),
|
||||
$tgrupo_join,
|
||||
join(' ', $tgrupo_join_filters),
|
||||
@ -3165,7 +3169,7 @@ function events_get_event_filter_select($manage=true)
|
||||
} else {
|
||||
$user_groups = users_get_groups(
|
||||
$config['id_user'],
|
||||
'EW',
|
||||
'ER',
|
||||
users_can_manage_group_all(),
|
||||
true
|
||||
);
|
||||
@ -3883,7 +3887,7 @@ function events_page_details($event, $server='')
|
||||
global $config;
|
||||
|
||||
// If server is provided, get the hash parameters.
|
||||
if (!empty($server) && defined('METACONSOLE')) {
|
||||
if (!empty($server) && is_metaconsole()) {
|
||||
$hashdata = metaconsole_get_server_hashdata($server);
|
||||
$hashstring = '&loginhash=auto&loginhash_data='.$hashdata.'&loginhash_user='.str_rot13($config['id_user']);
|
||||
$serverstring = $server['server_url'].'/';
|
||||
@ -4185,10 +4189,6 @@ function events_page_details($event, $server='')
|
||||
|
||||
$details = '<div id="extended_event_details_page" class="extended_event_pages">'.html_print_table($table_details, true).'</div>';
|
||||
|
||||
if (!empty($server) && defined('METACONSOLE')) {
|
||||
metaconsole_restore_db();
|
||||
}
|
||||
|
||||
return $details;
|
||||
}
|
||||
|
||||
|
@ -3252,7 +3252,7 @@ function graph_events_validated($width=300, $height=200, $extra_filters=[], $met
|
||||
$config['fontpath'],
|
||||
$config['font_size'],
|
||||
1,
|
||||
false,
|
||||
'bottom',
|
||||
$colors
|
||||
);
|
||||
}
|
||||
@ -3553,7 +3553,9 @@ function grafico_eventos_usuario($width, $height)
|
||||
'',
|
||||
$water_mark,
|
||||
$config['fontpath'],
|
||||
$config['font_size']
|
||||
$config['font_size'],
|
||||
1,
|
||||
'bottom'
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -2471,7 +2471,7 @@ function html_print_image(
|
||||
|
||||
if (!is_readable($working_dir.'/enterprise/meta'.$src)) {
|
||||
if ($isExternalLink) {
|
||||
$src = ui_get_full_url($src);
|
||||
$src = ui_get_full_url($src, false, false, false);
|
||||
} else {
|
||||
$src = ui_get_full_url('../..'.$src);
|
||||
}
|
||||
|
@ -545,7 +545,6 @@ function menu_add_extras(&$menu)
|
||||
$menu_extra['estado']['sub']['godmode/snmpconsole/snmp_filters']['text'] = __('SNMP filters');
|
||||
$menu_extra['estado']['sub']['enterprise/godmode/snmpconsole/snmp_trap_editor']['text'] = __('SNMP trap editor');
|
||||
$menu_extra['estado']['sub']['snmpconsole']['sub2']['godmode/snmpconsole/snmp_trap_generator']['text'] = __('SNMP trap generator');
|
||||
|
||||
$menu_extra['estado']['sub']['snmpconsole']['sub2']['operation/snmpconsole/snmp_view']['text'] = __('SNMP console');
|
||||
|
||||
$menu_extra['workspace']['sub']['operation/incidents/incident_detail']['text'] = __('Manage incident');
|
||||
|
@ -3100,7 +3100,7 @@ function reporting_historical_data($report, $content)
|
||||
|
||||
$return['type'] = 'historical_data';
|
||||
$period = $content['period'];
|
||||
$date_limit = (time() - $period);
|
||||
$date_limit = ($report['datetime'] - $period);
|
||||
if (empty($content['name'])) {
|
||||
$content['name'] = __('Historical data');
|
||||
}
|
||||
@ -3169,7 +3169,7 @@ function reporting_historical_data($report, $content)
|
||||
FROM tagente_datos_string
|
||||
WHERE id_agente_modulo ='.$content['id_agent_module'].'
|
||||
AND utimestamp >'.$date_limit.'
|
||||
AND utimestamp <='.time(),
|
||||
AND utimestamp <='.$report['datetime'],
|
||||
true
|
||||
);
|
||||
break;
|
||||
@ -3180,7 +3180,7 @@ function reporting_historical_data($report, $content)
|
||||
FROM tagente_datos
|
||||
WHERE id_agente_modulo ='.$content['id_agent_module'].'
|
||||
AND utimestamp >'.$date_limit.'
|
||||
AND utimestamp <='.time(),
|
||||
AND utimestamp <='.$report['datetime'],
|
||||
true
|
||||
);
|
||||
break;
|
||||
@ -4785,12 +4785,10 @@ function reporting_value($report, $content, $type, $pdf=false)
|
||||
'period' => $content['period'],
|
||||
'width' => '600px',
|
||||
'pure' => false,
|
||||
// true
|
||||
'date' => $report['datetime'],
|
||||
'only_image' => $only_image,
|
||||
'homeurl' => ui_get_full_url(false, false, false, false),
|
||||
'ttl' => 1,
|
||||
// 2
|
||||
'type_graph' => $config['type_module_charts'],
|
||||
'time_interval' => $content['lapse'],
|
||||
'server_id' => $id_meta,
|
||||
@ -4800,323 +4798,104 @@ function reporting_value($report, $content, $type, $pdf=false)
|
||||
|
||||
switch ($type) {
|
||||
case 'max':
|
||||
if ($content['lapse_calc'] == 0) {
|
||||
$value = reporting_get_agentmodule_data_max(
|
||||
$content['id_agent_module'],
|
||||
$content['period'],
|
||||
$report['datetime']
|
||||
);
|
||||
if (!$config['simple_module_value']) {
|
||||
$formated_value = $value;
|
||||
} else {
|
||||
$formated_value = format_for_graph($value, $config['graph_precision']).' '.$unit;
|
||||
}
|
||||
} else {
|
||||
$value = '
|
||||
<table border="0" style="margin:0 auto;text-align:center;">
|
||||
<tr>
|
||||
<td width="400px;" height="20%;">';
|
||||
if ($content['visual_format'] == 1 || $content['visual_format'] == 2 || $content['visual_format'] == 3) {
|
||||
$value .= '
|
||||
<table style="width:90%;margin:0 auto;background-color:#eee;border: solid lightgray 1px;">
|
||||
<tr>
|
||||
<th style="padding:5px;background-color:#82b92e;">
|
||||
'.__('Agent').'
|
||||
</th>
|
||||
<th style="padding:5px;background-color:#82b92e;">
|
||||
'.__('Module').'
|
||||
</th>
|
||||
<th style="padding:5px;background-color:#82b92e;">
|
||||
'.__('Maximum').'
|
||||
</th>
|
||||
<tr>
|
||||
<td style="padding:5px;">
|
||||
'.$agent_name.'
|
||||
</td>
|
||||
<td style="padding:5px;">
|
||||
'.$module_name.'
|
||||
</td>
|
||||
<td style="padding:5px;">
|
||||
'.format_for_graph(reporting_get_agentmodule_data_max($content['id_agent_module'], $content['period'], $report['datetime']), $config['graph_precision']).' '.$unit.'
|
||||
</td>
|
||||
</tr>
|
||||
</table>';
|
||||
}
|
||||
|
||||
$value .= '
|
||||
</td>
|
||||
<td rowspan="2" width="150px">
|
||||
</td>
|
||||
<td rowspan="2">';
|
||||
|
||||
if ($content['visual_format'] == 2 || $content['visual_format'] == 3) {
|
||||
$params['force_interval'] = 'max_only';
|
||||
$value .= grafico_modulo_sparse($params);
|
||||
}
|
||||
|
||||
$value .= '
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>';
|
||||
|
||||
if ($content['visual_format'] == 1 || $content['visual_format'] == 3) {
|
||||
$value .= '
|
||||
<table style="width:90%;margin:0 auto;margin-top:30px;background-color:#eee;border: solid lightgray 1px;">
|
||||
<tr>
|
||||
<th style="padding:5px;background-color:#82b92e;">
|
||||
'.__('Lapse').'
|
||||
</th>
|
||||
<th style="padding:5px;background-color:#82b92e;">
|
||||
'.__('Maximum').'
|
||||
</th>
|
||||
</tr>
|
||||
<tr>';
|
||||
$time_begin = db_get_row_sql('select utimestamp from tagente_datos where id_agente_modulo ='.$content['id_agent_module'], true);
|
||||
$date_reference = getdate();
|
||||
|
||||
for ($i = $date_reference[0]; $i > ($date_reference[0] - $content['period']); $i -= $content['lapse']) {
|
||||
$value .= '<tr><td style="padding:5px;">'.date('Y-m-d H:i:s', ($i - $content['lapse'] + 1)).' to '.date('Y-m-d H:i:s', $i).'</td><td>';
|
||||
|
||||
if ($i > $time_begin['utimestamp']) {
|
||||
$value .= format_for_graph(
|
||||
reporting_get_agentmodule_data_max(
|
||||
$content['id_agent_module'],
|
||||
$content['lapse'],
|
||||
$i
|
||||
),
|
||||
$config['graph_precision']
|
||||
).' '.$unit.'</td></tr>';
|
||||
} else {
|
||||
$value .= 'N/A</td></tr>';
|
||||
}
|
||||
}
|
||||
|
||||
$value .= '</table>';
|
||||
}
|
||||
|
||||
$value .= '
|
||||
</td>
|
||||
</tr>
|
||||
</table>';
|
||||
|
||||
$formated_value = $value;
|
||||
}
|
||||
break;
|
||||
|
||||
case 'min':
|
||||
if ($content['lapse_calc'] == 0) {
|
||||
$value = reporting_get_agentmodule_data_min(
|
||||
$content['id_agent_module'],
|
||||
$content['period'],
|
||||
$report['datetime']
|
||||
);
|
||||
|
||||
if (!$config['simple_module_value']) {
|
||||
$formated_value = $value;
|
||||
} else {
|
||||
$formated_value = format_for_graph($value, $config['graph_precision']).' '.$unit;
|
||||
}
|
||||
} else {
|
||||
$value = '
|
||||
<table border="0" style="margin:0 auto;text-align:center;">
|
||||
<tr>
|
||||
<td width="400px;" height="20%;">';
|
||||
|
||||
if ($content['visual_format'] == 1 || $content['visual_format'] == 2 || $content['visual_format'] == 3) {
|
||||
$value .= '
|
||||
<table style="width:90%;margin:0 auto;background-color:#eee;border: solid lightgray 1px;">
|
||||
<tr>
|
||||
<th style="padding:5px;background-color:#82b92e;">
|
||||
'.__('Agent').'
|
||||
</th>
|
||||
<th style="padding:5px;background-color:#82b92e;">
|
||||
'.__('Module').'
|
||||
</th>
|
||||
<th style="padding:5px;background-color:#82b92e;">
|
||||
'.__('Minimum').'
|
||||
</th>
|
||||
<tr>
|
||||
<td style="padding:5px;">
|
||||
'.$agent_name.'
|
||||
</td>
|
||||
<td style="padding:5px;">
|
||||
'.$module_name.'
|
||||
</td>
|
||||
<td style="padding:5px;">
|
||||
'.format_for_graph(reporting_get_agentmodule_data_min($content['id_agent_module'], $content['period'], $report['datetime']), $config['graph_precision']).' '.$unit.'
|
||||
</td>
|
||||
</tr>
|
||||
</table>';
|
||||
}
|
||||
|
||||
$value .= '
|
||||
</td>
|
||||
<td rowspan="2" width="150px">
|
||||
</td>
|
||||
<td rowspan="2">';
|
||||
|
||||
if ($content['visual_format'] == 2 || $content['visual_format'] == 3) {
|
||||
$params['force_interval'] = 'min_only';
|
||||
$value .= grafico_modulo_sparse($params);
|
||||
}
|
||||
|
||||
$value .= '
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>';
|
||||
|
||||
if ($content['visual_format'] == 1 || $content['visual_format'] == 3) {
|
||||
$value .= '
|
||||
<table style="width:90%;margin:0 auto;margin-top:30px;background-color:#eee;border: solid lightgray 1px;">
|
||||
<tr>
|
||||
<th style="padding:5px;background-color:#82b92e;">
|
||||
'.__('Lapse').'
|
||||
</th>
|
||||
<th style="padding:5px;background-color:#82b92e;">
|
||||
'.__('Minimum').'
|
||||
</th>
|
||||
</tr>
|
||||
<tr>';
|
||||
$time_begin = db_get_row_sql('select utimestamp from tagente_datos where id_agente_modulo ='.$content['id_agent_module']);
|
||||
$date_reference = getdate();
|
||||
|
||||
for ($i = $date_reference[0]; $i > ($date_reference[0] - $content['period']); $i -= $content['lapse']) {
|
||||
$value .= '<tr><td style="padding:5px;">'.date('Y-m-d H:i:s', ($i - $content['lapse'] + 1)).' to '.date('Y-m-d H:i:s', $i).'</td><td>';
|
||||
|
||||
if ($i > $time_begin['utimestamp']) {
|
||||
$value .= format_for_graph(
|
||||
reporting_get_agentmodule_data_min(
|
||||
$content['id_agent_module'],
|
||||
$content['lapse'],
|
||||
$i
|
||||
),
|
||||
$config['graph_precision']
|
||||
).' '.$unit.'</td></tr>';
|
||||
} else {
|
||||
$value .= 'N/A</td></tr>';
|
||||
}
|
||||
}
|
||||
|
||||
$value .= '</table>';
|
||||
}
|
||||
|
||||
$value .= '
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</table>';
|
||||
|
||||
$formated_value = $value;
|
||||
}
|
||||
break;
|
||||
|
||||
case 'avg':
|
||||
if ($content['lapse_calc'] == 0) {
|
||||
$value = reporting_get_agentmodule_data_average(
|
||||
$content['id_agent_module'],
|
||||
$content['period'],
|
||||
$report['datetime']
|
||||
);
|
||||
switch ($type) {
|
||||
case 'max':
|
||||
$value = reporting_get_agentmodule_data_max(
|
||||
$content['id_agent_module'],
|
||||
$content['period'],
|
||||
$report['datetime']
|
||||
);
|
||||
break;
|
||||
|
||||
case 'min':
|
||||
$value = reporting_get_agentmodule_data_min(
|
||||
$content['id_agent_module'],
|
||||
$content['period'],
|
||||
$report['datetime']
|
||||
);
|
||||
break;
|
||||
|
||||
case 'avg':
|
||||
$value = reporting_get_agentmodule_data_average(
|
||||
$content['id_agent_module'],
|
||||
$content['period'],
|
||||
$report['datetime']
|
||||
);
|
||||
break;
|
||||
}
|
||||
|
||||
if (!$config['simple_module_value']) {
|
||||
$formated_value = $value;
|
||||
} else {
|
||||
$formated_value = format_for_graph($value, $config['graph_precision']).' '.$unit;
|
||||
}
|
||||
} else {
|
||||
$value = '
|
||||
<table border="0" style="margin:0 auto;text-align:center;">
|
||||
<tr>
|
||||
<td width="400px;" height="20%;">';
|
||||
$return['visual_format'] = $content['visual_format'];
|
||||
|
||||
if ($content['visual_format'] == 1 || $content['visual_format'] == 2 || $content['visual_format'] == 3) {
|
||||
$value .= '
|
||||
<table style="width:90%;margin:0 auto;background-color:#eee;border: solid lightgray 1px;">
|
||||
<tr>
|
||||
<th style="padding:5px;background-color:#82b92e;">
|
||||
'.__('Agent').'
|
||||
</th>
|
||||
<th style="padding:5px;background-color:#82b92e;">
|
||||
'.__('Module').'
|
||||
</th>
|
||||
<th style="padding:5px;background-color:#82b92e;">
|
||||
'.__('Average').'
|
||||
</th>
|
||||
<tr>
|
||||
<td style="padding:5px;">
|
||||
'.$agent_name.'
|
||||
</td>
|
||||
<td style="padding:5px;">
|
||||
'.$module_name.'
|
||||
</td>
|
||||
<td style="padding:5px;">
|
||||
'.format_for_graph(reporting_get_agentmodule_data_average($content['id_agent_module'], $content['period'], $report['datetime']), $config['graph_precision']).' '.$unit.'
|
||||
</td>
|
||||
</tr>
|
||||
</table>';
|
||||
switch ($type) {
|
||||
case 'max':
|
||||
$params['force_interval'] = 'max_only';
|
||||
$value = format_for_graph(reporting_get_agentmodule_data_max($content['id_agent_module'], $content['period'], $report['datetime']), $config['graph_precision']).' '.$unit;
|
||||
break;
|
||||
|
||||
case 'min':
|
||||
$params['force_interval'] = 'min_only';
|
||||
$value = format_for_graph(reporting_get_agentmodule_data_min($content['id_agent_module'], $content['period'], $report['datetime']), $config['graph_precision']).' '.$unit;
|
||||
break;
|
||||
|
||||
case 'avg':
|
||||
$params['force_interval'] = 'avg_only';
|
||||
$value = format_for_graph(reporting_get_agentmodule_data_average($content['id_agent_module'], $content['period'], $report['datetime']), $config['graph_precision']).' '.$unit;
|
||||
break;
|
||||
}
|
||||
|
||||
$value .= '
|
||||
</td>
|
||||
<td rowspan="2" width="150px">
|
||||
</td>
|
||||
<td rowspan="2">';
|
||||
if ($content['visual_format'] == 2 || $content['visual_format'] == 3) {
|
||||
$params['force_interval'] = 'avg_only';
|
||||
$value .= grafico_modulo_sparse($params);
|
||||
$return['data'][] = [
|
||||
__('Agent') => $agent_name,
|
||||
__('Module') => $module_name,
|
||||
__('Maximun') => $value,
|
||||
];
|
||||
|
||||
if ($content['visual_format'] != 1) {
|
||||
$graph = grafico_modulo_sparse($params);
|
||||
$return['data'][] = ['value' => $graph];
|
||||
}
|
||||
|
||||
$value .= '
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>';
|
||||
|
||||
if ($content['visual_format'] == 1 || $content['visual_format'] == 3) {
|
||||
$value .= '
|
||||
<table style="width:90%;margin:0 auto;margin-top:30px;background-color:#eee;border: solid lightgray 1px;">
|
||||
<tr>
|
||||
<th style="padding:5px;background-color:#82b92e;">
|
||||
'.__('Lapse').'
|
||||
</th>
|
||||
<th style="padding:5px;background-color:#82b92e;">
|
||||
'.__('Average').'
|
||||
</th>
|
||||
</tr>
|
||||
<tr>';
|
||||
$time_begin = db_get_row_sql('select utimestamp from tagente_datos where id_agente_modulo ='.$content['id_agent_module']);
|
||||
$date_reference = getdate();
|
||||
|
||||
for ($i = $date_reference[0]; $i > ($date_reference[0] - $content['period']); $i -= $content['lapse']) {
|
||||
$value .= '<tr><td style="padding:5px;">'.date('Y-m-d H:i:s', ($i - $content['lapse'] + 1)).' to '.date('Y-m-d H:i:s', $i).'</td><td>';
|
||||
if ($content['visual_format'] != 2) {
|
||||
$time_begin = db_get_row_sql('select utimestamp from tagente_datos where id_agente_modulo ='.$content['id_agent_module'], true);
|
||||
for ($i = $report['datetime']; $i > ($report['datetime'] - $content['period']); $i -= $content['lapse']) {
|
||||
$row = [];
|
||||
$row[__('Lapse')] = date('Y-m-d H:i:s', ($i - $content['lapse'] + 1)).' to '.date('Y-m-d H:i:s', $i);
|
||||
|
||||
if ($i > $time_begin['utimestamp']) {
|
||||
$value .= format_for_graph(
|
||||
reporting_get_agentmodule_data_average(
|
||||
$content['id_agent_module'],
|
||||
$content['lapse'],
|
||||
$i
|
||||
),
|
||||
$config['graph_precision']
|
||||
).' '.$unit.'</td></tr>';
|
||||
} else {
|
||||
$value .= 'N/A</td></tr>';
|
||||
}
|
||||
}
|
||||
switch ($type) {
|
||||
case 'max':
|
||||
$row[__('Maximun')] = format_for_graph(reporting_get_agentmodule_data_max($content['id_agent_module'], $content['lapse'], $i), $config['graph_precision']).' '.$unit;
|
||||
break;
|
||||
|
||||
$value .= '</table>';
|
||||
case 'min':
|
||||
$row[__('Maximun')] = format_for_graph(reporting_get_agentmodule_data_min($content['id_agent_module'], $content['lapse'], $i), $config['graph_precision']).' '.$unit;
|
||||
break;
|
||||
|
||||
case 'avg':
|
||||
$row[__('Maximun')] = format_for_graph(reporting_get_agentmodule_data_average($content['id_agent_module'], $content['lapse'], $i), $config['graph_precision']).' '.$unit;
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
$row[__('Maximun')] = 'N/A';
|
||||
}
|
||||
|
||||
$return['data'][] = $row;
|
||||
}
|
||||
}
|
||||
|
||||
$value .= '
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</table>';
|
||||
if ($config['metaconsole']) {
|
||||
metaconsole_restore_db();
|
||||
}
|
||||
|
||||
$formated_value = $value;
|
||||
return reporting_check_structure_content($return);
|
||||
}
|
||||
break;
|
||||
|
||||
@ -5124,7 +4903,8 @@ function reporting_value($report, $content, $type, $pdf=false)
|
||||
$value = reporting_get_agentmodule_data_sum(
|
||||
$content['id_agent_module'],
|
||||
$content['period'],
|
||||
$report['datetime']
|
||||
$report['datetime'],
|
||||
$content['uncompressed_module']
|
||||
);
|
||||
if (!$config['simple_module_value']) {
|
||||
$formated_value = $value;
|
||||
@ -5309,6 +5089,9 @@ function reporting_sql($report, $content)
|
||||
$sql = io_safe_output($content['external_source']);
|
||||
}
|
||||
|
||||
// Check if exist sql macro
|
||||
$sql = reporting_sql_macro($report, $sql);
|
||||
|
||||
// Do a security check on SQL coming from the user.
|
||||
$sql = check_sql($sql);
|
||||
|
||||
@ -10943,17 +10726,19 @@ function reporting_get_agentmodule_data_min($id_agent_module, $period=0, $date=0
|
||||
* @param int Agent module id to get the sumatory.
|
||||
* @param int Period of time to check (in seconds)
|
||||
* @param int Top date to check the values. Default current time.
|
||||
* @param boolean Show uncompressed data from module
|
||||
*
|
||||
* @return float The sumatory of the module values in the interval.
|
||||
*/
|
||||
function reporting_get_agentmodule_data_sum(
|
||||
$id_agent_module,
|
||||
$period=0,
|
||||
$date=0
|
||||
$date=0,
|
||||
$uncompressed_module=true
|
||||
) {
|
||||
global $config;
|
||||
|
||||
// Initialize variables
|
||||
// Initialize variables.
|
||||
if (empty($date)) {
|
||||
$date = get_system_time();
|
||||
}
|
||||
@ -10975,21 +10760,24 @@ function reporting_get_agentmodule_data_sum(
|
||||
$id_module_type
|
||||
);
|
||||
$module_interval = modules_get_interval($id_agent_module);
|
||||
$uncompressed_module = is_module_uncompressed($module_name);
|
||||
// Check if module must be compressed.
|
||||
if (!$uncompressed_module) {
|
||||
$uncompressed_module = is_module_uncompressed($module_name);
|
||||
}
|
||||
|
||||
// Wrong module type
|
||||
if (is_module_data_string($module_name)) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
// Incremental modules are treated differently
|
||||
// Incremental modules are treated differently.
|
||||
$module_inc = is_module_inc($module_name);
|
||||
|
||||
if ($uncompressed_module) {
|
||||
// Get module data
|
||||
if (!$uncompressed_module) {
|
||||
// Get module data.
|
||||
$interval_data = db_get_all_rows_sql(
|
||||
'
|
||||
SELECT * FROM tagente_datos
|
||||
SELECT * FROM tagente_datos
|
||||
WHERE id_agente_modulo = '.(int) $id_agent_module.'
|
||||
AND utimestamp > '.(int) $datelimit.'
|
||||
AND utimestamp < '.(int) $date.'
|
||||
@ -11010,7 +10798,7 @@ function reporting_get_agentmodule_data_sum(
|
||||
return false;
|
||||
}
|
||||
|
||||
// Set initial conditions
|
||||
// Set initial conditions.
|
||||
$total = 0;
|
||||
$partial_total = 0;
|
||||
$count_sum = 0;
|
||||
@ -11019,18 +10807,9 @@ function reporting_get_agentmodule_data_sum(
|
||||
$partial_total = 0;
|
||||
$count_sum = 0;
|
||||
|
||||
switch ($config['dbtype']) {
|
||||
case 'mysql':
|
||||
case 'postgresql':
|
||||
// Do none
|
||||
break;
|
||||
|
||||
case 'oracle':
|
||||
$data['datos'] = oracle_format_float_to_php($data['datos']);
|
||||
break;
|
||||
}
|
||||
|
||||
if (!$module_inc) {
|
||||
if (!$uncompressed_module) {
|
||||
$total += $data['datos'];
|
||||
} else if (!$module_inc) {
|
||||
foreach ($data['data'] as $val) {
|
||||
if (is_numeric($val['datos'])) {
|
||||
$partial_total += $val['datos'];
|
||||
@ -11042,7 +10821,7 @@ function reporting_get_agentmodule_data_sum(
|
||||
continue;
|
||||
}
|
||||
|
||||
$total += ($partial_total / $count_sum);
|
||||
$total += $partial_total;
|
||||
} else {
|
||||
$last = end($data['data']);
|
||||
$total += $last['datos'];
|
||||
@ -12080,6 +11859,28 @@ function reporting_label_macro($item, $label)
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Convert macro in sql string to value
|
||||
*
|
||||
* @param array $report
|
||||
* @param string $sql
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
function reporting_sql_macro(array $report, string $sql): string
|
||||
{
|
||||
if (preg_match('/_timefrom_/', $sql)) {
|
||||
$sql = str_replace(
|
||||
'_timefrom_',
|
||||
$report['datetime'],
|
||||
$sql
|
||||
);
|
||||
}
|
||||
|
||||
return $sql;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @brief Calculates the SLA compliance value given an sla array
|
||||
*
|
||||
|
@ -2532,7 +2532,7 @@ function reporting_html_monitor_report($table, $item, $mini, $pdf=0)
|
||||
true
|
||||
).' '.__('OK').': '.remove_right_zeros(
|
||||
number_format(
|
||||
$item['data']['ok']['formated_value'],
|
||||
$item['data']['ok']['value'],
|
||||
$config['graph_precision']
|
||||
)
|
||||
).' %</p>';
|
||||
@ -2543,7 +2543,7 @@ function reporting_html_monitor_report($table, $item, $mini, $pdf=0)
|
||||
true
|
||||
).' '.__('Not OK').': '.remove_right_zeros(
|
||||
number_format(
|
||||
$item['data']['fail']['formated_value'],
|
||||
$item['data']['fail']['value'],
|
||||
$config['graph_precision']
|
||||
)
|
||||
).' % '.'</p>';
|
||||
@ -2784,20 +2784,130 @@ function reporting_html_value(&$table, $item, $mini, $only_value=false, $check_e
|
||||
$font_size = '3';
|
||||
}
|
||||
|
||||
$table->colspan['data']['cell'] = 3;
|
||||
$table->cellstyle['data']['cell'] = 'text-align: left;';
|
||||
if (isset($item['visual_format']) && $item['visual_format'] != 0
|
||||
&& ($item['type'] == 'max_value' || $item['type'] == 'min_value' || $item['type'] == 'avg_value')
|
||||
) {
|
||||
$table2 = new stdClass();
|
||||
$table2->width = '100%';
|
||||
switch ($item['type']) {
|
||||
case 'max_value':
|
||||
$table2->head = [
|
||||
__('Agent'),
|
||||
__('Module'),
|
||||
__('Maximun'),
|
||||
];
|
||||
break;
|
||||
|
||||
$table->data['data']['cell'] = '<p style="font: bold '.$font_size.'em Arial, Sans-serif; color: #000000;">';
|
||||
case 'min_value':
|
||||
$table2->head = [
|
||||
__('Agent'),
|
||||
__('Module'),
|
||||
__('Minimun'),
|
||||
];
|
||||
break;
|
||||
|
||||
if ($check_empty && empty($item['data']['value'])) {
|
||||
$table->data['data']['cell'] .= __('Unknown');
|
||||
} else if ($only_value) {
|
||||
$table->data['data']['cell'] .= $item['data']['value'];
|
||||
case 'avg_value':
|
||||
$table2->head = [
|
||||
__('Agent'),
|
||||
__('Module'),
|
||||
__('Average'),
|
||||
];
|
||||
break;
|
||||
}
|
||||
|
||||
$table2->data = [];
|
||||
|
||||
$data = $item['data'][0];
|
||||
|
||||
$row = [
|
||||
$data[__('Agent')],
|
||||
$data[__('Module')],
|
||||
$data[__('Maximun')],
|
||||
];
|
||||
|
||||
$table2->data[] = $row;
|
||||
|
||||
$table2->title = $item['title'];
|
||||
$table2->titleclass = 'title_table_pdf';
|
||||
$table2->titlestyle = 'text-align:left;';
|
||||
$table->colspan[1][0] = 3;
|
||||
$table->colspan[2][0] = 3;
|
||||
$table->colspan[3][0] = 3;
|
||||
|
||||
array_push($table->data, html_print_table($table2, true));
|
||||
unset($item['data'][0]);
|
||||
|
||||
if ($item['visual_format'] != 1) {
|
||||
$value = $item['data'][1]['value'];
|
||||
array_push($table->data, $value);
|
||||
unset($item['data'][1]);
|
||||
}
|
||||
|
||||
if ($item['visual_format'] != 2) {
|
||||
$table1 = new stdClass();
|
||||
$table1->width = '100%';
|
||||
switch ($item['type']) {
|
||||
case 'max_value':
|
||||
$table1->head = [
|
||||
__('Lapse'),
|
||||
__('Maximun'),
|
||||
];
|
||||
break;
|
||||
|
||||
case 'min_value':
|
||||
$table1->head = [
|
||||
__('Lapse'),
|
||||
__('Minimun'),
|
||||
];
|
||||
break;
|
||||
|
||||
case 'avg_value':
|
||||
$table1->head = [
|
||||
__('Lapse'),
|
||||
__('Average'),
|
||||
];
|
||||
break;
|
||||
}
|
||||
|
||||
$table1->data = [];
|
||||
foreach ($item['data'] as $data) {
|
||||
if (!is_numeric($data[__('Maximun')])) {
|
||||
$row = [
|
||||
$data[__('Lapse')],
|
||||
$data[__('Maximun')],
|
||||
];
|
||||
} else {
|
||||
$row = [
|
||||
$data[__('Lapse')],
|
||||
remove_right_zeros(number_format($data[__('Maximun')], $config['graph_precision'])),
|
||||
];
|
||||
}
|
||||
|
||||
$table1->data[] = $row;
|
||||
}
|
||||
|
||||
$table1->title = $item['title'];
|
||||
$table1->titleclass = 'title_table_pdf';
|
||||
$table1->titlestyle = 'text-align:left;';
|
||||
|
||||
array_push($table->data, html_print_table($table1, true));
|
||||
}
|
||||
} else {
|
||||
$table->data['data']['cell'] .= $item['data']['formated_value'];
|
||||
}
|
||||
$table->colspan['data']['cell'] = 3;
|
||||
$table->cellstyle['data']['cell'] = 'text-align: left;';
|
||||
|
||||
$table->data['data']['cell'] .= '</p>';
|
||||
$table->data['data']['cell'] = '<p style="font: bold '.$font_size.'em Arial, Sans-serif; color: #000000;">';
|
||||
|
||||
if ($check_empty && empty($item['data']['value'])) {
|
||||
$table->data['data']['cell'] .= __('Unknown');
|
||||
} else if ($only_value) {
|
||||
$table->data['data']['cell'] .= $item['data']['value'];
|
||||
} else {
|
||||
$table->data['data']['cell'] .= $item['data']['formated_value'];
|
||||
}
|
||||
|
||||
$table->data['data']['cell'] .= '</p>';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -48,15 +48,16 @@ if (isset($config['homedir'])) {
|
||||
*/
|
||||
function ui_bbcode_to_html($text, $allowed_tags=['[url]'])
|
||||
{
|
||||
$return = $text;
|
||||
|
||||
if (array_search('[url]', $allowed_tags) !== false) {
|
||||
$return = preg_replace(
|
||||
'/\[url=([^\]]*)\]/',
|
||||
'<a target="_blank" rel="noopener noreferrer" href="$1">',
|
||||
$return
|
||||
);
|
||||
$return = str_replace('[/url]', '</a>', $return);
|
||||
// If link hasn't http, add it.
|
||||
if (preg_match('/https?:\/\//', $text)) {
|
||||
$html_bbcode = '<a target="_blank" rel="noopener noreferrer" href="$1">$2</a>';
|
||||
} else {
|
||||
$html_bbcode = '<a target="_blank" rel="noopener noreferrer" href="http://$1">$2</a>';
|
||||
}
|
||||
|
||||
// Replace bbcode format [url=www.example.org] String [/url] with or without http and slashes
|
||||
$return = preg_replace('/\[url(?|](((?:https?:\/\/)?[^[]+))|(?:=[\'"]?((?:https?:\/\/)?[^]]+?)[\'"]?)](.+?))\[\/url]/', $html_bbcode, $text);
|
||||
}
|
||||
|
||||
return $return;
|
||||
@ -1487,7 +1488,7 @@ function ui_require_javascript_file($name, $path='include/javascript/', $echo_ta
|
||||
$filename = $path.$name.'.js';
|
||||
|
||||
if ($echo_tag) {
|
||||
echo '<script type="text/javascript" src="'.ui_get_full_url(false, false, false, false).$filename.'"></script>';
|
||||
echo '<script type="text/javascript" src="'.ui_get_full_url($filename, false, false, false).'"></script>';
|
||||
return null;
|
||||
}
|
||||
|
||||
@ -1504,7 +1505,7 @@ function ui_require_javascript_file($name, $path='include/javascript/', $echo_ta
|
||||
return false;
|
||||
}
|
||||
|
||||
if (defined('METACONSOLE')) {
|
||||
if (is_metaconsole()) {
|
||||
$config['js'][$name] = '../../'.$filename;
|
||||
} else {
|
||||
$config['js'][$name] = $filename;
|
||||
@ -1794,7 +1795,7 @@ function ui_process_page_head($string, $bitfield)
|
||||
|
||||
array_push($loaded, $name);
|
||||
|
||||
$url_css = ui_get_full_url($filename);
|
||||
$url_css = ui_get_full_url($filename, false, false, false);
|
||||
$output .= '<link rel="stylesheet" href="'.$url_css.'" type="text/css" />'."\n\t";
|
||||
}
|
||||
|
||||
@ -1851,7 +1852,7 @@ function ui_process_page_head($string, $bitfield)
|
||||
|
||||
array_push($loaded, $name);
|
||||
|
||||
$url_js = ui_get_full_url($filename);
|
||||
$url_js = ui_get_full_url($filename, false, false, false);
|
||||
$output .= '<script type="text/javascript" src="'.$url_js.'"></script>'."\n\t";
|
||||
}
|
||||
|
||||
@ -1892,7 +1893,7 @@ function ui_process_page_head($string, $bitfield)
|
||||
|
||||
array_push($loaded, $name);
|
||||
|
||||
$url_js = ui_get_full_url($filename);
|
||||
$url_js = ui_get_full_url($filename, false, false, false);
|
||||
$output .= '<script type="text/javascript" src="'.$url_js.'"></script>'."\n\t";
|
||||
}
|
||||
|
||||
@ -2841,7 +2842,7 @@ function ui_progress(
|
||||
width_interval = '.$ajax['interval'].';
|
||||
if (last % 10 == 0) {
|
||||
$.post({
|
||||
url: "'.ui_get_full_url('ajax.php').'",
|
||||
url: "'.ui_get_full_url('ajax.php', false, false, false).'",
|
||||
data: {';
|
||||
if (is_array($ajax['data'])) {
|
||||
foreach ($ajax['data'] as $token => $value) {
|
||||
@ -3216,7 +3217,7 @@ function ui_print_datatable(array $parameters)
|
||||
],
|
||||
lengthMenu: '.json_encode($pagination_options).',
|
||||
ajax: {
|
||||
url: "'.ui_get_full_url('ajax.php').'",
|
||||
url: "'.ui_get_full_url('ajax.php', false, false, false).'",
|
||||
type: "POST",
|
||||
dataSrc: function (json) {
|
||||
if (json.error) {
|
||||
@ -3692,7 +3693,7 @@ function ui_get_url_refresh($params=false, $relative=true, $add_post=true)
|
||||
$url = htmlspecialchars($url);
|
||||
|
||||
if (! $relative) {
|
||||
return ui_get_full_url($url);
|
||||
return ui_get_full_url($url, false, false, false);
|
||||
}
|
||||
|
||||
return $url;
|
||||
@ -4444,6 +4445,10 @@ function ui_print_agent_autocomplete_input($parameters)
|
||||
$get_only_string_modules = true;
|
||||
}
|
||||
|
||||
if (isset($parameters['no_disabled_modules'])) {
|
||||
$no_disabled_modules = $parameters['no_disabled_modules'];
|
||||
}
|
||||
|
||||
$spinner_image = html_print_image('images/spinner.gif', true, false, true);
|
||||
if (isset($parameters['spinner_image'])) {
|
||||
$spinner_image = $parameters['spinner_image'];
|
||||
@ -4451,7 +4456,7 @@ function ui_print_agent_autocomplete_input($parameters)
|
||||
|
||||
// Javascript configurations
|
||||
// ------------------------------------------------------------------.
|
||||
$javascript_ajax_page = ui_get_full_url('ajax.php', false, false, false, false);
|
||||
$javascript_ajax_page = ui_get_full_url('ajax.php', false, false, false);
|
||||
// Default value.
|
||||
if (isset($parameters['javascript_ajax_page'])) {
|
||||
$javascript_ajax_page = $parameters['javascript_ajax_page'];
|
||||
@ -4591,7 +4596,11 @@ function ui_print_agent_autocomplete_input($parameters)
|
||||
if ('.((int) $get_only_string_modules).') {
|
||||
inputs.push ("get_only_string_modules=1");
|
||||
}
|
||||
|
||||
|
||||
if ('.((int) $no_disabled_modules).') {
|
||||
inputs.push ("disabled=0");
|
||||
}
|
||||
|
||||
if ('.((int) $metaconsole_enabled).') {
|
||||
if (('.((int) $use_input_server).')
|
||||
|| ('.((int) $print_input_server).')) {
|
||||
|
@ -3611,11 +3611,6 @@ function visual_map_print_visual_map(
|
||||
|
||||
global $config;
|
||||
|
||||
$metaconsole_hack = '/';
|
||||
if (defined('METACONSOLE')) {
|
||||
$metaconsole_hack = '../../';
|
||||
}
|
||||
|
||||
enterprise_include_once('meta/include/functions_ui_meta.php');
|
||||
|
||||
include_once $config['homedir'].'/include/functions_custom_graphs.php';
|
||||
@ -3681,11 +3676,11 @@ function visual_map_print_visual_map(
|
||||
$mapHeight = $layout['height'];
|
||||
$backgroundImage = '';
|
||||
if ($layout['background'] != 'None.png') {
|
||||
$backgroundImage = $metaconsole_hack.'images/console/background/'.$layout['background'];
|
||||
$backgroundImage = 'images/console/background/'.$layout['background'];
|
||||
}
|
||||
}
|
||||
|
||||
if (defined('METACONSOLE')) {
|
||||
if (is_metaconsole()) {
|
||||
echo "<div style='width: 100%; overflow:auto; margin: 0 auto; padding:5px;'>";
|
||||
}
|
||||
|
||||
@ -3698,7 +3693,7 @@ function visual_map_print_visual_map(
|
||||
background-color:'.$layout['background_color'].';">';
|
||||
|
||||
if ($layout['background'] != 'None.png') {
|
||||
echo "<img src='".ui_get_full_url($backgroundImage)."' width='100%' height='100%' />";
|
||||
echo "<img src='".ui_get_full_url($backgroundImage, false, false, false)."' width='100%' height='100%' />";
|
||||
}
|
||||
|
||||
$layout_datas = db_get_all_rows_field_filter(
|
||||
@ -3776,7 +3771,7 @@ function visual_map_print_visual_map(
|
||||
// End main div
|
||||
echo '</div></div>';
|
||||
|
||||
if (defined('METACONSOLE')) {
|
||||
if (is_metaconsole()) {
|
||||
echo '</div>';
|
||||
}
|
||||
}
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -1,4 +1,5 @@
|
||||
/* global $ */
|
||||
/* exported pandoraFlotPie, pandoraFlotPieCustom */
|
||||
|
||||
function pandoraFlotPie(
|
||||
graph_id,
|
||||
@ -14,7 +15,7 @@ function pandoraFlotPie(
|
||||
colors,
|
||||
hide_labels
|
||||
) {
|
||||
var labels = labels.split(separator);
|
||||
labels = labels.split(separator);
|
||||
var data = values.split(separator);
|
||||
|
||||
if (colors != "") {
|
||||
@ -92,7 +93,7 @@ function pandoraFlotPie(
|
||||
function pieHover(event, pos, obj) {
|
||||
if (!obj) return;
|
||||
|
||||
index = obj.seriesIndex;
|
||||
var index = obj.seriesIndex;
|
||||
legends.css("color", "#3F3F3D");
|
||||
legends.eq(index).css("color", "");
|
||||
}
|
||||
@ -144,21 +145,14 @@ function pandoraFlotPieCustom(
|
||||
.pop()
|
||||
.split(".")
|
||||
.shift();
|
||||
var labels = labels.split(separator);
|
||||
var legend = legend.split(separator);
|
||||
labels = labels.split(separator);
|
||||
legend = legend.split(separator);
|
||||
var data = values.split(separator);
|
||||
var no_data = 0;
|
||||
if (colors != "") {
|
||||
colors = colors.split(separator);
|
||||
}
|
||||
var colors_data = [
|
||||
"#e63c52",
|
||||
"#FFA631",
|
||||
"#f3b200",
|
||||
"#5BB6E5",
|
||||
"#F2919D",
|
||||
"#82b92e"
|
||||
];
|
||||
|
||||
var color = null;
|
||||
for (var i = 0; i < data.length; i++) {
|
||||
if (colors != "") {
|
||||
@ -174,28 +168,31 @@ function pandoraFlotPieCustom(
|
||||
|
||||
if (width <= 450) {
|
||||
show_legend = false;
|
||||
label_conf = {
|
||||
show: false
|
||||
};
|
||||
} else {
|
||||
label_conf = {
|
||||
show: true,
|
||||
radius: 0.75,
|
||||
radius: 5 / 8,
|
||||
formatter: function(label, series) {
|
||||
console.log(series);
|
||||
return (
|
||||
'<div style="font-size:' +
|
||||
font_size +
|
||||
"pt;" +
|
||||
'text-align:center;padding:2px;color:white;">' +
|
||||
series.percent.toFixed(2) +
|
||||
"%</div>"
|
||||
"pt; font-weight:bolder;" +
|
||||
"text-align:center;padding:2px;color:rgb(63, 63, 61)" +
|
||||
'">' +
|
||||
label +
|
||||
":<br>" +
|
||||
series.data[0][1] +
|
||||
"</div>"
|
||||
);
|
||||
},
|
||||
background: {
|
||||
opacity: 0.5,
|
||||
color: ""
|
||||
opacity: 0.5
|
||||
}
|
||||
};
|
||||
} else {
|
||||
label_conf = {
|
||||
show: false
|
||||
};
|
||||
}
|
||||
|
||||
var conf_pie = {
|
||||
@ -203,8 +200,8 @@ function pandoraFlotPieCustom(
|
||||
pie: {
|
||||
show: true,
|
||||
radius: 3 / 4,
|
||||
innerRadius: 0.4
|
||||
//label: label_conf
|
||||
innerRadius: 0.4,
|
||||
label: label_conf
|
||||
}
|
||||
},
|
||||
legend: {
|
||||
@ -234,7 +231,7 @@ function pandoraFlotPieCustom(
|
||||
var legends = $("#" + graph_id + " .legendLabel");
|
||||
var j = 0;
|
||||
legends.each(function() {
|
||||
//$(this).css('width', $(this).width());
|
||||
//$(this).css("width", $(this).width());
|
||||
$(this).css("font-size", font_size + "pt");
|
||||
$(this).removeClass("legendLabel");
|
||||
$(this).addClass(font);
|
||||
@ -264,19 +261,6 @@ function pandoraFlotPieCustom(
|
||||
return false;
|
||||
});
|
||||
|
||||
var pielegends = $("#" + graph_id + " .pieLabelBackground");
|
||||
pielegends.each(function() {
|
||||
$(this)
|
||||
.css("transform", "rotate(-35deg)")
|
||||
.css("color", "black");
|
||||
});
|
||||
var labelpielegends = $("#" + graph_id + " .pieLabel");
|
||||
labelpielegends.each(function() {
|
||||
$(this)
|
||||
.css("transform", "rotate(-35deg)")
|
||||
.css("color", "black");
|
||||
});
|
||||
|
||||
// Events
|
||||
$("#" + graph_id).bind("plothover", pieHover);
|
||||
$("#" + graph_id).bind("plotclick", Clickpie);
|
||||
@ -287,16 +271,17 @@ function pandoraFlotPieCustom(
|
||||
function pieHover(event, pos, obj) {
|
||||
if (!obj) return;
|
||||
|
||||
index = obj.seriesIndex;
|
||||
var index = obj.seriesIndex;
|
||||
legends.css("color", "#3F3F3D");
|
||||
legends.eq(index).css("color", "");
|
||||
}
|
||||
|
||||
function Clickpie(event, pos, obj) {
|
||||
if (!obj) return;
|
||||
percent = parseFloat(obj.series.percent).toFixed(2);
|
||||
valor = parseFloat(obj.series.data[0][1]);
|
||||
var percent = parseFloat(obj.series.percent).toFixed(2);
|
||||
var valor = parseFloat(obj.series.data[0][1]);
|
||||
|
||||
var value = "";
|
||||
if (valor > 1000000) {
|
||||
value = Math.round((valor / 1000000) * 100) / 100;
|
||||
value = value + "M";
|
||||
@ -325,42 +310,6 @@ function pandoraFlotPieCustom(
|
||||
$("#watermark_image_" + graph_id).attr("src")
|
||||
);
|
||||
}
|
||||
/*
|
||||
window.onresize = function(event) {
|
||||
$.plot($('#' + graph_id), data, conf_pie);
|
||||
if (no_data == data.length) {
|
||||
$('#'+graph_id+' .overlay').remove();
|
||||
$('#'+graph_id+' .base').remove();
|
||||
$('#'+graph_id).prepend("<img style='width:50%;' src='images/no_data_toshow.png' />");
|
||||
}
|
||||
var legends = $('#'+graph_id+' .legendLabel');
|
||||
var j = 0;
|
||||
legends.each(function () {
|
||||
//$(this).css('width', $(this).width());
|
||||
$(this).css('font-size', font_size+'pt');
|
||||
$(this).removeClass("legendLabel");
|
||||
$(this).addClass(font);
|
||||
$(this).text(legend[j]);
|
||||
j++;
|
||||
});
|
||||
|
||||
if ($('input[name="custom_graph"]').val()) {
|
||||
$('.legend>div').css('right',($('.legend>div').height()*-1));
|
||||
$('.legend>table').css('right',($('.legend>div').height()*-1));
|
||||
}
|
||||
//$('.legend>table').css('border',"1px solid #E2E2E2");
|
||||
$('.legend>table').css('background-color',"transparent");
|
||||
|
||||
var pielegends = $('#'+graph_id+' .pieLabelBackground');
|
||||
pielegends.each(function () {
|
||||
$(this).css('transform', "rotate(-35deg)").css('color', 'black');
|
||||
});
|
||||
var labelpielegends = $('#'+graph_id+' .pieLabel');
|
||||
labelpielegends.each(function () {
|
||||
$(this).css('transform', "rotate(-35deg)").css('color', 'black');
|
||||
});
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
function pandoraFlotHBars(
|
||||
|
@ -24,7 +24,7 @@ function include_javascript_dependencies_flot_graph($return=false)
|
||||
$is_include_javascript = true;
|
||||
|
||||
$metaconsole_hack = '';
|
||||
if (defined('METACONSOLE')) {
|
||||
if (is_metaconsole()) {
|
||||
$metaconsole_hack = '../../';
|
||||
}
|
||||
|
||||
|
@ -91,6 +91,11 @@ function pandora_session_write($session_id, $data)
|
||||
{
|
||||
$session_id = addslashes($session_id);
|
||||
|
||||
// If it's an api call, the session must not be created.
|
||||
if (get_parameter('op', false) && get_parameter('op2', false)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (is_ajax()) {
|
||||
// Avoid session upadte while processing ajax responses - notifications.
|
||||
if (get_parameter('check_new_notifications', false)) {
|
||||
@ -159,7 +164,26 @@ function pandora_session_gc($max_lifetime=300)
|
||||
global $config;
|
||||
|
||||
if (isset($config['session_timeout'])) {
|
||||
$max_lifetime = $config['session_timeout'];
|
||||
$session_timeout = $config['session_timeout'];
|
||||
} else {
|
||||
// if $config doesn`t work ...
|
||||
$session_timeout = db_get_value(
|
||||
'value',
|
||||
'tconfig',
|
||||
'token',
|
||||
'session_timeout'
|
||||
);
|
||||
}
|
||||
|
||||
if (!empty($session_timeout)) {
|
||||
if ($session_timeout == -1) {
|
||||
// The session expires in 10 years
|
||||
$session_timeout = 315576000;
|
||||
} else {
|
||||
$session_timeout *= 60;
|
||||
}
|
||||
|
||||
$max_lifetime = $session_timeout;
|
||||
}
|
||||
|
||||
$time_limit = (time() - $max_lifetime);
|
||||
@ -171,6 +195,11 @@ function pandora_session_gc($max_lifetime=300)
|
||||
]
|
||||
);
|
||||
|
||||
// Deleting cron and empty sessions.
|
||||
$sql = "DELETE FROM tsessions_php WHERE
|
||||
data IS NULL OR id_session REGEXP '^cron-'";
|
||||
db_process_sql($sql);
|
||||
|
||||
return $retval;
|
||||
}
|
||||
|
||||
|
@ -291,21 +291,9 @@ final class Group extends Item
|
||||
$width = (int) $data['width'];
|
||||
$height = (int) $data['height'];
|
||||
if ($width === 0 || $height === 0) {
|
||||
// TODO: This will be the default behaviour after we finish the
|
||||
// builder. Don't delete this code.
|
||||
// $sizeImage = getimagesize($config['homedir'].'/'.$imagePath);
|
||||
// $data['width'] = $sizeImage[0];
|
||||
// $data['height'] = $sizeImage[1];
|
||||
$sizeImage = getimagesize($config['homedir'].'/'.$imagePath);
|
||||
$imageHeight = $sizeImage[1];
|
||||
|
||||
if ($width === 0) {
|
||||
$data['width'] = 70;
|
||||
}
|
||||
|
||||
if ($height === 0) {
|
||||
$data['height'] = ($imageHeight > 70) ? 70 : $imageHeight;
|
||||
}
|
||||
$data['width'] = $sizeImage[0];
|
||||
$data['height'] = $sizeImage[1];
|
||||
}
|
||||
|
||||
$data['html'] = '<img src="'.$data['statusImageSrc'].'">';
|
||||
|
@ -120,21 +120,9 @@ final class Icon extends Item
|
||||
$width = (int) $data['width'];
|
||||
$height = (int) $data['height'];
|
||||
if ($width === 0 || $height === 0) {
|
||||
// TODO: This will be the default behaviour after we finish the
|
||||
// builder. Don't delete this code.
|
||||
// $sizeImage = getimagesize($config['homedir'].'/'.$imagePath);
|
||||
// $data['width'] = $sizeImage[0];
|
||||
// $data['height'] = $sizeImage[1];
|
||||
$sizeImage = getimagesize($config['homedir'].'/'.$imagePath);
|
||||
$imageHeight = $sizeImage[1];
|
||||
|
||||
if ($width === 0) {
|
||||
$data['width'] = 70;
|
||||
}
|
||||
|
||||
if ($height === 0) {
|
||||
$data['height'] = ($imageHeight > 70) ? 70 : $imageHeight;
|
||||
}
|
||||
$data['width'] = $sizeImage[0];
|
||||
$data['height'] = $sizeImage[1];
|
||||
}
|
||||
|
||||
return $data;
|
||||
|
@ -184,23 +184,9 @@ final class StaticGraph extends Item
|
||||
$width = (int) $data['width'];
|
||||
$height = (int) $data['height'];
|
||||
if ($width === 0 || $height === 0) {
|
||||
// TODO: This will be the default behaviour after we finish the
|
||||
// builder. Don't delete this code.
|
||||
// $sizeImage = getimagesize($config['homedir'].'/'.$imagePath);
|
||||
// $data['width'] = $sizeImage[0];
|
||||
// $data['height'] = $sizeImage[1];
|
||||
// Default value. Will be replaced by a dynamic image size
|
||||
// calculation after the phase 3.
|
||||
$sizeImage = getimagesize($config['homedir'].'/'.$imagePath);
|
||||
$imageHeight = $sizeImage[1];
|
||||
|
||||
if ($width === 0) {
|
||||
$data['width'] = 70;
|
||||
}
|
||||
|
||||
if ($height === 0) {
|
||||
$data['height'] = ($imageHeight > 70) ? 70 : $imageHeight;
|
||||
}
|
||||
$data['width'] = $sizeImage[0];
|
||||
$data['height'] = $sizeImage[1];
|
||||
}
|
||||
|
||||
// Get last value.
|
||||
|
@ -27,6 +27,10 @@
|
||||
* GNU General Public License for more details.
|
||||
* ============================================================================
|
||||
*/
|
||||
table {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
table.header_table {
|
||||
width: 100%;
|
||||
}
|
||||
|
@ -392,3 +392,11 @@ div#box_online * {
|
||||
#text_wizard {
|
||||
color: #555;
|
||||
}
|
||||
|
||||
div#code_license_dialog div#code,
|
||||
div#form_activate_licence #code {
|
||||
margin-top: 20px;
|
||||
margin-bottom: 20px;
|
||||
border: 0px;
|
||||
background-color: #222;
|
||||
}
|
||||
|
@ -129,7 +129,7 @@
|
||||
<div style='height: 10px'>
|
||||
<?php
|
||||
$version = '7.0NG.738';
|
||||
$build = '190821';
|
||||
$build = '190919';
|
||||
$banner = "v$version Build $build";
|
||||
|
||||
error_reporting(0);
|
||||
|
@ -624,6 +624,13 @@ if (empty($agents)) {
|
||||
$agents = [];
|
||||
}
|
||||
|
||||
$agent_font_size = 'font-size: 7px';
|
||||
$description_font_size = 'font-size: 6.5px';
|
||||
if ($config['language'] == 'ja' || $config['language'] == 'zh_CN' || $own_info['language'] == 'ja' || $own_info['language'] == 'zh_CN') {
|
||||
$agent_font_size = 'font-size: 15px';
|
||||
$description_font_size = 'font-size: 11px';
|
||||
}
|
||||
|
||||
// Urls to sort the table.
|
||||
$url_up_agente = 'index.php?sec=view&sec2=operation/agentes/estado_agente&refr='.$refr.'&offset='.$offset.'&group_id='.$group_id.'&recursion='.$recursion.'&search='.$search.'&status='.$status.'&sort_field=name&sort=up';
|
||||
$url_down_agente = 'index.php?sec=view&sec2=operation/agentes/estado_agente&refr='.$refr.'&offset='.$offset.'&group_id='.$group_id.'&recursion='.$recursion.'&search='.$search.'&status='.$status.'&sort_field=name&sort=down';
|
||||
@ -739,7 +746,7 @@ foreach ($agents as $agent) {
|
||||
$data[0] = '<div class="left_'.$agent['id_agente'].'">';
|
||||
$data[0] .= '<span>';
|
||||
|
||||
$data[0] .= '<a href="index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente='.$agent['id_agente'].'"> <span style="font-size: 7pt;font-weight:bold" title ="'.$agent['nombre'].'">'.$agent['alias'].'</span></a>';
|
||||
$data[0] .= '<a href="index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente='.$agent['id_agente'].'"> <span style="'.$agent_font_size.';font-weight:bold" title ="'.$agent['nombre'].'">'.$agent['alias'].'</span></a>';
|
||||
$data[0] .= '</span>';
|
||||
|
||||
if ($agent['quiet']) {
|
||||
@ -772,7 +779,7 @@ foreach ($agents as $agent) {
|
||||
|
||||
$data[0] .= '</div></div>';
|
||||
|
||||
$data[1] = ui_print_truncate_text($agent['description'], 'description', false, true, true, '[…]', 'font-size: 6.5pt');
|
||||
$data[1] = ui_print_truncate_text($agent['description'], 'description', false, true, true, '[…]', $description_font_size);
|
||||
|
||||
$data[10] = '';
|
||||
|
||||
|
@ -244,14 +244,18 @@ $htmlForm = '<form method="post" action="index.php?sec=estado&sec2=operation/age
|
||||
$htmlForm .= html_print_table($table, true);
|
||||
$htmlForm .= html_print_input_hidden('filter', 1, true);
|
||||
$htmlForm .= '<div class="action-buttons" style="width: '.$table->width.'">';
|
||||
$htmlForm .= html_print_button(
|
||||
__('Save as custom graph'),
|
||||
'save_custom_graph',
|
||||
false,
|
||||
'',
|
||||
'class="sub add" style=""',
|
||||
true
|
||||
).' '.html_print_submit_button(__('Filter'), 'filter_button', false, 'class="sub upd" style=""', true);
|
||||
if (check_acl($config['id_user'], 0, 'RW') || check_acl($config['id_user'], 0, 'RM')) {
|
||||
$htmlForm .= html_print_button(
|
||||
__('Save as custom graph'),
|
||||
'save_custom_graph',
|
||||
false,
|
||||
'',
|
||||
'class="sub add" style=""',
|
||||
true
|
||||
);
|
||||
}
|
||||
|
||||
$htmlForm .= ' '.html_print_submit_button(__('Filter'), 'filter_button', false, 'class="sub upd" style=""', true);
|
||||
$htmlForm .= '</div>';
|
||||
$htmlForm .= '</form>';
|
||||
|
||||
|
@ -795,7 +795,7 @@ switch ($tab) {
|
||||
echo "<div style='width: ".$table->width."; margin-top: 5px;'>";
|
||||
echo '<form method="post" action="index.php?sec=network&sec2=operation/agentes/pandora_networkmap">';
|
||||
html_print_input_hidden('new_networkmap', 1);
|
||||
html_print_submit_button(__('Create networkmap'), 'crt', false, 'class="sub next" style="float: right;"');
|
||||
html_print_submit_button(__('Create network map'), 'crt', false, 'class="sub next" style="float: right;"');
|
||||
echo '</form>';
|
||||
echo '</div>';
|
||||
|
||||
@ -803,7 +803,7 @@ switch ($tab) {
|
||||
echo "<div style='width: ".$table->width."; margin-top: 5px;'>";
|
||||
echo '<form method="post" action="index.php?sec=network&sec2=operation/agentes/pandora_networkmap">';
|
||||
html_print_input_hidden('new_empty_networkmap', 1);
|
||||
html_print_submit_button(__('Create empty networkmap'), 'crt', false, 'class="sub next" style="float: right; margin-right:20px;"');
|
||||
html_print_submit_button(__('Create empty network map'), 'crt', false, 'class="sub next" style="float: right; margin-right:20px;"');
|
||||
echo '</form>';
|
||||
echo '</div>';
|
||||
}
|
||||
|
@ -62,7 +62,7 @@ echo '<table width=95%>';
|
||||
echo '</td>';
|
||||
|
||||
echo "<td valign='top'>";
|
||||
echo grafico_eventos_usuario(320, 296);
|
||||
echo grafico_eventos_usuario(320, 280);
|
||||
echo '</td>';
|
||||
echo '</tr>';
|
||||
|
||||
@ -83,7 +83,7 @@ if (!users_is_admin()) {
|
||||
|
||||
echo '<tr>';
|
||||
echo "<td valign='top'>";
|
||||
echo grafico_eventos_grupo(300, 200, $where);
|
||||
echo grafico_eventos_grupo(300, 250, $where);
|
||||
echo '</td>';
|
||||
|
||||
echo "<td valign='top'>";
|
||||
@ -101,7 +101,7 @@ if (!users_is_admin()) {
|
||||
];
|
||||
}
|
||||
|
||||
echo graph_events_validated(320, 296, $extra_filter);
|
||||
echo graph_events_validated(320, 250, $extra_filter);
|
||||
echo '</td>';
|
||||
echo '</tr>';
|
||||
|
||||
|
@ -246,6 +246,8 @@ if (is_ajax()) {
|
||||
$fields[] = 'ta.server_name as server_name';
|
||||
} else {
|
||||
$fields[] = 'ts.server_name as server_name';
|
||||
$fields[] = 'te.id_agentmodule';
|
||||
$fields[] = 'te.server_id';
|
||||
}
|
||||
|
||||
$events = events_get_all(
|
||||
@ -982,7 +984,7 @@ if (is_metaconsole()) {
|
||||
'SELECT id, server_name FROM tmetaconsole_setup',
|
||||
'server_id',
|
||||
$server_id,
|
||||
'script',
|
||||
'',
|
||||
__('All'),
|
||||
'0',
|
||||
true
|
||||
@ -1029,15 +1031,14 @@ $adv_inputs[] = $in;
|
||||
// Only alert events.
|
||||
$data = html_print_select(
|
||||
[
|
||||
'-1' => __('All'),
|
||||
'0' => __('Filter alert events'),
|
||||
'1' => __('Only alert events'),
|
||||
'0' => __('Filter alert events'),
|
||||
'1' => __('Only alert events'),
|
||||
],
|
||||
'filter_only_alert',
|
||||
$filter_only_alert,
|
||||
'',
|
||||
'',
|
||||
'',
|
||||
__('All'),
|
||||
-1,
|
||||
true
|
||||
);
|
||||
$in = '<div class="filter_input"><label>'.__('Alert events').'</label>';
|
||||
@ -1246,6 +1247,14 @@ try {
|
||||
];
|
||||
}
|
||||
|
||||
// Identifies column instructions to make it unsortable.
|
||||
if (in_array('instructions', $fields) > 0) {
|
||||
$fields[array_search('instructions', $fields)] = [
|
||||
'text' => 'instructions',
|
||||
'class' => 'column-instructions',
|
||||
];
|
||||
}
|
||||
|
||||
$evento_id = array_search('evento', $fields);
|
||||
if ($evento_id !== false) {
|
||||
$fields[$evento_id] = [
|
||||
@ -1410,6 +1419,7 @@ try {
|
||||
'no_sortable_columns' => [
|
||||
-1,
|
||||
-2,
|
||||
'column-instructions',
|
||||
],
|
||||
'ajax_postprocess' => 'process_datatables_item(item)',
|
||||
'drawCallback' => 'process_datatables_callback(this, settings)',
|
||||
|
@ -17,7 +17,7 @@ error_reporting(1);
|
||||
$MAX_MARQUEE_EVENTS = 10;
|
||||
$MARQUEE_INTERVAL = 90;
|
||||
$MARQUEE_FONT_SIZE = '32px';
|
||||
$MARQUEE_SPEED = 12;
|
||||
$MARQUEE_SPEED = 9;
|
||||
|
||||
$output = '';
|
||||
|
||||
|
@ -17,7 +17,6 @@ global $config;
|
||||
check_login();
|
||||
|
||||
enterprise_hook('open_meta_frame');
|
||||
|
||||
$id_report = (int) get_parameter('id');
|
||||
|
||||
if (! $id_report) {
|
||||
|
@ -43,7 +43,7 @@ if ($searchGraphs) {
|
||||
|
||||
$totalGraphs = (int) db_get_value_filter('COUNT(id_graph) AS count', 'tgraph', $filter);
|
||||
|
||||
if (! $only_count && $totalGraphs > 0) {
|
||||
if ($totalGraphs > 0) {
|
||||
$filter['limit'] = $config['block_size'];
|
||||
$filter['offset'] = (int) get_parameter('offset');
|
||||
$graphs = db_get_all_rows_filter('tgraph', $filter, $columns);
|
||||
|
@ -16,7 +16,7 @@ global $config;
|
||||
enterprise_include_once('include/functions_policies.php');
|
||||
|
||||
|
||||
$searchpolicies = check_acl($config['id'], 0, 'AW');
|
||||
$searchpolicies = check_acl($config['id_user'], 0, 'AW');
|
||||
|
||||
$selectpolicieIDUp = '';
|
||||
$selectpolicieIDDown = '';
|
||||
|
@ -155,7 +155,7 @@ foreach ($traps_generated_by_source as $trap) {
|
||||
$row['source'] = '<a href="index.php?sec=estado&sec2=godmode/agentes/configurar_agente&new_agent=1&direccion='.$trap['source'].'" title="'.__('Create agent').'">'.$trap['source'].'</a>';
|
||||
} else {
|
||||
$agent_id = $agent['id_agente'];
|
||||
$agent_name = ui_print_truncate_text($agent['nombre'], 'agent_medium', true, true, true, '[…]', '');
|
||||
$agent_name = ui_print_truncate_text($agent['alias'], 'agent_medium', true, true, true, '[…]', '');
|
||||
$row['source'] = "<a href=\"index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente=$agent_id\" title=\"".__('View agent details').'">';
|
||||
$row['source'] .= "<strong>$agent_name</strong></a>";
|
||||
}
|
||||
|
@ -1,17 +1,31 @@
|
||||
<?php
|
||||
/**
|
||||
* SNMP Console.
|
||||
*
|
||||
* @category SNMP
|
||||
* @package Pandora FMS
|
||||
* @subpackage Community
|
||||
* @version 1.0.0
|
||||
* @license See below
|
||||
*
|
||||
* ______ ___ _______ _______ ________
|
||||
* | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __|
|
||||
* | __/| _ | | _ || _ | _| _ | | ___| |__ |
|
||||
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
|
||||
*
|
||||
* ============================================================================
|
||||
* Copyright (c) 2005-2019 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-2010 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.
|
||||
// Load global vars
|
||||
global $config;
|
||||
enterprise_include('operation/snmpconsole/snmp_view.php');
|
||||
enterprise_include('include/functions_snmp.php');
|
||||
@ -31,7 +45,7 @@ if (!$agent_a && !$agent_w) {
|
||||
exit;
|
||||
}
|
||||
|
||||
// Read parameters
|
||||
// Read parameters.
|
||||
$filter_severity = (int) get_parameter('filter_severity', -1);
|
||||
$filter_fired = (int) get_parameter('filter_fired', -1);
|
||||
$filter_status = (int) get_parameter('filter_status', 0);
|
||||
@ -61,7 +75,7 @@ foreach ($user_groups as $id => $name) {
|
||||
$i++;
|
||||
}
|
||||
|
||||
$url = 'index.php?sec=estado&'.'sec2=operation/snmpconsole/snmp_view&'.'filter_severity='.$filter_severity.'&'.'filter_fired='.$filter_fired.'&'.'free_search_string='.$free_search_string.'&'.'pagination='.$pagination.'&'.'offset='.$offset.'&'.'trap_type='.$trap_type.'&'.'group_by='.$group_by.'&'.'date_from_trap='.$date_from_trap.'&'.'date_to_trap='.$date_to_trap.'&'.'time_from_trap='.$time_from_trap.'&'.'time_to_trap='.$time_to_trap;
|
||||
$url = 'index.php?sec=estado&sec2=operation/snmpconsole/snmp_view&filter_severity='.$filter_severity.'&filter_fired='.$filter_fired.'&free_search_string='.$free_search_string.'&pagination='.$pagination.'&offset='.$offset.'&trap_type='.$trap_type.'&group_by='.$group_by.'&date_from_trap='.$date_from_trap.'&date_to_trap='.$date_to_trap.'&time_from_trap='.$time_from_trap.'&time_to_trap='.$time_to_trap;
|
||||
|
||||
$statistics['text'] = '<a href="index.php?sec=estado&sec2=operation/snmpconsole/snmp_statistics&pure='.$config['pure'].'&refr='.$refr.'">'.html_print_image('images/op_reporting.png', true, ['title' => __('Statistics')]).'</a>';
|
||||
$list['text'] = '<a href="'.$url.'&pure='.$config['pure'].'&refresh='.$refr.'">'.html_print_image('images/op_snmp.png', true, ['title' => __('List')]).'</a>';
|
||||
@ -70,7 +84,7 @@ $list['active'] = true;
|
||||
if ($config['pure']) {
|
||||
$fullscreen['text'] = '<a target="_top" href="'.$url.'&pure=0&refresh='.$refr.'">'.html_print_image('images/normal_screen.png', true, ['title' => __('Normal screen')]).'</a>';
|
||||
} else {
|
||||
// Fullscreen
|
||||
// Fullscreen.
|
||||
$fullscreen['text'] = '<a target="_top" href="'.$url.'&pure=1&refresh='.$refr.'">'.html_print_image('images/full_screen.png', true, ['title' => __('Full screen')]).'</a>';
|
||||
}
|
||||
|
||||
@ -131,7 +145,7 @@ if (isset($_GET['check'])) {
|
||||
}
|
||||
}
|
||||
|
||||
// Mass-process DELETE
|
||||
// Mass-process DELETE.
|
||||
if (isset($_POST['deletebt'])) {
|
||||
$trap_ids = get_parameter_post('snmptrapid', []);
|
||||
if (is_array($trap_ids) && check_acl($config['id_user'], 0, 'IW')) {
|
||||
@ -161,7 +175,7 @@ if (isset($_POST['deletebt'])) {
|
||||
}
|
||||
}
|
||||
|
||||
// Mass-process UPDATE
|
||||
// Mass-process UPDATE.
|
||||
if (isset($_POST['updatebt'])) {
|
||||
$trap_ids = get_parameter_post('snmptrapid', []);
|
||||
if (is_array($trap_ids) && check_acl($config['id_user'], 0, 'IW')) {
|
||||
@ -178,14 +192,14 @@ if (isset($_POST['updatebt'])) {
|
||||
}
|
||||
}
|
||||
|
||||
// All traps
|
||||
// All traps.
|
||||
$all_traps = db_get_all_rows_sql('SELECT DISTINCT source FROM ttrap');
|
||||
|
||||
if (empty($all_traps)) {
|
||||
$all_traps = [];
|
||||
}
|
||||
|
||||
// Set filters
|
||||
// Set filters.
|
||||
$agents = [];
|
||||
$oids = [];
|
||||
$severities = get_priorities();
|
||||
@ -206,7 +220,7 @@ foreach ($all_traps as $trap) {
|
||||
|
||||
$prea = array_keys($user_groups);
|
||||
$ids = join(',', $prea);
|
||||
// Cuantos usuarios hay operadores con un grupo que exista y no lo tenga ningun usuario
|
||||
// Cuantos usuarios hay operadores con un grupo que exista y no lo tenga ningun usuario.
|
||||
$user_in_group_wo_agents = db_get_value_sql('select count(DISTINCT(id_usuario)) from tusuario_perfil where id_usuario ="'.$config['id_user'].'" and id_perfil = 1 and id_grupo in (select id_grupo from tgrupo where id_grupo in ('.$ids.') and id_grupo not in (select id_grupo from tagente))');
|
||||
|
||||
switch ($config['dbtype']) {
|
||||
@ -244,6 +258,10 @@ switch ($config['dbtype']) {
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
// Default.
|
||||
break;
|
||||
}
|
||||
|
||||
if (empty($address_by_user_groups)) {
|
||||
@ -293,6 +311,10 @@ switch ($config['dbtype']) {
|
||||
) OR source='' OR source NOT IN (SELECT direccion FROM tagente WHERE direccion IS NOT NULL)) %s
|
||||
ORDER BY timestamp DESC";
|
||||
break;
|
||||
|
||||
default:
|
||||
// Default.
|
||||
break;
|
||||
}
|
||||
|
||||
switch ($config['dbtype']) {
|
||||
@ -335,6 +357,10 @@ switch ($config['dbtype']) {
|
||||
) OR source='' OR source NOT IN (SELECT direccion FROM tagente WHERE direccion IS NOT NULL))
|
||||
%s";
|
||||
break;
|
||||
|
||||
default:
|
||||
// Default.
|
||||
break;
|
||||
}
|
||||
|
||||
// $whereSubquery = 'WHERE 1=1';
|
||||
@ -372,6 +398,10 @@ if ($free_search_string != '') {
|
||||
text LIKE \'%'.$free_search_string.'%\' OR
|
||||
description LIKE \'%'.$free_search_string.'%\')';
|
||||
break;
|
||||
|
||||
default:
|
||||
// Default.
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@ -422,7 +452,7 @@ if ($trap_type == 5) {
|
||||
$whereSubquery .= ' AND type = '.$trap_type;
|
||||
}
|
||||
|
||||
// Disable this feature (time will decide if temporarily) in Oracle cause the group by is very confictive
|
||||
// Disable this feature (time will decide if temporarily) in Oracle cause the group by is very confictive.
|
||||
if ($group_by && $config['dbtype'] != 'oracle') {
|
||||
$where_without_group = $whereSubquery;
|
||||
$whereSubquery .= ' GROUP BY source,oid';
|
||||
@ -444,6 +474,10 @@ switch ($config['dbtype']) {
|
||||
$sql = sprintf($sql, $whereSubquery);
|
||||
$sql = oracle_recode_query($sql, $set);
|
||||
break;
|
||||
|
||||
default:
|
||||
// Default.
|
||||
break;
|
||||
}
|
||||
|
||||
$sql_all = sprintf($sql_all, $whereSubquery);
|
||||
@ -458,7 +492,7 @@ $table->size = [];
|
||||
$table->size[0] = '120px';
|
||||
$table->data = [];
|
||||
|
||||
// Alert status select
|
||||
// Alert status select.
|
||||
$table->data[1][0] = '<strong>'.__('Alert').'</strong>';
|
||||
$table->data[1][1] = html_print_select(
|
||||
$alerted,
|
||||
@ -470,7 +504,7 @@ $table->data[1][1] = html_print_select(
|
||||
true
|
||||
);
|
||||
|
||||
// Block size for pagination select
|
||||
// Block size for pagination select.
|
||||
$table->data[2][0] = '<strong>'.__('Block size for pagination').'</strong>';
|
||||
$paginations[25] = 25;
|
||||
$paginations[50] = 50;
|
||||
@ -487,7 +521,7 @@ $table->data[2][1] = html_print_select(
|
||||
true
|
||||
);
|
||||
|
||||
// Severity select
|
||||
// Severity select.
|
||||
$table->data[1][2] = '<strong>'.__('Severity').'</strong>';
|
||||
$table->data[1][3] = html_print_select(
|
||||
$severities,
|
||||
@ -499,7 +533,7 @@ $table->data[1][3] = html_print_select(
|
||||
true
|
||||
);
|
||||
|
||||
// Status
|
||||
// Status.
|
||||
$table->data[3][0] = '<strong>'.__('Status').'</strong>';
|
||||
|
||||
$status_array[-1] = __('All');
|
||||
@ -515,7 +549,7 @@ $table->data[3][1] = html_print_select(
|
||||
true
|
||||
);
|
||||
|
||||
// Free search (search by all alphanumeric fields)
|
||||
// Free search (search by all alphanumeric fields).
|
||||
$table->data[2][3] = '<strong>'.__('Free search').'</strong>'.ui_print_help_tip(
|
||||
__(
|
||||
'Search by any alphanumeric field in the trap.
|
||||
@ -542,7 +576,7 @@ $table->data[5][1] = html_print_input_text('time_from_trap', $time_from_trap, fa
|
||||
$table->data[5][2] = '<strong>'.__('To (Time)').'</strong>';
|
||||
$table->data[5][3] = html_print_input_text('time_to_trap', $time_to_trap, false, 15, 10, true);
|
||||
|
||||
// Type filter (ColdStart, WarmStart, LinkDown, LinkUp, authenticationFailure, Other)
|
||||
// Type filter (ColdStart, WarmStart, LinkDown, LinkUp, authenticationFailure, Other).
|
||||
$table->data[6][1] = '<strong>'.__('Trap type').'</strong>'.ui_print_help_tip(__('Search by trap type'), true);
|
||||
$trap_types = [
|
||||
-1 => __('None'),
|
||||
@ -565,14 +599,14 @@ $table->data[6][2] = html_print_select(
|
||||
false
|
||||
);
|
||||
|
||||
// Disable this feature (time will decide if temporarily) in Oracle cause the group by is very confictive
|
||||
// Disable this feature (time will decide if temporarily) in Oracle cause the group by is very confictive.
|
||||
if ($config['dbtype'] != 'oracle') {
|
||||
$table->data[3][3] = '<strong>'.__('Group by Enterprise String/IP').'</strong>';
|
||||
$table->data[3][4] = __('Yes').' '.html_print_radio_button('group_by', 1, '', $group_by, true).' ';
|
||||
$table->data[3][4] .= __('No').' '.html_print_radio_button('group_by', 0, '', $group_by, true);
|
||||
}
|
||||
|
||||
$filter = '<form method="POST" action="index.php?'.'sec=snmpconsole&'.'sec2=operation/snmpconsole/snmp_view&'.'refresh='.((int) get_parameter('refresh', 0)).'&'.'pure='.$config['pure'].'">';
|
||||
$filter = '<form method="POST" action="index.php?sec=snmpconsole&sec2=operation/snmpconsole/snmp_view&refresh='.((int) get_parameter('refresh', 0)).'&pure='.$config['pure'].'">';
|
||||
$filter .= html_print_table($table, true);
|
||||
$filter .= '<div style="width: '.$table->width.'; text-align: right;">';
|
||||
$filter .= html_print_submit_button(__('Update'), 'search', false, 'class="sub upd"', true);
|
||||
@ -595,9 +629,9 @@ $filter_resume['trap_type'] = $trap_types[$trap_type];
|
||||
$traps = db_get_all_rows_sql($sql);
|
||||
$trapcount = (int) db_get_value_sql($sql_count);
|
||||
|
||||
// No traps
|
||||
// No traps.
|
||||
if (empty($traps)) {
|
||||
// Header
|
||||
// Header.
|
||||
ui_print_page_header(
|
||||
__('SNMP Console'),
|
||||
'images/op_snmp.png',
|
||||
@ -638,24 +672,24 @@ if (empty($traps)) {
|
||||
|
||||
echo '<div id="menu_tab">';
|
||||
echo '<ul class="mn">';
|
||||
// Normal view button
|
||||
// Normal view button.
|
||||
echo '<li class="nomn">';
|
||||
$normal_url = 'index.php?'.'sec=snmpconsole&'.'sec2=operation/snmpconsole/snmp_view&'.'filter_severity='.$filter_severity.'&'.'filter_fired='.$filter_fired.'&'.'filter_status='.$filter_status.'&'.'refresh='.((int) get_parameter('refresh', 0)).'&'.'pure=0&'.'trap_type='.$trap_type.'&'.'group_by='.$group_by.'&'.'free_search_string='.$free_search_string.'&'.'date_from_trap='.$date_from_trap.'&'.'date_to_trap='.$date_to_trap.'&'.'time_from_trap='.$time_from_trap.'&'.'time_to_trap='.$time_to_trap;
|
||||
$normal_url = 'index.php?sec=snmpconsole&sec2=operation/snmpconsole/snmp_view&filter_severity='.$filter_severity.'&filter_fired='.$filter_fired.'&filter_status='.$filter_status.'&refresh='.((int) get_parameter('refresh', 0)).'&pure=0&trap_type='.$trap_type.'&group_by='.$group_by.'&free_search_string='.$free_search_string.'&date_from_trap='.$date_from_trap.'&date_to_trap='.$date_to_trap.'&time_from_trap='.$time_from_trap.'&time_to_trap='.$time_to_trap;
|
||||
|
||||
$urlPagination = $normal_url.'&'.'pagination='.$pagination.'&'.'offset='.$offset;
|
||||
$urlPagination = $normal_url.'&pagination='.$pagination.'&offset='.$offset;
|
||||
|
||||
echo '<a href="'.$urlPagination.'">';
|
||||
echo html_print_image('images/normal_screen.png', true, ['title' => __('Exit fullscreen')]);
|
||||
echo '</a>';
|
||||
echo '</li>';
|
||||
|
||||
// Auto refresh control
|
||||
// Auto refresh control.
|
||||
echo '<li class="nomn">';
|
||||
echo '<div class="dashboard-refr" style="margin-top: 6px;">';
|
||||
echo '<div class="dashboard-countdown" style="display: inline;"></div>';
|
||||
$normal_url = 'index.php?'.'sec=snmpconsole&'.'sec2=operation/snmpconsole/snmp_view&'.'filter_severity='.$filter_severity.'&'.'filter_fired='.$filter_fired.'&'.'filter_status='.$filter_status.'&'.'refresh='.((int) get_parameter('refresh', 0)).'&'.'pure=1&'.'trap_type='.$trap_type.'&'.'group_by='.$group_by.'&'.'free_search_string='.$free_search_string.'&'.'date_from_trap='.$date_from_trap.'&'.'date_to_trap='.$date_to_trap.'&'.'time_from_trap='.$time_from_trap.'&'.'time_to_trap='.$time_to_trap;
|
||||
$normal_url = 'index.php?sec=snmpconsole&sec2=operation/snmpconsole/snmp_view&filter_severity='.$filter_severity.'&filter_fired='.$filter_fired.'&filter_status='.$filter_status.'&refresh='.((int) get_parameter('refresh', 0)).'&pure=1&trap_type='.$trap_type.'&group_by='.$group_by.'&free_search_string='.$free_search_string.'&date_from_trap='.$date_from_trap.'&date_to_trap='.$date_to_trap.'&time_from_trap='.$time_from_trap.'&time_to_trap='.$time_to_trap;
|
||||
|
||||
$urlPagination = $normal_url.'&'.'pagination='.$pagination.'&'.'offset='.$offset;
|
||||
$urlPagination = $normal_url.'&pagination='.$pagination.'&offset='.$offset;
|
||||
|
||||
|
||||
echo '<form id="refr-form" method="get" action="'.$urlPagination.'" style="display: inline;">';
|
||||
@ -669,7 +703,7 @@ if (empty($traps)) {
|
||||
html_print_input_hidden('pure', 1);
|
||||
html_print_input_hidden('refresh', ($refr > 0 ? $refr : $default_refr));
|
||||
|
||||
// Dashboard name
|
||||
// Dashboard name.
|
||||
echo '<li class="nomn">';
|
||||
echo '<div class="dashboard-title">'.__('SNMP Traps').'</div>';
|
||||
echo '</li>';
|
||||
@ -688,7 +722,7 @@ if (empty($traps)) {
|
||||
ui_require_javascript_file('wz_jsgraphics');
|
||||
ui_require_javascript_file('pandora_visual_console');
|
||||
} else {
|
||||
// Header
|
||||
// Header.
|
||||
ui_print_page_header(
|
||||
__('SNMP Console'),
|
||||
'images/op_snmp.png',
|
||||
@ -710,18 +744,19 @@ unset($table);
|
||||
print_snmp_tags_active_filters($filter_resume);
|
||||
|
||||
if (($config['dbtype'] == 'oracle') && ($traps !== false)) {
|
||||
for ($i = 0; $i < count($traps); $i++) {
|
||||
$traps_size = count($traps);
|
||||
for ($i = 0; $i < $traps_size; $i++) {
|
||||
unset($traps[$i]['rnum']);
|
||||
}
|
||||
}
|
||||
|
||||
$url_snmp = 'index.php?'.'sec=snmpconsole&'.'sec2=operation/snmpconsole/snmp_view&'.'filter_severity='.$filter_severity.'&'.'filter_fired='.$filter_fired.'&'.'filter_status='.$filter_status.'&'.'refresh='.((int) get_parameter('refresh', 0)).'&'.'pure='.$config['pure'].'&'.'trap_type='.$trap_type.'&'.'group_by='.$group_by.'&'.'free_search_string='.$free_search_string.'&'.'date_from_trap='.$date_from_trap.'&'.'date_to_trap='.$date_to_trap.'&'.'time_from_trap='.$time_from_trap.'&'.'time_to_trap='.$time_to_trap;
|
||||
$url_snmp = 'index.php?sec=snmpconsole&sec2=operation/snmpconsole/snmp_view&filter_severity='.$filter_severity.'&filter_fired='.$filter_fired.'&filter_status='.$filter_status.'&refresh='.((int) get_parameter('refresh', 0)).'&pure='.$config['pure'].'&trap_type='.$trap_type.'&group_by='.$group_by.'&free_search_string='.$free_search_string.'&date_from_trap='.$date_from_trap.'&date_to_trap='.$date_to_trap.'&time_from_trap='.$time_from_trap.'&time_to_trap='.$time_to_trap;
|
||||
|
||||
$urlPagination = $url_snmp.'&'.'pagination='.$pagination.'&'.'offset='.$offset;
|
||||
$urlPagination = $url_snmp.'&pagination='.$pagination.'&offset='.$offset;
|
||||
|
||||
ui_pagination($trapcount, $urlPagination, $offset, $pagination);
|
||||
|
||||
echo '<form name="eventtable" method="POST" action="'.$url_snmp.'">';
|
||||
echo '<form name="eventtable" method="POST" action="'.$urlPagination.'">';
|
||||
|
||||
$table->cellpadding = 0;
|
||||
$table->cellspacing = 0;
|
||||
@ -795,7 +830,7 @@ $table->headstyle[9] = 'text-align: center';
|
||||
|
||||
$table->style[8] = 'background: #F3F3F3; color: #111 !important;';
|
||||
|
||||
// Skip offset records
|
||||
// Skip offset records.
|
||||
$idx = 0;
|
||||
if ($traps !== false) {
|
||||
foreach ($traps as $trap) {
|
||||
@ -809,7 +844,7 @@ if ($traps !== false) {
|
||||
$severity = $trap['alerted'] == 1 ? $trap['priority'] : 1;
|
||||
}
|
||||
|
||||
// Status
|
||||
// Status.
|
||||
if ($trap['status'] == 0) {
|
||||
$data[0] = html_print_image(
|
||||
'images/pixel_red.png',
|
||||
@ -832,7 +867,7 @@ if ($traps !== false) {
|
||||
);
|
||||
}
|
||||
|
||||
// Agent matching source address
|
||||
// Agent matching source address.
|
||||
$table->cellclass[$idx][1] = get_priority_class($severity);
|
||||
$agent = agents_get_agent_with_ip($trap['source']);
|
||||
if ($agent === false) {
|
||||
@ -851,7 +886,7 @@ if ($traps !== false) {
|
||||
'</strong></a>';
|
||||
}
|
||||
|
||||
// OID
|
||||
// OID.
|
||||
$table->cellclass[$idx][2] = get_priority_class($severity);
|
||||
if (! empty($trap['text'])) {
|
||||
$enterprise_string = $trap['text'];
|
||||
@ -863,7 +898,7 @@ if ($traps !== false) {
|
||||
|
||||
$data[2] = '<a href="javascript: toggleVisibleExtendedInfo('.$trap['id_trap'].');">'.$enterprise_string.'</a>';
|
||||
|
||||
// Count
|
||||
// Count.
|
||||
if ($group_by) {
|
||||
$sql = "SELECT * FROM ttrap WHERE 1=1
|
||||
$where_without_group
|
||||
@ -875,7 +910,7 @@ if ($traps !== false) {
|
||||
$data[3] = '<strong>'.$count_group_traps.'</strong></a>';
|
||||
}
|
||||
|
||||
// Value
|
||||
// Value.
|
||||
$table->cellclass[$idx][4] = get_priority_class($severity);
|
||||
if (empty($trap['value'])) {
|
||||
$data[4] = __('N/A');
|
||||
@ -883,7 +918,7 @@ if ($traps !== false) {
|
||||
$data[4] = ui_print_truncate_text($trap['value'], GENERIC_SIZE_TEXT, false);
|
||||
}
|
||||
|
||||
// User
|
||||
// User.
|
||||
$table->cellclass[$idx][5] = get_priority_class($severity);
|
||||
if (!empty($trap['status'])) {
|
||||
$data[5] = '<a href="index.php?sec=workspace&sec2=operation/users/user_edit&ver='.$trap['id_usuario'].'">'.substr($trap['id_usuario'], 0, 8).'</a>';
|
||||
@ -894,35 +929,35 @@ if ($traps !== false) {
|
||||
$data[5] = '--';
|
||||
}
|
||||
|
||||
// Timestamp
|
||||
// Timestamp.
|
||||
$table->cellclass[$idx][6] = get_priority_class($severity);
|
||||
$data[6] = '<span title="'.$trap['timestamp'].'">';
|
||||
$data[6] .= ui_print_timestamp($trap['timestamp'], true);
|
||||
$data[6] .= '</span>';
|
||||
|
||||
// Use alert severity if fired
|
||||
// Use alert severity if fired.
|
||||
if (!empty($trap['alerted'])) {
|
||||
$data[7] = html_print_image('images/pixel_yellow.png', true, ['width' => '20', 'height' => '20', 'border' => '0', 'title' => __('Alert fired')]);
|
||||
} else {
|
||||
$data[7] = html_print_image('images/pixel_gray.png', true, ['width' => '20', 'height' => '20', 'border' => '0', 'title' => __('Alert not fired')]);
|
||||
}
|
||||
|
||||
// Actions
|
||||
// Actions.
|
||||
$data[8] = '';
|
||||
|
||||
if (empty($trap['status']) && check_acl($config['id_user'], 0, 'IW')) {
|
||||
$data[8] .= '<a href="'.$url_snmp.'&check='.$trap['id_trap'].'">'.html_print_image('images/ok.png', true, ['border' => '0', 'title' => __('Validate')]).'</a> ';
|
||||
$data[8] .= '<a href="'.$urlPagination.'&check='.$trap['id_trap'].'">'.html_print_image('images/ok.png', true, ['border' => '0', 'title' => __('Validate')]).'</a> ';
|
||||
}
|
||||
|
||||
if ($trap['source'] == '') {
|
||||
$is_admin = db_get_value('is_admin', 'tusuario', 'id_user', $config['id_user']);
|
||||
if ($is_admin) {
|
||||
$data[8] .= '<a href="'.$url_snmp.'&delete='.$trap['id_trap'].'&offset='.$offset.'" onClick="javascript:return confirm(\''.__('Are you sure?').'\')">'.html_print_image('images/cross.png', true, ['border' => '0', 'title' => __('Delete')]).'</a> ';
|
||||
$data[8] .= '<a href="'.$urlPagination.'&delete='.$trap['id_trap'].'&offset='.$offset.'" onClick="javascript:return confirm(\''.__('Are you sure?').'\')">'.html_print_image('images/cross.png', true, ['border' => '0', 'title' => __('Delete')]).'</a> ';
|
||||
}
|
||||
} else {
|
||||
$agent_trap_group = db_get_value('id_grupo', 'tagente', 'nombre', $trap['source']);
|
||||
if ((check_acl($config['id_user'], $agent_trap_group, 'AW'))) {
|
||||
$data[8] .= '<a href="'.$url_snmp.'&delete='.$trap['id_trap'].'&offset='.$offset.'" onClick="javascript:return confirm(\''.__('Are you sure?').'\')">'.html_print_image('images/cross.png', true, ['border' => '0', 'title' => __('Delete')]).'</a> ';
|
||||
$data[8] .= '<a href="'.$urlPagination.'&delete='.$trap['id_trap'].'&offset='.$offset.'" onClick="javascript:return confirm(\''.__('Are you sure?').'\')">'.html_print_image('images/cross.png', true, ['border' => '0', 'title' => __('Delete')]).'</a> ';
|
||||
}
|
||||
}
|
||||
|
||||
@ -934,18 +969,18 @@ if ($traps !== false) {
|
||||
|
||||
array_push($table->data, $data);
|
||||
|
||||
// Hiden file for description
|
||||
// Hiden file for description.
|
||||
$string = '<table style="border:solid 1px #D3D3D3;" width="90%" class="toggle">
|
||||
<tr>
|
||||
<td align="left" valign="top" width="15%">'.'<b>'.__('Variable bindings:').'</b></td>
|
||||
<td align="left" >';
|
||||
|
||||
if ($group_by) {
|
||||
$new_url = 'index.php?sec=snmpconsole&sec2=operation/snmpconsole/snmp_view&'.'filter_severity='.$filter_severity.'&'.'filter_fired='.$filter_fired.'&'.'filter_status='.$filter_status.'&'.'refresh='.((int) get_parameter('refresh', 0)).'&'.'pure='.$config['pure'].'&'.'group_by=0&'.'free_search_string='.$free_search_string.'&'.'date_from_trap='.$date_from_trap.'&'.'date_to_trap='.$date_to_trap.'&'.'time_from_trap='.$time_from_trap.'&'.'time_to_trap='.$time_to_trap;
|
||||
$new_url = 'index.php?sec=snmpconsole&sec2=operation/snmpconsole/snmp_view&filter_severity='.$filter_severity.'&filter_fired='.$filter_fired.'&filter_status='.$filter_status.'&refresh='.((int) get_parameter('refresh', 0)).'&pure='.$config['pure'].'&group_by=0&free_search_string='.$free_search_string.'&date_from_trap='.$date_from_trap.'&date_to_trap='.$date_to_trap.'&time_from_trap='.$time_from_trap.'&time_to_trap='.$time_to_trap;
|
||||
|
||||
$string .= '<a href='.$new_url.'>'.__('See more details').'</a>';
|
||||
} else {
|
||||
// Print binding vars separately
|
||||
// Print binding vars separately.
|
||||
$binding_vars = explode("\t", $trap['oid_custom']);
|
||||
foreach ($binding_vars as $var) {
|
||||
$string .= $var.'<br/>';
|
||||
@ -1007,7 +1042,7 @@ if ($traps !== false) {
|
||||
break;
|
||||
}
|
||||
|
||||
$string .= '<tr><td align="left" valign="top">'.'<b>'.__('Trap type:').'</b>'.'</td>'.'<td align="left">'.$desc_trap_type.'</td></tr>';
|
||||
$string .= '<tr><td align="left" valign="top"><b>'.__('Trap type:').'</b></td><td align="left">'.$desc_trap_type.'</td></tr>';
|
||||
}
|
||||
|
||||
if ($group_by) {
|
||||
@ -1060,7 +1095,7 @@ if ($traps !== false) {
|
||||
}
|
||||
}
|
||||
|
||||
// No matching traps
|
||||
// No matching traps.
|
||||
if ($idx == 0) {
|
||||
echo '<div class="nf">'.__('No matching traps found').'</div>';
|
||||
} else {
|
||||
|
@ -40,6 +40,9 @@ ob_start('ui_process_page_head');
|
||||
// Enterprise main
|
||||
enterprise_include('index.php');
|
||||
|
||||
$url_css = ui_get_full_url('include/styles/visual_maps.css', false, false, false);
|
||||
echo '<link rel="stylesheet" href="'.$url_css.'" type="text/css" />';
|
||||
|
||||
require_once 'include/functions_visual_map.php';
|
||||
|
||||
$hash = get_parameter('hash');
|
||||
@ -96,31 +99,41 @@ if ($layout) {
|
||||
echo '<div id="vc-container"></div>';
|
||||
}
|
||||
|
||||
// Floating menu - Start
|
||||
// Floating menu - Start.
|
||||
echo '<div id="vc-controls" style="z-index:300;">';
|
||||
|
||||
echo '<div id="menu_tab">';
|
||||
echo '<ul class="mn">';
|
||||
echo '<ul class="mn white-box-content box-shadow flex-row">';
|
||||
|
||||
// QR code
|
||||
// QR code.
|
||||
echo '<li class="nomn">';
|
||||
echo '<a href="javascript: show_dialog_qrcode();">';
|
||||
echo '<img class="vc-qr" src="../../images/qrcode_icon_2.jpg"/>';
|
||||
echo '</a>';
|
||||
echo '</li>';
|
||||
|
||||
// Countdown
|
||||
// Countdown.
|
||||
echo '<li class="nomn">';
|
||||
echo '<div class="vc-refr">';
|
||||
echo '<div class="vc-countdown"></div>';
|
||||
echo '<div class="vc-countdown style="display: inline;"></div>';
|
||||
echo '<div id="vc-refr-form">';
|
||||
echo __('Refresh').':';
|
||||
echo html_print_select(get_refresh_time_array(), 'refr', $refr, '', '', 0, true, false, false);
|
||||
echo html_print_select(
|
||||
get_refresh_time_array(),
|
||||
'vc-refr',
|
||||
$refr,
|
||||
'',
|
||||
'',
|
||||
0,
|
||||
true,
|
||||
false,
|
||||
false
|
||||
);
|
||||
echo '</div>';
|
||||
echo '</div>';
|
||||
echo '</li>';
|
||||
|
||||
// Console name
|
||||
// Console name.
|
||||
echo '<li class="nomn">';
|
||||
echo '<div class="vc-title">'.$layout_name.'</div>';
|
||||
echo '</li>';
|
||||
@ -129,15 +142,15 @@ echo '</ul>';
|
||||
echo '</div>';
|
||||
|
||||
echo '</div>';
|
||||
// Floating menu - End
|
||||
// QR code dialog
|
||||
|
||||
// QR code dialog.
|
||||
echo '<div style="display: none;" id="qrcode_container" title="'.__('QR code of the page').'">';
|
||||
echo '<div id="qrcode_container_image"></div>';
|
||||
echo '</div>';
|
||||
|
||||
ui_require_jquery_file('countdown');
|
||||
ui_require_javascript_file('wz_jsgraphics');
|
||||
ui_require_javascript_file('pandora_visual_console');
|
||||
ui_require_jquery_file('countdown', 'include/javascript/', true);
|
||||
ui_require_javascript_file('wz_jsgraphics', 'include/javascript/', true);
|
||||
ui_require_javascript_file('pandora_visual_console', 'include/javascript/', true);
|
||||
$ignored_params['refr'] = '';
|
||||
?>
|
||||
|
||||
@ -175,7 +188,7 @@ $ignored_params['refr'] = '';
|
||||
var controls = document.getElementById('vc-controls');
|
||||
autoHideElement(controls, 1000);
|
||||
|
||||
$('select#refr').change(function (event) {
|
||||
$('#vc-controls').change(function (event) {
|
||||
refr = Number.parseInt(event.target.value, 10);
|
||||
startCountDown(refr, false);
|
||||
});
|
||||
|
@ -44,6 +44,9 @@ ob_start('ui_process_page_head');
|
||||
// Enterprise main.
|
||||
enterprise_include('index.php');
|
||||
|
||||
$url_css = ui_get_full_url('include/styles/visual_maps.css', false, false, false);
|
||||
echo '<link rel="stylesheet" href="'.$url_css.'" type="text/css" />';
|
||||
|
||||
require_once 'include/functions_visual_map.php';
|
||||
|
||||
$hash = (string) get_parameter('hash');
|
||||
@ -136,7 +139,7 @@ if (!users_can_manage_group_all('AR')) {
|
||||
}
|
||||
|
||||
$ignored_params['refr'] = '';
|
||||
ui_require_javascript_file('pandora_visual_console');
|
||||
ui_require_javascript_file('pandora_visual_console', 'include/javascript/', true);
|
||||
include_javascript_d3();
|
||||
visual_map_load_client_resources();
|
||||
|
||||
@ -159,6 +162,10 @@ $visualConsoleItems = VisualConsole::getItemsFromDB(
|
||||
var props = <?php echo (string) $visualConsole; ?>;
|
||||
var items = <?php echo '['.implode($visualConsoleItems, ',').']'; ?>;
|
||||
var baseUrl = "<?php echo ui_get_full_url('/', false, false, false); ?>";
|
||||
|
||||
var controls = document.getElementById('vc-controls');
|
||||
autoHideElement(controls, 1000);
|
||||
|
||||
var handleUpdate = function (prevProps, newProps) {
|
||||
if (!newProps) return;
|
||||
|
||||
|
@ -3,7 +3,7 @@
|
||||
#
|
||||
%define name pandorafms_console
|
||||
%define version 7.0NG.738
|
||||
%define release 190821
|
||||
%define release 190919
|
||||
|
||||
# User and Group under which Apache is running
|
||||
%define httpd_name httpd
|
||||
|
@ -3,7 +3,7 @@
|
||||
#
|
||||
%define name pandorafms_console
|
||||
%define version 7.0NG.738
|
||||
%define release 190821
|
||||
%define release 190919
|
||||
|
||||
# User and Group under which Apache is running
|
||||
%define httpd_name httpd
|
||||
|
@ -3,7 +3,7 @@
|
||||
#
|
||||
%define name pandorafms_console
|
||||
%define version 7.0NG.738
|
||||
%define release 190821
|
||||
%define release 190919
|
||||
%define httpd_name httpd
|
||||
# User and Group under which Apache is running
|
||||
%define httpd_name apache2
|
||||
|
@ -1455,6 +1455,7 @@ CREATE TABLE IF NOT EXISTS `treport_content` (
|
||||
`current_month` TINYINT(1) DEFAULT '1',
|
||||
`failover_mode` tinyint(1) DEFAULT '1',
|
||||
`failover_type` tinyint(1) DEFAULT '1',
|
||||
`uncompressed_module` TINYINT DEFAULT '0',
|
||||
PRIMARY KEY(`id_rc`),
|
||||
FOREIGN KEY (`id_report`) REFERENCES treport(`id_report`)
|
||||
ON UPDATE CASCADE ON DELETE CASCADE
|
||||
@ -2998,6 +2999,7 @@ CREATE TABLE IF NOT EXISTS `treport_content_template` (
|
||||
`current_month` TINYINT(1) DEFAULT '1',
|
||||
`failover_mode` tinyint(1) DEFAULT '1',
|
||||
`failover_type` tinyint(1) DEFAULT '1',
|
||||
`uncompressed_module` TINYINT DEFAULT '0',
|
||||
PRIMARY KEY(`id_rc`)
|
||||
) ENGINE = InnoDB DEFAULT CHARSET=utf8;
|
||||
|
||||
|
@ -109,7 +109,7 @@ INSERT INTO `tconfig` (`token`, `value`) VALUES
|
||||
('custom_report_front_logo', 'images/pandora_logo_white.jpg'),
|
||||
('custom_report_front_header', ''),
|
||||
('custom_report_front_footer', ''),
|
||||
('MR', 30),
|
||||
('MR', 31),
|
||||
('identification_reminder', 1),
|
||||
('identification_reminder_timestamp', 0),
|
||||
('current_package_enterprise', '738'),
|
||||
|
@ -1,5 +1,5 @@
|
||||
package: pandorafms-server
|
||||
Version: 7.0NG.738-190821
|
||||
Version: 7.0NG.738-190919
|
||||
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.738-190821"
|
||||
pandora_version="7.0NG.738-190919"
|
||||
|
||||
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.738";
|
||||
my $pandora_build = "190821";
|
||||
my $pandora_build = "190919";
|
||||
our $VERSION = $pandora_version." ".$pandora_build;
|
||||
|
||||
# Setup hash
|
||||
|
@ -1205,13 +1205,13 @@ sub pandora_execute_action ($$$$$$$$$;$) {
|
||||
|
||||
|
||||
# Address
|
||||
$field1 = subst_alert_macros ($field1, \%macros, $pa_config, $dbh, $agent, $module);
|
||||
$field1 = subst_alert_macros ($field1, \%macros, $pa_config, $dbh, $agent, $module, $alert);
|
||||
# Subject
|
||||
$field2 = subst_alert_macros ($field2, \%macros, $pa_config, $dbh, $agent, $module);
|
||||
$field2 = subst_alert_macros ($field2, \%macros, $pa_config, $dbh, $agent, $module, $alert);
|
||||
# Message
|
||||
$field3 = subst_alert_macros ($field3, \%macros, $pa_config, $dbh, $agent, $module);
|
||||
$field3 = subst_alert_macros ($field3, \%macros, $pa_config, $dbh, $agent, $module, $alert);
|
||||
# Content
|
||||
$field4 = subst_alert_macros ($field4, \%macros, $pa_config, $dbh, $agent, $module);
|
||||
$field4 = subst_alert_macros ($field4, \%macros, $pa_config, $dbh, $agent, $module, $alert);
|
||||
|
||||
if($field4 eq ""){
|
||||
$field4 = "text/html";
|
||||
@ -3943,8 +3943,8 @@ sub pandora_evaluate_snmp_alerts ($$$$$$$$$) {
|
||||
##########################################################################
|
||||
# Search string for macros and substitutes them with their values.
|
||||
##########################################################################
|
||||
sub subst_alert_macros ($$;$$$$) {
|
||||
my ($string, $macros, $pa_config, $dbh, $agent, $module) = @_;
|
||||
sub subst_alert_macros ($$;$$$$$) {
|
||||
my ($string, $macros, $pa_config, $dbh, $agent, $module, $alert) = @_;
|
||||
|
||||
my $macro_regexp = join('|', keys %{$macros});
|
||||
|
||||
@ -3952,14 +3952,14 @@ sub subst_alert_macros ($$;$$$$) {
|
||||
if (defined($string) && $string =~ m/^(?:(")(?:.*)"|(')(?:.*)')$/) {
|
||||
my $quote = $1 ? $1 : $2;
|
||||
$subst_func = sub {
|
||||
my $macro = on_demand_macro($pa_config, $dbh, shift, $macros, $agent, $module);
|
||||
my $macro = on_demand_macro($pa_config, $dbh, shift, $macros, $agent, $module,$alert);
|
||||
$macro =~ s/'/'\\''/g; # close, escape, open
|
||||
return decode_entities($quote . "'" . $macro . "'" . $quote); # close, quote, open
|
||||
};
|
||||
}
|
||||
else {
|
||||
$subst_func = sub {
|
||||
my $macro = on_demand_macro($pa_config, $dbh, shift, $macros, $agent, $module);
|
||||
my $macro = on_demand_macro($pa_config, $dbh, shift, $macros, $agent, $module, $alert);
|
||||
return decode_entities($macro);
|
||||
};
|
||||
}
|
||||
@ -3993,8 +3993,8 @@ sub subst_column_macros ($$;$$$$) {
|
||||
##########################################################################
|
||||
# Load macros that access the database on demand.
|
||||
##########################################################################
|
||||
sub on_demand_macro($$$$$$) {
|
||||
my ($pa_config, $dbh, $macro, $macros, $agent, $module) = @_;
|
||||
sub on_demand_macro($$$$$$;$) {
|
||||
my ($pa_config, $dbh, $macro, $macros, $agent, $module,$alert) = @_;
|
||||
|
||||
# Static macro.
|
||||
return $macros->{$macro} if (defined($macros->{$macro}));
|
||||
@ -4010,7 +4010,7 @@ sub on_demand_macro($$$$$$) {
|
||||
} elsif ($macro eq '_moduletags_') {
|
||||
return (defined ($module)) ? pandora_get_module_url_tags ($pa_config, $dbh, $module->{'id_agente_modulo'}) : '';
|
||||
} elsif ($macro eq '_policy_') {
|
||||
return (defined ($module)) ? enterprise_hook('get_policy_name', [$dbh, $module->{'id_policy_module'}]) : '';
|
||||
return (defined ($alert)) ? enterprise_hook('get_policy_name_policy_alerts_id', [$dbh, $alert->{'id_policy_alerts'}]) : '';
|
||||
} elsif ($macro eq '_email_tag_') {
|
||||
return (defined ($module)) ? pandora_get_module_email_tags ($pa_config, $dbh, $module->{'id_agente_modulo'}) : '';
|
||||
} elsif ($macro eq '_phone_tag_') {
|
||||
|
@ -32,7 +32,7 @@ our @ISA = qw(Exporter);
|
||||
|
||||
# version: Defines actual version of Pandora Server for this module only
|
||||
my $pandora_version = "7.0NG.738";
|
||||
my $pandora_build = "190821";
|
||||
my $pandora_build = "190919";
|
||||
our $VERSION = $pandora_version." ".$pandora_build;
|
||||
|
||||
our %EXPORT_TAGS = ( 'all' => [ qw() ] );
|
||||
|
@ -3,7 +3,7 @@
|
||||
#
|
||||
%define name pandorafms_server
|
||||
%define version 7.0NG.738
|
||||
%define release 190821
|
||||
%define release 190919
|
||||
|
||||
Summary: Pandora FMS Server
|
||||
Name: %{name}
|
||||
|
@ -3,7 +3,7 @@
|
||||
#
|
||||
%define name pandorafms_server
|
||||
%define version 7.0NG.738
|
||||
%define release 190821
|
||||
%define release 190919
|
||||
|
||||
Summary: Pandora FMS Server
|
||||
Name: %{name}
|
||||
|
@ -9,7 +9,7 @@
|
||||
# **********************************************************************
|
||||
|
||||
PI_VERSION="7.0NG.738"
|
||||
PI_BUILD="190821"
|
||||
PI_BUILD="190919"
|
||||
|
||||
MODE=$1
|
||||
if [ $# -gt 1 ]; then
|
||||
|
@ -34,7 +34,7 @@ use PandoraFMS::Config;
|
||||
use PandoraFMS::DB;
|
||||
|
||||
# version: define current version
|
||||
my $version = "7.0NG.738 PS190821";
|
||||
my $version = "7.0NG.738 PS190919";
|
||||
|
||||
# Pandora server configuration
|
||||
my %conf;
|
||||
@ -136,7 +136,7 @@ sub pandora_purgedb ($$) {
|
||||
pandora_delete_old_export_data ($dbh, $ulimit_timestamp);
|
||||
|
||||
# Delete sessions data
|
||||
pandora_delete_old_session_data ($dbh, $ulimit_timestamp);
|
||||
pandora_delete_old_session_data (\%conf, $dbh, $ulimit_timestamp);
|
||||
|
||||
# Delete old inventory data
|
||||
|
||||
@ -678,6 +678,7 @@ sub pandora_load_config_pdb ($) {
|
||||
$conf->{'_netflow_nfexpire'} = get_db_value ($dbh, "SELECT value FROM tconfig WHERE token = 'netflow_nfexpire'");
|
||||
$conf->{'_netflow_path'} = get_db_value ($dbh, "SELECT value FROM tconfig WHERE token = 'netflow_path'");
|
||||
$conf->{'_delete_notinit'} = get_db_value ($dbh, "SELECT value FROM tconfig WHERE token = 'delete_notinit'");
|
||||
$conf->{'_session_timeout'} = get_db_value ($dbh, "SELECT value FROM tconfig WHERE token = 'session_timeout'");
|
||||
|
||||
$conf->{'_big_operation_step_datos_purge'} = get_db_value ($dbh, "SELECT value FROM tconfig WHERE token = 'big_operation_step_datos_purge'");
|
||||
$conf->{'_small_operation_step_datos_purge'} = get_db_value ($dbh, "SELECT value FROM tconfig WHERE token = 'small_operation_step_datos_purge'");
|
||||
@ -990,12 +991,28 @@ sub pandora_delete_old_export_data {
|
||||
# Delete old session data.
|
||||
##############################################################################
|
||||
sub pandora_delete_old_session_data {
|
||||
my ($dbh, $ulimit_timestamp) = @_;
|
||||
my ($conf, $dbh, $ulimit_timestamp) = @_;
|
||||
|
||||
my $session_timeout = $conf->{'_session_timeout'};
|
||||
|
||||
if ($session_timeout ne '') {
|
||||
if ($session_timeout == -1) {
|
||||
# The session expires in 10 years
|
||||
$session_timeout = 315576000;
|
||||
} else {
|
||||
$session_timeout *= 60;
|
||||
}
|
||||
|
||||
$ulimit_timestamp = time() - $session_timeout;
|
||||
}
|
||||
|
||||
log_message ('PURGE', "Deleting old session data from tsessions_php\n");
|
||||
while(db_delete_limit ($dbh, 'tsessions_php', 'last_active < ?', $SMALL_OPERATION_STEP, $ulimit_timestamp) ne '0E0') {
|
||||
usleep (10000);
|
||||
};
|
||||
|
||||
db_do ($dbh, "DELETE FROM tsessions_php WHERE
|
||||
data IS NULL OR id_session REGEXP '^cron-'");
|
||||
}
|
||||
|
||||
###############################################################################
|
||||
|
@ -36,7 +36,7 @@ use Encode::Locale;
|
||||
Encode::Locale::decode_argv;
|
||||
|
||||
# version: define current version
|
||||
my $version = "7.0NG.738 PS190821";
|
||||
my $version = "7.0NG.738 PS190919";
|
||||
|
||||
# save program name for logging
|
||||
my $progname = basename($0);
|
||||
|
Loading…
x
Reference in New Issue
Block a user