diff --git a/pandora_console/include/class/Diagnostics.class.php b/pandora_console/include/class/Diagnostics.class.php
index 2c00a6b328..9618e3e753 100644
--- a/pandora_console/include/class/Diagnostics.class.php
+++ b/pandora_console/include/class/Diagnostics.class.php
@@ -316,6 +316,8 @@ class Diagnostics extends Wizard
* Graph of the Free Disk Spool Dir module.
* Graph of the Free RAM module.
* Graph of the Queued Modules module.
+ * Graph of the Queued_Alerts.
+ * Graph of the Alert_Server_Status.
* Graph of the Status module.
* Graph of the System Load AVG module.
* Graph of the Execution Time module.
@@ -366,6 +368,20 @@ class Diagnostics extends Wizard
'nameModule' => 'Queued_Modules',
'idAgent' => $agentIdMasterServer,
],
+ 'chartQueuedAlerts' => [
+ 'title' => __(
+ 'Graph of the Queued Alerts total.'
+ ),
+ 'nameModule' => 'Queued_Alerts',
+ 'idAgent' => $agentIdMasterServer,
+ ],
+ 'chartAlertServerStatus' => [
+ 'title' => __(
+ 'Graph of the Alert Server Status.'
+ ),
+ 'nameModule' => 'Alert_Server_Status',
+ 'idAgent' => $agentIdMasterServer,
+ ],
'chartStatus' => [
'title' => __('Graph of the Status module.'),
'nameModule' => 'Status',
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/lib/PandoraFMS/Core.pm b/pandora_server/lib/PandoraFMS/Core.pm
index eac182781e..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;
@@ -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";