Merge branch '2784-Pantalla_por_dispositivos_filtrado_por_custom_fields' of https://brutus.artica.lan:8081/artica/pandorafms into 2784-Pantalla_por_dispositivos_filtrado_por_custom_fields
This commit is contained in:
commit
4a001d8192
|
@ -1,5 +1,5 @@
|
|||
package: pandorafms-agent-unix
|
||||
Version: 7.0NG.728-181112
|
||||
Version: 7.0NG.728-181113
|
||||
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.728-181112"
|
||||
pandora_version="7.0NG.728-181113"
|
||||
|
||||
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.728';
|
||||
use constant AGENT_BUILD => '181112';
|
||||
use constant AGENT_BUILD => '181113';
|
||||
|
||||
# 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.728
|
||||
%define release 181112
|
||||
%define release 181113
|
||||
|
||||
Summary: Pandora FMS Linux agent, PERL version
|
||||
Name: %{name}
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
#
|
||||
%define name pandorafms_agent_unix
|
||||
%define version 7.0NG.728
|
||||
%define release 181112
|
||||
%define release 181113
|
||||
|
||||
Summary: Pandora FMS Linux agent, PERL version
|
||||
Name: %{name}
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
# **********************************************************************
|
||||
|
||||
PI_VERSION="7.0NG.728"
|
||||
PI_BUILD="181112"
|
||||
PI_BUILD="181113"
|
||||
OS_NAME=`uname -s`
|
||||
|
||||
FORCE=0
|
||||
|
|
|
@ -186,7 +186,7 @@ UpgradeApplicationID
|
|||
{}
|
||||
|
||||
Version
|
||||
{181112}
|
||||
{181113}
|
||||
|
||||
ViewReadme
|
||||
{Yes}
|
||||
|
|
|
@ -30,7 +30,7 @@ using namespace Pandora;
|
|||
using namespace Pandora_Strutils;
|
||||
|
||||
#define PATH_SIZE _MAX_PATH+1
|
||||
#define PANDORA_VERSION ("7.0NG.728(Build 181112)")
|
||||
#define PANDORA_VERSION ("7.0NG.728(Build 181113)")
|
||||
|
||||
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.728(Build 181112))"
|
||||
VALUE "ProductVersion", "(7.0NG.728(Build 181113))"
|
||||
VALUE "FileVersion", "1.0.0.0"
|
||||
END
|
||||
END
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
package: pandorafms-console
|
||||
Version: 7.0NG.728-181112
|
||||
Version: 7.0NG.728-181113
|
||||
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.728-181112"
|
||||
pandora_version="7.0NG.728-181113"
|
||||
|
||||
package_pear=0
|
||||
package_pandora=1
|
||||
|
|
|
@ -2,6 +2,19 @@ START TRANSACTION;
|
|||
|
||||
ALTER TABLE `tusuario` DROP COLUMN `flash_chart`;
|
||||
|
||||
ALTER TABLE `tusuario` ADD COLUMN `default_custom_view` int(10) unsigned NULL default '0';
|
||||
|
||||
ALTER TABLE tlayout_template MODIFY `name` varchar(600) NOT NULL;
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `tagent_custom_fields_filter` (
|
||||
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
|
||||
`name` varchar(600) NOT NULL,
|
||||
`id_group` int(10) unsigned default '0',
|
||||
`id_custom_field` varchar(600) default '',
|
||||
`id_custom_fields_data` varchar(600) default '',
|
||||
`id_status` varchar(600) default '',
|
||||
`module_search` varchar(600) default '',
|
||||
PRIMARY KEY(`id`)
|
||||
) ENGINE = InnoDB DEFAULT CHARSET=utf8;
|
||||
|
||||
COMMIT;
|
||||
|
|
|
@ -1231,6 +1231,7 @@ ALTER TABLE tusuario ADD COLUMN `session_time` int(10) signed NOT NULL default '
|
|||
alter table tusuario add autorefresh_white_list text not null default '';
|
||||
ALTER TABLE tusuario ADD COLUMN `time_autorefresh` int(5) unsigned NOT NULL default '30';
|
||||
ALTER TABLE `tusuario` DROP COLUMN `flash_chart`;
|
||||
ALTER TABLE `tusuario` ADD COLUMN `default_custom_view` int(10) unsigned NULL default '0';
|
||||
|
||||
-- ---------------------------------------------------------------------
|
||||
-- Table `tagente_modulo`
|
||||
|
@ -1811,3 +1812,17 @@ ALTER TABLE `trecon_task` ADD COLUMN `snmp_auth_method` varchar(25) NOT NULL def
|
|||
ALTER TABLE `trecon_task` ADD COLUMN `snmp_privacy_method` varchar(25) NOT NULL default '';
|
||||
ALTER TABLE `trecon_task` ADD COLUMN `snmp_privacy_pass` varchar(255) NOT NULL default '';
|
||||
ALTER TABLE `trecon_task` ADD COLUMN `snmp_security_level` varchar(25) NOT NULL default '';
|
||||
|
||||
-- ---------------------------------------------------------------------
|
||||
-- Table `tagent_custom_fields_filter`
|
||||
-- ---------------------------------------------------------------------
|
||||
CREATE TABLE IF NOT EXISTS `tagent_custom_fields_filter` (
|
||||
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
|
||||
`name` varchar(600) NOT NULL,
|
||||
`id_group` int(10) unsigned default '0',
|
||||
`id_custom_field` varchar(600) default '',
|
||||
`id_custom_fields_data` varchar(600) default '',
|
||||
`id_status` varchar(600) default '',
|
||||
`module_search` varchar(600) default '',
|
||||
PRIMARY KEY(`id`)
|
||||
) ENGINE = InnoDB DEFAULT CHARSET=utf8;
|
||||
|
|
|
@ -1943,7 +1943,7 @@ switch ($tab) {
|
|||
|
||||
var aget_id_os = '<?php echo agents_get_os(modules_get_agentmodule_agent(get_parameter("id_agent_module"))); ?>';
|
||||
|
||||
if('<?php echo modules_get_agentmodule_name(get_parameter("id_agent_module")); ?>' != $('#text-name').val() &&
|
||||
if('<?php echo html_entity_decode(modules_get_agentmodule_name(get_parameter("id_agent_module"))); ?>' != $('#text-name').val() &&
|
||||
'<?php echo agents_get_os(modules_get_agentmodule_agent(get_parameter("id_agent_module"))); ?>' == 19){
|
||||
|
||||
event.preventDefault();
|
||||
|
@ -1977,7 +1977,7 @@ switch ($tab) {
|
|||
|
||||
var module_type_snmp = '<?php echo modules_get_agentmodule_type(get_parameter("id_agent_module")); ?>';
|
||||
|
||||
if('<?php echo modules_get_agentmodule_name(get_parameter("id_agent_module")); ?>' != $('#text-name').val() && (
|
||||
if('<?php echo html_entity_decode(modules_get_agentmodule_name(get_parameter("id_agent_module"))); ?>' != $('#text-name').val() && (
|
||||
module_type_snmp == 15 || module_type_snmp == 16 || module_type_snmp == 17 || module_type_snmp == 18)){
|
||||
|
||||
event.preventDefault();
|
||||
|
|
|
@ -169,6 +169,7 @@ if ($create_user) {
|
|||
$values['language'] = get_parameter ('language', 'default');
|
||||
$values['timezone'] = (string) get_parameter('timezone');
|
||||
$values['default_event_filter'] = (int) get_parameter('default_event_filter');
|
||||
$values['default_custom_view'] = (int) get_parameter('default_custom_view');
|
||||
$dashboard = get_parameter('dashboard', '');
|
||||
$visual_console = get_parameter('visual_console', '');
|
||||
|
||||
|
@ -281,6 +282,7 @@ if ($update_user) {
|
|||
$values['language'] = (string) get_parameter ('language');
|
||||
$values['timezone'] = (string) get_parameter('timezone');
|
||||
$values['default_event_filter'] = (int) get_parameter('default_event_filter');
|
||||
$values['default_custom_view'] = (int) get_parameter('default_custom_view');
|
||||
$dashboard = get_parameter('dashboard', '');
|
||||
$visual_console = get_parameter('visual_console', '');
|
||||
|
||||
|
@ -570,7 +572,16 @@ if (!$meta) {
|
|||
}
|
||||
}
|
||||
|
||||
$table->data[11][0] = __('Interactive charts').' '.ui_print_help_tip(__('Whether to use Javascript or static PNG graphs'), true) ;
|
||||
if($meta){
|
||||
$array_filters = get_filters_custom_fields_view(0, true);
|
||||
$table->data[11][0] = __('Search custom field view').' '.ui_print_help_tip(__('Load by default the selected view in custom field view'), true);
|
||||
$table->data[11][1] =html_print_select(
|
||||
$array_filters, 'default_custom_view',
|
||||
$user_info['default_custom_view'], '', __('None'), 0,
|
||||
true, false, true, '', false
|
||||
);
|
||||
}
|
||||
|
||||
$values = array(-1 => __('Use global conf'), 1 => __('Yes'), 0 => __('No'));
|
||||
|
||||
$table->data[12][0] = __('Home screen').
|
||||
|
@ -724,7 +735,6 @@ $(document).ready (function () {
|
|||
}
|
||||
else {
|
||||
$('#user_configuration_table-metaconsole_agents_manager').hide();
|
||||
$('#user_configuration_table-metaconsole_assigned_server').show();
|
||||
$('#user_configuration_table-metaconsole_access_node').hide();
|
||||
}
|
||||
});
|
||||
|
|
|
@ -35,9 +35,15 @@ $get_id_tag = (bool) get_parameter('get_id_tag', 0);
|
|||
$get_type = (bool) get_parameter('get_type', 0);
|
||||
$list_modules = (bool) get_parameter('list_modules', 0);
|
||||
$get_agent_modules_json_by_name = (bool) get_parameter('get_agent_modules_json_by_name', 0);
|
||||
|
||||
$get_custom_fields_data = (bool) get_parameter('get_custom_fields_data', 0);
|
||||
$build_table_custom_fields = (bool)get_parameter('build_table_custom_fields', 0);
|
||||
$build_table_child_custom_fields = (bool)get_parameter('build_table_child_custom_fields', 0);
|
||||
$build_table_save_filter = (bool)get_parameter('build_table_save_filter', 0);
|
||||
$append_tab_filter = (bool)get_parameter('append_tab_filter', 0);
|
||||
$create_filter_cf = (bool)get_parameter('create_filter_cf', 0);
|
||||
$update_filter_cf = (bool)get_parameter('update_filter_cf', 0);
|
||||
$delete_filter_cf = (bool)get_parameter('delete_filter_cf', 0);
|
||||
|
||||
if ($get_agent_modules_json_by_name) {
|
||||
$agent_name = get_parameter('agent_name');
|
||||
|
@ -1326,8 +1332,6 @@ if($build_table_child_custom_fields){
|
|||
$name_where
|
||||
);
|
||||
|
||||
hd($query, true, true);
|
||||
|
||||
$modules = db_get_all_rows_sql ($query);
|
||||
|
||||
$table_modules = new stdClass();
|
||||
|
@ -1335,15 +1339,15 @@ if($build_table_child_custom_fields){
|
|||
$table_modules->class="databox data";
|
||||
|
||||
$table_modules->head = array();
|
||||
$table_modules->head[0] = __('Name');
|
||||
$table_modules->head[1] = __('Data');
|
||||
$table_modules->head[2] = __('Min Warning');
|
||||
$table_modules->head[3] = __('Max Warning');
|
||||
$table_modules->head[4] = __('Min Critical');
|
||||
$table_modules->head[5] = __('Max Critical');
|
||||
$table_modules->head[0] = __('Module name');
|
||||
$table_modules->head[1] = __('Min Warning');
|
||||
$table_modules->head[2] = __('Max Warning');
|
||||
$table_modules->head[3] = __('Min Critical');
|
||||
$table_modules->head[4] = __('Max Critical');
|
||||
$table_modules->head[5] = __('Status');
|
||||
$table_modules->head[6] = __('Current interval');
|
||||
$table_modules->head[7] = __('Date');
|
||||
$table_modules->head[8] = __('Status');
|
||||
$table_modules->head[8] = __('Status');
|
||||
|
||||
$table_modules->data = array();
|
||||
if(isset($modules) && is_array($modules)){
|
||||
|
@ -1355,7 +1359,7 @@ if($build_table_child_custom_fields){
|
|||
$table_modules->data[$key][4] = $value['min_critical'];
|
||||
$table_modules->data[$key][5] = $value['max_critical'];
|
||||
$table_modules->data[$key][6] = $value['current_interval'];
|
||||
$table_modules->data[$key][7] = date('d/m/Y h:i:s', $value['utimestamp']);
|
||||
$table_modules->data[$key][7] = date('d/m/Y h:i:s', $value['utimestamp']);
|
||||
switch ($value['estado']) {
|
||||
case 0:
|
||||
case 300:
|
||||
|
@ -1428,6 +1432,275 @@ if($build_table_child_custom_fields){
|
|||
return;
|
||||
}
|
||||
|
||||
if($build_table_save_filter){
|
||||
$type_form = get_parameter("type_form", '');
|
||||
|
||||
if($type_form == 'save'){
|
||||
$tabs = '<div id="tabs" style="height:95%;">';
|
||||
$tabs .= "<ul class='tab_save_filter'>";
|
||||
$tabs .= "<li>";
|
||||
$tabs .= "<a href='#extended_create_filter' id='link_create'>";
|
||||
$tabs .= html_print_image('images/lightning_go.png',true);
|
||||
$tabs .= "<span>". __('New Filter') . "</span>";
|
||||
$tabs .= "</a>";
|
||||
$tabs .= "</li>";
|
||||
|
||||
$tabs .= "<li>";
|
||||
$tabs .= "<a href='#extended_update_filter' id='link_update'>";
|
||||
$tabs .= html_print_image('images/zoom.png',true);
|
||||
$tabs .= "<span>".__('Existing Filter')."</span>";
|
||||
$tabs .= "</a>";
|
||||
$tabs .= "</li>";
|
||||
$tabs .= "</ul>";
|
||||
|
||||
$tabs .= '<div id="extended_create_filter">';
|
||||
$tabs .= '</div>';
|
||||
$tabs .= '<div id="extended_update_filter">';
|
||||
$tabs .= '</div>';
|
||||
$tabs .= "</div>";
|
||||
echo $tabs;
|
||||
}
|
||||
else{
|
||||
$table = new StdClass;
|
||||
$table->id = 'save_filter_form';
|
||||
$table->width = '100%';
|
||||
$table->class = 'databox';
|
||||
|
||||
$array_filters = get_filters_custom_fields_view(0, true);
|
||||
$table->data[0][0] = __('Filter name');
|
||||
$table->data[0][1] = html_print_select(
|
||||
$array_filters, 'id_name',
|
||||
'', '', '', '',
|
||||
true, false, true, '', false
|
||||
);
|
||||
$table->data[0][3] = html_print_submit_button (__('Load filter'), 'load_filter', false, 'class="sub upd"', true);
|
||||
|
||||
echo "<form action='' method='post'>";
|
||||
html_print_table($table);
|
||||
echo "</form>";
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if($append_tab_filter){
|
||||
$filters = json_decode(io_safe_output(get_parameter("filters", '')), true);
|
||||
|
||||
$table = new StdClass;
|
||||
$table->id = 'save_filter_form';
|
||||
$table->width = '100%';
|
||||
$table->class = 'databox';
|
||||
|
||||
if($filters['id'] == 'extended_create_filter'){
|
||||
echo "<div id='msg_error_create'></div>";
|
||||
$table->data[0][0] = __('Filter name');
|
||||
$table->data[0][1] = html_print_input_text('id_name', '', '', 15, 255, true);
|
||||
$table->data[0][2] = html_print_submit_button (__('Create filter'), 'create_filter', false, 'class="sub upd"', true);
|
||||
}
|
||||
else{
|
||||
echo "<div id='msg_error_update'></div>";
|
||||
echo "<div id='msg_error_delete'></div>";
|
||||
$array_filters = get_filters_custom_fields_view(0, true);
|
||||
$table->data[0][0] = __('Filter name');
|
||||
$table->data[0][1] = html_print_select(
|
||||
$array_filters, 'id_name',
|
||||
'', '', __('None'), -1,
|
||||
true, false, true, '', false
|
||||
);
|
||||
$table->data[0][2] = html_print_submit_button (__('Delete filter'), 'delete_filter', false, 'class="sub upd"', true);
|
||||
$table->data[0][3] = html_print_submit_button (__('Update filter'), 'update_filter', false, 'class="sub upd"', true);
|
||||
}
|
||||
|
||||
html_print_table($table);
|
||||
return;
|
||||
}
|
||||
|
||||
if($create_filter_cf){
|
||||
//initialize result
|
||||
$result_array = array();
|
||||
$result_array['error'] = 0;
|
||||
$result_array['msg'] = '';
|
||||
|
||||
//initialize vars
|
||||
$filters = json_decode(io_safe_output(get_parameter("filters", '')), true);
|
||||
$name_filter = get_parameter("name_filter", '');
|
||||
|
||||
//check that the name is not empty
|
||||
if($name_filter == ''){
|
||||
$result_array['error'] = 1;
|
||||
$result_array['msg'] = ui_print_error_message(
|
||||
__('The name must not be empty'),
|
||||
'', true
|
||||
);
|
||||
echo json_encode($result_array);
|
||||
return;
|
||||
}
|
||||
|
||||
$name_exists = get_filters_custom_fields_view(0, false, $name_filter);
|
||||
|
||||
if($name_exists){
|
||||
$result_array['error'] = 1;
|
||||
$result_array['msg'] = ui_print_error_message(
|
||||
__('Filter name already exists in the bbdd'),
|
||||
'', true
|
||||
);
|
||||
echo json_encode($result_array);
|
||||
return;
|
||||
}
|
||||
|
||||
//check custom field is not empty
|
||||
if($filters['id_custom_fields'] == ''){
|
||||
$result_array['error'] = 1;
|
||||
$result_array['msg'] = ui_print_error_message(
|
||||
__('Please, select a custom field'),
|
||||
'', true
|
||||
);
|
||||
echo json_encode($result_array);
|
||||
return;
|
||||
}
|
||||
|
||||
//insert
|
||||
$values = array();
|
||||
$values['name'] = $name_filter;
|
||||
$values['id_group'] = $filters['group'];
|
||||
$values['id_custom_field'] = $filters['id_custom_fields'];
|
||||
$values['id_custom_fields_data'] = json_encode($filters['id_custom_fields_data']);
|
||||
$values['id_status'] = json_encode($filters['id_status']);
|
||||
$values['module_search'] = $filters['module_search'];
|
||||
|
||||
$insert = db_process_sql_insert('tagent_custom_fields_filter', $values);
|
||||
|
||||
//check error insert
|
||||
if($insert) {
|
||||
$result_array['error'] = 0;
|
||||
$result_array['msg'] = ui_print_success_message(
|
||||
__("Success create filter."),
|
||||
'', true
|
||||
);
|
||||
} else {
|
||||
$result_array['error'] = 1;
|
||||
$result_array['msg'] = ui_print_error_message(
|
||||
__("Error create filter."),
|
||||
'', true
|
||||
);
|
||||
}
|
||||
|
||||
echo json_encode($result_array);
|
||||
return;
|
||||
}
|
||||
|
||||
if($update_filter_cf){
|
||||
//initialize result
|
||||
$result_array = array();
|
||||
$result_array['error'] = 0;
|
||||
$result_array['msg'] = '';
|
||||
|
||||
//initialize vars
|
||||
$filters = json_decode(io_safe_output(get_parameter("filters", '')), true);
|
||||
$id_filter = get_parameter("id_filter", '');
|
||||
|
||||
//check selected filter
|
||||
if($id_filter == -1){
|
||||
$result_array['error'] = 1;
|
||||
$result_array['msg'] = ui_print_error_message(
|
||||
__('please, select a filter'),
|
||||
'', true
|
||||
);
|
||||
echo json_encode($result_array);
|
||||
return;
|
||||
}
|
||||
|
||||
//array condition update
|
||||
$condition = array();
|
||||
$condition['id'] = $id_filter;
|
||||
|
||||
//check selected custom fields
|
||||
if($filters['id_custom_fields'] == ''){
|
||||
$result_array['error'] = 1;
|
||||
$result_array['msg'] = ui_print_error_message(
|
||||
__('please, select a custom field'),
|
||||
'', true
|
||||
);
|
||||
echo json_encode($result_array);
|
||||
return;
|
||||
}
|
||||
|
||||
//array values update
|
||||
$values = array();
|
||||
$values['id_group'] = $filters['group'];
|
||||
$values['id_custom_field'] = $filters['id_custom_fields'];
|
||||
$values['id_custom_fields_data'] = json_encode($filters['id_custom_fields_data']);
|
||||
$values['id_status'] = json_encode($filters['id_status']);
|
||||
$values['module_search'] = $filters['module_search'];
|
||||
|
||||
//update
|
||||
$update = db_process_sql_update('tagent_custom_fields_filter', $values, $condition);
|
||||
|
||||
//check error insert
|
||||
if($update) {
|
||||
$result_array['error'] = 0;
|
||||
$result_array['msg'] = ui_print_success_message(
|
||||
__("Success update filter."),
|
||||
'', true
|
||||
);
|
||||
} else {
|
||||
$result_array['error'] = 1;
|
||||
$result_array['msg'] = ui_print_error_message(
|
||||
__("Error update filter."),
|
||||
'', true
|
||||
);
|
||||
}
|
||||
|
||||
echo json_encode($result_array);
|
||||
return;
|
||||
}
|
||||
|
||||
if($delete_filter_cf){
|
||||
//Initialize result
|
||||
$result_array = array();
|
||||
$result_array['error'] = 0;
|
||||
$result_array['msg'] = '';
|
||||
|
||||
//Initialize vars
|
||||
$filters = json_decode(io_safe_output(get_parameter("filters", '')), true);
|
||||
$id_filter = get_parameter("id_filter", '');
|
||||
|
||||
//Check selected filter
|
||||
if($id_filter == -1){
|
||||
$result_array['error'] = 1;
|
||||
$result_array['msg'] = ui_print_error_message(
|
||||
__('please, select a filter'),
|
||||
'', true
|
||||
);
|
||||
echo json_encode($result_array);
|
||||
return;
|
||||
}
|
||||
|
||||
//Array condition update
|
||||
$condition = array();
|
||||
$condition['id'] = $id_filter;
|
||||
|
||||
//Delete
|
||||
$delete = db_process_sql_delete('tagent_custom_fields_filter', $condition);
|
||||
|
||||
//Check error insert
|
||||
if($delete) {
|
||||
$result_array['error'] = 0;
|
||||
$result_array['msg'] = ui_print_success_message(
|
||||
__("Success delete filter."),
|
||||
'', true
|
||||
);
|
||||
} else {
|
||||
$result_array['error'] = 1;
|
||||
$result_array['msg'] = ui_print_error_message(
|
||||
__("Error delete filter."),
|
||||
'', true
|
||||
);
|
||||
}
|
||||
|
||||
echo json_encode($result_array);
|
||||
return;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
/**
|
||||
* Pandora build version and version
|
||||
*/
|
||||
$build_version = 'PC181112';
|
||||
$build_version = 'PC181113';
|
||||
$pandora_version = 'v7.0NG.728';
|
||||
|
||||
// Do not overwrite default timezone set if defined.
|
||||
|
|
|
@ -3204,4 +3204,33 @@ function agent_counters_custom_fields($filters){
|
|||
|
||||
return $final_result;
|
||||
}
|
||||
|
||||
function get_filters_custom_fields_view($id = 0, $for_select = false, $name = ""){
|
||||
if($for_select){
|
||||
$query = "SELECT id, `name` FROM tagent_custom_fields_filter";
|
||||
$rs = db_get_all_rows_sql($query);
|
||||
if(isset($rs) && is_array($rs)){
|
||||
foreach ($rs as $key => $value) {
|
||||
$result[$value['id']] = $value['name'];
|
||||
}
|
||||
}
|
||||
else{
|
||||
$result = false;
|
||||
}
|
||||
}
|
||||
else{
|
||||
$query = "SELECT * FROM tagent_custom_fields_filter WHERE 1=1";
|
||||
|
||||
if($id){
|
||||
$query .= " AND id = " . $id;
|
||||
}
|
||||
|
||||
if($name){
|
||||
$query .= " AND `name` = '" . $name . "'";
|
||||
}
|
||||
|
||||
$result = db_get_all_rows_sql($query);
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
?>
|
|
@ -495,17 +495,13 @@ function filemanager_file_explorer($real_directory, $relative_directory,
|
|||
|
||||
if ($homedir_filemanager === false) {
|
||||
$homedir_filemanager = $config['homedir'];
|
||||
unset($config['homedir_filemanager']);
|
||||
config_update_value('homedir_filemanager',
|
||||
$homedir_filemanager);
|
||||
}
|
||||
else {
|
||||
$config['homedir_filemanager'] = $homedir_filemanager;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
unset($config['homedir_filemanager']);
|
||||
config_update_value(
|
||||
'homedir_filemanager',
|
||||
$homedir_filemanager
|
||||
);
|
||||
|
||||
$hack_metaconsole = '';
|
||||
if (defined('METACONSOLE'))
|
||||
$hack_metaconsole = '../../';
|
||||
|
@ -743,11 +739,11 @@ function filemanager_file_explorer($real_directory, $relative_directory,
|
|||
//Actions buttons
|
||||
//Delete button
|
||||
$data[4] = '';
|
||||
$data[4] .= '<span style="">';
|
||||
$data[4] .= '<span style="display: flex">';
|
||||
$typefile = array_pop(explode(".",$fileinfo['name']));
|
||||
if (is_writable ($fileinfo['realpath']) &&
|
||||
(! is_dir ($fileinfo['realpath']) || count (scandir ($fileinfo['realpath'])) < 3)) {
|
||||
$data[4] .= '<form method="post" action="' . $url . '" style="display: inline;">';
|
||||
$data[4] .= '<form method="post" action="' . $url . '" style="">';
|
||||
$data[4] .= '<input type="image" src="images/cross.png" onClick="if (!confirm(\' '.__('Are you sure?').'\')) return false;">';
|
||||
$data[4] .= html_print_input_hidden ('filename', $fileinfo['realpath'], true);
|
||||
$data[4] .= html_print_input_hidden('hash', md5($fileinfo['realpath'] . $config['dbpass']), true);
|
||||
|
|
|
@ -4387,7 +4387,7 @@ function graph_monitor_wheel ($width = 550, $height = 600, $filter = false) {
|
|||
$data_agents[$agent_id]['children'][$module_group_id]['children'][] = $data_module;
|
||||
unset($modules[$module_id]);
|
||||
}
|
||||
function order_module_group_keys ($value, $key) {
|
||||
function order_module_group_keys ($value) {
|
||||
$value['children'] = array_merge($value['children']);
|
||||
return $value;
|
||||
}
|
||||
|
|
|
@ -1701,7 +1701,7 @@ function groups_get_tree_good (&$groups, $parent = false, &$childs) {
|
|||
if ($parent === false && (!isset($group['parent']) || $group['parent'] == 0 || !in_array($group['parent'], $groups))) {
|
||||
$return[$id] = $group;
|
||||
//unset($groups[$id]);
|
||||
$children = groups_get_tree_good($groups, $id);
|
||||
$children = groups_get_tree_good($groups, $id, $noUse);
|
||||
|
||||
if (!empty($children)) {
|
||||
$return[$id]['children'] = $children;
|
||||
|
@ -1713,7 +1713,7 @@ function groups_get_tree_good (&$groups, $parent = false, &$childs) {
|
|||
else if ($parent && isset($group['parent']) && $group['parent'] == $parent) {
|
||||
$return[$id] = $group;
|
||||
//unset($groups[$id]);
|
||||
$children = groups_get_tree_good($groups, $id);
|
||||
$children = groups_get_tree_good($groups, $id, $noUse);
|
||||
|
||||
if (!empty($children)) {
|
||||
$return[$id]['children'] = $children;
|
||||
|
|
|
@ -71,7 +71,7 @@
|
|||
<div style='height: 10px'>
|
||||
<?php
|
||||
$version = '7.0NG.728';
|
||||
$build = '181112';
|
||||
$build = '181113';
|
||||
$banner = "v$version Build $build";
|
||||
|
||||
error_reporting(0);
|
||||
|
|
|
@ -18,10 +18,11 @@
|
|||
global $config;
|
||||
|
||||
check_login ();
|
||||
if (_id_ != "_id_") {
|
||||
if (defined('_id_') && _id_ != "_id_") {
|
||||
$id = _id_;
|
||||
}
|
||||
else {
|
||||
define("_id_", "_id_");
|
||||
$id = get_parameter('id_networkmap', true);
|
||||
}
|
||||
|
||||
|
@ -36,8 +37,7 @@ if (enterprise_installed()) {
|
|||
$activeTab = $tab;
|
||||
}
|
||||
}
|
||||
|
||||
if (_activeTab_ != "_activeTab_") {
|
||||
if (defined("_activeTab_") && _activeTab_ != "_activeTab_") {
|
||||
$activeTab = _activeTab_;
|
||||
$tab = $activeTab;
|
||||
}
|
||||
|
|
|
@ -445,6 +445,7 @@ switch ($tab) {
|
|||
|
||||
if (enterprise_installed()) {
|
||||
$old_networkmaps_enterprise = db_get_all_rows_sql("SELECT * FROM tnetworkmap_enterprise");
|
||||
if ($old_networkmaps_enterprise === false) $old_networkmaps_enterprise = array();
|
||||
}
|
||||
$old_networkmaps_open = db_get_all_rows_sql("SELECT * FROM tnetwork_map");
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
#
|
||||
%define name pandorafms_console
|
||||
%define version 7.0NG.728
|
||||
%define release 181112
|
||||
%define release 181113
|
||||
|
||||
# User and Group under which Apache is running
|
||||
%define httpd_name httpd
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
#
|
||||
%define name pandorafms_console
|
||||
%define version 7.0NG.728
|
||||
%define release 181112
|
||||
%define release 181113
|
||||
%define httpd_name httpd
|
||||
# User and Group under which Apache is running
|
||||
%define httpd_name apache2
|
||||
|
|
|
@ -1133,6 +1133,7 @@ CREATE TABLE IF NOT EXISTS `tusuario` (
|
|||
`default_event_filter` int(10) unsigned NOT NULL default 0,
|
||||
`autorefresh_white_list` text not null default '',
|
||||
`time_autorefresh` int(5) unsigned NOT NULL default '30',
|
||||
`default_custom_view` int(10) unsigned NULL default '0',
|
||||
CONSTRAINT `fk_filter_id` FOREIGN KEY (`id_filter`) REFERENCES tevent_filter (`id_filter`) ON DELETE SET NULL,
|
||||
UNIQUE KEY `id_user` (`id_user`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
|
@ -3357,3 +3358,17 @@ CREATE TABLE IF NOT EXISTS `tlog_graph_models` (
|
|||
`average` tinyint(1) NOT NULL default '0',
|
||||
PRIMARY KEY(`id`)
|
||||
) ENGINE = InnoDB DEFAULT CHARSET=utf8;
|
||||
|
||||
-- ---------------------------------------------------------------------
|
||||
-- Table `tagent_custom_fields_filter`
|
||||
-- ---------------------------------------------------------------------
|
||||
CREATE TABLE IF NOT EXISTS `tagent_custom_fields_filter` (
|
||||
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
|
||||
`name` varchar(600) NOT NULL,
|
||||
`id_group` int(10) unsigned default '0',
|
||||
`id_custom_field` varchar(600) default '',
|
||||
`id_custom_fields_data` varchar(600) default '',
|
||||
`id_status` varchar(600) default '',
|
||||
`module_search` varchar(600) default '',
|
||||
PRIMARY KEY(`id`)
|
||||
) ENGINE = InnoDB DEFAULT CHARSET=utf8;
|
|
@ -1,5 +1,5 @@
|
|||
package: pandorafms-server
|
||||
Version: 7.0NG.728-181112
|
||||
Version: 7.0NG.728-181113
|
||||
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.728-181112"
|
||||
pandora_version="7.0NG.728-181113"
|
||||
|
||||
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.728";
|
||||
my $pandora_build = "181112";
|
||||
my $pandora_build = "181113";
|
||||
our $VERSION = $pandora_version." ".$pandora_build;
|
||||
|
||||
# Setup hash
|
||||
|
|
|
@ -52,7 +52,6 @@ my %Agents :shared;
|
|||
my $Sem :shared;
|
||||
my $TaskSem :shared;
|
||||
my $AgentSem :shared;
|
||||
my $ModuleSem :shared;
|
||||
|
||||
########################################################################################
|
||||
# Data Server class constructor.
|
||||
|
@ -69,7 +68,6 @@ sub new ($$;$) {
|
|||
$Sem = Thread::Semaphore->new;
|
||||
$TaskSem = Thread::Semaphore->new (0);
|
||||
$AgentSem = Thread::Semaphore->new (1);
|
||||
$ModuleSem = Thread::Semaphore->new (1);
|
||||
|
||||
# Call the constructor of the parent class
|
||||
my $self = $class->SUPER::new($config, DATASERVER, \&PandoraFMS::DataServer::data_producer, \&PandoraFMS::DataServer::data_consumer, $dbh);
|
||||
|
@ -677,7 +675,6 @@ sub process_module_data ($$$$$$$$$$) {
|
|||
$module_conf->{'module_macros'} = '' unless defined ($module_conf->{'module_macros'});
|
||||
|
||||
# Get module data or create it if it does not exist
|
||||
$ModuleSem->down ();
|
||||
my $module = get_db_single_row ($dbh, 'SELECT * FROM tagente_modulo WHERE id_agente = ? AND ' . db_text ('nombre') . ' = ?', $agent->{'id_agente'}, safe_input($module_name));
|
||||
if (! defined ($module)) {
|
||||
|
||||
|
@ -685,14 +682,12 @@ sub process_module_data ($$$$$$$$$$) {
|
|||
# Do not auto create modules
|
||||
#if ($pa_config->{'autocreate'} ne '1') {
|
||||
# logger($pa_config, "Module '$module_name' not found for agent '$agent_name' and module auto-creation disabled.", 10);
|
||||
# $ModuleSem->up ();
|
||||
# return;
|
||||
#}
|
||||
|
||||
# Is the agent not learning?
|
||||
if (($agent->{'modo'} == 0) && !($force_processing)) {
|
||||
logger($pa_config, "Learning mode disabled. Skipping module '$module_name' agent '$agent_name'.", 10);
|
||||
$ModuleSem->up ();
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -700,7 +695,6 @@ sub process_module_data ($$$$$$$$$$) {
|
|||
$module_conf->{'id_tipo_modulo'} = get_module_id ($dbh, $module_type);
|
||||
if ($module_conf->{'id_tipo_modulo'} <= 0) {
|
||||
logger($pa_config, "Invalid module type '$module_type' for module '$module_name' agent '$agent_name'.", 3);
|
||||
$ModuleSem->up ();
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -758,7 +752,6 @@ sub process_module_data ($$$$$$$$$$) {
|
|||
$module = get_db_single_row ($dbh, 'SELECT * FROM tagente_modulo WHERE id_agente = ? AND ' . db_text('nombre') . ' = ?', $agent->{'id_agente'}, safe_input($module_name));
|
||||
if (! defined ($module)) {
|
||||
logger($pa_config, "Could not create module '$module_name' for agent '$agent_name'.", 3);
|
||||
$ModuleSem->up ();
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -816,8 +809,6 @@ sub process_module_data ($$$$$$$$$$) {
|
|||
update_module_configuration ($pa_config, $dbh, $module, $module_conf);
|
||||
}
|
||||
|
||||
$ModuleSem->up ();
|
||||
|
||||
# Module disabled!
|
||||
if ($module->{'disabled'} eq '1') {
|
||||
logger($pa_config, "Skipping disabled module '$module_name' agent '$agent_name'.", 10);
|
||||
|
|
|
@ -32,7 +32,7 @@ our @ISA = qw(Exporter);
|
|||
|
||||
# version: Defines actual version of Pandora Server for this module only
|
||||
my $pandora_version = "7.0NG.728";
|
||||
my $pandora_build = "181112";
|
||||
my $pandora_build = "181113";
|
||||
our $VERSION = $pandora_version." ".$pandora_build;
|
||||
|
||||
our %EXPORT_TAGS = ( 'all' => [ qw() ] );
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
#
|
||||
%define name pandorafms_server
|
||||
%define version 7.0NG.728
|
||||
%define release 181112
|
||||
%define release 181113
|
||||
|
||||
Summary: Pandora FMS Server
|
||||
Name: %{name}
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
#
|
||||
%define name pandorafms_server
|
||||
%define version 7.0NG.728
|
||||
%define release 181112
|
||||
%define release 181113
|
||||
|
||||
Summary: Pandora FMS Server
|
||||
Name: %{name}
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
# **********************************************************************
|
||||
|
||||
PI_VERSION="7.0NG.728"
|
||||
PI_BUILD="181112"
|
||||
PI_BUILD="181113"
|
||||
|
||||
MODE=$1
|
||||
if [ $# -gt 1 ]; then
|
||||
|
|
|
@ -34,7 +34,7 @@ use PandoraFMS::Config;
|
|||
use PandoraFMS::DB;
|
||||
|
||||
# version: define current version
|
||||
my $version = "7.0NG.728 PS181112";
|
||||
my $version = "7.0NG.728 PS181113";
|
||||
|
||||
# Pandora server configuration
|
||||
my %conf;
|
||||
|
@ -297,7 +297,9 @@ sub pandora_purgedb ($$) {
|
|||
|
||||
my $buffer = 1000;
|
||||
my $id_module = $module->{'id_agente_modulo'};
|
||||
|
||||
|
||||
db_do ($dbh, 'UPDATE tagente_modulo SET parent_module_id=0 WHERE parent_module_id=?', $id_module);
|
||||
|
||||
log_message ('', ".");
|
||||
|
||||
while(1) {
|
||||
|
|
|
@ -36,7 +36,7 @@ use Encode::Locale;
|
|||
Encode::Locale::decode_argv;
|
||||
|
||||
# version: define current version
|
||||
my $version = "7.0NG.728 PS181112";
|
||||
my $version = "7.0NG.728 PS181113";
|
||||
|
||||
# save program name for logging
|
||||
my $progname = basename($0);
|
||||
|
|
Loading…
Reference in New Issue