Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save niedbalski/c6bc61ec836a1ec55bbfd9336c4f228e to your computer and use it in GitHub Desktop.

Select an option

Save niedbalski/c6bc61ec836a1ec55bbfd9336c4f228e to your computer and use it in GitHub Desktop.
check that memcached is reacheable from ncc
#!/bin/bash
# ./{0} nova-cloud-controller
units=$(juju status $1 | grep -E '[a-z\-]+\/[0-9]+' | awk '{print $1}' | sed s'/.$//')
for unit in ${units}; do
relations=$(juju run --unit ${unit} 'relation-ids memcache')
for relation in ${relations}; do
unit_list=$(juju run --unit ${unit} "relation-list -r ${relation}")
for related in ${unit_list}; do
addr=$(juju run --unit ${unit} "relation-get -r ${relation} private-address ${related}")
juju run --unit ${unit} "nc -vz -t ${addr} 11211"
done
done
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment