Submitted By: Anonymous Submission

Periodically checks to see if your Windows server is available on the network.

Visual Basic
net view \\servername
	:: replace "servername" with the name of the server you wish to monitor
sleep 30
	:: set the sleep time to how often in SECONDS, you want the checking to run.
goto BEGIN

Blat ServerDOWN.txt -to -s "Server appears to be hung!" -server -f
	:: This is the email alert which is sent to your pager, cell, or e-mail. I use Blat but others like Fastmail also work fine.
	:: ServerDOWN.txt is a text file explaining the problem like "ServerX is DOWN! Please check.", put in a pager, cell, or e-mail address.
	:: Also change the smtp host name and reply address. 
	:: NOTE if you're checking a mail server, you should not use that server as your smtp host in the above command.
sleep 1800
	:: This sets the time in SECONDS after the initial alert, to wait before checking the server again.
	:: You will get repeated pages until the problem is fixed so don't set this too low.
goto BEGIN