Thruk icon indicating copy to clipboard operation
Thruk copied to clipboard

Missing validity-check when entering date for "Downtime"

Open dan-m-joh opened this issue 2 years ago • 2 comments

It is possible to enter dates for Downtime that are "beyond" 2038-01-19, which translates to a negative timestamp. These dates can not be handled very well by Nagios.

2022-01-18_16-26

It would be cool to prohibit such dates.

Thruk Version: 2.46-2 (from ConsolLabs) Nagios: 4.4.6

-- Dan

dan-m-joh avatar Jan 18 '22 15:01 dan-m-joh

What kind of linux is that? And is it 32 or 64bit?

sni avatar Jan 18 '22 15:01 sni

This is on Nagios running on a RedHat Server.

$ uname -a
Linux nagios 3.10.0-1160.49.1.el7.x86_64 #1 SMP Tue Nov 9 16:09:48 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
$ cat /etc/redhat-release
Red Hat Enterprise Linux Server release 7.9 (Maipo)

dan-m-joh avatar Jan 19 '22 06:01 dan-m-joh

Just tested this. I can confirm the issue. But i'd say this should be fixed in the nagios core instead. As a workaroud you could set the downtime_max_duration to a couple of years: http://thruk.org/documentation/configuration.html#_downtime_max_duration

sni avatar Nov 07 '22 09:11 sni

Thanks for the Feedback.

Good idea!

Regards, Dan

dan-m-joh avatar Nov 07 '22 10:11 dan-m-joh

Btw, i just checked the naemon source which should be still quite similar to nagios in those areas and it uses the time_t type which is 64bit after linux 5.6 from 2020. So the issue should be fine once you update on rhel/rocky 8 or 9. Also i noticed an issue in the livestatus module, but this should be fixed separately.

sni avatar Nov 07 '22 10:11 sni