Kaseya Community

"Schedule" reboot in response to external check failure?

  • I have a client with a Windows 2003 SBS that sporadically (about every two months) loses the extranet web sites (Remote Web Workplace and Outlook Web Access). When this happens, users that attempt to connect to https://[fqdn]/remote or /exchange simply get the standard "Page cannot be displayed" error instead of the login page.

    We have not yet figured out the cause of this--the event logs show absolutely nothing out of the ordinary, and all related services appear to be running fine. The issue is resolved by a server reboot, and stays resolved for months on end at that point, only to recur at some point several months later.

    I have built an external monitor check that simply alarms and tickets us if their RWW/OWA site is down, and that external check is working perfectly.

    As it's currently our best solution, like to have the external check simply reboot the server if this issue occurs. HOWEVER, since this is the company's primary production server, and because we have no substantial log information telling us the exact time of day the issue occurred, we cannot take a chance on the server rebooting during the business day when 10 users are relying upon it for production.

    Is there a way to have the external check schedule a reboot? Not run it when the check fails, but schedule it for, say, 9:00pm the day it fails. I know a monitor check can directly run a script, but is there a way to schedule a script (such as "Reboot") to occur at a later time?


    Legacy Forum Name: "Schedule" reboot in response to external check failure?,
    Legacy Posted By Username: DNeuwir
  • Out of curiousity, have you tried restarting the IIS services when this occurs? We've had something similar and a restart of IIS has solved the issue..

    Legacy Forum Name: Monitor Sets,
    Legacy Posted By Username: LANWorx
  • Yes, we've tried an IISReset (one of the first things we tried) and it does not resolve the issue.

    Legacy Forum Name: Monitor Sets,
    Legacy Posted By Username: DNeuwir
  • You can make a "Schedule Reboot" script that does nothing but schedule your regular Reboot script.

    Legacy Forum Name: Monitor Sets,
    Legacy Posted By Username: sequoya
  • I thought of that, but how do you schedule a script to run at a particular time? The "Schedule a Script" command only inserts a time delay, but there doesn't appear to be a way to say "launch this script at 9:00pm".

    The problem is, because the problem itself can happen at any time of day or night, simply delaying "x" minutes won't work. If I say to delay 600 minutes, then if the issue occurs at 4:00am, then their server would reboot 600 minutes later at 2:00pm in the middle of the work day.

    Legacy Forum Name: Monitor Sets,
    Legacy Posted By Username: DNeuwir
  • 1.) Create a scheduled task on the system that creates a text file in a temp directory somewhere. Set this task to run at the end of the work day.
    2.) Create a second scheduled task that deletes the file just before the start of the workday.
    3.) Create a script in Kaseya. Set your IF step to "IF File Exists(textfile from step 1)". Set your THEN step to "Reboot". Set your ELSE step to execute the following shell command: AT (time you want to reboot) shutdown -f -r -t 0

    In a nutshell, if the test file is present, it's after work hours and it's safe to reboot. If it's missing, then schedule the reboot for after hours.

    Legacy Forum Name: Monitor Sets,
    Legacy Posted By Username: sequoya
  • Two thoughts...

    1) If your running ISA2004 as part of SBS, check to see if there is anything in the log regarding the outage. We had a similar type situation where ISA2004 would shutdown by itself every few months. It turned out to be our backup trying to backup the ISA logs while it was writing to them. Stopped backing up that directory and has never stopped since.

    2) For a script, you could use 2 scripts....
    2a) Run a script that uses WGET to retrieve a file from the IIS Web Server. First line need to delete the test file from a temporary location, second line does the getfile to a temporary location. Skip the step if it fails, then schedule the 2nd script to run.
    2b) Check if the test file above exists in the temporary location. If it does, IIS is running do nothing. If it's not their, IIS failed, reboot.

    Alternatively, since you can now do math inside a script, you might be able to get the current time on any script then calculate how many minutes you should wait before scheduling the reboot script so you are sure it runs at a specific time.

    Legacy Forum Name: Monitor Sets,
    Legacy Posted By Username: doug.jenkins@ispire.ca
  • Thanks for the post here. I have a similar issue. We run Symantec Continuous Protection Server, and frequently, patches come down to each protected machine that doesn't require the system to be restarted, but Symantec does.

    With Kaseya, we monitor the event logs for the errors that notify us the protected server needs rebooting, and wanted to use these events to trigger a server reboot at an off-hour.

    The problem is, we only have the time delay in the Schedule Procedure even under K2. You'd think that since we can manually schedule a script to run at a later time, we could schedule a script within a script to do the same.

    Mad This is crazy that I have to rely on an external command like AT to accomplish this task. Simply crazy! Mad

    Legacy Forum Name: Monitor Sets,
    Legacy Posted By Username: pcteamadmin