From 0af20e03e2f09a0c59033bd4e4a2b10827e89f54 Mon Sep 17 00:00:00 2001 From: "alejandro.campos@artica.es" Date: Wed, 16 Nov 2022 09:41:27 +0100 Subject: [PATCH] fixed minor issues --- pandora_server/lib/PandoraFMS/Core.pm | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pandora_server/lib/PandoraFMS/Core.pm b/pandora_server/lib/PandoraFMS/Core.pm index b3c8b2576a..45212252e3 100644 --- a/pandora_server/lib/PandoraFMS/Core.pm +++ b/pandora_server/lib/PandoraFMS/Core.pm @@ -7253,9 +7253,12 @@ sub pandora_snmptrapd_still_working ($$) { my $snmptrapdFile = $pa_config->{'snmp_logfile'}; tie my @snmptrapdFileComplete, 'Tie::File', $snmptrapdFile; my $lastTimestampLogFile = $snmptrapdFileComplete[-1]; + + $lastTimestampLogFile = '' unless defined ($lastTimestampLogFile); + my ($protocol, $date, $time) = split(/\[\*\*\]/, $lastTimestampLogFile, 4); # If time or date not filled in, probably havent caught any snmptraps yet. - if ($time ne '' && $date ne '') { + if (defined $date && defined $time && $time ne '' && $date ne '') { my ($hour, $min, $sec) = split(/:/, $time, 3); my ($year, $month, $day) = split(/-/, $date, 3); my $lastTimestampLogFile = timelocal($sec,$min,$hour,$day,$month-1,$year);