[ale] Ping support
Jim Kinney
jim.kinney at gmail.com
Sun Mar 28 10:35:52 EDT 2021
Sweet! Take it one step further and write the data to a rrd and live plot it. Rrdtool or prometheus/grafana with pushgateway.
One the head is wrapped around how prometheus and grafana work, they will likely replace rrdtool graphs.
https://vinayakpandey-7997.medium.com/pushing-bash-script-result-to-prometheus-using-pushgateway-a0760cd261e
If systemd makes you gag, please substitute appropriate sysV start/stop stuff. It's just an example of how to do something and not an offer to start a flame war.
Flame war topics "best beer style" (obviously an Imperial Stout is the clear winner) and "the best pasta shape" (clearly rotini since is holds sauce best) are the only 2 worth discussing. :-)
On March 28, 2021 9:05:26 AM EDT, DJ-Pfulio via Ale <ale at ale.org> wrote:
>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.
>_______________________________________________
>Ale mailing list
>Ale at ale.org
>https://mail.ale.org/mailman/listinfo/ale
>See JOBS, ANNOUNCE and SCHOOLS lists at
>http://mail.ale.org/mailman/listinfo
--
Computers amplify human error
Super computers are really cool
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.ale.org/pipermail/ale/attachments/20210328/71826a4e/attachment.htm>
More information about the Ale
mailing list