Where file gets downloaded?

(imported topic written by rahulcynosure91)

Hi

I am trying to do patch management .

I see Adobe Flash player available as one of the fixlet in the list panel and I took action to install it in the endpoint.

I noticed that as soon as the task progress showed that Download complete , the message was :

"*.exe cached on BES server "

But I couldn’t find that file on BES server , I find it on my end point inside BES Client folder.

only BES server is exposed to internet so that .exe file has to be downloaded into BES server

Could you please tell me where that file was downloaded on my BES server ?

Thanks in advance

(imported comment written by tscott91)

The master BES server downloads packages into: C:\Program Files\BigFix Enterprise\BES Server\sha1.

The files in their aren’t friendly names… They are the checksum values which BigFix uses to verify the file is as it says it should be. You can find out the sha1 value is by looking at the BigFix action code…

IE: For the latest Flash Player update if you look in the action you’ll see:

continue 

if
{(size of it = 2827728 AND sha1 of it = 
"<b>58412bcc83e349be50cafe0e1c46e19088620866</b>") of file 
"install_flash_player_10_active_x.exe" of folder 
"__Download"
}

If you search for “58412bcc83e349be50cafe0e1c46e19088620866” in your sha1 directory you’ll find the actually file… Copy it off and rename it so it’s an exe and you’ll see it’s the actual patch.

Hope that helps.

Tom

(imported comment written by rahulcynosure91)

Thanks Tom,

It really helps …

Could you please also tell the following…

  1. Could you please tell me the reason for downloading files with checksum names ? for checking Sha1 there could be other way as well … I didn’t get the actual purpose of that … please let me know if you can help ?

  2. Which statement in my action list actually copies it to the end point ? Or is it done itself ? I had a impression that download itself does that i.e it download and copies it to the endpoint

  3. When Sha1 is matched of downloaded file ? After copying it to end point (on client machine ) or when it is cached in BES server ,but before copying it to the client ?

  4. Where in my end point this file gets copied ?

I observed 2 locations for 2 different files :-

a) C:\Program Files\BigFix Enterprise\BES Client__BESData__Global__Download\Updates for Windows Applications\91\named\installer.exe

b) C:\Program Files\BigFix Enterprise\BES Client__BESData\actionsite__Download\installer name

In case a ) I run a fixlet which was pre-defined in patchmanagement domain

In case b) I run a custom action which only has download command : download http://***/installer.exe

both installer.exe are same file (install_flash_player .exe)

  1. I observed that if I download something(using custom action) for one computer and then again I apply the same download command then it overwrites the previous file in sha1 directory . Is there any specific reason why it does that ? I mean why it overwrite previous file ,if it was already downloaded then it should have used already existing file ?

PS: here I have created a custom action and just written a download command for flash player

  1. After completing a fixlet from patch management domain (for flash player) I found a file with name 58412bcc83e349be50cafe0e1c46e19088620866 ( sha1 of .exe file and same name as found under sha1 directory of BES server) in my client under C:\Program Files\BigFix Enterprise\BES Client__BESData__Global__Cache\Downloads folder… This file can be renamed to .exe file and it could be used for installing flash player …Could you tell me the reason and purpose of that , why to keep that file with SHA1 name after installing it on that end point(client) ??? I tried other fixlet as well , every time a file with sha1 name remains on my client.

Thanks

Rahul

(imported comment written by SystemAdmin)

Hi Rahul,

Here are the answers to your questions:

  1. The files are stored in the cache using the SHA1 hash as their filename because it is the most efficient way for the system to determine whether a file of interest is in the cache or not. There could also be cases where you’re downloading completely different files that have the same filename so if these files were stored in cache using their original filename this would be challenging. Converting the filename to its hash equivalent removes this issue.

  2. The “download" keyword is what actually initiates the download of the file to the client. When downloading a file the client doesn’t download the file directly from the source but rather goes upstream and requests the file from the relay it’s connected to. If the relay doesn’t have the file in its cache it will do the same and go upstream until the request reaches the BES server. If the BES server doesn’t have the file in its cache it will then download the file from the source and once it’s cached on the BES server it will be propagated down to the client through the relay(s). All this happens behind the scenes when “download" is executed.

  3. The SHA1 of the file is verified each time the file moves through the system. So, when it’s downloaded from the source to the BES server the BES server will verify it. When it’s downloaded from the BES server to a relay the relay will verify it and when it’s downloaded to the client the client will verify it.

  4. Depending on what site the fixlet belongs to will determine where its payload gets downloaded on the endpoint. So in case (a) the site was “Updates for Windows Applications" and in (b) the site was “Master action site" .

  5. In your actionscript if you just execute the “download" command without the following “continue if {(size of it = … AND sha1 of it = …" then the BES server can’t determine if the file is in cache and will therefore download the file again. Once the file is downloaded BES will calculate the SHA1 hash and copy the file to the sha1 directory even if it already exists.

  6. Files are kept in the client cache because they may be needed again in the near future. The files in the client cache are very short lived and typically only hang around for about a day. There is a Task (#679) to clear this cache. Take a look at http://forum.bigfix.com/viewtopic.php?id=5346 as well.

I hope this helps.

Rick Roque.

(imported comment written by BenKus)

Rahul,

Please do not post questions twice in different threads:

http://forum.bigfix.com/viewtopic.php?id=6270

Ben

(imported comment written by cstoneba)

so if no sha1/size is included after the download command, the file is downloaded directley each time? I’m having a problem where i have a file that keeps the same name, but the contents of the file changes hourly. When i have my clients download it, they don’t download the recently changed file, just a cached version. Is there a way around this?

(imported comment written by liuhoting)

Hmmm, if you’re just getting a cached version of it, what you could use is the “download now” command which would force the agents themselves to download the latest version of the file directly, but the downside is that it doesn’t use our download architecture to handle the download.

(imported comment written by cstoneba)

exactly, that’s why i chose to go with “download” instead of “download now/download now as”, because i can’t assume that TCP 52311 is open from the client back to the source.

(imported comment written by cstoneba)

I’m still getting the cached version everytime the policy action runs. Even though i’m deleting the file from the \bfdownloads\sha1\ directory on the relays. Anyone have any worksarounds?