Hi @HeikoAnkenbrand
nice one.
unfortunately it Will not work with multi domain. With mdm the oneliner would be much longer and then when working with many cma using -r true is very inefficient.
Edith says:
first to loop over cma
mgmt_cli -r true show domains --format json | jq -r '.objects[] | .name'
Then for each domain
while read domain; do
mgmt_cli -r true show tasks status "successful" from-date "$(date -u -d '30 days ago' +%Y-%m-%dT%H:%M:%S)" -d "$domain" --format json
Could then be something like this
mgmt_cli -r true show domains --format json | jq -r '.objects[] | .name' | while read domain; do
mgmt_cli -r true show tasks status "successful" from-date "$(date -u -d '30 days ago' +%Y-%m-%dT%H:%M:%S)" -d "$domain" --format json |
jq -r --arg dom "$domain" '.tasks[]? | . as $t | ($t["meta-info"]["last-modify-time"]["iso-8601"] | split("T")) as $d | "\($dom)\t\($t["task-name"])\t\($t.status)\t\($d[0]) \($d[1][0:5])"'
done | awk -F'\t' '{ printf "%-20s %-80s %-20s %-20s\n", $1, $2, $3, $4 }'
and now to something completely different - CCVS, CCAS, CCTE, CCCS, CCSM elite