From eba9c58f18db9cea241a82ffbe45a21fa1b9ec7c Mon Sep 17 00:00:00 2001 From: Ramon Novoa Date: Tue, 2 Oct 2018 12:43:39 +0200 Subject: [PATCH] Prevent the counter from overflowing often when server_threshold is low. --- pandora_server/bin/pandora_server | 2 +- pandora_server/lib/PandoraFMS/Core.pm | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pandora_server/bin/pandora_server b/pandora_server/bin/pandora_server index f26cf3d016..1edb896101 100755 --- a/pandora_server/bin/pandora_server +++ b/pandora_server/bin/pandora_server @@ -382,7 +382,7 @@ sub pandora_server_tasks ($) { } # Avoid counter overflow - if ($counter > 10000){ + if ($counter >= ~0){ $counter = 0; } else { diff --git a/pandora_server/lib/PandoraFMS/Core.pm b/pandora_server/lib/PandoraFMS/Core.pm index 5ce5614d16..4530493471 100644 --- a/pandora_server/lib/PandoraFMS/Core.pm +++ b/pandora_server/lib/PandoraFMS/Core.pm @@ -4882,7 +4882,7 @@ sub pandora_self_monitoring ($$) { my $filename = $pa_config->{"incomingdir"}."/".$pa_config->{'servername'}.".self.".$utimestamp.".data"; - open (XMLFILE, ">> $filename") or die "[FATAL] Could not open internal monitoring XML file for deploying monitorization at '$filename'"; + open (XMLFILE, ">", $filename) or die "[FATAL] Could not open internal monitoring XML file for deploying monitorization at '$filename'"; print XMLFILE $xml_output; close (XMLFILE); }