Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #
- # Pipe output from mgmt_cli
- # MGMT_CLI_USER=admin MGMT_CLI_PASSWORD=password mgmt_cli -f json show group uid <uid> | jq ...
- #
- # List networks, hosts, IP range
- # Prints uid of sub-groups
- jq '.members|map(if .icon=="NetworkObjects/network" then "\(.subnet4)/\(."mask-length4")" else if .icon=="Objects/host" then "\(."ipv4-address")" else if .icon=="Objects/ip" then "\(."ipv4-address-first")-\(."ipv4-address-last")" else {"name": .name, "uid": .uid} end end end)'
Advertisement