| Ping an address and send email or save log when state changes
| Any modern Windows
| None, just lives here
| Zip file should be attached here
- Hasn't been updated in 5 years, don't expect to in the next 5.
I had a need to monitor a specific server that was having sporadic connection issues, and came up with this to watch what was happening. This version can email one or more users on state change, and save a log in text or CSV format. As stated, it uses blat.exe to provide email function, and date.exe from (unxutils) to provide time tracking. You will need to configure blat for your email server, but note it does not support encryption or Oauth2 so you might need to configure a mail relay - we use hMailserver for this purpose (simple but it's beyond the scope of this article).Features
Monitors an IP address to find if it starts or stops responding to a ping. When the state changes, the bat file will send an email, save to a text log file, and/or save to a csv log file so you can keep track in realtime or afterward.Planned Features
No enhancements expected, it does what I occasionally need.Screenshots
It's a batch file doing pings, boring to look at. UsageInstallation
Copy the three zipped files into %windir% (generally c:\windows).
Configure blat.exe (sample config command is "blat -install mailserver.name.or.ip from@address 35" from an elevated prompt).
The two required exes are included in this zip for convenience but are available on the interwebz:
date.exe - see http://unxutils.sourceforge.net/
blat.exe - see http://www.blat.netUsing the Application
Just type "pingmon" in a command prompt, the usage prompt tells you how to use it...
pingmon: ping an address every x seconds, log/email on state change (3.9)
usage: pingmon computer frequency emailaddress logfile csvfile [mailserver]
usage: computer = computer name or IP address
usage: frequency = seconds between ping attempts
usage: emailaddress = valid email address, or period for no email
usage: logfile = complete log file name, or period for no log file
usage: csvfile = complete csv file name, or period for no csv log
usage: mailserver = optional mail server to override blat setting
usage: note, use valid email address and file names, no checking is doneUninstallation
Just delete the three files to "uninstall".Tips
Really, just try it and see. Since it's a dumb batch file, make your life easier and do not use any spaces in filenames. Filenames should use the complete path and name unless you want the log files in your current directory. Use a valid email address as a recipient, and following blat syntax you can have multiple recipient addresses separated by commas (no spaces). Note that since it is just a batch file, you'll of course need to leave the window running (minimized is fine). And it does no error checking, so use reasonable and valid values.Known Issues
The whole script is based on looking for the "bytes=" response for a successful ping, so if a non-English installation uses a different word then it won't work right (but you should be able to edit the batch file for that easily).