Merge remote-tracking branch 'origin/develop' into ent-9086-eliminacion-de-la-replicacion-de-eventos-duplicado

This commit is contained in:
Daniel Barbero Martin 2022-06-06 08:16:25 +02:00
commit 459df79c8b
33 changed files with 580 additions and 90 deletions

View File

@ -1,5 +1,5 @@
package: pandorafms-agent-unix package: pandorafms-agent-unix
Version: 7.0NG.762-220603 Version: 7.0NG.762-220606
Architecture: all Architecture: all
Priority: optional Priority: optional
Section: admin Section: admin

View File

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

View File

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

View File

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

View File

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

View File

@ -10,7 +10,7 @@
# ********************************************************************** # **********************************************************************
PI_VERSION="7.0NG.762" PI_VERSION="7.0NG.762"
PI_BUILD="220603" PI_BUILD="220606"
OS_NAME=`uname -s` OS_NAME=`uname -s`
FORCE=0 FORCE=0

View File

@ -186,7 +186,7 @@ UpgradeApplicationID
{} {}
Version Version
{220603} {220606}
ViewReadme ViewReadme
{Yes} {Yes}

View File

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

View File

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

View File

@ -1,5 +1,5 @@
package: pandorafms-console package: pandorafms-console
Version: 7.0NG.762-220603 Version: 7.0NG.762-220606
Architecture: all Architecture: all
Priority: optional Priority: optional
Section: admin Section: admin

View File

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

View File

@ -37,7 +37,7 @@ ui_require_css_file('first_task');
ui_print_info_message(['no_close' => true, 'message' => __('There are no HA clusters defined yet.') ]); ui_print_info_message(['no_close' => true, 'message' => __('There are no HA clusters defined yet.') ]);
?> ?>
<div class="new_task_cluster"> <div class="new_task">
<div class="image_task_cluster"> <div class="image_task_cluster">
<?php echo html_print_image('images/first_task/slave-mode.png', true, ['title' => __('Clusters')]); ?> <?php echo html_print_image('images/first_task/slave-mode.png', true, ['title' => __('Clusters')]); ?>
</div> </div>

View File

@ -315,7 +315,20 @@ html_print_select_groups(
'', '',
false false
); );
echo '</div>'; echo '</div></td>';
// Recursion checkbox.
echo '<td>';
echo __('Recursion').'&nbsp;';
html_print_checkbox(
'recursion',
1,
$recursion,
false,
false,
'this.form.submit()'
);
echo '</td>';
echo '<td>'; echo '<td>';
echo __('Show Agents').'&nbsp;'; echo __('Show Agents').'&nbsp;';
$fields = [ $fields = [
@ -346,19 +359,6 @@ foreach ($pre_fields as $key => $value) {
html_print_select($fields, 'os', $os, 'this.form.submit()', 'All', 0); html_print_select($fields, 'os', $os, 'this.form.submit()', 'All', 0);
echo '</td>';
echo '<td>';
echo __('Recursion').'&nbsp;';
html_print_checkbox(
'recursion',
1,
$recursion,
false,
false,
'this.form.submit()'
);
echo '</td><td>'; echo '</td><td>';
echo __('Search').'&nbsp;'; echo __('Search').'&nbsp;';
html_print_input_text('search', $search, '', 12); html_print_input_text('search', $search, '', 12);

View File

@ -713,7 +713,7 @@ class DiscoveryTaskList extends HTML
} }
if ($task['id_recon_script'] == 0 || $ipam === true) { if ($task['id_recon_script'] == 0 || $ipam === true) {
$data[4] = $subnet; $data[4] = ui_print_truncate_text($subnet, 50, true, true, true, '[&hellip;]');
} else { } else {
$data[4] = '-'; $data[4] = '-';
} }

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.5 KiB

View File

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

View File

@ -14,54 +14,190 @@
// Get critical agents by using the status code in modules. // Get critical agents by using the status code in modules.
function os_agents_critical($id_os) function os_agents_critical($id_os)
{ {
// TODO REVIEW ORACLE AND POSTGRES global $config;
return db_get_sql(
" $table = (is_metaconsole() === true) ? 'tmetaconsole_agent' : 'tagente';
SELECT COUNT(*)
FROM tagente if (users_is_admin() === true) {
WHERE tagente.disabled=0 AND return db_get_sql(
critical_count>0 AND id_os=$id_os" sprintf(
); 'SELECT COUNT(*)
FROM %s
WHERE tagente.disabled=0 AND
critical_count>0 AND id_os=%d',
$table,
$id_os
)
);
} else {
$groups = array_keys(users_get_groups($config['id_user'], 'AR', false));
return db_get_sql(
sprintf(
'SELECT COUNT(*)
FROM %s
WHERE tagente.disabled=0 AND
critical_count>0 AND
id_os=%d AND id_grupo IN (%s)',
$table,
$id_os,
implode(',', $groups)
)
);
}
} }
// Get ok agents by using the status code in modules. // Get ok agents by using the status code in modules.
function os_agents_ok($id_os) function os_agents_ok($id_os)
{ {
return db_get_sql( global $config;
"
SELECT COUNT(*) $table = (is_metaconsole() === true) ? 'tmetaconsole_agent' : 'tagente';
FROM tagente
WHERE tagente.disabled=0 AND if (users_is_admin() === true) {
normal_count=total_count AND id_os=$id_os" return db_get_sql(
); sprintf(
'SELECT COUNT(*)
FROM %s
WHERE tagente.disabled=0 AND
normal_count=total_count AND id_os=%d',
$table,
$id_os
)
);
} else {
$groups = array_keys(users_get_groups($config['id_user'], 'AR', false));
return db_get_sql(
sprintf(
'SELECT COUNT(*)
FROM %s
WHERE tagente.disabled=0 AND
normal_count=total_count AND
id_os=%d AND id_grupo IN (%s)',
$table,
$id_os,
implode(',', $groups)
)
);
}
} }
// Get warning agents by using the status code in modules. // Get warning agents by using the status code in modules.
function os_agents_warning($id_os) function os_agents_warning($id_os)
{ {
return db_get_sql( global $config;
"
SELECT COUNT(*) $table = (is_metaconsole() === true) ? 'tmetaconsole_agent' : 'tagente';
FROM tagente
WHERE tagente.disabled=0 AND if (users_is_admin() === true) {
critical_count=0 AND warning_count>0 AND id_os=$id_os" return db_get_sql(
); sprintf(
'SELECT COUNT(*)
FROM %s
WHERE tagente.disabled=0 AND
critical_count=0 AND warning_count>0
AND id_os=%d',
$table,
$id_os
)
);
} else {
$groups = array_keys(users_get_groups($config['id_user'], 'AR', false));
return db_get_sql(
sprintf(
'SELECT COUNT(*)
FROM %s
WHERE tagente.disabled=0 AND
critical_count=0 AND warning_count>0 AND
id_os=%d AND id_grupo IN (%s)',
$table,
$id_os,
implode(',', $groups)
)
);
}
} }
// Get unknown agents by using the status code in modules. // Get unknown agents by using the status code in modules.
function os_agents_unknown($id_os) function os_agents_unknown($id_os)
{ {
return db_get_sql( global $config;
"
SELECT COUNT(*) $table = (is_metaconsole() === true) ? 'tmetaconsole_agent' : 'tagente';
FROM tagente
WHERE tagente.disabled=0 AND if (users_is_admin() === true) {
critical_count=0 AND warning_count=0 AND return db_get_sql(
unknown_count>0 AND id_os=$id_os" sprintf(
); 'SELECT COUNT(*)
FROM %s
WHERE tagente.disabled=0 AND
critical_count=0 AND warning_count=0 AND
unknown_count>0 AND id_os=%d',
$table,
$id_os
)
);
} else {
$groups = array_keys(users_get_groups($config['id_user'], 'AR', false));
return db_get_sql(
sprintf(
'SELECT COUNT(*)
FROM %s
WHERE tagente.disabled=0 AND
critical_count=0 AND warning_count=0 AND
unknown_count>0 AND id_os=%d AND id_grupo IN (%s)',
$table,
$id_os,
implode(',', $groups)
)
);
}
}
/**
* Get total agents
*
* @param integer $id_os OS id.
*
* @return array|boolean
*/
function os_agents_total(int $id_os)
{
global $config;
$table = (is_metaconsole() === true) ? 'tmetaconsole_agent' : 'tagente';
if (users_is_admin() === true) {
return db_get_sql(
sprintf(
'SELECT COUNT(*)
FROM %s
WHERE tagente.disabled=0 AND id_os=%d',
$table,
$id_os
)
);
} else {
$groups = array_keys(users_get_groups($config['id_user'], 'AR', false));
return db_get_sql(
sprintf(
'SELECT COUNT(*)
FROM %s
WHERE tagente.disabled=0 AND id_os=%d AND id_grupo IN (%s)',
$table,
$id_os,
implode(',', $groups)
)
);
}
} }

View File

@ -412,6 +412,10 @@ class Widget
$className .= '\WuxWidget'; $className .= '\WuxWidget';
break; break;
case 'os_quick_report':
$className .= '\OsQuickReportWidget';
break;
default: default:
$className = false; $className = false;
break; break;

View File

@ -0,0 +1,350 @@
<?php
/**
* Widget Tree view Pandora FMS Console
*
* @category Console Class
* @package Pandora FMS
* @subpackage Widget Tree view
* @version 1.0.0
* @license See below
*
* ______ ___ _______ _______ ________
* | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __|
* | __/| _ | | _ || _ | _| _ | | ___| |__ |
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
*
* ============================================================================
* Copyright (c) 2005-2022 Artica Soluciones Tecnologicas
* Please see http://pandorafms.org for full contribution list
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation for version 2.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* ============================================================================
*/
namespace PandoraFMS\Dashboard;
/**
* OS quick report Widgets.
*/
class OsQuickReportWidget extends Widget
{
/**
* Name widget.
*
* @var string
*/
protected $name;
/**
* Title widget.
*
* @var string
*/
protected $title;
/**
* Page widget;
*
* @var string
*/
protected $page;
/**
* Class name widget.
*
* @var [type]
*/
protected $className;
/**
* Values options for each widget.
*
* @var [type]
*/
protected $values;
/**
* Configuration required.
*
* @var boolean
*/
protected $configurationRequired;
/**
* Error load widget.
*
* @var boolean
*/
protected $loadError;
/**
* Width.
*
* @var integer
*/
protected $width;
/**
* Heigth.
*
* @var integer
*/
protected $height;
/**
* Dashboard ID.
*
* @var integer
*/
protected $dashboardId;
/**
* Cell ID.
*
* @var integer
*/
protected $cellId;
/**
* Construct.
*
* @param integer $cellId Cell ID.
* @param integer $dashboardId Dashboard ID.
* @param integer $widgetId Widget ID.
* @param integer|null $width New width.
* @param integer|null $height New height.
*/
public function __construct(
int $cellId,
int $dashboardId=0,
int $widgetId=0,
?int $width=0,
?int $height=0
) {
global $config;
// Includes.
enterprise_include_once('/include/functions_services.php');
enterprise_include_once('/include/functions_servicemap.php');
// WARNING: Do not edit. This chunk must be in the constructor.
parent::__construct(
$cellId,
$dashboardId,
$widgetId
);
// Width.
$this->width = $width;
// Height.
$this->height = $height;
// Cell Id.
$this->cellId = $cellId;
// Widget ID.
$this->widgetId = $widgetId;
// Dashboard ID.
$this->dashboardId = $dashboardId;
// Options.
$this->values = $this->decoders($this->getOptionsWidget());
// Positions.
$this->position = $this->getPositionWidget();
// Page.
$this->page = basename(__FILE__);
// ClassName.
$class = new \ReflectionClass($this);
$this->className = $class->getShortName();
// Title.
$this->title = __('OS quick report');
// Name.
if (empty($this->name) === true) {
$this->name = 'os_quick_report';
}
$this->overflow_scrollbars = false;
}
/**
* Decoders hack for retrocompability.
*
* @param array $decoder Values.
*
* @return array Returns the values with the correct key.
*/
public function decoders(array $decoder): array
{
$values = [];
// Retrieve global - common inputs.
$values = parent::decoders($decoder);
return $values;
}
/**
* Generates inputs for form (specific).
*
* @return array Of inputs.
*
* @throws Exception On error.
*/
public function getFormInputs(): array
{
// Retrieve global - common inputs.
$inputs = parent::getFormInputs();
return $inputs;
}
/**
* Get Post for widget.
*
* @return array
*/
public function getPost():array
{
// Retrieve global - common inputs.
$values = parent::getPost();
return $values;
}
/**
* Draw widget.
*
* @return string;
*/
public function load()
{
global $config;
$values = $this->values;
$result = [];
$os_array = os_get_os();
foreach ($os_array as $os) {
$id_os = (int) $os['id_os'];
$total = os_agents_total($id_os);
if ((int) $total === 0) {
continue;
}
$result[$id_os]['name'] = $os['name'];
$result[$id_os]['total'] = (int) $total;
$result[$id_os]['normal'] = (int) os_agents_ok($id_os);
$result[$id_os]['critical'] = (int) os_agents_critical($id_os);
$result[$id_os]['unknown'] = (int) os_agents_unknown($id_os);
}
$output = '';
if (empty($result) === false) {
$table = new \stdClass();
$table->class = 'info_table';
$table->width = '100%';
$table->cellpadding = 0;
$table->cellspacing = 0;
$table->size = [];
$table->size[0] = '10%';
$table->size[1] = '10%';
$table->size[2] = '20%';
$table->size[3] = '20%';
$table->size[4] = '20%';
$table->size[5] = '20%';
$table->align = [];
$table->align[0] = 'center';
$table->align[1] = 'left';
$table->align[2] = 'center';
$table->align[3] = 'center';
$table->align[4] = 'center';
$table->align[5] = 'center';
$table->head = [];
$table->head[0] = __('OS');
$table->head[1] = __('OS name');
$table->head[2] = ucfirst(__('total agents'));
$table->head[3] = ucfirst(__('normal agents'));
$table->head[4] = ucfirst(__('critical agents'));
$table->head[5] = ucfirst(__('unknown agents'));
$table->headstyle = [];
$table->headstyle[0] = 'text-align:center;background-color: '.$values['background'];
$table->headstyle[1] = 'background-color: '.$values['background'];
$table->headstyle[2] = 'text-align:center;background-color: '.$values['background'];
$table->headstyle[3] = 'text-align:center;background-color: '.$values['background'];
$table->headstyle[4] = 'text-align:center;background-color: '.$values['background'];
$table->headstyle[5] = 'text-align:center;background-color: '.$values['background'];
$table->style = [];
$table->style[0] = 'background-color: '.$values['background'];
$table->style[1] = 'background-color: '.$values['background'];
$table->style[2] = 'font-size: 22px;background-color: '.$values['background'];
$table->style[3] = 'font-size: 22px;background-color: '.$values['background'];
$table->style[4] = 'font-size: 22px;background-color: '.$values['background'];
$table->style[5] = 'font-size: 22px;background-color: '.$values['background'];
foreach ($result as $id => $os) {
$data = [];
$data[0] = ui_print_os_icon($id, false, true);
$data[1] = $os['name'];
$data[2] = $os['total'];
$data[3] = $os['normal'];
$data[4] = $os['critical'];
$data[5] = $os['unknown'];
$table->data[] = $data;
}
$output = html_print_table($table, true);
} else {
$output = 'No data available';
}
return $output;
}
/**
* Get description.
*
* @return string.
*/
public static function getDescription()
{
return __('OS quick report');
}
/**
* Get Name.
*
* @return string.
*/
public static function getName()
{
return 'os_quick_report';
}
}

View File

@ -340,8 +340,8 @@ a.pandora_pagination {
/* firts_task.css */ /* firts_task.css */
.new_task, .new_task,
div.new_task_cluster, div.new_task,
div.new_task_cluster > div { div.new_task > div {
background-color: #222; background-color: #222;
} }

View File

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

View File

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

View File

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

View File

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

View File

@ -1,5 +1,5 @@
package: pandorafms-server package: pandorafms-server
Version: 7.0NG.762-220603 Version: 7.0NG.762-220606
Architecture: all Architecture: all
Priority: optional Priority: optional
Section: admin Section: admin

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -35,7 +35,7 @@ use PandoraFMS::Config;
use PandoraFMS::DB; use PandoraFMS::DB;
# version: define current version # version: define current version
my $version = "7.0NG.762 Build 220603"; my $version = "7.0NG.762 Build 220606";
# Pandora server configuration # Pandora server configuration
my %conf; my %conf;

View File

@ -36,7 +36,7 @@ use Encode::Locale;
Encode::Locale::decode_argv; Encode::Locale::decode_argv;
# version: define current version # version: define current version
my $version = "7.0NG.762 Build 220603"; my $version = "7.0NG.762 Build 220606";
# save program name for logging # save program name for logging
my $progname = basename($0); my $progname = basename($0);
@ -3078,7 +3078,7 @@ sub cli_user_update() {
$new_value = md5($new_value); $new_value = md5($new_value);
} }
else { else {
print_log "[ERROR] Field '$field' doesnt exist\n\n"; print_log "[ERROR] Field '$field' doesn't exist\n\n";
exit; exit;
} }
@ -3107,7 +3107,7 @@ sub cli_agent_update_custom_fields() {
my $found = 0; my $found = 0;
if($agent_name eq '') { if($agent_name eq '') {
print_log "[ERROR] Agent '$id_agent' doesnt exist\n\n"; print_log "[ERROR] Agent '$id_agent' doesn't exist\n\n";
exit; exit;
} }
@ -3116,7 +3116,7 @@ sub cli_agent_update_custom_fields() {
if($custom_field eq '') { if($custom_field eq '') {
print_log "[ERROR] Field '$field' doesnt exist\n\n"; print_log "[ERROR] Field '$field' doesn't exist\n\n";
exit; exit;
} }
@ -3142,7 +3142,7 @@ sub cli_agent_update_custom_fields() {
if($result == "0E0"){ if($result == "0E0"){
print_log "[ERROR] Error updating field '$field'\n\n"; print_log "[ERROR] Error updating field '$field'\n\n";
} else { } else {
print_log "[INFO] Field '$field' updated succesfully!\n\n"; print_log "[INFO] Field '$field' updated successfully!\n\n";
} }
exit; exit;
@ -3210,7 +3210,7 @@ sub cli_agent_update() {
# Check if the address already exist # Check if the address already exist
my $address_id = get_addr_id($dbh,$new_value); my $address_id = get_addr_id($dbh,$new_value);
# If the addres doesnt exist, we add it to the addresses list # If the addres doesn't exist, we add it to the addresses list
if($address_id == -1) { if($address_id == -1) {
$address_id = add_address($dbh,$new_value); $address_id = add_address($dbh,$new_value);
} }
@ -3233,7 +3233,7 @@ sub cli_agent_update() {
$field = 'direccion'; $field = 'direccion';
} }
else { else {
print_log "[ERROR] Field '$field' doesnt exist\n\n"; print_log "[ERROR] Field '$field' doesn't exist\n\n";
exit; exit;
} }
@ -3299,7 +3299,7 @@ sub cli_alert_template_update() {
$field = 'id_group'; $field = 'id_group';
} }
else { else {
print_log "[ERROR] Field '$field' doesnt exist\n\n"; print_log "[ERROR] Field '$field' doesn't exist\n\n";
exit; exit;
} }
@ -3346,7 +3346,7 @@ sub pandora_check_network_module_fields($) {
# Check if the address already exist # Check if the address already exist
my $address_id = get_addr_id($dbh,$field_value->{'new_value'}); my $address_id = get_addr_id($dbh,$field_value->{'new_value'});
# If the addres doesnt exist, we add it to the addresses list # If the addres doesn't exist, we add it to the addresses list
if($address_id == -1) { if($address_id == -1) {
$address_id = add_address($dbh,$field_value->{'new_value'}); $address_id = add_address($dbh,$field_value->{'new_value'});
} }
@ -3419,7 +3419,7 @@ sub pandora_check_snmp_module_fields($) {
# Check if the address already exist # Check if the address already exist
my $address_id = get_addr_id($dbh,$field_value->{'new_value'}); my $address_id = get_addr_id($dbh,$field_value->{'new_value'});
# If the addres doesnt exist, we add it to the addresses list # If the addres doesn't exist, we add it to the addresses list
if($address_id == -1) { if($address_id == -1) {
$address_id = add_address($dbh,$field_value->{'new_value'}); $address_id = add_address($dbh,$field_value->{'new_value'});
} }
@ -3482,7 +3482,7 @@ sub pandora_check_plugin_module_fields($) {
# Check if the address already exist # Check if the address already exist
my $address_id = get_addr_id($dbh,$field_value->{'new_value'}); my $address_id = get_addr_id($dbh,$field_value->{'new_value'});
# If the addres doesnt exist, we add it to the addresses list # If the addres doesn't exist, we add it to the addresses list
if($address_id == -1) { if($address_id == -1) {
$address_id = add_address($dbh,$field_value->{'new_value'}); $address_id = add_address($dbh,$field_value->{'new_value'});
} }
@ -3584,7 +3584,7 @@ sub cli_module_update() {
my $module_group_id = get_module_group_id($dbh,$new_value); my $module_group_id = get_module_group_id($dbh,$new_value);
if ($module_group_id == -1) { if ($module_group_id == -1) {
print_log "[ERROR] Module group '$new_value' doesnt exist\n\n"; print_log "[ERROR] Module group '$new_value' doesn't exist\n\n";
exit; exit;
} }
$field = 'id_module_group'; $field = 'id_module_group';
@ -3728,7 +3728,7 @@ sub cli_module_update() {
my $module_group_id = get_module_group_id($dbh,$new_value); my $module_group_id = get_module_group_id($dbh,$new_value);
if ($module_group_id == -1) { if ($module_group_id == -1) {
print_log "[ERROR] Module group '$new_value' doesnt exist\n\n"; print_log "[ERROR] Module group '$new_value' doesn't exist\n\n";
exit; exit;
} }
$field = 'id_module_group'; $field = 'id_module_group';
@ -4744,7 +4744,7 @@ if($result == 0) {
print_log "[ERROR] Alert could not be validated\n\n"; print_log "[ERROR] Alert could not be validated\n\n";
} }
else { else {
print_log "[INFO] Alert succesfully validated\n\n"; print_log "[INFO] Alert successfully validated\n\n";
; ;
} }
@ -5584,7 +5584,7 @@ sub cli_delete_conf_file() {
} }
if($conf_deleted == 1 || $md5_deleted == 1) { if($conf_deleted == 1 || $md5_deleted == 1) {
print_log "[INFO] Local conf files of the agent '$agent_name' has been deleted succesfully\n\n"; print_log "[INFO] Local conf files of the agent '$agent_name' has been deleted successfully\n\n";
} }
else { else {
print_log "[ERROR] Local conf file of the agent '$agent_name' was not found\n\n"; print_log "[ERROR] Local conf file of the agent '$agent_name' was not found\n\n";
@ -5602,7 +5602,7 @@ sub cli_delete_conf_file() {
} }
if($conf_deleted == 1 || $md5_deleted == 1) { if($conf_deleted == 1 || $md5_deleted == 1) {
print_log "[INFO] Local conf files of the agent '$agent_name' has been deleted succesfully\n\n"; print_log "[INFO] Local conf files of the agent '$agent_name' has been deleted successfully\n\n";
} }
else { else {
print_log "[ERROR] Local conf file of the agent '$agent_name' was not found\n\n"; print_log "[ERROR] Local conf file of the agent '$agent_name' was not found\n\n";
@ -5908,7 +5908,7 @@ sub cli_create_group() {
$parent_group_id, 0, 0, '', 0, $description); $parent_group_id, 0, 0, '', 0, $description);
}; };
if ($@) { if ($@) {
print_log "[ERROR] Problems with IDS and doesnt created group\n\n"; print_log "[ERROR] Problems with IDS and doesn't created group\n\n";
$count_error++; $count_error++;
next; next;
} }
@ -6543,7 +6543,7 @@ sub cli_update_special_day() {
$field = 'id_group'; $field = 'id_group';
} }
else { else {
print_log "[ERROR] Field '$field' doesnt exist\n\n"; print_log "[ERROR] Field '$field' doesn't exist\n\n";
exit; exit;
} }