This commit is contained in:
marcos.alconada 2019-06-17 10:02:11 +02:00
commit b627636863
33 changed files with 107 additions and 90 deletions

View File

@ -1,5 +1,5 @@
package: pandorafms-agent-unix
Version: 7.0NG.735-190614
Version: 7.0NG.735-190617
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.735-190614"
pandora_version="7.0NG.735-190617"
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

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

View File

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

View File

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

View File

@ -10,7 +10,7 @@
# **********************************************************************
PI_VERSION="7.0NG.735"
PI_BUILD="190614"
PI_BUILD="190617"
OS_NAME=`uname -s`
FORCE=0

View File

@ -186,7 +186,7 @@ UpgradeApplicationID
{}
Version
{190614}
{190617}
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.735(Build 190614)")
#define PANDORA_VERSION ("7.0NG.735(Build 190617)")
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.735(Build 190614))"
VALUE "ProductVersion", "(7.0NG.735(Build 190617))"
VALUE "FileVersion", "1.0.0.0"
END
END

View File

@ -1,5 +1,5 @@
package: pandorafms-console
Version: 7.0NG.735-190614
Version: 7.0NG.735-190617
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.735-190614"
pandora_version="7.0NG.735-190617"
package_pear=0
package_pandora=1

View File

@ -221,7 +221,7 @@ switch ($action) {
$server_name = $item['server_name'];
// Metaconsole db connection.
if ($meta && $server_name != '') {
if ($meta && !empty($server_name)) {
$connection = metaconsole_get_connection($server_name);
if (metaconsole_load_external_db($connection) != NOERR) {
continue;
@ -547,8 +547,43 @@ switch ($action) {
break;
case 'event_report_agent':
case 'event_report_group':
$description = $item['description'];
$period = $item['period'];
$group = $item['id_group'];
$recursion = $item['recursion'];
$idAgent = $item['id_agent'];
$idAgentModule = $item['id_agent_module'];
$show_summary_group = $style['show_summary_group'];
$filter_event_severity = json_decode($style['filter_event_severity'], true);
$filter_event_status = json_decode($style['filter_event_status'], true);
$filter_event_type = json_decode($style['filter_event_type'], true);
$event_graph_by_user_validator = $style['event_graph_by_user_validator'];
$event_graph_by_criticity = $style['event_graph_by_criticity'];
$event_graph_validated_vs_unvalidated = $style['event_graph_validated_vs_unvalidated'];
$include_extended_events = $item['show_extended_events'];
$filter_search = $style['event_filter_search'];
break;
case 'event_report_group':
$description = $item['description'];
$period = $item['period'];
$group = $item['id_group'];
$recursion = $item['recursion'];
$event_graph_by_agent = $style['event_graph_by_agent'];
$event_graph_by_user_validator = $style['event_graph_by_user_validator'];
$event_graph_by_criticity = $style['event_graph_by_criticity'];
$event_graph_validated_vs_unvalidated = $style['event_graph_validated_vs_unvalidated'];
$filter_search = $style['event_filter_search'];
$include_extended_events = $item['show_extended_events'];
break;
@ -2805,7 +2840,7 @@ function print_SLA_list($width, $action, $idItem=null)
foreach ($itemsSLA as $item) {
$server_name = $item['server_name'];
// Metaconsole db connection.
if ($meta && $server_name != '') {
if ($meta && !empty($server_name)) {
$connection = metaconsole_get_connection(
$server_name
);
@ -3133,7 +3168,7 @@ function print_General_list($width, $action, $idItem=null, $type='general')
foreach ($itemsGeneral as $item) {
$server_name = $item['server_name'];
// Metaconsole db connection.
if ($meta && $server_name != '') {
if ($meta && !empty($server_name)) {
$connection = metaconsole_get_connection(
$server_name
);

View File

@ -1348,6 +1348,8 @@ switch ($action) {
$values['description'] = get_parameter('description');
$values['type'] = get_parameter('type', null);
$values['recursion'] = get_parameter('recursion', null);
$values['show_extended_events'] = get_parameter('include_extended_events', null);
$label = get_parameter('label', '');
// Add macros name.
@ -1903,8 +1905,8 @@ switch ($action) {
$style['event_graph_by_user_validator'] = $event_graph_by_user_validator;
$style['event_graph_by_criticity'] = $event_graph_by_criticity;
$style['event_graph_validated_vs_unvalidated'] = $event_graph_validated_vs_unvalidated;
$style['event_filter_search'] = $event_filter_search;
if ($label != '') {
$style['label'] = $label;
} else {
@ -2010,6 +2012,7 @@ switch ($action) {
);
$name_it = (string) get_parameter('name');
$values['recursion'] = get_parameter('recursion', null);
$values['show_extended_events'] = get_parameter('include_extended_events', null);
$values['name'] = reporting_label_macro(
$items_label,
$name_it
@ -2421,6 +2424,7 @@ switch ($action) {
case 'event_report_agent':
case 'event_report_group':
case 'event_report_module':
$show_summary_group = get_parameter(
'show_summary_group',
0
@ -2476,22 +2480,11 @@ switch ($action) {
$style['event_graph_by_user_validator'] = $event_graph_by_user_validator;
$style['event_graph_by_criticity'] = $event_graph_by_criticity;
$style['event_graph_validated_vs_unvalidated'] = $event_graph_validated_vs_unvalidated;
switch ($values['type']) {
case 'event_report_group':
case 'event_report_agent':
$style['event_filter_search'] = $event_filter_search;
if ($label != '') {
$style['label'] = $label;
} else {
$style['label'] = '';
}
break;
default:
// Default.
break;
$style['event_filter_search'] = $event_filter_search;
if ($label != '') {
$style['label'] = $label;
} else {
$style['label'] = '';
}
break;

View File

@ -659,18 +659,18 @@ class Wizard
if ($input['arguments']['inline'] != 'true') {
$output .= '<div class="edit_discovery_input">';
} else {
$output .= '<div style="display: flex; margin-bottom: 25px;">';
$output .= '<div style="display: flex; margin-bottom: 25px; flex-wrap: wrap;">';
if (!isset($input['extra'])) {
$output .= '<div style="width: 50%;">';
}
if (isset($input['extra'])) {
$output .= '<div style="width: 50%; display: flex;">';
$output .= '<div style="display: flex; margin-right:10px;">';
}
}
if ($input['arguments']['inline'] == 'true' && isset($input['extra'])) {
$output .= '<div style="width: 50%">';
$output .= '<div style="margin-right:10px;">';
}
$output .= '<div class="label_select">';
@ -690,11 +690,11 @@ class Wizard
$output .= $this->printInput($input['arguments']);
$output .= '</div>';
} else if ($input['arguments']['inline'] == 'true') {
$output .= '<div style="width: 50%;">';
if (isset($input['extra'])) {
$output .= '<div style="float: center;">';
$output .= '<div style="">';
$output .= '<div style="float: left;">';
} else {
$output .= '<div style="width:50%;">';
$output .= '<div style="float: right;">';
}

View File

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

View File

@ -11519,7 +11519,7 @@ function api_set_create_event($id, $trash1, $other, $returnType)
if ($other['data'][18] != '') {
$values['id_extra'] = $other['data'][18];
$sql_validation = 'SELECT id_evento FROM tevento where estado=0 and id_extra ="'.$other['data'][18].'";';
$sql_validation = 'SELECT id_evento FROM tevento where estado IN (0,2) and id_extra ="'.$other['data'][18].'";';
$validation = db_get_all_rows_sql($sql_validation);
if ($validation) {
foreach ($validation as $val) {

View File

@ -180,7 +180,7 @@ function config_update_config()
$error_update[] = __('Automatic check for updates');
}
if (!config_update_value('cert_path', (bool) get_parameter('cert_path'))) {
if (!config_update_value('cert_path', get_parameter('cert_path'))) {
$error_update[] = __('SSL cert path');
}

View File

@ -1383,7 +1383,7 @@ function reporting_event_top_n(
foreach ($tops as $key => $row) {
// Metaconsole connection.
$server_name = $row['server_name'];
if (($config['metaconsole'] == 1) && $server_name != '' && defined('METACONSOLE')) {
if (($config['metaconsole'] == 1) && $server_name != '' && is_metaconsole()) {
$connection = metaconsole_get_connection($server_name);
if (metaconsole_load_external_db($connection) != NOERR) {
// ui_print_error_message ("Error connecting to ".$server_name);
@ -1426,7 +1426,7 @@ function reporting_event_top_n(
}
// Restore dbconnection.
if (($config['metaconsole'] == 1) && $server_name != '' && defined('METACONSOLE')) {
if (($config['metaconsole'] == 1) && $server_name != '' && is_metaconsole()) {
metaconsole_restore_db();
}
}
@ -2330,7 +2330,7 @@ function reporting_exception(
do {
// Metaconsole connection.
$server_name = $exceptions[$i]['server_name'];
if (($config['metaconsole'] == 1) && $server_name != '' && defined('METACONSOLE')) {
if (($config['metaconsole'] == 1) && $server_name != '' && is_metaconsole()) {
$connection = metaconsole_get_connection($server_name);
if (metaconsole_load_external_db($connection) != NOERR) {
// ui_print_error_message ("Error connecting to ".$server_name);
@ -2372,7 +2372,7 @@ function reporting_exception(
$i++;
// Restore dbconnection.
if (($config['metaconsole'] == 1) && $server_name != '' && defined('METACONSOLE')) {
if (($config['metaconsole'] == 1) && $server_name != '' && is_metaconsole()) {
metaconsole_restore_db();
}
} while ($min === false && $i < count($exceptions));
@ -2385,7 +2385,7 @@ function reporting_exception(
foreach ($exceptions as $exc) {
// Metaconsole connection.
$server_name = $exc['server_name'];
if (($config['metaconsole'] == 1) && $server_name != '' && defined('METACONSOLE')) {
if (($config['metaconsole'] == 1) && $server_name != '' && is_metaconsole()) {
$connection = metaconsole_get_connection($server_name);
if (metaconsole_load_external_db($connection) != NOERR) {
// ui_print_error_message ("Error connecting to ".$server_name);
@ -2499,7 +2499,7 @@ function reporting_exception(
}
// Restore dbconnection
if (($config['metaconsole'] == 1) && $server_name != '' && defined('METACONSOLE')) {
if (($config['metaconsole'] == 1) && $server_name != '' && is_metaconsole()) {
metaconsole_restore_db();
}
}
@ -2693,7 +2693,7 @@ function reporting_group_report($report, $content)
{
global $config;
$metaconsole_on = ($config['metaconsole'] == 1) && defined('METACONSOLE');
$metaconsole_on = ($config['metaconsole'] == 1) && is_metaconsole();
$return['type'] = 'group_report';
@ -6173,7 +6173,7 @@ function reporting_availability($report, $content, $date=false, $time=false)
foreach ($items as $item) {
// aaMetaconsole connection
$server_name = $item['server_name'];
if (($config['metaconsole'] == 1) && $server_name != '' && defined('METACONSOLE')) {
if (($config['metaconsole'] == 1) && $server_name != '' && is_metaconsole()) {
$connection = metaconsole_get_connection($server_name);
if (metaconsole_load_external_db($connection) != NOERR) {
// ui_print_error_message ("Error connecting to ".$server_name);
@ -6185,7 +6185,7 @@ function reporting_availability($report, $content, $date=false, $time=false)
|| modules_is_not_init($item['id_agent_module'])
) {
// Restore dbconnection
if (($config['metaconsole'] == 1) && $server_name != '' && defined('METACONSOLE')) {
if (($config['metaconsole'] == 1) && $server_name != '' && is_metaconsole()) {
metaconsole_restore_db();
}
@ -6242,7 +6242,7 @@ function reporting_availability($report, $content, $date=false, $time=false)
$text = $row['data']['agent'].' ('.$text.')';
// Restore dbconnection
if (($config['metaconsole'] == 1) && $server_name != '' && defined('METACONSOLE')) {
if (($config['metaconsole'] == 1) && $server_name != '' && is_metaconsole()) {
metaconsole_restore_db();
}
@ -6807,7 +6807,7 @@ function reporting_increment($report, $content)
$return['data'] = [];
if (defined('METACONSOLE')) {
if (is_metaconsole()) {
$sql1 = 'SELECT datos FROM tagente_datos WHERE id_agente_modulo = '.$id_agent_module.'
AND utimestamp <= '.(time() - $period).' ORDER BY utimestamp DESC';
$sql2 = 'SELECT datos FROM tagente_datos WHERE id_agente_modulo = '.$id_agent_module.' ORDER BY utimestamp DESC';
@ -6845,7 +6845,7 @@ function reporting_increment($report, $content)
$last_data = db_get_value_sql('SELECT datos FROM tagente_datos WHERE id_agente_modulo = '.$id_agent_module.' ORDER BY utimestamp DESC');
}
if (!defined('METACONSOLE')) {
if (!is_metaconsole()) {
}
if ($old_data === false || $last_data === false) {
@ -6934,7 +6934,7 @@ function reporting_general($report, $content)
foreach ($generals as $row) {
// Metaconsole connection
$server_name = $row['server_name'];
if (($config['metaconsole'] == 1) && $server_name != '' && defined('METACONSOLE')) {
if (($config['metaconsole'] == 1) && $server_name != '' && is_metaconsole()) {
$connection = metaconsole_get_connection($server_name);
if (metaconsole_load_external_db($connection) != NOERR) {
// ui_print_error_message ("Error connecting to ".$server_name);
@ -7085,7 +7085,7 @@ function reporting_general($report, $content)
$i++;
// Restore dbconnection
if (($config['metaconsole'] == 1) && $server_name != '' && defined('METACONSOLE')) {
if (($config['metaconsole'] == 1) && $server_name != '' && is_metaconsole()) {
metaconsole_restore_db();
}
}

View File

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

View File

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

View File

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

View File

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

View File

@ -1,5 +1,5 @@
package: pandorafms-server
Version: 7.0NG.735-190614
Version: 7.0NG.735-190617
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.735-190614"
pandora_version="7.0NG.735-190617"
package_cpan=0
package_pandora=1

View File

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

View File

@ -3352,7 +3352,7 @@ sub pandora_event ($$$$$$$$$$;$$$$$$$$$$$) {
# Validate events with the same event id
if (defined ($id_extra) && $id_extra ne '') {
logger($pa_config, "Updating events with extended id '$id_extra'.", 10);
db_do ($dbh, 'UPDATE ' . $event_table . ' SET estado = 1, ack_utimestamp = ? WHERE estado = 0 AND id_extra=?', $utimestamp, $id_extra);
db_do ($dbh, 'UPDATE ' . $event_table . ' SET estado = 1, ack_utimestamp = ? WHERE estado IN (0,2) AND id_extra=?', $utimestamp, $id_extra);
}
# Create the event

View File

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

View File

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

View File

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

View File

@ -9,7 +9,7 @@
# **********************************************************************
PI_VERSION="7.0NG.735"
PI_BUILD="190614"
PI_BUILD="190617"
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.735 PS190614";
my $version = "7.0NG.735 PS190617";
# 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.735 PS190614";
my $version = "7.0NG.735 PS190617";
# save program name for logging
my $progname = basename($0);

View File

@ -68,27 +68,16 @@ then
help
fi
TMPFILE=/tmp/dns_$DNS_CHECK.tmp
dig @$DNS_CHECK $DOMAIN_CHECK > $TMPFILE
RETURN_IP=`cat $TMPFILE | grep "^$DOMAIN_CHECK" | awk '{print $5}'`
RETURN_TIMEOUT=`cat $TMPFILE | grep "Query time" | grep -o "[0-9]*"`
rm $TMPFILE 2> /dev/null
if [ $TIMEOUT_CHECK == 1 ]
then
echo $RETURN_TIMEOUT
exit 0
fi
if [ "$RETURN_IP" != "$IP_CHECK" ]
then
echo 0
exit 1
else
echo 1
exit 0
fi
results=`dig @$DNS_CHECK +nocmd $DOMAIN_CHECK +multiline +noall +answer A`
targets=`echo "$results"| awk '{print $5}'`
for x in $targets; do
if [ "$x" == "$IP_CHECK" ]; then
echo 1
exit 0
fi
done
echo 0
exit 0