From 29028148c3f46af235bf70a30961f8cf1f26cbf4 Mon Sep 17 00:00:00 2001 From: meni2029 <56351431+meni2029@users.noreply.github.com> Date: Wed, 6 Nov 2019 15:16:01 +0100 Subject: [PATCH] DateAndTime - Fallback when datetime = 0 Re-insert the fallback when the datetime value is 0 (year and month = 0) --- lib/Monitoring/GLPlugin/SNMP/MibsAndOids/MIB2MIB.pm | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/Monitoring/GLPlugin/SNMP/MibsAndOids/MIB2MIB.pm b/lib/Monitoring/GLPlugin/SNMP/MibsAndOids/MIB2MIB.pm index 4a4c47e..a93c160 100644 --- a/lib/Monitoring/GLPlugin/SNMP/MibsAndOids/MIB2MIB.pm +++ b/lib/Monitoring/GLPlugin/SNMP/MibsAndOids/MIB2MIB.pm @@ -97,6 +97,11 @@ $Monitoring::GLPlugin::SNMP::MibsAndOids::definitions->{'MIB-2-MIB'} = { $year -= 1900; $month += 1; } + if ($year == 0 && $month == 0) { + $year = 1970; + $month = 1; + $day = 1; + } my $epoch = timegm($second, $minute, $hour, $day, $month-1, $year-1900); # 1992-5-26,13:30:15.0,-4:0 = Tuesday May 26, 1992 at 1:30:15 PM EDT # Eastern Daylight Time (EDT) is 4 hours behind Coordinated Universal Time (UTC)