How to check correct timezone and time

(imported topic written by Fredrik23)

Hi,

I have a problem, we have severeal domain controllers that are suited on our ships. In two different timezones.

The problem i have is that sometimes the clients on the ship dont have the same timezone or time that the domain controller has, and this causes some problem. So I need to make a analys to check this. My first thought was to get the timezone and time reported in and compare, but as they report in at different time interval… I dont know how to do this.

Do anyone have any ideas or maybe done some similar relevance code before?

Thanks // Fredrik

(imported comment written by jessewk)

I would do this on the console side based on two retrieved properties.

Create a location property using the location property wizard to bucket your machines. Clients on the same ship should return the same value, probably using subnet ranges. You likely already have one of these properties.

Next create a custom retrieved property with relevance ‘local time zone’.

Then just filter the computers by location propertry and sub-filter by the local time zone property. You’ll be able to quickly see outliers that have an incorrect time zone.

Jesse

(imported comment written by Fredrik23)

Hi, Thanks fore your quick response.

The location problem is sorted out on either subnet or the computer name, we always use the same start on each ship.

Yes getting the correct timezone out on each machine is fairly easy, the problem is that i need to know that the server has the same time when they are in the same timezone.

So problem is more in how to compare local time on client and server… And see if they have different time.

Fredrik

(imported comment written by jessewk)

Oh, I think maybe I misunderstood your problem. Are you saying that on each ship the client and server both have the correct timezone, but the time does not match?

Either way, BigFix clients do not talk to each other so any analysis comparing two clients will need to be done at the BigFix server.

(imported comment written by Fredrik23)

The timezone should be the same, thats a easy thing to check an easy to correct.

Regarding the time, I believe it needs to be done at the server. My thought was if the client could run question or a dos command asking net time against the server or something and then get a string answer and comparing to it self, and then report in the difference?

Fredrik

(imported comment written by jessewk)

You can use ‘apparent registration server time’ to get the bes server time.

There is a property here: http://forum.bigfix.com/viewtopic.php?id=1945

Is that what you are looking for?

Jesse

(imported comment written by Fredrik23)

Ok, that sounds good,

But when running this in my relevance debugger 7.0.9.164 or 7.1.1.315

(if (it contains “.”) then substring before “.” of it else it) of ((absolute value of(now - (apparent registration server time))) as string)

I only get the answer: Error: No inspector context.

Running only “apparent registration server time” gives me the same error

So do i need to insert a property or something before?

// Fredrik

(imported comment written by Fredrik23)

Ok,

Did a analys instead to test, and then it works…

So great, thanks alot for the help.

But why can you not run this in the debugger?

Fredrik

(imported comment written by jessewk)

Hi Fredrik,

Glad it’s working!

Certain properties require client context, meaning that only the client knows how to give the correct answer. In this case the client gets the server time whenever it registers. The relevance debugger doesn’t resgister with the server so it can’t know the server time.

Jesse