BBWin V.12 filesystem epoch time and local time conflict
McGraw, Robert P
rmcgraw at purdue.edu
Tue Jun 24 16:40:08 CEST 2008
I have the [file:] set up in central mode on our BBWin V.12 client and it
returns the following client data to the Hobbit server.
[file:c:\Alligate\AAATEST]
type:0x00020 (file)
mode:777 (not implemented)
linkcount:1
owner:0 (not implemented)
group:0 (not implemented)
size:0
atime:1214222069 (2008/06/23-11:54:29)
ctime:1213796626 (2008/06/18-13:43:46)
mtime:1214222069 (2008/06/23-11:54:29)
On my hobbit server hobbit-clients.cfg I have
FILE c:\Alligate\AAATEST red MTIME<88200
The YYYY/MM/DD-HH:MM:SS atime, ctime and mtime are local time.
During testing I noticed that the red icon would come on before I had
expected.
I decided to do a little checking and using a web epoch time calculator.
If I enter 2008/06/23-11:54:29 it returns the epoch time of 1214236469, which
does not match mtime epoch time above.
If I enter the epoch mtime 1214222069 I get Mon Jun 23 2008 07:54:29
GMT-0400 (EDT) which does not match the date.
If I enter epoch time 1214236469 I get Mon Jun 23 2008 11:54:29 GMT-0400
(EDT)
It seems that the YYYY/MM/DD-HH:MM:SS time is reported in local time and the
epoch time is reported in GMT time which throws things off by four hours.
The following is the code in filesystem
325 reportData << format("type:0x%05x ") %
handle_file_info.dwFileAttributes;
326 if (handle_file_info.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)
327 reportData << "(dir)" << endl;
328 else
329 reportData << "(file)" << endl;
330 reportData << "mode:777 (not implemented)" << endl;
331 reportData << format("linkcount:%u") % handle_file_info.nNumberOfLinks
<< endl;
332 reportData << "owner:0 (not implemented)" << endl;
333 reportData << "group:0 (not implemented)" << endl;
334 reportData << format("size:%lu") % fsize << endl;
335 string output;
336 GetTimeString(handle_file_info.ftLastAccessTime, output);
337 reportData << "atime:" << output << endl;
338 GetTimeString(handle_file_info.ftCreationTime, output);
339 reportData << "ctime:" << output << endl;
340 GetTimeString(handle_file_info.ftLastWriteTime, output);
341 reportData << "mtime:" << output << endl;
342 fclose(f);
343 return true;
The function GetTimeString seems to be the code that is returning the time
information. I have not been able to find this code in the BBWin svn so I am
not sure if this is a local function or a system function.
I am not a Window type guy and no very little about such things. Can a super
duper window type person peruse this and see what they can find.
Tanks
Thanks
Robert
--------------------------------------------------------------------
Robert P. McGraw, Jr.
Manager, Computer System EMAIL: rmcgraw at purdue.edu
Purdue University ROOM: MATH-807
Department of Mathematics PHONE: (765) 494-6055
150 N. University Street
West Lafayette, IN 47907-2067
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 3105 bytes
Desc: not available
URL: <http://lists.xymon.com/pipermail/xymon/attachments/20080624/fb168818/attachment.bin>
More information about the Xymon
mailing list