Timo
(T. Gohde)
1
Iam trying to get a table of all vars.notification Dicitionaries:
This one is fine but contains not the host/service pair:
curl -s -k -u $APILOGIN:$APIPASSWORD -H 'X-HTTP-Method-Override: GET' -X POST 'https://localhost:5665/v1/objects/services' | jq '.results[].attrs.vars.notification'
Thanks in advance
dnsmichi
(Michael Friedrich)
2
Maybe joins can help here.
Timo
(T. Gohde)
3
Its jq related. I found a solution, but I dont claim greater depth understanding:
curl -s -k -u $APILOGIN:$APIPASSWORD -H 'X-HTTP-Method-Override: GET' -X POST 'https://localhost:5665/v1/objects/services?' | jq '.results[].attrs | { __name: .__name, notification: .vars.notification }'
I get such objects:
{
"__name": "myhost.company.tld!ping4",
"notification": {
"mail": {
"groups": [
"icingaadmins"
]
}
}
}
This is a good starting point for a table.