I wrote this up to run a simple IP check and alert from any Windows machine. Basically, it runs a ping and alerts you by email and/or popup message if your site is down. All the files needed to run this are included in the zip.
[]ericgtr said: I wrote this up to run a simple IP check and alert from any Windows machine. Basically, it runs a ping and alerts you by email and/or popup message if your site is down. All the files needed to run this are included in the zip. [/] Very cool and much appreciated. Please give more details as to how to set it.
If you edit the batch (right click on it and select "Edit") file the instructions should tell you all you need to know. I think the only thing I didn't describe is the sleep command, that is set for 60 seconds in the script, you can change that to whatever you want.
Here is an example of your site, socaps.com. You will still need to edit the Postie part for your mail settings though.
Code
<br />:: Make sure it is ran in the same direcorty as all the accompanying .exe files. <br />:: This script will check that your site is up, please see the commented instructions below. <br /> <br />:TOP <br />@echo off <br />IF EXIST status.txt DEL status.txt <br />echo | time /t <br />::Type in your site name below. <br />ping socaps.com >status.txt <br />echo | time /t >>status.txt <br />::Type in your IP address below. <br />type status.txt | find /i "64.62.140.213" <br />echo Searching string... <br />if %errorlevel% EQU 1 GOTO DROP <br />if %errorlevel% EQU 0 GOTO RESTART <br /> <br />:DROP <br />echo Your site is not responding. Proceeding to send a message.. <br />::Optional: uncomment the next line to send a popup message to yourself, Messenger service must be started. <br />::net send localhost Your site is currently unavailabe! <br />::Fill in the info below with your information, you may want to use a differnt email than what's on your site. <br />postie.exe -host:mail.yourserver.com -to:[email protected] -from:"[email protected]" -s:"Down Message" -msg:"Your Site is currently unavailable!" <br />echo Message sent. <br />choice Run this script again? <br />if %errorlevel% EQU 1 GOTO TOP <br />IF %ERRORLEVEL% EQU 2 GOTO EOF <br />GOTO EOF <br /> <br /> <br />:RESTART <br />echo Received a response. <br />sleep 2 <br />echo Sleeping... <br />sleep 60 <br />cls <br />GOTO TOP <br /> <br />:EOF <br />
Donate to UBBDev today to help aid in Operational, Server and Script Maintenance, and Development costs.
Please also see our parent organization VNC Web Services if you're in the need of a new UBB.threads Install or Upgrade, Site/Server Migrations, or Security and Coding Services.