For example, on OSX, if you use %c you get:
pir@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

Reply via email to