10 Nov 2022 04:57 PM - last edited on 20 Aug 2024 03:11 PM by Michal_Gebacki
Hello,
Will be great to have an API to create/update/delete monitoring rule for a host or a hostgroup.
For example, in the GUI, we have to go on Hosts (or Host groups)> Settings > Process availability > Add monitoring rule
Thanks
Solved! Go to Solution.
11 Nov 2022 05:47 PM
Hi Julien,
Ever tried settings API? (schema builtin:processavailability)
Example to call all defined rules:
https://[dtenv]/api/v2/settings/objects?schemaIds=builtin%3Aprocessavailability&fields=objectId%2Cvalue
Output:
{
"items": [
{
"objectId": "vu9U3hXa3q0AAAABABtidWlsdGluOnByb2Nlc3NhdmFpbGFiaWxpdHkABEhPU1QAEDY2NkU0OTUxRTA3MDI1NTYAJGMyNGY2NDBlLTYzZGItMzllZS04Nzk4LTRmMjMxNDg5ODJkML7vVN4V2t6t",
"value": {
"enabled": true,
"name": "Test",
"rules": [
{
"property": "executable",
"condition": "$contains(Elastic)"
}
],
"metadata": [
{
"metadataKey": "test",
"metadataValue": "test_value"
}
]
}
},
...
Regards,
Ingrida
14 Nov 2022 09:00 AM
Hello Ingrida,
It works.
Thanks a lot
Regards,
Julien
14 Nov 2022 12:12 PM
I'll convert the idea to a question in the Dynatrace API forum then 🙂
Thanks a lot for sorting this out so quickly!