Skip to content

Instantly share code, notes, and snippets.

@mfeit-internet2
Created October 20, 2017 20:17
Show Gist options
  • Save mfeit-internet2/24ad3bb83a6dd3fdef87fb9469f92a4a to your computer and use it in GitHub Desktop.
Save mfeit-internet2/24ad3bb83a6dd3fdef87fb9469f92a4a to your computer and use it in GitHub Desktop.
Ping pScheduler and produce a netstat on failure.
#!/bin/sh -e
#
# Ping pScheduler every so often and grab a netstat when it fails,
# placing a copy in /tmp/netstat.
#
while pscheduler ping --quiet localhost > /dev/null
do
sleep 10
done
netstat -na | egrep -e '^tcp' | tee /tmp/netstat
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment