Skip to content

Instantly share code, notes, and snippets.

@srenatus
Last active December 24, 2015 11:29
Show Gist options
  • Save srenatus/6791122 to your computer and use it in GitHub Desktop.
Save srenatus/6791122 to your computer and use it in GitHub Desktop.
find active logical switch port mirror targets (NVP)
#!/bin/bash
# jq: http://stedolan.github.io/jq/
# resty: http://github.com/micha/resty
. resty
resty https://172.24.0.40 -u admin:admin -k # change me
for tnode in $(GET /ws.v1/transport-node | jq -r '.results[] | ._href'); do
GET $tnode/mirror | jq -r '.results[] | ._href'
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment