Merge branch 'ent-4388-Nuevos-eventos' of https://brutus.artica.lan:8081/artica/pandorafms into ent-4388-Nuevos-eventos

This commit is contained in:
alejandro-campos 2019-08-05 16:24:00 +02:00
commit b43c489b1a
82 changed files with 804 additions and 494 deletions

49
pandora_agents/Dockerfile Normal file
View File

@ -0,0 +1,49 @@
FROM centos:centos7
MAINTAINER Pandora FMS Team <info@pandorafms.com>
# Add Pandora FMS agent installer
ADD unix /tmp/pandora_agent/unix
# Install dependencies
RUN yum -y install \
epel-release \
unzip \
perl \
sed \
"perl(Sys::Syslog)"
# Install Pandora FMS agent
RUN cd /tmp/pandora_agent/unix \
&& ./pandora_agent_installer --install
# Set default variables
ENV SERVER_IP '127.0.0.1'
ENV REMOTE_CONFIG '0'
ENV GROUP 'Servers'
ENV DEBUG '0'
ENV AGENT_NAME 'agent_docker'
ENV AGENT_ALIAS 'agent_docker'
ENV TIMEZONE 'UTC'
ENV SECONDARY_GROUPS ''
# Create the entrypoint script.
RUN echo -e '#/bin/bash\n \
sed -i "s/^server_ip.*$/server_ip $SERVER_IP/g" /etc/pandora/pandora_agent.conf\n \
sed -i "s/^remote_config.*$/remote_config $REMOTE_CONFIG/g" /etc/pandora/pandora_agent.conf\n \
sed -i "s/^group.*$/group $GROUP/g" /etc/pandora/pandora_agent.conf\n \
sed -i "s/^debug.*$/debug $DEBUG/g" /etc/pandora/pandora_agent.conf\n \
sed -i "s/^#agent_name.*$/agent_name $AGENT_NAME/g" /etc/pandora/pandora_agent.conf\n \
sed -i "s/^#agent_alias.*$/agent_alias $AGENT_ALIAS/g" /etc/pandora/pandora_agent.conf\n \
sed -i "s/^# secondary_groups.*$/secondary_groups $SECONDARY_GROUPS/g" /etc/pandora/pandora_agent.conf\n \
if [ $TIMEZONE != "" ]; then\n \
\tln -sfn /usr/share/zoneinfo/$TIMEZONE /etc/localtime\n \
fi\n \
/etc/init.d/pandora_agent_daemon start\n \
rm -f $0\n \
bash' \
>> /entrypoint.sh && \
chmod +x /entrypoint.sh
# Entrypoint + CMD
ENTRYPOINT ["bash"]
CMD ["/entrypoint.sh"]

View File

@ -0,0 +1,18 @@
#!/bin/bash
source /root/code/pandorafms/extras/build_vars.sh
# Set tag for docker build
if [ "$1" == "nightly" ]; then
LOCAL_VERSION="latest"
else
LOCAL_VERSION=$VERSION
fi
# Build image with code
docker build --rm=true --pull --no-cache -t pandorafms/pandorafms-agent:$LOCAL_VERSION -f $CODEHOME/pandora_agents/Dockerfile $CODEHOME/pandora_agents/
# Push image
docker push pandorafms/pandorafms-agent:$LOCAL_VERSION
# Delete local image
docker image rm -f pandorafms/pandorafms-agent:$LOCAL_VERSION

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents
# Version 7.0NG.736, AIX version
# Version 7.0NG.737, AIX version
# Licensed under GPL license v2,
# Copyright (c) 2003-2010 Artica Soluciones Tecnologicas
# http://www.pandorafms.com

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents
# Version 7.0NG.736, FreeBSD Version
# Version 7.0NG.737, FreeBSD Version
# Licensed under GPL license v2,
# Copyright (c) 2003-2010 Artica Soluciones Tecnologicas
# http://www.pandorafms.com

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents
# Version 7.0NG.736, HP-UX Version
# Version 7.0NG.737, HP-UX Version
# Licensed under GPL license v2,
# Copyright (c) 2003-2009 Artica Soluciones Tecnologicas
# http://www.pandorafms.com

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents
# Version 7.0NG.736, GNU/Linux
# Version 7.0NG.737, GNU/Linux
# Licensed under GPL license v2,
# Copyright (c) 2003-2009 Artica Soluciones Tecnologicas
# http://www.pandorafms.com

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents
# Version 7.0NG.736, GNU/Linux
# Version 7.0NG.737, GNU/Linux
# Licensed under GPL license v2,
# Copyright (c) 2003-2009 Artica Soluciones Tecnologicas
# http://www.pandorafms.com

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents
# Version 7.0NG.736, Solaris Version
# Version 7.0NG.737, Solaris Version
# Licensed under GPL license v2,
# Copyright (c) 2003-2009 Artica Soluciones Tecnologicas
# http://www.pandorafms.com

View File

@ -1,6 +1,6 @@
# Base config file for Pandora FMS Windows Agent
# (c) 2006-2010 Artica Soluciones Tecnologicas
# Version 7.0NG.736
# Version 7.0NG.737
# This program is Free Software, you can redistribute it and/or modify it
# under the terms of the GNU General Public Licence as published by the Free Software

View File

@ -1,6 +1,6 @@
# Fichero de configuracion base de agentes de Pandora
# Base config file for Pandora agents
# Version 7.0NG.736, AIX version
# Version 7.0NG.737, AIX version
# General Parameters
# ==================

View File

@ -1,6 +1,6 @@
# Fichero de configuracion base de agentes de Pandora
# Base config file for Pandora agents
# Version 7.0NG.736
# Version 7.0NG.737
# FreeBSD/IPSO version
# Licenced under GPL licence, 2003-2007 Sancho Lerena

View File

@ -1,6 +1,6 @@
# Fichero de configuracion base de agentes de Pandora
# Base config file for Pandora agents
# Version 7.0NG.736, HPUX Version
# Version 7.0NG.737, HPUX Version
# General Parameters
# ==================

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents
# Version 7.0NG.736
# Version 7.0NG.737
# Licensed under GPL license v2,
# (c) 2003-2010 Artica Soluciones Tecnologicas
# please visit http://pandora.sourceforge.net

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents
# Version 7.0NG.736
# Version 7.0NG.737
# Licensed under GPL license v2,
# (c) 2003-2009 Artica Soluciones Tecnologicas
# please visit http://pandora.sourceforge.net

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents
# Version 7.0NG.736
# Version 7.0NG.737
# Licensed under GPL license v2,
# please visit http://pandora.sourceforge.net

View File

@ -1,6 +1,6 @@
# Fichero de configuracion base de agentes de Pandora
# Base config file for Pandora agents
# Version 7.0NG.736, Solaris version
# Version 7.0NG.737, Solaris version
# General Parameters
# ==================

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents
# Version 7.0NG.736, AIX version
# Version 7.0NG.737, AIX version
# Licensed under GPL license v2,
# Copyright (c) 2003-2010 Artica Soluciones Tecnologicas
# http://www.pandorafms.com

View File

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

View File

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

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents
# Version 7.0NG.736, GNU/Linux
# Version 7.0NG.737, GNU/Linux
# Licensed under GPL license v2,
# Copyright (c) 2003-2012 Artica Soluciones Tecnologicas
# http://www.pandorafms.com

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents
# Version 7.0NG.736, FreeBSD Version
# Version 7.0NG.737, FreeBSD Version
# Licensed under GPL license v2,
# Copyright (c) 2003-2016 Artica Soluciones Tecnologicas
# http://www.pandorafms.com

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents
# Version 7.0NG.736, HP-UX Version
# Version 7.0NG.737, HP-UX Version
# Licensed under GPL license v2,
# Copyright (c) 2003-2009 Artica Soluciones Tecnologicas
# http://www.pandorafms.com

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents
# Version 7.0NG.736, GNU/Linux
# Version 7.0NG.737, GNU/Linux
# Licensed under GPL license v2,
# Copyright (c) 2003-2014 Artica Soluciones Tecnologicas
# http://www.pandorafms.com

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents
# Version 7.0NG.736, GNU/Linux
# Version 7.0NG.737, GNU/Linux
# Licensed under GPL license v2,
# Copyright (c) 2003-2009 Artica Soluciones Tecnologicas
# http://www.pandorafms.com

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents
# Version 7.0NG.736, NetBSD Version
# Version 7.0NG.737, NetBSD Version
# Licensed under GPL license v2,
# Copyright (c) 2003-2010 Artica Soluciones Tecnologicas
# http://www.pandorafms.com

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents
# Version 7.0NG.736, Solaris Version
# Version 7.0NG.737, Solaris Version
# Licensed under GPL license v2,
# Copyright (c) 2003-2009 Artica Soluciones Tecnologicas
# http://www.pandorafms.com

View File

@ -41,8 +41,8 @@ my $Sem = undef;
# Semaphore used to control the number of threads
my $ThreadSem = undef;
use constant AGENT_VERSION => '7.0NG.736';
use constant AGENT_BUILD => '190729';
use constant AGENT_VERSION => '7.0NG.737';
use constant AGENT_BUILD => '190805';
# Agent log default file size maximum and instances
use constant DEFAULT_MAX_LOG_SIZE => 600000;

View File

@ -2,8 +2,8 @@
#Pandora FMS Linux Agent
#
%define name pandorafms_agent_unix
%define version 7.0NG.736
%define release 190729
%define version 7.0NG.737
%define release 190805
Summary: Pandora FMS Linux agent, PERL version
Name: %{name}

View File

@ -2,8 +2,8 @@
#Pandora FMS Linux Agent
#
%define name pandorafms_agent_unix
%define version 7.0NG.736
%define release 190729
%define version 7.0NG.737
%define release 190805
Summary: Pandora FMS Linux agent, PERL version
Name: %{name}

View File

@ -9,8 +9,8 @@
# Please see http://www.pandorafms.org. This code is licensed under GPL 2.0 license.
# **********************************************************************
PI_VERSION="7.0NG.736"
PI_BUILD="190729"
PI_VERSION="7.0NG.737"
PI_BUILD="190805"
OS_NAME=`uname -s`
FORCE=0

View File

@ -1,6 +1,6 @@
# Base config file for Pandora FMS Windows Agent
# (c) 2006-2017 Artica Soluciones Tecnologicas
# Version 7.0NG.736
# Version 7.0NG.737
# This program is Free Software, you can redistribute it and/or modify it
# under the terms of the GNU General Public Licence as published by the Free Software

View File

@ -3,7 +3,7 @@ AllowLanguageSelection
{Yes}
AppName
{Pandora FMS Windows Agent v7.0NG.736}
{Pandora FMS Windows Agent v7.0NG.737}
ApplicationID
{17E3D2CF-CA02-406B-8A80-9D31C17BD08F}
@ -186,7 +186,7 @@ UpgradeApplicationID
{}
Version
{190729}
{190805}
ViewReadme
{Yes}

View File

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

View File

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

View File

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

View File

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

View File

@ -12,4 +12,40 @@ ALTER TABLE `tmodule_relationship` ADD COLUMN `type` ENUM('direct', 'failover')
ALTER TABLE `treport_content` MODIFY COLUMN `name` varchar(300) NULL;
COMMIT;
CREATE TABLE `tagent_repository` (
`id` SERIAL,
`id_os` INT(10) UNSIGNED DEFAULT 0,
`arch` ENUM('x64', 'x86') DEFAULT 'x64',
`version` VARCHAR(10) DEFAULT '',
`path` text,
`uploaded_by` VARCHAR(100) DEFAULT '',
`uploaded` bigint(20) NOT NULL DEFAULT 0 COMMENT "When it was uploaded",
`last_err` text,
PRIMARY KEY (`id`),
FOREIGN KEY (`id_os`) REFERENCES `tconfig_os`(`id_os`)
ON UPDATE CASCADE ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `tdeployment_hosts` (
`id` SERIAL,
`id_cs` VARCHAR(100),
`ip` VARCHAR(100) NOT NULL UNIQUE,
`id_os` INT(10) UNSIGNED DEFAULT 0,
`os_version` VARCHAR(100) DEFAULT '' COMMENT "OS version in STR format",
`arch` ENUM('x64', 'x86') DEFAULT 'x64',
`current_agent_version` VARCHAR(100) DEFAULT '' COMMENT "String latest installed agent",
`target_agent_version_id` BIGINT UNSIGNED,
`deployed` bigint(20) NOT NULL DEFAULT 0 COMMENT "When it was deployed",
`server_ip` varchar(100) default NULL COMMENT "Where to point target agent",
`last_err` text,
PRIMARY KEY (`id`),
FOREIGN KEY (`id_cs`) REFERENCES `tcredential_store`(`identifier`)
ON UPDATE CASCADE ON DELETE SET NULL,
FOREIGN KEY (`id_os`) REFERENCES `tconfig_os`(`id_os`)
ON UPDATE CASCADE ON DELETE CASCADE,
FOREIGN KEY (`target_agent_version_id`) REFERENCES `tagent_repository`(`id`)
ON UPDATE CASCADE ON DELETE SET NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
COMMIT;

View File

@ -2,4 +2,11 @@ START TRANSACTION;
UPDATE `tconfig` SET `value` = 'mini_severity,evento,id_agente,estado,timestamp' WHERE `token` LIKE 'event_fields';
DELETE FROM `talert_commands` WHERE `id` = 11;
DELETE FROM `tconfig` WHERE `token` LIKE 'integria_enabled';
DELETE FROM `tconfig` WHERE `token` LIKE 'integria_api_password';
DELETE FROM `tconfig` WHERE `token` LIKE 'integria_inventory';
DELETE FROM `tconfig` WHERE `token` LIKE 'integria_url';
COMMIT;

View File

@ -1225,6 +1225,8 @@ ALTER TABLE `talert_commands` ADD COLUMN `fields_hidden` text;
UPDATE `talert_actions` SET `field4` = 'text/html', `field4_recovery` = 'text/html' WHERE id = 1;
DELETE FROM `talert_commands` WHERE `id` = 11;
-- ---------------------------------------------------------------------
-- Table `tmap`
-- ---------------------------------------------------------------------
@ -1250,6 +1252,10 @@ DELETE FROM `tconfig` WHERE `token` = 'current_package_enterprise';
INSERT INTO `tconfig` (`token`, `value`) VALUES ('current_package_enterprise', '737');
INSERT INTO `tconfig` (`token`, `value`) VALUES ('status_monitor_fields', 'policy,agent,data_type,module_name,server_type,interval,status,graph,warn,data,timestamp');
UPDATE `tconfig` SET `value` = 'mini_severity,evento,id_agente,estado,timestamp' WHERE `token` LIKE 'event_fields';
DELETE FROM `tconfig` WHERE `token` LIKE 'integria_enabled';
DELETE FROM `tconfig` WHERE `token` LIKE 'integria_api_password';
DELETE FROM `tconfig` WHERE `token` LIKE 'integria_inventory';
DELETE FROM `tconfig` WHERE `token` LIKE 'integria_url';
-- ---------------------------------------------------------------------
-- Table `tconfig_os`
@ -2221,3 +2227,44 @@ CREATE TABLE IF NOT EXISTS `tcredential_store` (
-- Table `treport_content_sla_combined`
-- ---------------------------------------------------------------------
ALTER TABLE `treport_content_sla_combined` ADD `id_agent_module_failover` int(10) unsigned NOT NULL;
-- ---------------------------------------------------------------------
-- Table `tagent_repository`
-- ---------------------------------------------------------------------
CREATE TABLE `tagent_repository` (
`id` SERIAL,
`id_os` INT(10) UNSIGNED DEFAULT 0,
`arch` ENUM('x64', 'x86') DEFAULT 'x64',
`version` VARCHAR(10) DEFAULT '',
`path` text,
`uploaded_by` VARCHAR(100) DEFAULT '',
`uploaded` bigint(20) NOT NULL DEFAULT 0 COMMENT "When it was uploaded",
`last_err` text,
PRIMARY KEY (`id`),
FOREIGN KEY (`id_os`) REFERENCES `tconfig_os`(`id_os`)
ON UPDATE CASCADE ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- ----------------------------------------------------------------------
-- Table `tdeployment_hosts`
-- ----------------------------------------------------------------------
CREATE TABLE `tdeployment_hosts` (
`id` SERIAL,
`id_cs` VARCHAR(100),
`ip` VARCHAR(100) NOT NULL UNIQUE,
`id_os` INT(10) UNSIGNED DEFAULT 0,
`os_version` VARCHAR(100) DEFAULT '' COMMENT "OS version in STR format",
`arch` ENUM('x64', 'x86') DEFAULT 'x64',
`current_agent_version` VARCHAR(100) DEFAULT '' COMMENT "String latest installed agent",
`target_agent_version_id` BIGINT UNSIGNED,
`deployed` bigint(20) NOT NULL DEFAULT 0 COMMENT "When it was deployed",
`server_ip` varchar(100) default NULL COMMENT "Where to point target agent",
`last_err` text,
PRIMARY KEY (`id`),
FOREIGN KEY (`id_cs`) REFERENCES `tcredential_store`(`identifier`)
ON UPDATE CASCADE ON DELETE SET NULL,
FOREIGN KEY (`id_os`) REFERENCES `tconfig_os`(`id_os`)
ON UPDATE CASCADE ON DELETE CASCADE,
FOREIGN KEY (`target_agent_version_id`) REFERENCES `tagent_repository`(`id`)
ON UPDATE CASCADE ON DELETE SET NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

View File

@ -524,8 +524,10 @@ if (enterprise_installed()) {
);
$safe_mode_modules = [];
$safe_mode_modules[0] = __('Any');
foreach ($sql_modules as $m) {
$safe_mode_modules[$m['id_module']] = $m['name'];
if (is_array($sql_modules)) {
foreach ($sql_modules as $m) {
$safe_mode_modules[$m['id_module']] = $m['name'];
}
}
$table_adv_safe = '<div class="label_select_simple label_simple_items"><p class="input_label input_label_simple">'.__('Safe operation mode').': '.ui_print_help_tip(

View File

@ -369,7 +369,7 @@ echo '</div>';
text = err.message;
failed = 1;
}
if (!failed && data['error']) {
if (!failed && data['error'] != undefined) {
title = "<?php echo __('Failed'); ?>";
text = data['error'];
failed = 1;
@ -522,12 +522,10 @@ echo '</div>';
function calculate_inputs() {
if ($('#product :selected').val() == "CUSTOM") {
$('#div-username label').text('<?php echo __('Username'); ?>');
$('#div-username label').text('<?php echo __('User'); ?>');
$('#div-password label').text('<?php echo __('Password'); ?>');
$('#div-extra_1 label').text('<?php echo __('Extra'); ?>');
$('#div-extra_2 label').text('<?php echo __('Extra (2)'); ?>');
$('#div-extra_1').show();
$('#div-extra_2').show();
$('#div-extra_1').hide();
$('#div-extra_2').hide();
} else if ($('#product :selected').val() == "AWS") {
$('#div-username label').text('<?php echo __('Access key ID'); ?>');
$('#div-password label').text('<?php echo __('Secret access key'); ?>');
@ -557,8 +555,8 @@ echo '</div>';
success: function(data) {
$('#form_new').html(data);
$('#id_group').val(0);
// By default AWS.
$('#product').val('AWS');
// By default CUSTOM.
$('#product').val('CUSTOM');
calculate_inputs();
$('#product').on('change', function() {
@ -590,9 +588,6 @@ echo '</div>';
text: 'OK',
click: function(e) {
var values = {};
console.log($('#form_new'));
$('#form_new :input').each(function() {
values[this.name] = btoa($(this).val());
});

View File

@ -24,23 +24,24 @@ $menu_godmode['class'] = 'godmode';
if (check_acl($config['id_user'], 0, 'PM')) {
$sub = [];
$sub['godmode/servers/discovery&wiz=main']['text'] = __('Discovery Main');
$sub['godmode/servers/discovery&wiz=main']['text'] = __('Main');
$sub['godmode/servers/discovery&wiz=main']['id'] = 'Discovery';
$sub['godmode/servers/discovery&wiz=tasklist']['text'] = __('Task list');
$sub['godmode/servers/discovery&wiz=tasklist']['id'] = 'tasklist';
$sub['godmode/servers/discovery&wiz=app']['text'] = __('Applications');
$sub['godmode/servers/discovery&wiz=app']['id'] = 'app';
$sub['godmode/servers/discovery&wiz=cloud']['text'] = __('Cloud');
$sub['godmode/servers/discovery&wiz=cloud']['id'] = 'cloud';
$sub['godmode/servers/discovery&wiz=ctask']['text'] = __('Console task');
$sub['godmode/servers/discovery&wiz=ctask']['id'] = 'ctask';
$sub2 = [];
$sub2['godmode/servers/discovery&wiz=hd&mode=netscan']['text'] = __('Network scan');
enterprise_hook('hostdevices_submenu');
$sub2['godmode/servers/discovery&wiz=hd&mode=customnetscan']['text'] = __('Custom network scan');
$sub2['godmode/servers/discovery&wiz=hd&mode=managenetscanscripts']['text'] = __('Manage scan scripts');
$sub['godmode/servers/discovery&wiz=hd']['text'] = __('Host & devices');
$sub['godmode/servers/discovery&wiz=hd']['id'] = 'hd';
$sub['godmode/servers/discovery&wiz=hd']['sub2'] = $sub2;
enterprise_hook('applications_menu');
enterprise_hook('cloud_menu');
enterprise_hook('console_task_menu');
// Add to menu.
$menu_godmode['discovery']['text'] = __('Discovery');
@ -128,6 +129,7 @@ if (check_acl($config['id_user'], 0, 'PM')) {
$sub['godmode/modules/manage_network_templates']['id'] = 'Module templates';
enterprise_hook('inventory_submenu');
enterprise_hook('autoconfiguration_menu');
enterprise_hook('agent_repository_menu');
}
if (check_acl($config['id_user'], 0, 'AW')) {

View File

@ -42,7 +42,19 @@ function get_wiz_class($str)
return 'ConsoleTasks';
default:
// Ignore.
// Main, show header.
ui_print_page_header(
__('Discovery'),
'',
false,
'',
true,
'',
false,
'',
GENERIC_SIZE_TEXT,
''
);
return null;
}
}
@ -81,7 +93,7 @@ function cl_load_cmp($a, $b)
$classes = glob($config['homedir'].'/godmode/wizards/*.class.php');
if (enterprise_installed()) {
$ent_classes = glob(
$config['homedir'].'/enterprise/godmode/wizards/*.class.php'
$config['homedir'].'/'.ENTERPRISE_DIR.'/godmode/wizards/*.class.php'
);
if ($ent_classes === false) {
$ent_classes = [];
@ -130,7 +142,7 @@ if ($classname_selected === null) {
}
}
// Show hints if there is no task
// Show hints if there is no task.
if (get_parameter('discovery_hint', 0)) {
ui_require_css_file('discovery-hint');
ui_print_info_message(__('You must create a task first'));

View File

@ -418,6 +418,7 @@ class DiscoveryTaskList extends Wizard
$table->align[9] = 'left';
foreach ($recon_tasks as $task) {
$no_operations = false;
$data = [];
$server_name = servers_get_name($task['id_recon_server']);
@ -552,6 +553,17 @@ class DiscoveryTaskList extends Wizard
$data[6] .= __('Discovery.App.Oracle');
break;
case DISCOVERY_DEPLOY_AGENTS:
// Internal deployment task.
$no_operations = true;
$data[6] = html_print_image(
'images/deploy.png',
true,
['title' => __('Agent deployment')]
).'&nbsp;&nbsp;';
$data[6] .= __('Discovery.Agent.Deployment');
break;
case DISCOVERY_HOSTDEVICES:
default:
if ($task['id_recon_script'] == 0) {
@ -595,71 +607,75 @@ class DiscoveryTaskList extends Wizard
$data[8] = __('Not executed yet');
}
if ($task['disabled'] != 2) {
$data[9] = '<a href="#" onclick="progress_task_list('.$task['id_rt'].',\''.$task['name'].'\')">';
$data[9] .= html_print_image(
'images/eye.png',
true
);
$data[9] .= '</a>';
}
if ($task['disabled'] != 2 && $task['utimestamp'] > 0
&& $task['type'] != DISCOVERY_APP_MYSQL
&& $task['type'] != DISCOVERY_APP_ORACLE
&& $task['type'] != DISCOVERY_CLOUD_AWS_RDS
) {
$data[9] .= '<a href="#" onclick="show_map('.$task['id_rt'].',\''.$task['name'].'\')">';
$data[9] .= html_print_image(
'images/dynamic_network_icon.png',
true
);
$data[9] .= '</a>';
}
if (check_acl(
$config['id_user'],
$task['id_group'],
'PM'
)
) {
if ($ipam === true) {
$data[9] .= '<a href="'.ui_get_full_url(
sprintf(
'index.php?sec=godmode/extensions&sec2=enterprise/extensions/ipam&action=edit&id=%d',
$tipam_task_id
)
).'">'.html_print_image(
'images/config.png',
if (!$no_operations) {
if ($task['disabled'] != 2) {
$data[9] = '<a href="#" onclick="progress_task_list('.$task['id_rt'].',\''.$task['name'].'\')">';
$data[9] .= html_print_image(
'images/eye.png',
true
).'</a>';
$data[9] .= '<a href="'.ui_get_full_url(
'index.php?sec=godmode/extensions&sec2=enterprise/extensions/ipam&action=delete&id='.$tipam_task_id
).'" onClick="if (!confirm(\' '.__('Are you sure?').'\')) return false;">'.html_print_image(
'images/cross.png',
);
$data[9] .= '</a>';
}
if ($task['disabled'] != 2 && $task['utimestamp'] > 0
&& $task['type'] != DISCOVERY_APP_MYSQL
&& $task['type'] != DISCOVERY_APP_ORACLE
&& $task['type'] != DISCOVERY_CLOUD_AWS_RDS
) {
$data[9] .= '<a href="#" onclick="show_map('.$task['id_rt'].',\''.$task['name'].'\')">';
$data[9] .= html_print_image(
'images/dynamic_network_icon.png',
true
).'</a>';
);
$data[9] .= '</a>';
}
if (check_acl(
$config['id_user'],
$task['id_group'],
'PM'
)
) {
if ($ipam === true) {
$data[9] .= '<a href="'.ui_get_full_url(
sprintf(
'index.php?sec=godmode/extensions&sec2=enterprise/extensions/ipam&action=edit&id=%d',
$tipam_task_id
)
).'">'.html_print_image(
'images/config.png',
true
).'</a>';
$data[9] .= '<a href="'.ui_get_full_url(
'index.php?sec=godmode/extensions&sec2=enterprise/extensions/ipam&action=delete&id='.$tipam_task_id
).'" onClick="if (!confirm(\' '.__('Are you sure?').'\')) return false;">'.html_print_image(
'images/cross.png',
true
).'</a>';
} else {
// Check if is a H&D, Cloud or Application or IPAM.
$data[9] .= '<a href="'.ui_get_full_url(
sprintf(
'index.php?sec=gservers&sec2=godmode/servers/discovery&%s&task=%d',
$this->getTargetWiz($task, $recon_script_data),
$task['id_rt']
)
).'">'.html_print_image(
'images/config.png',
true
).'</a>';
$data[9] .= '<a href="'.ui_get_full_url(
'index.php?sec=gservers&sec2=godmode/servers/discovery&wiz=tasklist&delete=1&task='.$task['id_rt']
).'" onClick="if (!confirm(\' '.__('Are you sure?').'\')) return false;">'.html_print_image(
'images/cross.png',
true
).'</a>';
}
} else {
// Check if is a H&D, Cloud or Application or IPAM.
$data[9] .= '<a href="'.ui_get_full_url(
sprintf(
'index.php?sec=gservers&sec2=godmode/servers/discovery&%s&task=%d',
$this->getTargetWiz($task, $recon_script_data),
$task['id_rt']
)
).'">'.html_print_image(
'images/config.png',
true
).'</a>';
$data[9] .= '<a href="'.ui_get_full_url(
'index.php?sec=gservers&sec2=godmode/servers/discovery&wiz=tasklist&delete=1&task='.$task['id_rt']
).'" onClick="if (!confirm(\' '.__('Are you sure?').'\')) return false;">'.html_print_image(
'images/cross.png',
true
).'</a>';
$data[9] = '';
}
} else {
$data[9] = '';
$data[9] = '-';
}
$table->cellclass[][9] = 'action_buttons';

View File

@ -32,6 +32,7 @@ require_once $config['homedir'].'/include/class/CustomNetScan.class.php';
require_once $config['homedir'].'/include/class/ManageNetScanScripts.class.php';
enterprise_include_once('include/class/CSVImportAgents.class.php');
enterprise_include_once('include/class/DeploymentCenter.class.php');
enterprise_include_once('include/functions_hostdevices.php');
/**
@ -127,6 +128,12 @@ class HostDevices extends Wizard
'icon' => ENTERPRISE_DIR.'/images/wizard/csv.png',
'label' => __('Import CSV'),
];
$buttons[] = [
'url' => $this->url.'&mode=deploy',
'icon' => ENTERPRISE_DIR.'/images/wizard/deployment.png',
'label' => __('Agent deployment'),
];
}
$buttons[] = [
@ -149,11 +156,30 @@ class HostDevices extends Wizard
),
'label' => __('Discovery'),
],
[
'link' => ui_get_full_url(
'index.php?sec=gservers&sec2=godmode/servers/discovery&wiz=hd'
),
'label' => __('Host & Devices'),
'selected' => true,
],
],
true
);
ui_print_page_header(__('Host & devices'), '', false, '', true, '', false, '', GENERIC_SIZE_TEXT, '', $this->printHeader(true));
ui_print_page_header(
__('Host & devices'),
'',
false,
'',
true,
'',
false,
'',
GENERIC_SIZE_TEXT,
'',
$this->printHeader(true)
);
$this->printBigButtonsList($buttons);
return;
@ -167,6 +193,14 @@ class HostDevices extends Wizard
);
return $csv_importer->runCSV();
}
if ($mode === 'deploy') {
$deployObject = new DeploymentCenter(
$this->page,
$this->breadcrum
);
return $deployObject->run();
}
}
if ($mode === 'customnetscan') {
@ -785,6 +819,7 @@ class HostDevices extends Wizard
}).change();';
$this->printFormAsGrid($form);
$this->printGoBackButton($this->url.'&page='.($this->page - 1));
}
}
@ -877,6 +912,7 @@ class HostDevices extends Wizard
];
$this->printFormAsList($form);
$this->printGoBackButton($this->url.'&mode=netscan&task='.$this->task['id_rt'].'&page='.($this->page - 1));
}
if ($this->page == 2) {

View File

@ -296,241 +296,20 @@ class Wizard
*/
public function printInput($data)
{
global $config;
include_once $config['homedir'].'/include/functions_html.php';
if (is_array($data) === false) {
return '';
}
switch ($data['type']) {
case 'text':
return html_print_input_text(
$data['name'],
$data['value'],
((isset($data['alt']) === true) ? $data['alt'] : ''),
((isset($data['size']) === true) ? $data['size'] : 50),
((isset($data['maxlength']) === true) ? $data['maxlength'] : 255),
((isset($data['return']) === true) ? $data['return'] : true),
((isset($data['disabled']) === true) ? $data['disabled'] : false),
((isset($data['required']) === true) ? $data['required'] : false),
((isset($data['function']) === true) ? $data['function'] : ''),
((isset($data['class']) === true) ? $data['class'] : ''),
((isset($data['onChange']) === true) ? $data['onChange'] : ''),
((isset($data['autocomplete']) === true) ? $data['autocomplete'] : '')
);
case 'image':
return html_print_input_image(
$data['name'],
$data['src'],
$data['value'],
((isset($data['style']) === true) ? $data['style'] : ''),
((isset($data['return']) === true) ? $data['return'] : false),
((isset($data['options']) === true) ? $data['options'] : false)
);
case 'text_extended':
return html_print_input_text_extended(
$data['name'],
$data['value'],
$data['id'],
$data['alt'],
$data['size'],
$data['maxlength'],
$data['disabled'],
$data['script'],
$data['attributes'],
((isset($data['return']) === true) ? $data['return'] : false),
((isset($data['password']) === true) ? $data['password'] : false),
((isset($data['function']) === true) ? $data['function'] : '')
);
case 'password':
return html_print_input_password(
$data['name'],
$data['value'],
((isset($data['alt']) === true) ? $data['alt'] : ''),
((isset($data['size']) === true) ? $data['size'] : 50),
((isset($data['maxlength']) === true) ? $data['maxlength'] : 255),
((isset($data['return']) === true) ? $data['return'] : false),
((isset($data['disabled']) === true) ? $data['disabled'] : false),
((isset($data['required']) === true) ? $data['required'] : false),
((isset($data['class']) === true) ? $data['class'] : '')
);
case 'text':
return html_print_input_text(
$data['name'],
$data['value'],
((isset($data['alt']) === true) ? $data['alt'] : ''),
((isset($data['size']) === true) ? $data['size'] : 50),
((isset($data['maxlength']) === true) ? $data['maxlength'] : 255),
((isset($data['return']) === true) ? $data['return'] : false),
((isset($data['disabled']) === true) ? $data['disabled'] : false),
((isset($data['required']) === true) ? $data['required'] : false),
((isset($data['function']) === true) ? $data['function'] : ''),
((isset($data['class']) === true) ? $data['class'] : ''),
((isset($data['onChange']) === true) ? $data['onChange'] : ''),
((isset($data['autocomplete']) === true) ? $data['autocomplete'] : '')
);
case 'image':
return html_print_input_image(
$data['name'],
$data['src'],
$data['value'],
((isset($data['style']) === true) ? $data['style'] : ''),
((isset($data['return']) === true) ? $data['return'] : false),
((isset($data['options']) === true) ? $data['options'] : false)
);
case 'hidden':
return html_print_input_hidden(
$data['name'],
$data['value'],
((isset($data['return']) === true) ? $data['return'] : false),
((isset($data['class']) === true) ? $data['class'] : false)
);
case 'hidden_extended':
return html_print_input_hidden_extended(
$data['name'],
$data['value'],
$data['id'],
((isset($data['return']) === true) ? $data['return'] : false),
((isset($data['class']) === true) ? $data['class'] : false)
);
case 'color':
return html_print_input_color(
$data['name'],
$data['value'],
((isset($data['class']) === true) ? $data['class'] : false),
((isset($data['return']) === true) ? $data['return'] : false)
);
case 'file':
return html_print_input_file(
$data['name'],
((isset($data['return']) === true) ? $data['return'] : false),
((isset($data['options']) === true) ? $data['options'] : false)
);
case 'select':
return html_print_select(
$data['fields'],
$data['name'],
((isset($data['selected']) === true) ? $data['selected'] : ''),
((isset($data['script']) === true) ? $data['script'] : ''),
((isset($data['nothing']) === true) ? $data['nothing'] : ''),
((isset($data['nothing_value']) === true) ? $data['nothing_value'] : 0),
((isset($data['return']) === true) ? $data['return'] : false),
((isset($data['multiple']) === true) ? $data['multiple'] : false),
((isset($data['sort']) === true) ? $data['sort'] : true),
((isset($data['class']) === true) ? $data['class'] : ''),
((isset($data['disabled']) === true) ? $data['disabled'] : false),
((isset($data['style']) === true) ? $data['style'] : false),
((isset($data['option_style']) === true) ? $data['option_style'] : false),
((isset($data['size']) === true) ? $data['size'] : false),
((isset($data['modal']) === true) ? $data['modal'] : false),
((isset($data['message']) === true) ? $data['message'] : ''),
((isset($data['select_all']) === true) ? $data['select_all'] : false)
);
case 'select_from_sql':
return html_print_select_from_sql(
$data['sql'],
$data['name'],
((isset($data['selected']) === true) ? $data['selected'] : ''),
((isset($data['script']) === true) ? $data['script'] : ''),
((isset($data['nothing']) === true) ? $data['nothing'] : ''),
((isset($data['nothing_value']) === true) ? $data['nothing_value'] : '0'),
((isset($data['return']) === true) ? $data['return'] : false),
((isset($data['multiple']) === true) ? $data['multiple'] : false),
((isset($data['sort']) === true) ? $data['sort'] : true),
((isset($data['disabled']) === true) ? $data['disabled'] : false),
((isset($data['style']) === true) ? $data['style'] : false),
((isset($data['size']) === true) ? $data['size'] : false),
((isset($data['trucate_size']) === true) ? $data['trucate_size'] : GENERIC_SIZE_TEXT)
);
case 'select_groups':
return html_print_select_groups(
((isset($data['id_user']) === true) ? $data['id_user'] : false),
((isset($data['privilege']) === true) ? $data['privilege'] : 'AR'),
((isset($data['returnAllGroup']) === true) ? $data['returnAllGroup'] : true),
$data['name'],
((isset($data['selected']) === true) ? $data['selected'] : ''),
((isset($data['script']) === true) ? $data['script'] : ''),
((isset($data['nothing']) === true) ? $data['nothing'] : ''),
((isset($data['nothing_value']) === true) ? $data['nothing_value'] : 0),
((isset($data['return']) === true) ? $data['return'] : false),
((isset($data['multiple']) === true) ? $data['multiple'] : false),
((isset($data['sort']) === true) ? $data['sort'] : true),
((isset($data['class']) === true) ? $data['class'] : ''),
((isset($data['disabled']) === true) ? $data['disabled'] : false),
((isset($data['style']) === true) ? $data['style'] : false),
((isset($data['option_style']) === true) ? $data['option_style'] : false),
((isset($data['id_group']) === true) ? $data['id_group'] : false),
((isset($data['keys_field']) === true) ? $data['keys_field'] : 'id_grupo'),
((isset($data['strict_user']) === true) ? $data['strict_user'] : false),
((isset($data['delete_groups']) === true) ? $data['delete_groups'] : false),
((isset($data['include_groups']) === true) ? $data['include_groups'] : false),
((isset($data['size']) === true) ? $data['size'] : false),
((isset($data['simple_multiple_options']) === true) ? $data['simple_multiple_options'] : false)
);
case 'submit':
return '<div class="action-buttons" style="width: 100%">'.html_print_submit_button(
((isset($data['label']) === true) ? $data['label'] : 'OK'),
((isset($data['name']) === true) ? $data['name'] : ''),
((isset($data['disabled']) === true) ? $data['disabled'] : false),
((isset($data['attributes']) === true) ? $data['attributes'] : ''),
((isset($data['return']) === true) ? $data['return'] : false)
).'</div>';
case 'checkbox':
return html_print_checkbox(
$data['name'],
$data['value'],
((isset($data['checked']) === true) ? $data['checked'] : false),
((isset($data['return']) === true) ? $data['return'] : false),
((isset($data['disabled']) === true) ? $data['disabled'] : false),
((isset($data['script']) === true) ? $data['script'] : ''),
((isset($data['disabled_hidden']) === true) ? $data['disabled_hidden'] : false)
);
case 'switch':
return html_print_switch($data);
case 'interval':
return html_print_extended_select_for_time(
$data['name'],
$data['value'],
((isset($data['script']) === true) ? $data['script'] : ''),
((isset($data['nothing']) === true) ? $data['nothing'] : ''),
((isset($data['nothing_value']) === true) ? $data['nothing_value'] : 0),
((isset($data['size']) === true) ? $data['size'] : false),
((isset($data['return']) === true) ? $data['return'] : false),
((isset($data['style']) === true) ? $data['selected'] : false),
((isset($data['unique']) === true) ? $data['unique'] : false)
);
case 'textarea':
return html_print_textarea(
$data['name'],
$data['rows'],
$data['columns'],
((isset($data['value']) === true) ? $data['value'] : ''),
((isset($data['attributes']) === true) ? $data['attributes'] : ''),
((isset($data['return']) === true) ? $data['return'] : false),
((isset($data['class']) === true) ? $data['class'] : '')
);
default:
// Ignore.
break;
$input = html_print_input(($data + ['return' => true]), 'div', true);
if ($input === false) {
return '';
}
return '';
return $input;
}
@ -556,6 +335,7 @@ class Wizard
],
'inputs' => [
[
'class' => 'w100p',
'arguments' => [
'name' => 'submit',
'label' => __('Go back'),
@ -594,13 +374,24 @@ class Wizard
if (is_array($input['block_content']) === true) {
// Print independent block of inputs.
$output .= '<li id="'.$input['block_id'].'" class="'.$class.'">';
$output .= '<ul class="wizard">';
if ($input['wrapper']) {
$output .= '<li id="li-'.$input['block_id'].'" class="'.$class.'">';
$output .= '<'.$input['wrapper'].' id="'.$input['block_id'].'" class="'.$class.'">';
} else {
$output .= '<li id="'.$input['block_id'].'" class="'.$class.'">';
}
$output .= '<ul class="wizard '.$input['block_class'].'">';
foreach ($input['block_content'] as $input) {
$output .= $this->printBlock($input, $return);
}
$output .= '</ul></li>';
// Close block.
if ($input['wrapper']) {
$output .= '</ul></'.$input['wrapper'].'>';
} else {
$output .= '</ul></li>';
}
} else {
if ($input['arguments']['type'] != 'hidden') {
$output .= '<li id="'.$input['id'].'" class="'.$class.'">';
@ -648,7 +439,7 @@ class Wizard
if (is_array($input['block_content']) === true) {
// Print independent block of inputs.
$output .= '<li id="'.$input['block_id'].'" class="'.$class.'">';
$output .= '<ul class="wizard">';
$output .= '<ul class="wizard '.$input['block_class'].'">';
foreach ($input['block_content'] as $input) {
$output .= $this->printBlockAsGrid($input, $return);
}
@ -751,7 +542,7 @@ class Wizard
if (is_array($input['block_content']) === true) {
// Print independent block of inputs.
$output .= '<li id="'.$input['block_id'].'" class="'.$class.'">';
$output .= '<ul class="wizard">';
$output .= '<ul class="wizard '.$input['block_class'].'">';
foreach ($input['block_content'] as $input) {
$output .= $this->printBlockAsList($input, $return);
}
@ -797,10 +588,11 @@ class Wizard
$form = $data['form'];
$inputs = $data['inputs'];
$js = $data['js'];
$rawjs = $data['js_block'];
$cb_function = $data['cb_function'];
$cb_args = $data['cb_args'];
$output_head = '<form class="discovery" enctype="'.$form['enctype'].'" action="'.$form['action'].'" method="'.$form['method'];
$output_head = '<form id="'.$form['id'].'" class="discovery '.$form['class'].'" onsubmit="'.$form['onsubmit'].'" enctype="'.$form['enctype'].'" action="'.$form['action'].'" method="'.$form['method'];
$output_head .= '" '.$form['extra'].'>';
if ($return === false) {
@ -844,6 +636,9 @@ class Wizard
$output .= '<ul class="wizard">'.$output_submit.'</ul>';
$output .= '</form>';
$output .= '<script>'.$js.'</script>';
if ($rawjs) {
$output .= $rawjs;
}
if ($return === false) {
echo $output;
@ -869,10 +664,11 @@ class Wizard
$rows = $data['rows'];
$js = $data['js'];
$rawjs = $data['js_block'];
$cb_function = $data['cb_function'];
$cb_args = $data['cb_args'];
$output_head = '<form class="discovery" enctype="'.$form['enctype'].'" action="'.$form['action'].'" method="'.$form['method'];
$output_head = '<form class="discovery" onsubmit="'.$form['onsubmit'].'" enctype="'.$form['enctype'].'" action="'.$form['action'].'" method="'.$form['method'];
$output_head .= '" '.$form['extra'].'>';
if ($return === false) {
@ -895,45 +691,47 @@ class Wizard
$first_block_printed = false;
foreach ($rows as $row) {
if ($row['new_form_block'] == true) {
if ($first_block_printed === true) {
// If first form block has been placed, then close it before starting a new one.
$output .= '</div>';
$output .= '<div class="white_box" style="margin-top: 30px;">';
} else {
$output .= '<div class="white_box">';
if (is_array($rows)) {
foreach ($rows as $row) {
if ($row['new_form_block'] == true) {
if ($first_block_printed === true) {
// If first form block has been placed, then close it before starting a new one.
$output .= '</div>';
$output .= '<div class="white_box" style="margin-top: 30px;">';
} else {
$output .= '<div class="white_box">';
}
$first_block_printed = true;
}
$first_block_printed = true;
}
$output .= '<div class="edit_discovery_info" style="'.$row['style'].'">';
$output .= '<div class="edit_discovery_info" style="'.$row['style'].'">';
foreach ($row['columns'] as $column) {
$width = isset($column['width']) ? 'width: '.$column['width'].';' : 'width: 100%;';
$padding_left = isset($column['padding-left']) ? 'padding-left: '.$column['padding-left'].';' : 'padding-left: 0;';
$padding_right = isset($column['padding-right']) ? 'padding-right: '.$column['padding-right'].';' : 'padding-right: 0;';
$extra_styles = isset($column['style']) ? $column['style'] : '';
foreach ($row['columns'] as $column) {
$width = isset($column['width']) ? 'width: '.$column['width'].';' : 'width: 100%;';
$padding_left = isset($column['padding-left']) ? 'padding-left: '.$column['padding-left'].';' : 'padding-left: 0;';
$padding_right = isset($column['padding-right']) ? 'padding-right: '.$column['padding-right'].';' : 'padding-right: 0;';
$extra_styles = isset($column['style']) ? $column['style'] : '';
$output .= '<div style="'.$width.$padding_left.$padding_right.$extra_styles.'">';
$output .= '<div style="'.$width.$padding_left.$padding_right.$extra_styles.'">';
foreach ($column['inputs'] as $input) {
if (is_array($input)) {
if ($input['arguments']['type'] != 'submit') {
$output .= $this->printBlockAsGrid($input, true);
foreach ($column['inputs'] as $input) {
if (is_array($input)) {
if ($input['arguments']['type'] != 'submit') {
$output .= $this->printBlockAsGrid($input, true);
} else {
$output_submit .= $this->printBlockAsGrid($input, true);
}
} else {
$output_submit .= $this->printBlockAsGrid($input, true);
$output .= $input;
}
} else {
$output .= $input;
}
$output .= '</div>';
}
$output .= '</div>';
}
$output .= '</div>';
}
$output .= '</div>';
@ -941,6 +739,9 @@ class Wizard
$output .= '<ul class="wizard">'.$output_submit.'</ul>';
$output .= '</form>';
$output .= '<script>'.$js.'</script>';
if ($rawjs) {
$output .= $rawjs;
}
if ($return === false) {
echo $output;
@ -964,10 +765,11 @@ class Wizard
$form = $data['form'];
$inputs = $data['inputs'];
$js = $data['js'];
$rawjs = $data['js_block'];
$cb_function = $data['cb_function'];
$cb_args = $data['cb_args'];
$output_head = '<form class="discovery" enctype="'.$form['enctype'].'" action="'.$form['action'].'" method="'.$form['method'];
$output_head = '<form class="discovery" onsubmit="'.$form['onsubmit'].'" enctype="'.$form['enctype'].'" action="'.$form['action'].'" method="'.$form['method'];
$output_head .= '" '.$form['extra'].'>';
if ($return === false) {
@ -1001,6 +803,9 @@ class Wizard
$output .= '<ul class="wizard">'.$output_submit.'</ul>';
$output .= '</form>';
$output .= '<script>'.$js.'</script>';
if ($rawjs) {
$output .= $rawjs;
}
if ($return === false) {
echo $output;

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 978 B

View File

@ -279,7 +279,7 @@ if (check_login()) {
'agent_small',
false,
true,
false,
true,
'[&hellip;]',
'font-size:7.5pt;'
);

View File

@ -20,8 +20,8 @@
/**
* Pandora build version and version
*/
$build_version = 'PC190729';
$pandora_version = 'v7.0NG.736';
$build_version = 'PC190805';
$pandora_version = 'v7.0NG.737';
// Do not overwrite default timezone set if defined.
$script_tz = @date_default_timezone_get();

View File

@ -583,6 +583,7 @@ define('DISCOVERY_APP_ORACLE', 5);
define('DISCOVERY_CLOUD_AWS_EC2', 6);
define('DISCOVERY_CLOUD_AWS_RDS', 7);
define('DISCOVERY_CLOUD_AZURE_COMPUTE', 8);
define('DISCOVERY_DEPLOY_AGENTS', 9);
// Discovery types matching definition.

View File

@ -56,8 +56,6 @@ function credentials_get_all(
global $config;
$user_is_admin = users_is_admin();
if (!is_array($filter)) {
error_log('[credential_get_all] Filter must be an array.');
throw new Exception('[credential_get_all] Filter must be an array.');
@ -295,9 +293,9 @@ function print_inputs($values=null)
'type' => 'select',
'script' => 'calculate_inputs()',
'fields' => [
// 'CUSTOM' => __('Custom'),
'AWS' => __('Aws'),
'AZURE' => __('Azure'),
'CUSTOM' => __('Custom'),
'AWS' => __('Aws'),
'AZURE' => __('Azure'),
// 'GOOGLE' => __('Google'),
],
'selected' => $values['product'],
@ -331,6 +329,10 @@ function print_inputs($values=null)
case 'GOOGLE':
// Need further investigation.
case 'CUSTOM':
$user_label = __('Account ID');
$pass_label = __('Password');
$extra1 = false;
$extra2 = false;
default:
// Use defaults.
break;

View File

@ -3070,11 +3070,13 @@ function html_print_link_with_params($text, $params=[], $type='text', $style='')
/**
* Print input using functions html lib.
*
* @param array $data Input definition.
* @param array $data Input definition.
* @param string $wrapper Wrapper 'div' or 'li'.
* @param boolean $input_only Return or print only input or also label.
*
* @return string HTML code for desired input.
*/
function html_print_input($data)
function html_print_input($data, $wrapper='div', $input_only=false)
{
if (is_array($data) === false) {
return '';
@ -3082,8 +3084,8 @@ function html_print_input($data)
$output = '';
if ($data['label']) {
$output = '<div id="div-'.$data['name'].'" ';
if ($data['label'] && $input_only === false) {
$output = '<'.$wrapper.' id="'.$wrapper.'-'.$data['name'].'" ';
$output .= ' class="'.$data['input_class'].'">';
$output .= '<label class="'.$data['label_class'].'">';
$output .= $data['label'];
@ -3171,17 +3173,6 @@ function html_print_input($data)
);
break;
case 'image':
$output .= html_print_input_image(
$data['name'],
$data['src'],
$data['value'],
((isset($data['style']) === true) ? $data['style'] : ''),
((isset($data['return']) === true) ? $data['return'] : false),
((isset($data['options']) === true) ? $data['options'] : false)
);
break;
case 'hidden':
$output .= html_print_input_hidden(
$data['name'],
@ -3286,13 +3277,13 @@ function html_print_input($data)
break;
case 'submit':
$output .= '<div class="action-buttons" style="width: 100%">'.html_print_submit_button(
$output .= '<'.$wrapper.' class="action-buttons" style="width: 100%">'.html_print_submit_button(
((isset($data['label']) === true) ? $data['label'] : 'OK'),
((isset($data['name']) === true) ? $data['name'] : ''),
((isset($data['disabled']) === true) ? $data['disabled'] : false),
((isset($data['attributes']) === true) ? $data['attributes'] : ''),
((isset($data['return']) === true) ? $data['return'] : false)
).'</div>';
).'</'.$wrapper.'>';
break;
case 'checkbox':
@ -3335,20 +3326,33 @@ function html_print_input($data)
((isset($data['return']) === true) ? $data['return'] : false),
((isset($data['class']) === true) ? $data['class'] : '')
);
break;
case 'button':
$output .= html_print_button(
((isset($data['label']) === true) ? $data['label'] : 'OK'),
((isset($data['name']) === true) ? $data['name'] : ''),
((isset($data['disabled']) === true) ? $data['disabled'] : false),
((isset($data['script']) === true) ? $data['script'] : ''),
((isset($data['attributes']) === true) ? $data['attributes'] : ''),
((isset($data['return']) === true) ? $data['return'] : false),
((isset($data['imageButton']) === true) ? $data['imageButton'] : false),
((isset($data['modal']) === true) ? $data['modal'] : false),
((isset($data['message']) === true) ? $data['message'] : '')
);
break;
default:
// Ignore.
break;
}
if ($data['label']) {
$output .= '</div>';
if ($data['label'] && $input_only === false) {
$output .= '</'.$wrapper.'>';
if (!$data['return']) {
echo '</div>';
echo '</'.$wrapper.'>';
}
}
return $output;
}

View File

@ -3094,38 +3094,7 @@ function ui_print_datatable(array $parameters)
$filter .= '<ul class="datatable_filter content">';
foreach ($parameters['form']['inputs'] as $input) {
$filter .= '<li>';
$filter .= '<label>'.$input['label'].'</label>';
if ($input['type'] != 'select') {
$filter .= '<input type="'.$input['type'].'" ';
$filter .= ' style="'.$input['style'].'" ';
$filter .= ' class="'.$input['class'].'" ';
$filter .= ' value="'.$input['value'].'" ';
$filter .= ' name="'.$input['name'].'" id="'.$input['id'].'" />';
} else {
// Select.
$filter .= '<select class="'.$input['class'].'"';
$filter .= ' style="'.$input['style'].'" ';
$filter .= ' name="'.$input['name'].'" ';
$filter .= 'id="'.$input['id'].'">';
foreach ($input['options'] as $key => $opt) {
if (is_array($opt)) {
$filter .= '<option value="'.$opt['value'].'"';
if ($opt['selected']) {
$filter .= ' selected="yes" >';
}
$filter .= __($opt['text']).'</option>';
} else {
$filter .= '<option value="'.$key.'">'.$opt.'</option>';
}
}
$filter .= '</select>';
}
$filter .= '</li>';
$filter .= html_print_input(($input + ['return' => true]), 'li');
}
$filter .= '<li>';
@ -3799,14 +3768,22 @@ function ui_get_full_url($url='', $no_proxy=false, $add_name_php_file=false, $me
if (ui_forced_public_url()) {
$proxy = true;
$fullurl = $config['public_url'];
if (substr($fullurl, -1) != '/') {
$fullurl .= '/';
}
if ($url == 'index.php' && is_metaconsole()) {
$fullurl .= '/'.ENTERPRISE_DIR.'/meta';
}
$fullurl .= ENTERPRISE_DIR.'/meta';
}
} else if (!empty($config['public_url'])
&& (!empty($_SERVER['HTTP_X_FORWARDED_HOST']))
) {
// Forced to use public url when being forwarder by a reverse proxy.
$fullurl = $config['public_url'];
if (substr($fullurl, -1) != '/') {
$fullurl .= '/';
}
$proxy = true;
} else {
$fullurl = $protocol.'://'.$_SERVER['SERVER_NAME'];

View File

@ -1870,3 +1870,100 @@ function logo_preview(icon_name, icon_path, incoming_options) {
// console.log(err);
}
}
// Advanced Form control.
/* global $ */
/* exported load_modal */
function load_modal(settings) {
var AJAX_RUNNING = 0;
var data = new FormData();
if (settings.extradata) {
settings.extradata.forEach(function(item) {
if (item.value != undefined) data.append(item.name, item.value);
});
}
data.append("page", settings.onshow.page);
data.append("method", settings.onshow.method);
var width = 630;
if (settings.onshow.width) {
width = settings.onshow.width;
}
$.ajax({
method: "post",
url: settings.url,
processData: false,
contentType: false,
data: data,
success: function(data) {
settings.target.html(data);
settings.target.dialog({
resizable: true,
draggable: true,
modal: true,
title: settings.modal.title,
width: width,
overlay: {
opacity: 0.5,
background: "black"
},
buttons: [
{
class:
"ui-widget ui-state-default ui-corner-all ui-button-text-only sub upd submit-cancel",
text: settings.modal.cancel,
click: function() {
$(this).dialog("close");
settings.cleanup();
}
},
{
class:
"ui-widget ui-state-default ui-corner-all ui-button-text-only sub ok submit-next",
text: settings.modal.ok,
click: function() {
if (AJAX_RUNNING) return;
AJAX_RUNNING = 1;
var formdata = new FormData();
if (settings.extradata) {
settings.extradata.forEach(function(item) {
if (item.value != undefined)
formdata.append(item.name, item.value);
});
}
formdata.append("page", settings.onsubmit.page);
formdata.append("method", settings.onsubmit.method);
$("#" + settings.form + " :input").each(function() {
if (this.type == "file") {
if ($(this).prop("files")[0]) {
formdata.append(this.name, $(this).prop("files")[0]);
}
} else {
formdata.append(this.name, $(this).val());
}
});
$.ajax({
method: "post",
url: settings.url,
processData: false,
contentType: false,
data: formdata,
success: function(data) {
settings.ajax_callback(data);
AJAX_RUNNING = 0;
}
});
}
}
],
closeOnEscape: false,
open: function() {
$(".ui-dialog-titlebar-close").hide();
}
});
}
});
}

View File

@ -0,0 +1,29 @@
ul.wizard li > label:not(.p-switch) {
width: auto;
}
form.top-action-buttons ul.wizard {
display: flex;
flex-direction: row;
}
ul.wizard li {
margin-right: 1em;
}
form.modal ul.wizard li {
display: flex;
flex-direction: row;
width: 90%;
margin: 0.5em auto;
justify-items: center;
}
form.modal ul.wizard li * {
flex: 1;
}
ul.wizard li.flex-indep {
flex: 1;
margin: 0;
}

View File

@ -0,0 +1,34 @@
ul.wizard li > label:not(.p-switch) {
width: auto;
}
form.top-action-buttons ul.wizard {
display: flex;
flex-direction: row;
}
ul.wizard li {
margin-right: 1em;
}
form.modal ul.wizard li {
display: flex;
flex-direction: row;
width: 90%;
margin: 0.5em auto;
justify-items: center;
}
form.modal ul.wizard li * {
flex: 1;
}
ul.wizard li.flex-indep {
flex: 1;
margin: 0;
}
.datatable_filter.content li input[type="text"] {
width: 150px;
margin: 0 1em 0 0;
}

View File

@ -437,8 +437,17 @@ select:-internal-list-box {
* - GLOBAL STYLES -
* ---------------------------------------------------------------------
*/
.truncate {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.truncate:hover {
white-space: pre-wrap;
}
.w120px {
width: 120px;
max-width: 120px;
}
.mw120px {
min-width: 120px;
@ -1588,6 +1597,8 @@ button.config,
button.filter,
button.cancel,
button.default,
button.deploy,
input.deploy,
input.next,
input.upd,
input.ok,
@ -1708,7 +1719,10 @@ button.spinn,
input.spinn {
background-image: url(../../images/spinner_green.gif);
}
button.deploy,
input.deploy {
background-image: url(../../images/input_deploy.png);
}
/*#table-add-item select, #table-add-sla select {
width: 180px;
}*/

View File

@ -122,6 +122,7 @@
letter-spacing: 0.3pt;
color: #000;
background-color: #fff;
cursor: pointer;
}
.info_table tr th {
@ -346,3 +347,8 @@ a.pandora_pagination.current:hover {
background-position-y: center;
cursor: pointer;
}
.info_table tr th.sorting_asc,
.info_table tr th.sorting_desc {
padding-left: 15px;
}

View File

@ -128,8 +128,8 @@
</div>
<div style='height: 10px'>
<?php
$version = '7.0NG.736';
$build = '190729';
$version = '7.0NG.737';
$build = '190805';
$banner = "v$version Build $build";
error_reporting(0);

View File

@ -1559,8 +1559,11 @@ switch ($tab) {
include 'estado_monitores.php';
echo "<a name='alerts'></a>";
include 'alerts_status.php';
echo "<a name='events'></a>";
include 'status_events.php';
// Check permissions to read events
if (check_acl($config['id_user'], 0, 'ER')) {
echo "<a name='events'></a>";
include 'status_events.php';
}
break;
case 'data_view':

View File

@ -2,8 +2,8 @@
# Pandora FMS Console
#
%define name pandorafms_console
%define version 7.0NG.736
%define release 190729
%define version 7.0NG.737
%define release 190805
# User and Group under which Apache is running
%define httpd_name httpd

View File

@ -2,8 +2,8 @@
# Pandora FMS Console
#
%define name pandorafms_console
%define version 7.0NG.736
%define release 190729
%define version 7.0NG.737
%define release 190805
# User and Group under which Apache is running
%define httpd_name httpd

View File

@ -2,8 +2,8 @@
# Pandora FMS Console
#
%define name pandorafms_console
%define version 7.0NG.736
%define release 190729
%define version 7.0NG.737
%define release 190805
%define httpd_name httpd
# User and Group under which Apache is running
%define httpd_name apache2

View File

@ -9,7 +9,7 @@
# This code is licensed under GPL 2.0 license.
# **********************************************************************
PI_VERSION="7.0NG.736"
PI_VERSION="7.0NG.737"
FORCE=0
DESTDIR=""
LOG_TIMESTAMP=`date +"%Y/%m/%d %H:%M:%S"`

View File

@ -3611,3 +3611,44 @@ CREATE TABLE IF NOT EXISTS `tvisual_console_elements_cache` (
ON DELETE CASCADE
ON UPDATE CASCADE
) engine=InnoDB DEFAULT CHARSET=utf8;
-- ---------------------------------------------------------------------
-- Table `tagent_repository`
-- ---------------------------------------------------------------------
CREATE TABLE `tagent_repository` (
`id` SERIAL,
`id_os` INT(10) UNSIGNED DEFAULT 0,
`arch` ENUM('x64', 'x86') DEFAULT 'x64',
`version` VARCHAR(10) DEFAULT '',
`path` text,
`uploaded_by` VARCHAR(100) DEFAULT '',
`uploaded` bigint(20) NOT NULL DEFAULT 0 COMMENT "When it was uploaded",
`last_err` text,
PRIMARY KEY (`id`),
FOREIGN KEY (`id_os`) REFERENCES `tconfig_os`(`id_os`)
ON UPDATE CASCADE ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- ----------------------------------------------------------------------
-- Table `tdeployment_hosts`
-- ----------------------------------------------------------------------
CREATE TABLE `tdeployment_hosts` (
`id` SERIAL,
`id_cs` VARCHAR(100),
`ip` VARCHAR(100) NOT NULL UNIQUE,
`id_os` INT(10) UNSIGNED DEFAULT 0,
`os_version` VARCHAR(100) DEFAULT '' COMMENT "OS version in STR format",
`arch` ENUM('x64', 'x86') DEFAULT 'x64',
`current_agent_version` VARCHAR(100) DEFAULT '' COMMENT "String latest installed agent",
`target_agent_version_id` BIGINT UNSIGNED,
`deployed` bigint(20) NOT NULL DEFAULT 0 COMMENT "When it was deployed",
`server_ip` varchar(100) default NULL COMMENT "Where to point target agent",
`last_err` text,
PRIMARY KEY (`id`),
FOREIGN KEY (`id_cs`) REFERENCES `tcredential_store`(`identifier`)
ON UPDATE CASCADE ON DELETE SET NULL,
FOREIGN KEY (`id_os`) REFERENCES `tconfig_os`(`id_os`)
ON UPDATE CASCADE ON DELETE CASCADE,
FOREIGN KEY (`target_agent_version_id`) REFERENCES `tagent_repository`(`id`)
ON UPDATE CASCADE ON DELETE SET NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

View File

@ -22,7 +22,6 @@ INSERT INTO `talert_commands` (`id`, `name`, `command`, `description`, `internal
INSERT INTO `talert_commands` (`id`, `name`, `command`, `description`, `internal`, `fields_descriptions`, `fields_values`) VALUES (8,'Jabber&#x20;Alert','echo&#x20;_field3_&#x20;|&#x20;sendxmpp&#x20;-r&#x20;_field1_&#x20;--chatroom&#x20;_field2_','Send&#x20;jabber&#x20;alert&#x20;to&#x20;chat&#x20;room&#x20;in&#x20;a&#x20;predefined&#x20;server&#x20;&#40;configure&#x20;first&#x20;.sendxmpprc&#x20;file&#41;.&#x20;Uses&#x20;field3&#x20;as&#x20;text&#x20;message,&#x20;field1&#x20;as&#x20;useralias&#x20;for&#x20;source&#x20;message,&#x20;and&#x20;field2&#x20;for&#x20;chatroom&#x20;name',0,'[\"User&#x20;alias\",\"Chatroom&#x20;name\",\"Message\",\"\",\"\",\"\",\"\",\"\",\"\",\"\"]','[\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\"]');
INSERT INTO `talert_commands` (`id`, `name`, `command`, `description`, `internal`, `fields_descriptions`, `fields_values`) VALUES (9,'SMS','sendsms&#x20;_field1_&#x20;_field2_','Send&#x20;SMS&#x20;using&#x20;the&#x20;standard&#x20;SMS&#x20;device,&#x20;using&#x20;smstools.&#x20;&#x20;Uses&#x20;field2&#x20;as&#x20;text&#x20;message,&#x20;field1&#x20;as&#x20;destination&#x20;phone&#x20;&#40;include&#x20;international&#x20;prefix!&#41;',0,'[\"Destination&#x20;number\",\"Message\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\"]','[\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\"]');
INSERT INTO `talert_commands` (`id`, `name`, `command`, `description`, `internal`, `fields_descriptions`, `fields_values`) VALUES (10,'Validate&#x20;Event','Internal&#x20;type','This&#x20;alert&#x20;validate&#x20;the&#x20;events&#x20;matched&#x20;with&#x20;a&#x20;module&#x20;given&#x20;the&#x20;agent&#x20;name&#x20;&#40;_field1_&#41;&#x20;and&#x20;module&#x20;name&#x20;&#40;_field2_&#41;',1,'[\"Agent&#x20;name\",\"Module&#x20;name\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\"]','[\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\"]');
INSERT INTO `talert_commands` (`id`, `name`, `command`, `description`, `internal`, `fields_descriptions`, `fields_values`) VALUES (11,'Integria&#x20;IMS&#x20;Ticket','Internal&#x20;type','This&#x20;alert&#x20;create&#x20;a&#x20;ticket&#x20;into&#x20;your&#x20;Integria&#x20;IMS.',1,'[\"Integria&#x20;IMS&#x20;API&#x20;path\",\"Integria&#x20;IMS&#x20;API&#x20;pass\",\"Integria&#x20;IMS&#x20;user\",\"Integria&#x20;IMS&#x20;user&#x20;pass\",\"Ticket&#x20;title\",\"Ticket&#x20;group&#x20;ID\",\"Ticket&#x20;priority\",\"Email&#x20;copy\",\"Ticket&#x20;owner\",\"Ticket&#x20;description\"]','[\"\",\"\",\"\",\"\",\"\",\"\",\"10,Maintenance;0,Informative;1,Low;2,Medium;3,Serious;4,Very&#x20;Serious\",\"\",\"\",\"\"]');
INSERT INTO `talert_commands` (`id`, `name`, `command`, `description`, `internal`, `fields_descriptions`, `fields_values`) VALUES (12,'Remote&#x20;agent&#x20;control','/usr/share/pandora_server/util/udp_client.pl&#x20;_address_&#x20;41122&#x20;&quot;_field1_&quot;','This&#x20;command&#x20;is&#x20;used&#x20;to&#x20;send&#x20;commands&#x20;to&#x20;the&#x20;agents&#x20;with&#x20;the&#x20;UDP&#x20;server&#x20;enabled.&#x20;The&#x20;UDP&#x20;server&#x20;is&#x20;used&#x20;to&#x20;order&#x20;agents&#x20;&#40;Windows&#x20;and&#x20;UNIX&#41;&#x20;to&#x20;&quot;refresh&quot;&#x20;the&#x20;agent&#x20;execution:&#x20;that&#x20;means,&#x20;to&#x20;force&#x20;the&#x20;agent&#x20;to&#x20;execute&#x20;and&#x20;send&#x20;data',0,'[\"Command\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\"]','[\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\"]');
INSERT INTO `talert_commands` (`id`, `name`, `command`, `description`, `internal`, `fields_descriptions`, `fields_values`) VALUES (13,'Generate&#x20;Notification','Internal&#x20;type','This&#x20;command&#x20;allows&#x20;you&#x20;to&#x20;send&#x20;an&#x20;internal&#x20;notification&#x20;to&#x20;any&#x20;user&#x20;or&#x20;group.',1,'[\"Destination&#x20;user\",\"Destination&#x20;group\",\"Title\",\"Message\",\"Link\",\"Criticity\",\"\",\"\",\"\",\"\",\"\"]','[\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\"]');
--
@ -80,10 +79,6 @@ INSERT INTO `tconfig` (`token`, `value`) VALUES
('sound_alert', 'include/sounds/air_shock_alarm.wav'),
('sound_critical', 'include/sounds/Star_Trek_emergency_simulation.wav'),
('sound_warning', 'include/sounds/negativebeep.wav'),
('integria_enabled', '0'),
('integria_api_password', ''),
('integria_inventory', '0'),
('integria_url', ''),
('netflow_interval', '3600'),
('netflow_daemon', '/usr/bin/nfcapd'),
('netflow_nfdump', '/usr/bin/nfdump'),
@ -1114,8 +1109,6 @@ INSERT INTO `talert_actions` (`id`, `name`, `id_alert_command`, `field1`, `field
(2,'Restart&#x20;agent',12,'REFRESH AGENT *','','','','','','','','','',0,0,'','','','','','','','','','');
INSERT INTO `talert_actions` (`id`, `name`, `id_alert_command`, `field1`, `field2`, `field3`, `field4`, `field5`, `field6`, `field7`, `field8`, `field9`, `field10`, `id_group`, `action_threshold`, `field1_recovery`, `field2_recovery`, `field3_recovery`, `field4_recovery`, `field5_recovery`, `field6_recovery`, `field7_recovery`, `field8_recovery`, `field9_recovery`, `field10_recovery`) VALUES
(3,'Monitoring&#x20;Event',3,'_agent_&#x20;_module_&#x20;generated&#x20;an&#x20;event&#x20;alert&#x20;&#40;_data_&#41;','alert_fired','pandora','','4','','','','','',0,0,'RECOVERED:&#x20;_agent_&#x20;_module_&#x20;generated&#x20;event&#x20;alert&#x20;&#40;_data_&#41;','alert_ceased','pandora','','4','','','','','');
INSERT INTO `talert_actions` (`id`, `name`, `id_alert_command`, `field1`, `field2`, `field3`, `field4`, `field5`, `field6`, `field7`, `field8`, `field9`, `field10`, `id_group`, `action_threshold`, `field1_recovery`, `field2_recovery`, `field3_recovery`, `field4_recovery`, `field5_recovery`, `field6_recovery`, `field7_recovery`, `field8_recovery`, `field9_recovery`, `field10_recovery`) VALUES
(4,'Create&#x20;a&#x20;ticket&#x20;in&#x20;Integria&#x20;IMS',11,'http://localhost/integria/include/api.php','1234','admin','integria','_agent_:&#x20;_alert_name_','1','3','copy@dom.com','admin','_alert_description_',0,0,'','','','','','','','','','');
-- alert templates (default)

View File

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

View File

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

View File

@ -1,7 +1,7 @@
#############################################################################
# Pandora FMS Server Parameters
# Pandora FMS, the Flexible Monitoring System.
# Version 7.0NG.736
# Version 7.0NG.737
# Licensed under GPL license v2,
# (c) 2003-2017 Artica Soluciones Tecnologicas
# http://www.pandorafms.com
@ -429,6 +429,10 @@ eventserver 0
event_window 3600
# If set to 1, an alert will not be fired if the last event it generated is in 'in-process' status.
event_inhibit_alerts 0
# Enable (1) or disable (0) Pandora FMS Enterprise ICMP Server (PANDORA FMS ENTERPRISE ONLY).
# You need nmap 5.20 or higher in order to use this !

View File

@ -379,6 +379,10 @@ eventserver 0
event_window 3600
# If set to 1, an alert will not be fired if the last event it generated is in 'in-process' status.
event_inhibit_alerts 0
# Enable (1) or disable (0) Pandora FMS Enterprise ICMP Server (PANDORA FMS ENTERPRISE ONLY).
# You need nmap 5.20 or higher in order to use this !

View File

@ -44,8 +44,8 @@ our @EXPORT = qw(
);
# version: Defines actual version of Pandora Server for this module only
my $pandora_version = "7.0NG.736";
my $pandora_build = "190729";
my $pandora_version = "7.0NG.737";
my $pandora_build = "190805";
our $VERSION = $pandora_version." ".$pandora_build;
# Setup hash
@ -495,6 +495,8 @@ sub pandora_load_config {
$pa_config->{"fsnmp"} = "/usr/bin/pandorafsnmp"; # 7.0 732
$pa_config->{"event_inhibit_alerts"} = 0; # 7.0 737
# Check for UID0
if ($pa_config->{"quiet"} != 0){
if ($> == 0){
@ -921,6 +923,9 @@ sub pandora_load_config {
elsif ($parametro =~ m/^event_file\s+(.*)/i) {
$pa_config->{'event_file'}= clean_blank($1);
}
elsif ($parametro =~ m/^event_inhibit_alerts\s+([0-1])/i) {
$pa_config->{'event_inhibit_alerts'}= clean_blank($1);
}
elsif ($parametro =~ m/^text_going_down_normal\s+(.*)/i) {
$pa_config->{'text_going_down_normal'} = safe_input ($1);
}

View File

@ -130,7 +130,17 @@ use Text::ParseWords;
# due a bug processing some XML with blank spaces.
# See http://www.perlmonks.org/?node_id=706838
$XML::Simple::PREFERRED_PARSER='XML::Parser';
eval {
local $SIG{__DIE__};
eval "use XML::SAX::ExpatXS;1" or die "XML::SAX::ExpatXS not available";
};
if (!$@) {
# Force best option available.
$XML::Simple::PREFERRED_PARSER='XML::SAX::ExpatXS';
} else {
# Use classic parser.
$XML::Simple::PREFERRED_PARSER='XML::Parser';
}
# Default lib dir for RPM and DEB packages
use lib '/usr/lib/perl5';
@ -726,6 +736,15 @@ sub pandora_execute_alert ($$$$$$$$$;$) {
my ($pa_config, $data, $agent, $module,
$alert, $alert_mode, $dbh, $timestamp, $forced_alert, $extra_macros) = @_;
# 'in-process' events can inhibit alers too.
if ($pa_config->{'event_inhibit_alerts'} == 1 && $alert_mode != RECOVERED_ALERT) {
my $status = get_db_value($dbh, 'SELECT estado FROM tevento WHERE id_alert_am = ? ORDER BY utimestamp DESC LIMIT 1', $alert->{'id_template_module'});
if (defined($status) && $status == 2) {
logger ($pa_config, "Alert '" . safe_output($alert->{'name'}) . "' inhibited by in-process events.", 10);
return;
}
}
# Alerts in stand-by are not executed
if ($alert->{'standby'} == 1) {
if (defined ($module)) {

View File

@ -65,7 +65,8 @@ use constant {
sub new ($$$$$$) {
my ($class, $config, $dbh) = @_;
return undef unless $config->{'reconserver'} == 1 || $config->{'discoveryserver'} == 1;
return undef unless (defined($config->{'reconserver'}) && $config->{'reconserver'} == 1)
|| (defined($config->{'discoveryserver'}) && $config->{'discoveryserver'} == 1);
if (! -e $config->{'nmap'}) {
logger ($config, ' [E] ' . $config->{'nmap'} . " needed by " . $config->{'rb_product_name'} . " Discovery Server not found.", 1);
@ -227,6 +228,7 @@ sub data_consumer ($$) {
server_id => $server_id,
%{$pa_config},
task_data => $task,
public_url => PandoraFMS::Config::pandora_get_tconfig_token($dbh, 'public_url', ''),
%cnf_extra
);
@ -237,6 +239,12 @@ sub data_consumer ($$) {
&& -f $cnf_extra{'creds_file'}) {
unlink($cnf_extra{'creds_file'});
}
# Clean one shot tasks
if ($task->{'type'} eq DISCOVERY_DEPLOY_AGENTS) {
db_delete_limit($dbh, ' trecon_task ', ' id_rt = ? ', 1, $task->{'id_rt'});
}
};
if ($@) {
logger(
@ -347,9 +355,10 @@ sub PandoraFMS::Recon::Base::guess_os($$) {
# Use xprobe2 if available
if (-e $self->{pa_config}->{xprobe2}) {
my $output = `"$self->{pa_config}->{xprobe2}" $device 2>$DEVNULL | grep 'Running OS' | head -1`;
return OS_OTHER if ($? != 0);
my $output = `"$self->{pa_config}->{xprobe2}" $device 2>$DEVNULL | grep 'Running OS' | head -1`;
if ($? == 0) {
return pandora_get_os($self->{'dbh'}, $output);
}
}
# Use nmap by default

View File

@ -31,8 +31,8 @@ use base 'Exporter';
our @ISA = qw(Exporter);
# version: Defines actual version of Pandora Server for this module only
my $pandora_version = "7.0NG.736";
my $pandora_build = "190729";
my $pandora_version = "7.0NG.737";
my $pandora_build = "190805";
our $VERSION = $pandora_version." ".$pandora_build;
our %EXPORT_TAGS = ( 'all' => [ qw() ] );

View File

@ -31,7 +31,9 @@ use constant {
DISCOVERY_APP_MYSQL => 4,
DISCOVERY_APP_ORACLE => 5,
DISCOVERY_CLOUD_AWS_EC2 => 6,
DISCOVERY_CLOUD_AWS_RDS => 7
DISCOVERY_CLOUD_AWS_RDS => 7,
DISCOVERY_CLOUD_AZURE_COMPUTE => 8,
DISCOVERY_DEPLOY_AGENTS => 9,
};
# /dev/null
@ -1632,6 +1634,41 @@ sub app_scan($) {
}
##########################################################################
# Perform a deployment scan.
##########################################################################
sub deploy_scan($) {
my $self = shift;
my ($progress, $step);
my $type = '';
# Initialize deployer object.
my $deployer = PandoraFMS::Recon::Util::enterprise_new(
'PandoraFMS::Recon::Deployer',
[
task_data => $self->{'task_data'},
parent => $self
]
);
if (!$deployer) {
# Failed to initialize, check Cloud credentials or anything.
call('message', 'Unable to initialize PandoraFMS::Recon::Deployer', 3);
} else {
# Let deployer object manage scan.
$deployer->scan();
}
# Update progress.
# Done!
$self->{'step'} = '';
$self->call('update_progress', -1);
}
##########################################################################
# Perform a network scan.
##########################################################################
@ -1653,6 +1690,10 @@ sub scan($) {
# Cloud scan.
return $self->cloud_scan();
}
if($self->{'task_data'}->{'type'} == DISCOVERY_DEPLOY_AGENTS) {
return $self->deploy_scan();
}
}
# Find devices.

View File

@ -81,6 +81,7 @@ our @EXPORT = qw(
DISCOVERY_CLOUD_AWS_EC2
DISCOVERY_CLOUD_AWS_RDS
DISCOVERY_CLOUD_AZURE_COMPUTE
DISCOVERY_DEPLOY_AGENTS
$DEVNULL
$OS
$OS_VERSION
@ -191,6 +192,7 @@ use constant DISCOVERY_APP_ORACLE => 5;
use constant DISCOVERY_CLOUD_AWS_EC2 => 6;
use constant DISCOVERY_CLOUD_AWS_RDS => 7;
use constant DISCOVERY_CLOUD_AZURE_COMPUTE => 8;
use constant DISCOVERY_DEPLOY_AGENTS => 9;
# Set OS, OS version and /dev/null
our $OS = $^O;

View File

@ -2,8 +2,8 @@
# Pandora FMS Server
#
%define name pandorafms_server
%define version 7.0NG.736
%define release 190729
%define version 7.0NG.737
%define release 190805
Summary: Pandora FMS Server
Name: %{name}

View File

@ -2,8 +2,8 @@
# Pandora FMS Server
#
%define name pandorafms_server
%define version 7.0NG.736
%define release 190729
%define version 7.0NG.737
%define release 190805
Summary: Pandora FMS Server
Name: %{name}

View File

@ -8,8 +8,8 @@
# This code is licensed under GPL 2.0 license.
# **********************************************************************
PI_VERSION="7.0NG.736"
PI_BUILD="190729"
PI_VERSION="7.0NG.737"
PI_BUILD="190805"
MODE=$1
if [ $# -gt 1 ]; then

View File

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

View File

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