10 Nov 2022
08:57 AM
- last edited on
14 Nov 2022
01:23 AM
by
MaciejNeumann
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.
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
Hello Ingrida,
It works.
Thanks a lot
Regards,
Julien
I'll convert the idea to a question in the Dynatrace API forum then 🙂
Thanks a lot for sorting this out so quickly!
Featured Posts