Kaseya Community

Agent goes offline but machine stays online

  • I know this was often discussed in the past but I never heard a solution. I'm hoping someone has one now.

    We have machines at some clients that have the Kaseya agent installed but they mysteriously go offline from Kaseya. They show online via LanWatch. And if we try to push the agent installation again via LanWatch it says that it won't install because it is already installed. yet the system remains offline in Kaseya.

    Other than asking the user to reboot their machine and hope that fixes it, is there any way to remotely restart the Kaseya service/agent?

    Is there any type of command line option or switch for the Lanwatch install so that it reinstalls and restarts the agent even if it is supposedly installed already?

    Does anyone know if Kaseya has any plans to bring together Lanwatch information compared with online/offline status to automatically restart the agent if it goes offline in kaseya but stays online in Lanwatch?


    Legacy Forum Name: Agent goes offline but machine stays online,
    Legacy Posted By Username: kentschu
  • By the way, I was able to manually restart the service using the Computer Management MMC console from the W2K3 server remotely connected to that desktop system.

    But it seems like there should be an automated way to do this. Or it would be really nice if the Lanwatch install routine tried to restart the service if it sees that the agent is already installed.

    any suggestions for automating would be appreciated.


    Legacy Forum Name: Agents,
    Legacy Posted By Username: kentschu
  • Tricky situation.

    You can't use Kaseya to fix the agent going offline because once the agent is offline, Kaseya is no longer working. Think of it like trying to drive your car that won't start to the mechanic to get it started (grin).

    You can set the agent service to restart when it fails on each machine. I'm not sure if there is a way of using VB Script or a command line function to setthis (there probably is if you research it enough) but you can certainly set it manually. Go into SERVICES on the machine, go to the properties of the service, go to the RECOVERY tab, and set the response on failures to restart the service.

    Basically, what this will do is if the Kaseya agent service fails, it will then automatically restart.

    However, I've seen a number of cases where the service is still running but just not communicating. This seems to happen particularly on servers where there are lots of event log entries or on some machines that go to sleep and the agent doesn't wake up properly when the system does. In cases like that, since the service hasn't failed, it won't auto-restart. In fact, I've seen a number of cases where the agent service has simply CRASHED and can't be stoppped (so you can't even manually restart it). In cases like that, you're basically screwed. All you can do is have the user manually reboot the machine. And, of course, you can try to find out why the agent keeps going offline in the first place.

    LANwatch has nothing to do with this. There's no reason why you'd want to use LANwatch to try to install an agent when one is already there but simply not responding.

    By the way, it is probably a good idea to have machines rebooted periodically. I actually have a script scheduled to reboot any machine left logged on at a particular time (which has the effect of making sure Windows is reset after the reboot and also making sure that no files are left open on the server which could cause problems with a backup).




    Legacy Forum Name: Agents,
    Legacy Posted By Username: warever
  • Warever,

    I understand how agents work.

    And I know how to set the RECOVERY function on services (we even have a script that can set it automatically).

    And Lanwatch is related in the sense that it is a service that runs from one machine affecting a different machine on the network.

    Let's say that this was designed differently. Kaseya tracks all its agents and know their MAC address (as it currently does). When LANWatch runs it gathers information about all the devices on the network including MAC addresses. It would then run a routine to compare the devices it found against the internal database to see if an agent was already installed on this device (as it does now when you are in the Install Agents screen). But then it takes it one step further, if it sees that the Kaseya agent WAS installed on that machine and that machine IS online per the Lanwatch scan, it then takes some additional action (performs a remote services restart as I did manually today to get this agent online again, performs an agent reinstall, or something else) to try to get that agent back online. Obviously, if the agent is offline and LANwatch does NOT find it online, then it doesn't need to do anything.

    Also, the default resolution of "rebooting"a machine to fix problems is not one that we tend to employ. Sure, rebooting is necessary sometimes and periodic reboots can keep things running smoothly. But that's not a solution for all things that might go wrong. This type of function is well within the technical capabilities of Kaseya with some extra effort. I was hoping someone might have already figured out an automated way to do this.

    The system that I brought back online today simply had the Kaseya service stopped - whether manually by the user or through some problem. I just would like Kaseya to automatically do that for us rather than requiring the extra effort.


    Legacy Forum Name: Agents,
    Legacy Posted By Username: kentschu
  • The name is Jeff, actually (Warever is the company name - my parents weren't THAT cruel - grin).

    I didn't mean to come off as sounding condescending. The thing about not being able to fix an agent with that agent was merely restating the obvious.

    As to restarting the service, I have no idea how much you do or don't know. Some people would know that, others wouldn't.

    I suppose you could use one agent to monitor the others and then use RPC or something to remotely restart the service on a "dead" machine - but LANwatch wasn't really designed for that.




    Legacy Forum Name: Agents,
    Legacy Posted By Username: warever
  • What we have done is create a Monitor Set for the Kaseya Agent Service, setting the restart attempts to 3 at 1 minute intervals. We apply this to all computers to make sure that if the Kaseya Agent Service stops, it will attempt to restart it 3 times.

    Legacy Forum Name: Agents,
    Legacy Posted By Username: gssloan
  • gssloan wrote:
    What we have done is create a Monitor Set for the Kaseya Agent Service, setting the restart attempts to 3 at 1 minute intervals. We apply this to all computers to make sure that if the Kaseya Agent Service stops, it will attempt to restart it 3 times.

    Actually, we run a script to set the recovery on each computer.

    Legacy Forum Name: Agents,
    Legacy Posted By Username: gssloan
  • Glad you sent that second message... I was beginning to wonder how you had a crashed agent fix itself.

    Care to share the script?




    Legacy Forum Name: Agents,
    Legacy Posted By Username: warever
  • I have one but I've only verified on XP. Anyone want to tackle any other OS's and update the script?

    Script Name: Set Failure Action for Kaseya Service to Restart
    Script Description: Sets the service failure action to restart

    IF True
    THEN
    Set Registry Value
    Parameter 1 : HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\KaseyaAgent\FailureActions
    Parameter 2 : 00000000000000000000000003000000520049000100000060ea00000100000060ea00000100000060ea0000
    Parameter 3 : REG_BINARY
    OS Type : 8
    ELSE




    Legacy Forum Name: Agents,
    Legacy Posted By Username: rvines
  • Sorry for my late response. This script has been tested withXP,Server 2003, Vista andWindows Server 2008 - Longhorn.

    For Windows2000 Server and Pro, Windows NT 4.0 and Windows NT 3.51, use SC.EXE from the resource kit.


    Script Name: Set Recovery on KaseyaAgentService
    Script Description: This script uses the SC command to set the Recovery on the KaseyaAgent Service to restart the service with a delay of 60 seconds for 3 instances.
    The SC.EXE command is native on XP, 2003 Server, Vista and Windows Server 2008 - Longhorn

    You can use the SC.EXE command from the resource kit for Windows 2000, NT 4.0 and NT 3.51.

    See SC /? for command syntax.

    IF True
    THEN
    Get Variable
    Parameter 1 : 6
    Parameter 2 :
    Parameter 3 : machine.groupid
    OS Type : 0
    Execute Shell Command
    Parameter 1 : sc failure kaseyaagent reset= 60 actions= restart/60000/restart/60000/restart/60000
    Parameter 2 : 0
    OS Type : 9
    Execute Shell Command
    Parameter 1 : sc failure kaseyaagent reset= 60 actions= restart/60000/restart/60000/restart/60000
    Parameter 2 : 0
    OS Type : 8
    Execute Shell Command
    Parameter 1 : sc failure kaseyaagent reset= 60 actions= restart/60000/restart/60000/restart/60000
    Parameter 2 : 0
    OS Type : 10
    Write Script Log Entry
    Parameter 1 : /// Recovery Actions SUCCESSFULLY SET for KaseyaAgent Service on #machine.groupid# \\\
    OS Type : 0
    ELSE




    Legacy Forum Name: Agents,
    Legacy Posted By Username: gssloan