UnixTips.net

* use my tips at your own risk !!

* use my tips at your own risk !!

Categories

  • Other (3)
  • Scripting (10)
  • Unix (70)
  • Wordpress (2)

Powered by Genesis

ssh script hanging

I had an issue where an ssh loop script was exiting after 1 host.

The fix use the -n flag.

Ensure ssh isn’t reading from standard input by using the -n option:

ZFSHEALTH=`/usr/local/bin/ssh -n $MACHINE "/sbin/zpool get health rpool" |
grep ONLINE | wc -l`