-
February 11th, 2010, 05:22 PM
#1
Script to detect server response time & reboot if necessary...
At my university we use a server for learning ASP by making dynamic web pages. When a page with some dodgy code is uploaded and run, the server confuses itself and needs to be rebooted before anyone can do anything with it. The only people with the ability to reboot the server are a few IT staff. The problem is that with so many people using it, it often goes down and it takes ages for someone to get round to checking their emails and rebooting it.
What I want to do is create a script/program that checks the server response time every 2 minutes or so and if it is over a certain time (1 minute), to reboot the server automatically. I will have full access to the server etc.
I would like some pointers on where to start.
E.g. what language to use, how to run the script every 2 minutes etc...
Hope you can help, thanks
-
February 11th, 2010, 05:34 PM
#2
Re: Script to detect server response time & reboot if necessary...
You'd need ADMIN rights, but most scripting languages can do something like that.
Look into POWERSHELL 2.0. It's the new DOS-like language
-
February 11th, 2010, 06:03 PM
#3
Re: Script to detect server response time & reboot if necessary...
I'd have admin rights. The university have asked me to do it.
What kind of program would I be making?
I have done various web development projects but nothing like this.
-
February 12th, 2010, 10:48 AM
#4
Re: Script to detect server response time & reboot if necessary...
Bit more information:
The server is running Microsoft Windows Server 2003. I'm pretty sure I could find a reliable server to run the script. I have access to a couple of other servers. Currently to restart it, I simply login using VNC and do a manual restart...all very basic stuff.
When it goes down it's only the http sites. FTP still works so the reboot script could be hosted and run locally but triggered from another machine.
Any ideas?
-
February 12th, 2010, 07:04 PM
#5
Re: Script to detect server response time & reboot if necessary...
Powershell lets you INVOKE scripts, to run on any WMI-enabled machine that you set up. It'd be perfect to be able to stop and start services.
-
February 13th, 2010, 09:17 AM
#6
Re: Script to detect server response time & reboot if necessary...
I think some questions need to be answered before there can be a clear cut answer to your problem.
Are you talking about rebooting the physical server or just the web service? Does just the web service become unresponsive or does the whole OS?
If you're talking about just the web service, then just use VBScript on a scheduled Task. VBScript has the full ability to check the status of Windows services and start/stop them.
If the whole OS is what's the problem, then you are out of luck and need to be physically present with the machine.
If the post was helpful...Rate it! Remember to use [code] or [php] tags.
-
February 14th, 2010, 08:45 AM
#7
Re: Script to detect server response time & reboot if necessary...
It's just the web service.
Web pages will not load but ftp can be accessed and used.
At the moment the whole system is just restarted but restarting the web service is a possibility.
How would I get the script to run every few minutes?
-
February 14th, 2010, 12:46 PM
#8
Re: Script to detect server response time & reboot if necessary...
As stated before...Scheduled Task.
If the post was helpful...Rate it! Remember to use [code] or [php] tags.
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|