[lug] Bash Scripting Ping

Jeff Sharkey jsharkey at jsharkey.org
Sun Nov 8 11:05:17 MST 2020


I've been very happy using Prometheus in my production environments for
robust monitoring/alerting, but it can be tedious to configure:
https://prometheus.io/

I also have Smokeping running, which is easier to configure and has nice
visualizations:
https://oss.oetiker.ch/smokeping/doc/reading.en.html

j

On Sun, Nov 8, 2020 at 10:53 AM D. Stimits <stimits at comcast.net> wrote:

> I am curious about something in bash scripting which does not seem to be
> particularly easy. I wanted to script "ping -O -D address" such that each
> line gets processed by some logic if the ping fails. Redirecting ping to a
> variable does not work because it only "returns" when the ping exits (each
> line is not an exit). Even if I were to fork and exec, the forked process
> would itself have the same problem.
>
> Is there some simple/clever way to process each line of a ping in bash
> without killing off the ping itself? My goal was to send it through some
> database and statistics type processing as success/failure lines occur.
> _______________________________________________
> Web Page:  http://lug.boulder.co.us
> Mailing List: http://lists.lug.boulder.co.us/mailman/listinfo/lug
> Join us on IRC: irc.hackingsociety.org port=6667 channel=#hackingsociety



-- 
Jeff Sharkey
jsharkey at jsharkey.org
http://jsharkey.org/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lug.boulder.co.us/pipermail/lug/attachments/20201108/5d1c12c9/attachment.html>


More information about the LUG mailing list