Kaseya Community

Monitoring for Reboots

This question is not answered


what I want to achieve is when a machine reboots it runs a script on startup.

I can't seem to find an elegant way of doing this.  I can script it so that it compares against uptime, but that is not a terribly accurate way of returning the data.  I can run it against agent offline/online but that is monitoring whether the agent is checking in or not rather than whether it has rebooted.

Kaseya is obviously monitoring the reboot time, as it has it listed in the agent status, and this refreshes fairly regularlly (I think!).  So why is this not a variable available to me?  I don't want to go rooting aroung the sql database to pull this information back to decide to run the script.  It seems to be making things more complicated than they need to be.

Can anyone help or point me in the right direction?

All Replies
  • You can:

    1. exec a script when an agent goes online - this isn't always going to be when it was rebooted though.

    2. monitor eventlog for eventid 6009, and use that to trigger a script.

    or, found these using the search:





    and a few more found in search, I got tired of pasting.

  • Thank you very much for that Dan.  Sadly I have already searched through most of those and rejected them.  I don't want to use the part where the agent goes online, as has been discussed elsewhere in these forums, I do still get the random disconnects of the agent.  I also rejected looking for the various event ID specified because they are informational.  I would prefer not to have to poll informational events as well.

    If this query is run against the database it clearly shows there is a record of the rebootTime.  So why is that not an option to monitor and alert against that?

    select computerName, rebootTime

    from dbo.vAgentStatus

    I mean I can do various other things as well, like monitor against system uptime.  It just seems strange that this data is being created and is not being utilised, and there is no option to utilise it.

    I think I may go and log a feature request.

  • This is support's response, I was annoyed until I read the last line:

    I have been discussing with Andrei (Specialist) your requirements:

    While server / end point 'uptime' is one way to go, we understand you may not want to do this.

    Monitoring for Event ID is another option and you could avoid pulling all events by blacklisting and using EventID 6006 (see below).


    Then there is the cmd 'systeminfo : find "System Boot Time" , this would require a procedure to be set up. We haven't explored this

    option any further.

    So, we take your point and will raise a feature request.

    Thanks and best regards,


  • I am a little confused why you are struggling with this to be honest.  

    We monitor around 1000 systems and poll the information events with our Kaseya server running as a VM...THE most accurate and simpliest method is to just perform an action on the event 6009.  

    Personally we actually only care about unexpected reboots (event 6008)...6009 gives you best of both worlds, with very little to no effort...and can be completed in less time then you spent posting about it...or talking to support.

  • Thank you very much for providing me with your opinion.

    Can I ask how you would monitor for a Mac?