Kaseya Community

Inappropriate use of agent's "Temp Directory" by Kaseya?

  • Just wondering what others think of Kaseya using the agent's Temp Directory, which defaults to C:\Temp, for agent logs and other K files?

    Here's my beef: in an effort to keep PCs running fast, we have scripts that delete the contents of various "temp" folders, such as C:\Temp, C:\Documents and Settings\\Local Settings\Temp, C:\Windows\Temp etc. It turns out that purging the C:\Temp folder breaks several aspects of Kaseya software. In my latest problem, Kaseya said that purging that C:\Temp folder caused agent logs to stop synchronizing back with my KServer.

    Months ago, this same purging of C:\Temp caused several problems with KES too. But Jeff Keyes reacted swiftly and modified KES to use the agent's program folder (C:\Program Files\Kaseya\Agent) instead of the agent's Temp Directory (C\Temp) for storing necessary KES files/logs.

    So WHY is Kaseya using what they define as a "temporary" folder for long term storage of misc files need by various Kaseya components? I wonder how many trouble tickets are a result of their unwise use of this folder?

    I am always amazed at how often Kaseya techs are surprised that a common IT practice is to purge temp folders. I guess none of them have ever maintained their own PCs Confused

    And here's the oddest part: Kaseya's own Script Pack 2009 contains a script that cleans out C:\Temp. So their own proactive script breaks their agent Confused

    If you feel the way I do, submit a Feature Request ticket to them to change their code to use a different folder. Some obvious choices are either the agent's program folder or C:\Documents and Settings\All Users\Application Data\Kaseya.

    Legacy Forum Name: Inappropriate use of agent's "Temp Directory" by Kaseya?,
    Legacy Posted By Username: ReedMikel
  • ReedMikel
    Just wondering what others think of Kaseya using the agent's Temp Directory, which defaults to C:\Temp, for agent logs and other K files?

    Here's my beef: in an effort to keep PCs running fast, we have scripts that delete the contents of various "temp" folders, such as C:\Temp, C:\Documents and Settings\\Local Settings\Temp, C:\Windows\Temp etc. It turns out that purging the C:\Temp folder breaks several aspects of Kaseya software. In my latest problem, Kaseya said that purging that C:\Temp folder caused agent logs to stop synchronizing back with my KServer.

    Months ago, this same purging of C:\Temp caused several problems with KES too. But Jeff Keyes reacted swiftly and modified KES to use the agent's program folder (C:\Program Files\Kaseya\Agent) instead of the agent's Temp Directory (C\Temp) for storing necessary KES files/logs.

    So WHY is Kaseya using what they define as a "temporary" folder for long term storage of misc files need by various Kaseya components? I wonder how many trouble tickets are a result of their unwise use of this folder?

    I am always amazed at how often Kaseya techs are surprised that a common IT practice is to purge temp folders. I guess none of them have ever maintained their own PCs Confused

    And here's the oddest part: Kaseya's own Script Pack 2009 contains a script that cleans out C:\Temp. So their own proactive script breaks their agent Confused

    If you feel the way I do, submit a Feature Request ticket to them to change their code to use a different folder. Some obvious choices are either the agent's program folder or C:\Documents and Settings\All Users\Application Data\Kaseya.


    Why don't you just change K's temp folder to something else? That will also prevent the problem of the user emptying their temp folders themselves...

    Michael

    Legacy Forum Name: General Discussion,
    Legacy Posted By Username: RCS-Michael
  • [QUOTE=RCS-Michael;48891]Why don't you just change K's temp folder to something else? That will also prevent the problem of the user emptying their temp folders themselves...Michael[/QUOTE]

    Hi Michael,
    I could do that, but it might open another can of worms. e.g. permissions on the alternate folder that I assign to agent's temp folder, I'd have to create the folder, I'd have to apply the new folder setting to all agents etc.

    I still argue that Kaseya is improperly using this folder. It's description in Agent screen in VSA is "Temporary Directory" - which implies to me that any files stored there are temporary. They should not be kept there for long term use.

    Kaseya is the one that chose C:\Temp as the default agent Temporary Directory. KES developers saw the wisdom in not using the Temporary Directory - and changed their code to use agent's program folder. It just makes sense that Kaseya should do this across the board, no?

    Lastly, while changing the Temporary Directory's location in my VSA might solve the problem for me - how about all the users that might be experiencing problems because of this flaw? Wouldn't it be in the best interest of Kaseya to change their code - which would reduce their tickets and reduce problems for their customers?

    Legacy Forum Name: General Discussion,
    Legacy Posted By Username: ReedMikel
  • ReedMikel
    So WHY is Kaseya using what they define as a "temporary" folder for long term storage of misc files need by various Kaseya components? I wonder how many trouble tickets are a result of their unwise use of this folder?


    I would tend to agree with you here. We've definitely hit this problem on our own (specifically because we used the temp cleaner script provided by Kaseya only to find that it caused scripted defrags to fail, and a loss of log data). We just simply moved the temp location somewhere else and stopped cleaning it out, but it really doesn't make much sense. Anything that isn't temporary shouldn't be in the agent's temp folder.

    Legacy Forum Name: General Discussion,
    Legacy Posted By Username: arobar
  • I agree too. This has been discussed before. Kaseya agents use several techniques that are simply sloppy and outdated. This is just one of them.

    /kenw

    Legacy Forum Name: General Discussion,
    Legacy Posted By Username: Ken Wallewein
  • I really hope this place doesnt turn into something like the CW forums where its just a bunch of moaning and groaning about this that or the other...

    That being said, I wonder how many of you took the boot camp, or even the crash course because the "Temp" directory was kind of explained there... well it was for us... Ready for the slam? Do we use the default location? No, why, because we knew enough at least ask about it and look to see what it does before anything else...

    Does Kaseya use it to store lots of "permanent" items... yes, but it is also a place that you can store things temporarily. Ready for the slam folks... after looking at many scripts most people have posted, no one cleans up after themselves... leaving this exe or that vbs or some log file here or there... if you use the directory for its intent... it becomes temporary... It makes me wondner, how much stuff you have in your temp directories...

    Maybe some of you weren't privy to the bootcamp or the crash course, but if you're in here you must have some say in how Kaseya is operated in your company. You can move the location of the temp dir with little to no affect. (just watch out for gotchas like BU-DR and KES you can find info in those sections of the forum).

    As for what I think about Kaseyas use of the Temp directory? Like everything else, its a decent starting point, but there are better ways...

    I guess what I'm trying to put across here is that if everything worked right out of the box there would be no need for us. If there were only one way of doing things there would only be one MSP, if even that. whether be it the location of the temp directory or the setup of monitoring sets everyone does it differently, which is what makes Kaseya so wonderful. I can do it my way while Ken can do it his, and Alex and do it his way... (names mentioned becuase I could see them while making the post, no offense ment).

    In the end, we were chosen to take care of our clients machines, and at somepoint the tool for the job became Kaseya, this tool allows us to relocate the agent temp directory anyone on the clients system (dont put it on removable storage). In my opinion, the technique chosen by Kaseya was is not sloppy, it was the person that implemented that tool. Its customizable, why not customize it?

    Although thinking about it, maybe the VSA should force you into creating your own temp directory during setup... think about it, if they did that this would be a non issue.

    /rant

    EDIT: My appolgies if I've offended any one, it was not the intent here.

    EDIT2:


    Some obvious choices are either the agent's program folder or C:\Documents and Settings\All Users\Application Data\Kaseya.

    Having things in the agents program folder isnt such a hot idea, because not everything is "run by the application" some things are run by the system, which should work fine, but others are run by the user, and if you're not going to impersonate an administrative user. writing there wont happen. That is unless you change the permissions on the install folder (which I'm guessing you changed the location of too).

    It makes most sense to store something in a generalized area unlike the all users profile. c:\sometempdirecotrynameherethatcanberemovedsafelyuponuninstall will do fine.

    its also easier/quicker to find should you have to FTP into a box.

    Legacy Forum Name: General Discussion,
    Legacy Posted By Username: thirteentwenty
  • We ran in to some problems with the temp directory as well. Problem was with permissions and the temp directory being in the system32 folder (exactly where we were told to put it in bootcamp). Since then, Kaseya has changed their mind saying it causes problems.

    Anyways... the two scripts below seem to work for us. Haven't seen any problems yet with KES or BUDR.

    The second script is to add the network service for counters to run within that folder.



    Script Name: Move KTemp Files
    Script Description: Move temp directory.

    IF Test File
    Parameter 1 : c:\windows\system32\OldFolder\NUL
    Exists :
    THEN
    Execute Shell Command
    Parameter 1 : move "c:\windows\system32\OldFolder" "c:\"
    Parameter 2 : 1
    OS Type : 0
    Execute Shell Command
    Parameter 1 : ren "c:\OldFolder\" "New Folder"
    Parameter 2 : 1
    OS Type : 0
    ELSE



    Script Name: Klogs Permission Change
    Script Description:

    IF Test File
    Parameter 1 : C:\New Folder\NUL
    Exists :
    THEN
    Execute Shell Command
    Parameter 1 : cacls "c:\New Folder\KLogs" /e /g "network service":F
    Parameter 2 : 0
    OS Type : 9
    ELSE


    Legacy Forum Name: General Discussion,
    Legacy Posted By Username: GDRBrian
  • Nicely done GDRBrian, When I moved the temp folders, I had to do it for drive space issues, I just reset the location in the Agent tab |> Configure Agents > Temp Directory.

    One of them was on a server and I recall reading in the either the BU-DR or the KES areas that if you relocate on a server you'd need to repush the installers.

    Legacy Forum Name: General Discussion,
    Legacy Posted By Username: thirteentwenty
  • That's nice that some Kaseyans attended boot camp, but did Kaseya attend their own boot camp? One of THEIR cleanup scripts deletes items in the C:\Temp folder - which is the default Agent Temp Directory that KASEYA CHOSE. That tells me even their own wizards are getting fooled by the description "Temporary Directory" Smile And hey - if Kaseya boot camp gurus recommend changing the Temp Directory to something other than the current default of C:\Temp - then why not make it (the boot camp suggested directory) the default? Why leave the default set to a poor choice in Kaseya's own code?

    Sure, there are all kinds of workarounds we could do. I say the simplest is for Kaseya to do it right: store their data in a more logical folder. I know of no programs that store their long term data in a folder named Temp (other than Kaseya).

    I do agree that the agent's program folder is not the best choice. I opt for the more conventional C:\Program Files\All Users\Documents and Settings\Application Data\Kaseya folder.

    I'm not wining/moaning or groaning. I am just a programmer using logic - and voicing my concerns over a questionable design choice Kaseya developers made. I guarantee you that if their code was changed to use a more appropriate directory, plenty of Kaseyans would benefit. I'll bet there are lots of Kaseyans that are unknowingly affected by this issue...

    Legacy Forum Name: General Discussion,
    Legacy Posted By Username: ReedMikel
  • Moving the temp folder to a path that contains spaces may not be a good idea as it can break some existing scripts that don't enclose paths in quotes and may complicate script troubleshooting.

    Not necessarily a show stopper just something else to be cautious about.

    Legacy Forum Name: General Discussion,
    Legacy Posted By Username: ed@securemycompany.com
  • That's another area they need to improve - handling of paths in scripts. The current parsing done by their script engine is inconsistent - at best Sad

    One could always use the 8.3 short name of the path to get around this concern when specifying the Agent's Temporary Directory in the VSA. e.g. "C:\Docume~1\AllUse~1\Kaseya"

    ed@securemycompany.com
    Moving the temp folder to a path that contains spaces may not be a good idea as it can break some existing scripts that don't enclose paths in quotes and may complicate script troubleshooting.


    Legacy Forum Name: General Discussion,
    Legacy Posted By Username: ReedMikel
  • ReedMikel
    That's another area they need to improve - handling of paths in scripts. The current parsing done by their script engine is inconsistent - at best Sad

    One could always use the 8.3 short name of the path to get around this concern when specifying the Agent's Temporary Directory in the VSA. e.g. "C:\Docume~1\AllUse~1\Kaseya"


    Except you can't because this varies from machine to machine as well.

    Use the full path name, and avoid a temp directory name that has spaces in the paths.

    Andrew

    Legacy Forum Name: General Discussion,
    Legacy Posted By Username: andrew.doull@computer-care.com.au
  • Great Point. Now that you mention it, has anyone seen a script to reinstall the agent on that machine where the temp folder was cleaned out so the K files can be put back into that temp folder?

    Legacy Forum Name: General Discussion,
    Legacy Posted By Username: shickey
  • Great question. I've been waiting a few days for a ticket I have with Support asking this very question. I'm hoping one does not have to reinstall the Agent in order to get the Agent to rebuild whatever files it needs in the infamous "Temporary Directory".

    shickey
    Great Point. Now that you mention it, has anyone seen a script to reinstall the agent on that machine where the temp folder was cleaned out so the K files can be put back into that temp folder?


    Legacy Forum Name: General Discussion,
    Legacy Posted By Username: ReedMikel
  • Maybe the Agent->Temporary Directory screen could be made a little more sophisticated. e.g. In addition to offering a field for entering a constant path, what if they offered choices such as:
    - use Window's All Users/Public folder (e.g. "C:\Documents and Settings\All Users" in XP; "C:\Users\Public" in Vista)
    - use the following fixed path: e.g. "C:\Temp"
    - something for Macintosh


    [QUOTE=andrew.doull@computer-care.com.au;48974]Except you can't because this varies from machine to machine as well.

    Use the full path name, and avoid a temp directory name that has spaces in the paths.

    Andrew[/QUOTE]

    Legacy Forum Name: General Discussion,
    Legacy Posted By Username: ReedMikel