[ale] Ping support

DJ-Pfulio DJPfulio at jdpfu.com
Sun Mar 28 09:05:26 EDT 2021


That's what bing.com is for - best to use the IP for that.
#########################
#!/bin/bash
# let other crontabs run 1st
sleep 10s;
# 1 ping only (in Sean Connery voice)
PING=`/bin/ping -c 1 204.79.197.200|/bin/grep loss`
NOW=`/bin/date +'%F-%H%M%S'`
echo "$NOW      $PING"
#########################
Then have the crontab throw it into a log file:
MAILTO=root
LOG=/var/log/internet-up.log
SCRIPT=/usr/local/sbin/internet-up.sh
*/2 * * * *     root if [ -x $SCRIPT ]; then $SCRIPT >> $LOG fi
#########################

Then you can grep the log file for 
"100% packet loss"
and
"0% packet loss"

lines to know how much downtime there is. This script is a little 
more complex - the output from last week.  I rotate log files Sunday
mornings.
#########################
$ /usr/local/sbin/internet-up-summary.sh /var/log/internet-up.log.1.gz 
  Using /var/log/internet-up.log.1.gz ... 
  Using /tmp/internet-up.log.1
 ... 
 Period 20210321-062611  - 20210328-062411
  Total Time: 10080 (min) 168.00 (hrs)
  Percent Up Time: 99.98 % 
  Percent Down Time: 0.02 % 
  Total Down Time: 2 min or 0.03 hrs
 Currently: UP
  Removing /tmp/internet-up.log.1
#########################

Or did I miss the question?


On 3/28/21 4:21 AM, Alex Carver via Ale wrote:
> Would anyone (or multiple anyones) be willing to be a ping recipient
> for a few days?  I'm trying to determine how many times my connection
> drops and for approximately how long.  The plan is to record the
> results of a ping to each host at a rate of one per minute for a few
> days so I can spot any short or long duration drops.
> 
> I already know it's dropping in the early morning hours because my
> daily speed test is failing completely.  I just want to get a higher
> resolution check of connection status.


More information about the Ale mailing list