Skip to content

Instantly share code, notes, and snippets.

@erdnuesse
Created March 11, 2019 10:20
Show Gist options
  • Save erdnuesse/c905689e02235cbbd9caa8c4e833b71d to your computer and use it in GitHub Desktop.
Save erdnuesse/c905689e02235cbbd9caa8c4e833b71d to your computer and use it in GitHub Desktop.
check multiple connections and write to a log
#!/bin/bash
# make sure to install fping first.
# and run this in a screen env. or make sure it's detachable, I was lazy.
#
adddate() {
while IFS= read -r line; do
echo "$(date +%Y-%m-%d" "%H:%M:%S) $line"
done
}
while true; do fping <ip-1> <ip-2> <ip-n> | adddate | tee -a output.log;done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment