mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-04-08 18:55:09 +02:00
Merge remote-tracking branch 'origin/develop' into ent-3595-discovery-fase-2
Former-commit-id: 1e68380f62f61e9ac895a0c2bade2e6c8f5b589f
This commit is contained in:
commit
c03631ec9b
pandora_agents
pandora_console
DEBIAN
general
godmode/setup
images
include
install.phppandora_console.redhat.specpandora_console.specpandora_server
@ -1,5 +1,5 @@
|
||||
package: pandorafms-agent-unix
|
||||
Version: 7.0NG.732-190301
|
||||
Version: 7.0NG.732-190305
|
||||
Architecture: all
|
||||
Priority: optional
|
||||
Section: admin
|
||||
|
@ -14,7 +14,7 @@
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
|
||||
pandora_version="7.0NG.732-190301"
|
||||
pandora_version="7.0NG.732-190305"
|
||||
|
||||
echo "Test if you has the tools for to make the packages."
|
||||
whereis dpkg-deb | cut -d":" -f2 | grep dpkg-deb > /dev/null
|
||||
|
@ -42,7 +42,7 @@ my $Sem = undef;
|
||||
my $ThreadSem = undef;
|
||||
|
||||
use constant AGENT_VERSION => '7.0NG.732';
|
||||
use constant AGENT_BUILD => '190301';
|
||||
use constant AGENT_BUILD => '190305';
|
||||
|
||||
# Agent log default file size maximum and instances
|
||||
use constant DEFAULT_MAX_LOG_SIZE => 600000;
|
||||
|
@ -3,7 +3,7 @@
|
||||
#
|
||||
%define name pandorafms_agent_unix
|
||||
%define version 7.0NG.732
|
||||
%define release 190301
|
||||
%define release 190305
|
||||
|
||||
Summary: Pandora FMS Linux agent, PERL version
|
||||
Name: %{name}
|
||||
|
@ -3,7 +3,7 @@
|
||||
#
|
||||
%define name pandorafms_agent_unix
|
||||
%define version 7.0NG.732
|
||||
%define release 190301
|
||||
%define release 190305
|
||||
|
||||
Summary: Pandora FMS Linux agent, PERL version
|
||||
Name: %{name}
|
||||
|
@ -10,7 +10,7 @@
|
||||
# **********************************************************************
|
||||
|
||||
PI_VERSION="7.0NG.732"
|
||||
PI_BUILD="190301"
|
||||
PI_BUILD="190305"
|
||||
OS_NAME=`uname -s`
|
||||
|
||||
FORCE=0
|
||||
|
@ -186,7 +186,7 @@ UpgradeApplicationID
|
||||
{}
|
||||
|
||||
Version
|
||||
{190301}
|
||||
{190305}
|
||||
|
||||
ViewReadme
|
||||
{Yes}
|
||||
|
@ -30,7 +30,7 @@ using namespace Pandora;
|
||||
using namespace Pandora_Strutils;
|
||||
|
||||
#define PATH_SIZE _MAX_PATH+1
|
||||
#define PANDORA_VERSION ("7.0NG.732(Build 190301)")
|
||||
#define PANDORA_VERSION ("7.0NG.732(Build 190305)")
|
||||
|
||||
string pandora_path;
|
||||
string pandora_dir;
|
||||
|
@ -11,7 +11,7 @@ BEGIN
|
||||
VALUE "LegalCopyright", "Artica ST"
|
||||
VALUE "OriginalFilename", "PandoraAgent.exe"
|
||||
VALUE "ProductName", "Pandora FMS Windows Agent"
|
||||
VALUE "ProductVersion", "(7.0NG.732(Build 190301))"
|
||||
VALUE "ProductVersion", "(7.0NG.732(Build 190305))"
|
||||
VALUE "FileVersion", "1.0.0.0"
|
||||
END
|
||||
END
|
||||
|
@ -1,5 +1,5 @@
|
||||
package: pandorafms-console
|
||||
Version: 7.0NG.732-190301
|
||||
Version: 7.0NG.732-190305
|
||||
Architecture: all
|
||||
Priority: optional
|
||||
Section: admin
|
||||
|
@ -14,7 +14,7 @@
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
|
||||
pandora_version="7.0NG.732-190301"
|
||||
pandora_version="7.0NG.732-190305"
|
||||
|
||||
package_pear=0
|
||||
package_pandora=1
|
||||
|
113
pandora_console/general/mysqlerr.php
Normal file
113
pandora_console/general/mysqlerr.php
Normal file
@ -0,0 +1,113 @@
|
||||
<html>
|
||||
<head>
|
||||
|
||||
<style>
|
||||
|
||||
#alert_messages_na{
|
||||
-moz-border-bottom-right-radius: 5px;
|
||||
-webkit-border-bottom-left-radius: 5px;
|
||||
border-bottom-right-radius: 5px;
|
||||
border-bottom-left-radius: 5px;
|
||||
z-index:2;
|
||||
position:fixed;
|
||||
width:700px;
|
||||
background:white;
|
||||
left:50%;
|
||||
top:20%;
|
||||
margin-left:-350px;
|
||||
|
||||
}
|
||||
|
||||
.modalheade{
|
||||
text-align:center;
|
||||
width:100%;
|
||||
height:37px;
|
||||
left:0px;
|
||||
background-color:#82b92e;
|
||||
}
|
||||
.modalheadertex{
|
||||
color:white;
|
||||
position:relative;
|
||||
font-family:Nunito;
|
||||
font-size:13pt;
|
||||
top:8px;
|
||||
}
|
||||
|
||||
.modalconten{
|
||||
color:black;
|
||||
background:white;
|
||||
}
|
||||
.modalcontentim{
|
||||
float:left;
|
||||
margin-left:30px;
|
||||
margin-top:30px;
|
||||
margin-bottom:30px;
|
||||
}
|
||||
.modalcontenttex{
|
||||
float:left;
|
||||
text-align:justify;
|
||||
color:black;
|
||||
font-size: 9.5pt;
|
||||
line-height:13pt;
|
||||
margin-top:40px;
|
||||
width:430px;
|
||||
margin-left:30px;
|
||||
}
|
||||
.modalwikibutto{
|
||||
cursor:pointer;
|
||||
text-align:center;
|
||||
margin-right:45px;
|
||||
float:right;
|
||||
-moz-border-radius: 3px;
|
||||
-webkit-border-radius: 3px;
|
||||
margin-bottom:30px;
|
||||
border-radius: 3px;
|
||||
width:170px;
|
||||
height:30px;
|
||||
border: 1px solid #82b92e;
|
||||
margin-top:8%;
|
||||
background-color:#82b92e;
|
||||
}
|
||||
.modalwikibuttontex{
|
||||
color:#ffffff;
|
||||
font-family:Nunito;
|
||||
font-size:10pt;
|
||||
position:relative;
|
||||
top:6px;
|
||||
}
|
||||
|
||||
#opacity{
|
||||
background:black;opacity:0.1;left:0px;top:0px;width:100%;height:100%;
|
||||
}
|
||||
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div id="alert_messages_na">
|
||||
|
||||
<div class='modalheade'>
|
||||
<span class='modalheadertex'>
|
||||
<?php echo __('Database error'); ?>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<div class='modalconten'>
|
||||
<img class='modalcontentim' src='<?php echo $config['homeurl']; ?>/images/mysqlerr.png'>
|
||||
<div class='modalcontenttex'>
|
||||
<?php
|
||||
echo __('Failure to connect to Database server, please check the configuration file config.php or contact system administrator if you need assistance.');
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
<a href='https://wiki.pandorafms.com/index.php?title=Pandora:Documentation_en:Configuration' target='_blank'>
|
||||
<div class='modalwikibutto cerrar'>
|
||||
<span class='modalwikibuttontex'> <?php echo __('Documentation'); ?></span>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div id="opacity"></div>
|
||||
|
||||
</body>
|
||||
</html>
|
@ -43,7 +43,7 @@ if (is_ajax()) {
|
||||
if ($type_auth != 'mysql') {
|
||||
// Fallback to local authentication
|
||||
$row = [];
|
||||
$row['name'] = __('Fallback to local authentication').ui_print_help_tip(__('Enable this option if you want to fallback to local authentication when remote (ldap etc...) authentication failed.'), true);
|
||||
$row['name'] = __('Fallback to local authentication').ui_print_help_tip(__('Enable this option if you want to fallback to local authentication when remote (ldap etc...) authentication failed. Only available when \'Save password\' is enabled.'), true);
|
||||
$row['control'] = html_print_checkbox_switch('fallback_local_auth', 1, $config['fallback_local_auth'], true);
|
||||
$table->data['fallback_local_auth'] = $row;
|
||||
|
||||
|
BIN
pandora_console/images/mysqlerr.png
Normal file
BIN
pandora_console/images/mysqlerr.png
Normal file
Binary file not shown.
After ![]() (image error) Size: 3.4 KiB |
@ -20,7 +20,7 @@
|
||||
/**
|
||||
* Pandora build version and version
|
||||
*/
|
||||
$build_version = 'PC190301';
|
||||
$build_version = 'PC190305';
|
||||
$pandora_version = 'v7.0NG.732';
|
||||
|
||||
// Do not overwrite default timezone set if defined.
|
||||
|
@ -45,6 +45,7 @@ function mysql_connect_db($host=null, $db=null, $user=null, $pass=null, $port=nu
|
||||
if ($config['mysqli']) {
|
||||
$connect_id = mysqli_connect($host, $user, $pass, $db, $port);
|
||||
if (mysqli_connect_errno() > 0) {
|
||||
include 'general/mysqlerr.php';
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -82,17 +82,25 @@ function agents_get_agent_id_by_alias($alias)
|
||||
|
||||
|
||||
/**
|
||||
* Creates an agent
|
||||
* Creates an agent.
|
||||
*
|
||||
* @param string Agent name.
|
||||
* @param string Group to be included.
|
||||
* @param int Agent interval
|
||||
* @param string Agent IP
|
||||
* @param string $name Agent name.
|
||||
* @param string $id_group Group to be included.
|
||||
* @param integer $interval Agent interval.
|
||||
* @param string $ip_address Agent IP.
|
||||
* @param mixed $values Other tagente fields.
|
||||
* @param boolean $alias_as_name True to not assign an alias as name.
|
||||
*
|
||||
* @return integer New agent id if created. False if it could not be created.
|
||||
*/
|
||||
function agents_create_agent($name, $id_group, $interval, $ip_address, $values=false)
|
||||
{
|
||||
function agents_create_agent(
|
||||
$name,
|
||||
$id_group,
|
||||
$interval,
|
||||
$ip_address,
|
||||
$values=false,
|
||||
$alias_as_name=false
|
||||
) {
|
||||
if (empty($name)) {
|
||||
return false;
|
||||
}
|
||||
@ -101,7 +109,7 @@ function agents_create_agent($name, $id_group, $interval, $ip_address, $values=f
|
||||
return false;
|
||||
}
|
||||
|
||||
// Check interval greater than zero
|
||||
// Check interval greater than zero.
|
||||
if ($interval < 0) {
|
||||
$interval = false;
|
||||
}
|
||||
@ -115,7 +123,7 @@ function agents_create_agent($name, $id_group, $interval, $ip_address, $values=f
|
||||
}
|
||||
|
||||
$values['alias'] = $name;
|
||||
$values['nombre'] = hash('sha256', $name.'|'.$ip_address.'|'.time().'|'.sprintf('%04d', rand(0, 10000)));
|
||||
$values['nombre'] = ($alias_as_name === false) ? hash('sha256', $name.'|'.$ip_address.'|'.time().'|'.sprintf('%04d', rand(0, 10000))) : $name;
|
||||
$values['id_grupo'] = $id_group;
|
||||
$values['intervalo'] = $interval;
|
||||
|
||||
@ -128,12 +136,12 @@ function agents_create_agent($name, $id_group, $interval, $ip_address, $values=f
|
||||
return false;
|
||||
}
|
||||
|
||||
// Create address for this agent in taddress
|
||||
// Create address for this agent in taddress.
|
||||
if (!empty($ip_address)) {
|
||||
agents_add_address($id_agent, $ip_address);
|
||||
}
|
||||
|
||||
db_pandora_audit('Agent management', "New agent '$name' created");
|
||||
db_pandora_audit('Agent management', 'New agent '.$name.' created');
|
||||
|
||||
return $id_agent;
|
||||
}
|
||||
|
@ -2272,35 +2272,29 @@ function events_page_responses($event, $childrens_ids=[])
|
||||
|
||||
/**
|
||||
* Replace macros in the target of a response and return it.
|
||||
* If server_id > 0, is a metaconsole query.
|
||||
* If server_id > 0, it's a metaconsole query.
|
||||
*
|
||||
* @param integer $event_id Event_id.
|
||||
* @param integer $response_id Response_id.
|
||||
* @param integer $server_id Server_id.
|
||||
* @param boolean $history History.
|
||||
* @param integer $event_id Event identifier.
|
||||
* @param integer $response_id Event response identifier.
|
||||
* @param integer $server_id Node identifier (for metaconsole).
|
||||
* @param boolean $history Use the history database or not.
|
||||
*
|
||||
* @return string Target.
|
||||
* @return string The response text with the macros applied.
|
||||
*/
|
||||
function events_get_response_target(
|
||||
$event_id,
|
||||
$response_id,
|
||||
$server_id,
|
||||
$history=false
|
||||
int $event_id,
|
||||
int $response_id,
|
||||
int $server_id=0,
|
||||
bool $history=false
|
||||
) {
|
||||
global $config;
|
||||
|
||||
$event_response = db_get_row('tevent_response', 'id', $response_id);
|
||||
|
||||
if ($server_id > 0) {
|
||||
$meta = true;
|
||||
} else {
|
||||
$meta = false;
|
||||
}
|
||||
|
||||
// If server_id > 0, it's a metaconsole query.
|
||||
$meta = $server_id > 0;
|
||||
$event_table = events_get_events_table($meta, $history);
|
||||
|
||||
$event = db_get_row($event_table, 'id_evento', $event_id);
|
||||
|
||||
$event_response = db_get_row('tevent_response', 'id', $response_id);
|
||||
$target = io_safe_output($event_response['target']);
|
||||
|
||||
// Substitute each macro.
|
||||
@ -2317,7 +2311,7 @@ function events_get_response_target(
|
||||
}
|
||||
|
||||
$ip = db_get_value_filter('direccion', $agente_table_name, $filter);
|
||||
// If agent has not an ip, display N/A.
|
||||
// If agent has not an IP, display N/A.
|
||||
if ($ip === false) {
|
||||
$ip = __('N/A');
|
||||
}
|
||||
@ -2499,6 +2493,11 @@ function events_get_response_target(
|
||||
}
|
||||
}
|
||||
|
||||
// This will replace the macro with the current logged user.
|
||||
if (strpos($target, '_current_user_') !== false) {
|
||||
$target = str_replace('_current_user_', $config['id_user'], $target);
|
||||
}
|
||||
|
||||
return $target;
|
||||
}
|
||||
|
||||
|
@ -534,9 +534,10 @@ function planned_downtimes_migrate_malformed_downtimes_copy_items($original_down
|
||||
/**
|
||||
* Stop a planned downtime.
|
||||
*
|
||||
* @param array Planned downtime data.
|
||||
* @param array $downtime Planned downtime data.
|
||||
*
|
||||
* @return mixes False on error or an array with the result and a message of the operation.
|
||||
* @return mixed False on error or an array with the result and a message of
|
||||
* the operation.
|
||||
*/
|
||||
function planned_downtimes_stop($downtime)
|
||||
{
|
||||
@ -566,7 +567,9 @@ function planned_downtimes_stop($downtime)
|
||||
case 'periodically':
|
||||
return false;
|
||||
|
||||
break;
|
||||
default:
|
||||
// Nothing to do.
|
||||
break;
|
||||
}
|
||||
|
||||
$message .= ui_print_result_message(
|
||||
@ -593,7 +596,7 @@ function planned_downtimes_stop($downtime)
|
||||
true
|
||||
);
|
||||
|
||||
// Reenabled the Agents or Modules or alerts...depends of type
|
||||
// Reenabled the Agents or Modules or alerts...depends of type.
|
||||
switch ($downtime['type_downtime']) {
|
||||
case 'quiet':
|
||||
$agents = db_get_all_rows_filter(
|
||||
@ -658,7 +661,10 @@ function planned_downtimes_stop($downtime)
|
||||
foreach ($agents as $agent) {
|
||||
$result = db_process_sql_update(
|
||||
'tagente',
|
||||
['disabled' => 0],
|
||||
[
|
||||
'disabled' => 0,
|
||||
'update_module_count' => 1,
|
||||
],
|
||||
['id_agente' => $agent['id_agent']]
|
||||
);
|
||||
|
||||
@ -702,6 +708,10 @@ function planned_downtimes_stop($downtime)
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
// Nothing to do.
|
||||
break;
|
||||
}
|
||||
|
||||
$message .= ui_print_info_message(
|
||||
|
@ -748,7 +748,7 @@ function flot_slicesbar_graph(
|
||||
if ($widgets) {
|
||||
$return = "<div id='$graph_id' class='noresizevc graph $adapt_key' style='width: ".$width.'px; height: '.$height."px;'></div>";
|
||||
} else {
|
||||
$return = "<div id='$graph_id' class='noresizevc graph $adapt_key' style='width: ".$width.'%; height: '.$height."px;'></div>";
|
||||
$return = "<div id='$graph_id' class='noresizevc graph $adapt_key' style='width: ".$width.'px; height: '.$height."px;'></div>";
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -129,7 +129,7 @@
|
||||
<div style='height: 10px'>
|
||||
<?php
|
||||
$version = '7.0NG.732';
|
||||
$build = '190301';
|
||||
$build = '190305';
|
||||
$banner = "v$version Build $build";
|
||||
|
||||
error_reporting(0);
|
||||
|
@ -3,7 +3,7 @@
|
||||
#
|
||||
%define name pandorafms_console
|
||||
%define version 7.0NG.732
|
||||
%define release 190301
|
||||
%define release 190305
|
||||
|
||||
# User and Group under which Apache is running
|
||||
%define httpd_name httpd
|
||||
|
@ -3,7 +3,7 @@
|
||||
#
|
||||
%define name pandorafms_console
|
||||
%define version 7.0NG.732
|
||||
%define release 190301
|
||||
%define release 190305
|
||||
%define httpd_name httpd
|
||||
# User and Group under which Apache is running
|
||||
%define httpd_name apache2
|
||||
|
@ -1,5 +1,5 @@
|
||||
package: pandorafms-server
|
||||
Version: 7.0NG.732-190301
|
||||
Version: 7.0NG.732-190305
|
||||
Architecture: all
|
||||
Priority: optional
|
||||
Section: admin
|
||||
|
@ -14,7 +14,7 @@
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
|
||||
pandora_version="7.0NG.732-190301"
|
||||
pandora_version="7.0NG.732-190305"
|
||||
|
||||
package_cpan=0
|
||||
package_pandora=1
|
||||
|
@ -306,7 +306,7 @@ sub pandora_server_tasks ($) {
|
||||
if (($counter % 30) == 0) {
|
||||
|
||||
# Update module status and fired alert counts
|
||||
my @agents = get_db_rows ($dbh, 'SELECT id_agente, nombre, update_module_count, update_alert_count, update_secondary_groups FROM tagente WHERE disabled = 0 AND (update_module_count=1 OR update_alert_count=1 OR update_secondary_groups=1)');
|
||||
my @agents = get_db_rows ($dbh, 'SELECT id_agente, nombre, update_module_count, update_alert_count, update_secondary_groups FROM tagente WHERE (update_module_count=1 OR update_alert_count=1 OR update_secondary_groups=1)');
|
||||
foreach my $agent (@agents) {
|
||||
logger ($pa_config, "Updating module status and fired alert counts for agent " . $agent->{'nombre'}, 10);
|
||||
|
||||
|
@ -45,7 +45,7 @@ our @EXPORT = qw(
|
||||
|
||||
# version: Defines actual version of Pandora Server for this module only
|
||||
my $pandora_version = "7.0NG.732";
|
||||
my $pandora_build = "190301";
|
||||
my $pandora_build = "190305";
|
||||
our $VERSION = $pandora_version." ".$pandora_build;
|
||||
|
||||
# Setup hash
|
||||
|
@ -1820,7 +1820,8 @@ sub pandora_planned_downtime_set_disabled_elements($$$) {
|
||||
WHERE tp.id_agent = ta.id_agente AND tp.id_downtime = ?',$downtime->{'id'});
|
||||
|
||||
db_do($dbh,'UPDATE tagente ta, tplanned_downtime_agents tpa
|
||||
SET ta.disabled = 1 WHERE tpa.id_agent = ta.id_agente AND
|
||||
SET ta.disabled = 1, ta.update_module_count = 1
|
||||
WHERE tpa.id_agent = ta.id_agente AND
|
||||
tpa.id_downtime = ?',$downtime->{'id'});
|
||||
|
||||
} else {
|
||||
@ -1857,7 +1858,8 @@ sub pandora_planned_downtime_unset_disabled_elements($$$) {
|
||||
|
||||
if ($only_alerts == 0) {
|
||||
db_do($dbh,'UPDATE tagente ta, tplanned_downtime_agents tpa
|
||||
set ta.disabled = 0 WHERE tpa.id_agent = ta.id_agente AND
|
||||
set ta.disabled = 0, ta.update_module_count = 1
|
||||
WHERE tpa.id_agent = ta.id_agente AND
|
||||
tpa.manually_disabled = 0 AND tpa.id_downtime = ?',$downtime->{'id'});
|
||||
} else {
|
||||
my @downtime_agents = get_db_rows($dbh, 'SELECT *
|
||||
|
@ -32,7 +32,7 @@ our @ISA = qw(Exporter);
|
||||
|
||||
# version: Defines actual version of Pandora Server for this module only
|
||||
my $pandora_version = "7.0NG.732";
|
||||
my $pandora_build = "190301";
|
||||
my $pandora_build = "190305";
|
||||
our $VERSION = $pandora_version." ".$pandora_build;
|
||||
|
||||
our %EXPORT_TAGS = ( 'all' => [ qw() ] );
|
||||
|
@ -3,7 +3,7 @@
|
||||
#
|
||||
%define name pandorafms_server
|
||||
%define version 7.0NG.732
|
||||
%define release 190301
|
||||
%define release 190305
|
||||
|
||||
Summary: Pandora FMS Server
|
||||
Name: %{name}
|
||||
|
@ -3,7 +3,7 @@
|
||||
#
|
||||
%define name pandorafms_server
|
||||
%define version 7.0NG.732
|
||||
%define release 190301
|
||||
%define release 190305
|
||||
|
||||
Summary: Pandora FMS Server
|
||||
Name: %{name}
|
||||
|
@ -9,7 +9,7 @@
|
||||
# **********************************************************************
|
||||
|
||||
PI_VERSION="7.0NG.732"
|
||||
PI_BUILD="190301"
|
||||
PI_BUILD="190305"
|
||||
|
||||
MODE=$1
|
||||
if [ $# -gt 1 ]; then
|
||||
|
@ -34,7 +34,7 @@ use PandoraFMS::Config;
|
||||
use PandoraFMS::DB;
|
||||
|
||||
# version: define current version
|
||||
my $version = "7.0NG.732 PS190301";
|
||||
my $version = "7.0NG.732 PS190305";
|
||||
|
||||
# Pandora server configuration
|
||||
my %conf;
|
||||
|
@ -36,7 +36,7 @@ use Encode::Locale;
|
||||
Encode::Locale::decode_argv;
|
||||
|
||||
# version: define current version
|
||||
my $version = "7.0NG.732 PS190301";
|
||||
my $version = "7.0NG.732 PS190305";
|
||||
|
||||
# save program name for logging
|
||||
my $progname = basename($0);
|
||||
|
Loading…
x
Reference in New Issue
Block a user