I'm trying to create a script that will output the MAC and IP addresses from the VMs on this host.
"qm guest cmd 1017 network-get-interfaces | jq ." will generate a valid JSON file. But when I try to address the element "hardware-address" all I get is errors like this:
Yes I know this is more of a JSON or jq problem, but I am hoping someone has tried to gather this info before. If there a better way?
"qm guest cmd 1017 network-get-interfaces | jq ." will generate a valid JSON file. But when I try to address the element "hardware-address" all I get is errors like this:
Bash:
# qm guest cmd 1017 network-get-interfaces | jq . | jq .network-interfaces
jq: error: interfaces/0 is not defined at <top-level>, line 1:
.network-interfaces
jq: 1 compile error
Yes I know this is more of a JSON or jq problem, but I am hoping someone has tried to gather this info before. If there a better way?