Skip to content

Instantly share code, notes, and snippets.

@tiernano
Created February 15, 2023 22:04
Show Gist options
  • Save tiernano/7c94b07dfa83876a689a310f51295419 to your computer and use it in GitHub Desktop.
Save tiernano/7c94b07dfa83876a689a310f51295419 to your computer and use it in GitHub Desktop.
some work on Zerotier CLI with jq.
get all data from about zerotier peers and pipe into jq:
`zerotier-cli peers -j | jq`
only show the peers and the paths (IP and port) that you end up talking though... does show dupe addresses...
`zerotier-cli peers -j | jq '.[] | {address: .address, paths: .paths[].address}'`
same as above but with more info:
`zerotier-cli peers -j | jq '.[] | {address: .address, paths: .paths[].address, active: .paths[].active, preferred: .paths[].preferred, ifname: .paths[].ifname}'`
Now to figure out how to filter some stuff: only show active, only show preferred, merge the paths together and remove any dupes... ideally, if i could get bandwidth info and some other info, that would be cool... does not look like bandwidth is availble though...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment