Use GMT timezone in SSL certs (#1396)

Peter (pir) notifications at github.com
Tue Nov 24 15:14:02 CET 2015


For example, on OSX, if you use %c you get:
pir at shiny> ./plugins/check_http -H www.mozilla.org --onredirect=follow --ssl
--sni -C 200000 -4
WARNING - Certificate 'www.mozilla.org' expires in 400 day(s) (Thu 29 Dec
12:00:00 2016).

No timezone listed. You have to know that time is in GMT whereas people
generally assume timezone is in the server timezone (which would be PST or
other timezones for most of our monitoring servers).

With this code:
	tz = getenv("TZ");
	setenv("TZ", "GMT", 1);
	tzset();
	strftime(timestamp, 50, "%c %z", localtime(&tm_t));
	if (tz)
		setenv("TZ", tz, 1);
	else
		unsetenv("TZ");
	tzset();

I get:
WARNING - Certificate 'www.mozilla.org' expires in 400 day(s) (Thu 29 Dec
12:00:00 2016 +0000).

Which at least lists a time offset from GMT (0 here, since the date is in
GMT) and should make it obvious what timezone is and if a timezone is
included in %c already the offset is additional information rather than
repeating the timezone name.

How does that sound?

-- 
Reply to this email on GitHub:
https://github.com/monitoring-plugins/monitoring-plugins/pull/1396#issuecomment-159278706
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.monitoring-plugins.org/archive/devel/attachments/20151124/9ff7439a/attachment.html>


More information about the Devel mailing list