I'm trying to debug some monitoring code that uses SNMP, and have come across an issue.
If I run snmpwalk -v 1 -c $COMMUNITY $SERVER hrSystemDate.0
on a Windows 2003/2008/2008R2 machine, I get an output like
HOST-RESOURCES-MIB::hrSystemDate.0 = STRING: 2012-2-16,16:30:21.1
But the same check on a Linux machine (debian) yields.
HOST-RESOURCES-MIB::hrSystemDate.0 = STRING: 2012-2-16,16:31:23.0,+11:0
The Windows version lacks a timezone.
Is this a known/documented limitation on Microsoft's part? And/or is there another way to get the timezone out by itself?
It is not in SNMP in any way that I can see. However, if you have SMB access and have Samba installed on your management station, you can do:
I've worked out his one.
Instead of using SNMP walks, I can use a internal script (part of nagios/nsclient) to run:
That gives an offset value that takes into consideration a change in timezones (offset is within reasonable bounds when changing from +10 to +11, but breaks if the hour changes +1)