';
+ echo sprintf(
+ 'PandoraFMS requires PHP 8.0 to work properly and the version %s has been detected. Please update the PHP version of the system. More info %s. The latest version with PHP 7.4 support is PandoraFMS 767 hope LTS.',
+ PHP_VERSION,
+ 'here'
+ );
+ echo '
';
}
}
trigger_error(
diff --git a/pandora_plugins/PandoraFMS/pandorafms.pl b/pandora_plugins/PandoraFMS/pandorafms.pl
index 8a4d390c7e..5f5e533785 100644
--- a/pandora_plugins/PandoraFMS/pandorafms.pl
+++ b/pandora_plugins/PandoraFMS/pandorafms.pl
@@ -8,6 +8,7 @@ use POSIX qw(strftime);
use PandoraFMS::DB;
use constant DATASERVER => 0;
+use constant ALERTSERVER => 21;
use Scalar::Util qw(looks_like_number);
@@ -159,6 +160,18 @@ sub pandora_self_monitoring ($$) {
if (!defined($queued_modules)) {
$queued_modules = 0;
}
+
+ my $queued_alerts = get_db_value ($dbh, "SELECT count(id) FROM talert_execution_queue");
+
+ if (!defined($queued_alerts)) {
+ $queued_alerts = 0;
+ }
+
+ my $alert_server_status = get_db_value ($dbh, "SELECT status FROM tserver WHERE server_type = ?", ALERTSERVER);
+
+ if (!defined($alert_server_status || $alert_server_status eq "") ) {
+ $alert_server_status = 0;
+ }
my $dbmaintance;
if ($RDBMS eq 'postgresql') {
@@ -193,7 +206,19 @@ sub pandora_self_monitoring ($$) {
$xml_output .=" generic_data\n";
$xml_output .=" $queued_modules\n";
$xml_output .=" \n";
+
+ $xml_output .=" \n";
+ $xml_output .=" Queued_Alerts\n";
+ $xml_output .=" generic_data\n";
+ $xml_output .=" $queued_alerts\n";
+ $xml_output .=" \n";
+ $xml_output .=" \n";
+ $xml_output .=" Alert_Server_Status\n";
+ $xml_output .=" generic_proc\n";
+ $xml_output .=" $alert_server_status\n";
+ $xml_output .=" \n";
+
$xml_output .=" \n";
$xml_output .=" Agents_Unknown\n";
$xml_output .=" generic_data\n";
diff --git a/pandora_server/DEBIAN/control b/pandora_server/DEBIAN/control
index 8c9fbb451b..19f2fbb59b 100644
--- a/pandora_server/DEBIAN/control
+++ b/pandora_server/DEBIAN/control
@@ -1,5 +1,5 @@
package: pandorafms-server
-Version: 7.0NG.773.3-230907
+Version: 7.0NG.773.3-230918
Architecture: all
Priority: optional
Section: admin
diff --git a/pandora_server/DEBIAN/make_deb_package.sh b/pandora_server/DEBIAN/make_deb_package.sh
index 630067cc22..39ee7fd114 100644
--- a/pandora_server/DEBIAN/make_deb_package.sh
+++ b/pandora_server/DEBIAN/make_deb_package.sh
@@ -14,7 +14,7 @@
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
-pandora_version="7.0NG.773.3-230907"
+pandora_version="7.0NG.773.3-230918"
package_cpan=0
package_pandora=1
diff --git a/pandora_server/lib/PandoraFMS/Config.pm b/pandora_server/lib/PandoraFMS/Config.pm
index 3f4e75f73c..0dc572ebed 100644
--- a/pandora_server/lib/PandoraFMS/Config.pm
+++ b/pandora_server/lib/PandoraFMS/Config.pm
@@ -46,7 +46,7 @@ our @EXPORT = qw(
# version: Defines actual version of Pandora Server for this module only
my $pandora_version = "7.0NG.773.3";
-my $pandora_build = "230907";
+my $pandora_build = "230918";
our $VERSION = $pandora_version." ".$pandora_build;
# Setup hash
diff --git a/pandora_server/lib/PandoraFMS/Core.pm b/pandora_server/lib/PandoraFMS/Core.pm
index cbb4ea851e..f2c7d46143 100644
--- a/pandora_server/lib/PandoraFMS/Core.pm
+++ b/pandora_server/lib/PandoraFMS/Core.pm
@@ -127,6 +127,7 @@ use JSON qw(decode_json encode_json);
use MIME::Base64;
use Text::ParseWords;
use Math::Trig; # Math functions
+use constant ALERTSERVER => 21;
# Debugging
#use Data::Dumper;
@@ -5687,7 +5688,7 @@ sub pandora_server_statistics ($$) {
$server->{"modules_total"} = get_db_value ($dbh, "SELECT COUNT(tagent_module_inventory.id_agent_module_inventory) FROM tagente, tagent_module_inventory WHERE tagente.disabled=0 AND tagent_module_inventory.id_agente = tagente.id_agente");
# Calculate lag
- $lag_row = get_db_single_row ($dbh, "SELECT COUNT(tagent_module_inventory.id_agent_module_inventory) AS module_lag, AVG(UNIX_TIMESTAMP() - utimestamp - tagent_module_inventory.interval) AS lag
+ $lag_row = get_db_single_row ($dbh, "SELECT COUNT(tagent_module_inventory.id_agent_module_inventory) AS `module_lag`, AVG(UNIX_TIMESTAMP() - utimestamp - tagent_module_inventory.interval) AS `lag`
FROM tagente, tagent_module_inventory
WHERE utimestamp > 0
AND tagent_module_inventory.id_agente = tagente.id_agente
@@ -5736,8 +5737,8 @@ sub pandora_server_statistics ($$) {
if ($server->{"server_type"} != DATASERVER){
$lag_row = get_db_single_row (
$dbh,
- "SELECT COUNT(tam.id_agente_modulo) AS module_lag,
- AVG(UNIX_TIMESTAMP() - tae.last_execution_try - tae.current_interval) AS lag
+ "SELECT COUNT(tam.id_agente_modulo) AS `module_lag`,
+ AVG(UNIX_TIMESTAMP() - tae.last_execution_try - tae.current_interval) AS `lag`
FROM (
SELECT tagente_estado.last_execution_try, tagente_estado.current_interval, tagente_estado.id_agente_modulo
FROM tagente_estado
@@ -5762,8 +5763,8 @@ sub pandora_server_statistics ($$) {
else {
$lag_row = get_db_single_row (
$dbh,
- "SELECT COUNT(tam.id_agente_modulo) AS module_lag,
- AVG(UNIX_TIMESTAMP() - tae.last_execution_try - tae.current_interval) AS lag
+ "SELECT COUNT(tam.id_agente_modulo) AS `module_lag`,
+ AVG(UNIX_TIMESTAMP() - tae.last_execution_try - tae.current_interval) AS `lag`
FROM (
SELECT tagente_estado.last_execution_try, tagente_estado.current_interval, tagente_estado.id_agente_modulo
FROM tagente_estado
@@ -6132,6 +6133,18 @@ sub pandora_self_monitoring ($$) {
if (!defined($queued_modules)) {
$queued_modules = 0;
}
+
+ my $queued_alerts = get_db_value ($dbh, "SELECT count(id) FROM talert_execution_queue");
+
+ if (!defined($queued_alerts)) {
+ $queued_alerts = 0;
+ }
+
+ my $alert_server_status = get_db_value ($dbh, "SELECT status FROM tserver WHERE server_type = ?", ALERTSERVER);
+
+ if (!defined($alert_server_status) || $alert_server_status eq "") {
+ $alert_server_status = 0;
+ }
my $pandoradb = 0;
my $pandoradb_tstamp = get_db_value ($dbh, "SELECT `value` FROM tconfig WHERE token = 'db_maintance'");
@@ -6158,6 +6171,18 @@ sub pandora_self_monitoring ($$) {
$xml_output .=" generic_data";
$xml_output .=" $queued_modules";
$xml_output .=" ";
+
+ $xml_output .=" \n";
+ $xml_output .=" Queued_Alerts\n";
+ $xml_output .=" generic_data\n";
+ $xml_output .=" $queued_alerts\n";
+ $xml_output .=" \n";
+
+ $xml_output .=" \n";
+ $xml_output .=" Alert_Server_Status\n";
+ $xml_output .=" generic_proc\n";
+ $xml_output .=" $alert_server_status\n";
+ $xml_output .=" \n";
$xml_output .=" ";
$xml_output .=" Agents_Unknown";
diff --git a/pandora_server/lib/PandoraFMS/PluginTools.pm b/pandora_server/lib/PandoraFMS/PluginTools.pm
index ed6f3abe83..0fe5e566c8 100644
--- a/pandora_server/lib/PandoraFMS/PluginTools.pm
+++ b/pandora_server/lib/PandoraFMS/PluginTools.pm
@@ -34,7 +34,7 @@ our @ISA = qw(Exporter);
# version: Defines actual version of Pandora Server for this module only
my $pandora_version = "7.0NG.773.3";
-my $pandora_build = "230907";
+my $pandora_build = "230918";
our $VERSION = $pandora_version." ".$pandora_build;
our %EXPORT_TAGS = ( 'all' => [ qw() ] );
diff --git a/pandora_server/pandora_server.redhat.spec b/pandora_server/pandora_server.redhat.spec
index 4da9c7472a..4ae90a8296 100644
--- a/pandora_server/pandora_server.redhat.spec
+++ b/pandora_server/pandora_server.redhat.spec
@@ -4,7 +4,7 @@
%global __os_install_post %{nil}
%define name pandorafms_server
%define version 7.0NG.773.3
-%define release 230907
+%define release 230918
Summary: Pandora FMS Server
Name: %{name}
diff --git a/pandora_server/pandora_server.spec b/pandora_server/pandora_server.spec
index 4cdaa0d4c3..5c1910854b 100644
--- a/pandora_server/pandora_server.spec
+++ b/pandora_server/pandora_server.spec
@@ -4,7 +4,7 @@
%global __os_install_post %{nil}
%define name pandorafms_server
%define version 7.0NG.773.3
-%define release 230907
+%define release 230918
Summary: Pandora FMS Server
Name: %{name}
diff --git a/pandora_server/pandora_server_installer b/pandora_server/pandora_server_installer
index 49f082ea35..21e1e1b47d 100755
--- a/pandora_server/pandora_server_installer
+++ b/pandora_server/pandora_server_installer
@@ -9,7 +9,7 @@
# **********************************************************************
PI_VERSION="7.0NG.773.3"
-PI_BUILD="230907"
+PI_BUILD="230918"
MODE=$1
if [ $# -gt 1 ]; then
diff --git a/pandora_server/util/load/pandora_xml_stress.agents b/pandora_server/util/load/pandora_xml_stress.agents
index da718018e0..0b4a54a894 100644
--- a/pandora_server/util/load/pandora_xml_stress.agents
+++ b/pandora_server/util/load/pandora_xml_stress.agents
@@ -147,154 +147,4 @@ be67e5298c830c0bb582556f
63f5d1404aea4377779edf35
b03831cce718125cb9612c07
5465b26fd45d86b059066cc2
-5351de84d2fd638b138ba27b
-6c63000157aed37fa8c0c022
-8d3c18c7fbe518694c6bdb22
-615ec092b6f63bb14a2bb42e
-61de25cf8e12926c28aeffdc
-2b96bc1c8f6f81a5437b61bf
-ba1f4fcf3954e0efe5d68c83
-ee5bd3e1a937b90562677f1d
-0cf18ae18b0c680d00cb4d2e
-abf72b0d66f90bd6e67c43c6
-f263d033bb07e0b8cd405224
-418ddf02720649b40db2dd67
-01d1a735aa980326d385ea65
-0cc3860bb0a3fd5822b25ea4
-b0b89dbebfab05fafd6cf9dd
-2fcbb999444db5c0c77c2ec2
-f49a97b3531b8ab8d487c7a7
-ffb66d5003620e2fa47ef8ea
-04da742ab6c99b5c44f9f0cc
-dc310a9d42d7c367671ffbf9
-b0f5c4ee8d327449ef2103e6
-5bd2ce604ed7c820169f0ac2
-57f874a6e41baa5a1196b15f
-b43142736205ad1011f4a5a6
-50cf8523e5090251516eecb0
-ebad61d47be209696f9d41aa
-66bc5976a98266560d1867ff
-3c37fc452e9ad36cd7adcb1a
-4ac8c3db63a69ce883f3fcf5
-6c89e2bb90b9ab95f4adde3c
-917de5ece0a5ef663a8f44e7
-b50eba76cf29aca3cf696d7e
-74264c913ac1e141db78708a
-2b6c93011f62cffb5c085886
-700617c377952010272b9522
-dac10c8ddf7c45e55d8028af
-053328a6ff4f2773eebe76fe
-2d7390260285c272688ae1e8
-fa30c9ee6fb1e2f00d7ccb77
-0ca6db378a05246f30c8b820
-9ad6f959de166cc1475040ea
-23b4702f4dfb350085e77482
-4198a8ab80780c5d9b0d82d5
-baebd530dfc47ac77ea42d2a
-636d2ab4e018b5542e429f5e
-40ae44193af360eea68b6f0b
-dd47b39e494a62a4f5b6bef8
-240339c9dcd159595c1edbf3
-0f11840efe364ca6bbb17f43
-8522e203fb4b53e2bd6d6f82
-f134d9b501fa40b17993beee
-d0483306f2f972aacfb4fcea
-926ee4e0a80455cfee517f8b
-c188a327bc66df4878cb3e8b
-c874083c1d932bb4ade6d028
-be2271d8da327f97e05c1c60
-9ca7451d3f261682ec717547
-9eb46e2a5fd072c5267d7432
-41e8f3f7733f87e16b773bad
-f642220cd19f84154e4dd972
-fe3d9f6433883332b464b7ca
-3e9648ccf60b1fa712ea8590
-b7da7292e9418889bc957bd7
-fb4a392d386eca19eec9215e
-34188e4a6590877b2dbb67b0
-e233cb364659dea13dee1fd8
-757b8330465df34879414b7d
-5e0f80102fee69d0742934b2
-d72124afc78e9b3f91550497
-21c77bfe67c6e99f73323f42
-afa8ce345db6300882858f93
-886cc8b32ed80f4c69edb990
-64ea275ce73ef4070cefca19
-c676f1ffe5bdce4e1d3643ed
-baca61ab59568605e3ec8899
-1610892c53a071ed02d20c75
-3321fb7111d74e532932d262
-29583747ac9fbf0bf21c1574
-f51210b47a6e847dcfb52f94
-63c95735ba96c65d2d45b23d
-679c4e3acb15ebec6ecc7529
-42da0760b02d50c6587a8c31
-e42de775dcfcc3c950c1cff5
-ae5791cf265badebd39c78d9
-f66c123309525eeb81b47e92
-7cddc2b9ed6b4df83c72fcbe
-e69cc74632fdaa06f76f708a
-7cfd19c2eeaef2c0537332be
-d27cdcea69f4e49fbae06f4d
-bdfaa2ec52319f0e6533e826
-d59452cdfce11e21682a791f
-cbb74f2d35d54557abdbc2da
-369a4e6f128475bc9f87ef42
-90bf992a98d0b768cbc50520
-1fea663421dae7b418b9b15f
-f9fc5505565c43cebc1545f9
-d02a8f77fbb2b7f384a99949
-279ff35e17c7f6b6a043fde7
-9cf7725d3a97d9aa9e529ce6
-1f465b328b349502c0953b2d
-283fad60fa48ea2075a0e516
-ef5d9e841a02665c54d8fa7f
-b6023425cb4a1503726b3135
-7fb8a1a734c24cc22a5c75eb
-da38d78e83c9288e4cd60cca
-2a928a6498ae8e0b29675c25
-d2194ab5b0e48c2c1f213860
-53acafcd86a61ce55688ebef
-65608eeebc7d9fe2912635ed
-fafb0273e3b04deb1edb2628
-baf07d1f28416da065b6771f
-c2ee8e58209102fdd0bb341c
-f8e92e00670f65c29c4617c9
-a83661705134029ae344176d
-fc02c24e172d12a29b17eede
-2632f143ffe3f64e63e4ba32
-847120de4b72f59263d160f1
-5be36ff5b668eb93823974b2
-cdd8fe5081225519b5fc28af
-53569cbaedb9265839290a6c
-decca89ea0e8944fd93fcd24
-4b10511d840b7f5129ed6190
-5c4a1904de5f90f4d5dd749a
-49c47514c3308df82fcd6b79
-15af3e182c00000eea12f8e5
-a9645c4a43ad211d9ae9a406
-dcffa4e5eee8f966b1edcdaf
-75b25f796f1e392f45c3a737
-0ad5f0b96946ebcabd0457e9
-2f9128177cab74e0bad61189
-49ed14b81e0a166ccf335b4a
-dfe100788326c45dfb84579c
-2616f38caef9decae47e5023
-99b2d0eb14ac19d1cfedd86e
-fb1d4c42ea70fad330b5c5ee
-b6c560867faa3b41b1f5d4fa
-1167fb22e86098ef684eb702
-a2e2c2ee8ec87d4e5d59eb22
-b228beac094e16a0fa3cb528
-ea0de9aad68deed0a4df3e71
-e50cb420497d928ef9827800
-3bb39890ca4a6da941e01782
-73391f2914465c3f2335e24a
-f8b2f512cc0cbc024e2cd377
-4f816b0d36c934b44dbd5bc0
-817edf1e2637fef229752a5f
-4466f97959df7247f7410fbe
-cc85c727080e9d6eb75ef513
-7e27f012167ed8bedc4bd635
-98a445ff41a81a0a752aff25
-3b339e213dd613c4efd878c1
\ No newline at end of file
+5351de84d2fd638b138ba27b
\ No newline at end of file
diff --git a/pandora_server/util/pandora_db.pl b/pandora_server/util/pandora_db.pl
index 119a8d5abc..4f087de961 100755
--- a/pandora_server/util/pandora_db.pl
+++ b/pandora_server/util/pandora_db.pl
@@ -35,7 +35,7 @@ use PandoraFMS::Config;
use PandoraFMS::DB;
# version: define current version
-my $version = "7.0NG.773.3 Build 230907";
+my $version = "7.0NG.773.3 Build 230918";
# Pandora server configuration
my %conf;
@@ -359,7 +359,12 @@ sub pandora_purgedb ($$$) {
log_message ('!', "Cannot execute " . $conf->{'_netflow_nfexpire'} . ", skipping.");
}
else {
- `yes 2>/dev/null | $conf->{'_netflow_nfexpire'} -r "$conf->{'_netflow_path'}" -t $conf->{'_netflow_max_lifetime'}d`;
+ # Update stats file with max lifetime.
+ `yes 2>/dev/null | $conf->{'_netflow_nfexpire'} -u "$conf->{'_netflow_path'}" -t $conf->{'_netflow_max_lifetime'}d -w 100`;
+ # Rescan directory.
+ `yes 2>/dev/null | $conf->{'_netflow_nfexpire'} -r "$conf->{'_netflow_path'}"`;
+ # Expire files
+ `yes 2>/dev/null | $conf->{'_netflow_nfexpire'} -e "$conf->{'_netflow_path'}"`;
}
}
else {
diff --git a/pandora_server/util/pandora_manage.pl b/pandora_server/util/pandora_manage.pl
index d1793aaa3b..b841bc79ae 100755
--- a/pandora_server/util/pandora_manage.pl
+++ b/pandora_server/util/pandora_manage.pl
@@ -36,7 +36,7 @@ use Encode::Locale;
Encode::Locale::decode_argv;
# version: define current version
-my $version = "7.0NG.773.3 Build 230907";
+my $version = "7.0NG.773.3 Build 230918";
# save program name for logging
my $progname = basename($0);