Splunk AppDynamics

disable health rules with rest

CommunityUser
Splunk Employee
Splunk Employee

I know you can use alert suppression to do blackouts of actions, but the rules are still active and the GUI will show the problem even with the supression.  This can be corrected by disabling the rule with rule configuration.  This is time consuming with many rules.  Is there a REST command to list all rules and then submit a series of REST commands to disable and later enable all the health rules?

Labels (3)
Tags (2)
0 Karma

biharper
Engager

There is a typo in this for disabling a health rule.  The end parameter should be disable not enable. 

URL: http://<controller-host>:<port>/controller/api/accounts/<account-id>/applications/<application-id>/healthrules/<healthrule-id>/enabled

You should then get a list of all the health rules with that were disabled in the return payload.

Pratik_Maskey
Communicator

Hi Eric,

You can use swagger to find all the avaliable API's. Do find the below link for your referance.

https://docs.appdynamics.com/display/PRO43/Access+Swagger+and+Accounts+API

To use below API's you need account-id and application-id which you can get from swagger API's.

GET - /accounts/myaccount : will get you the account-id

GET - /accounts/{accId/applications} : will get you all the application with respective application-ids.

Health Rules API's:

Get HR's for application:

Request type: GET
URL: http://<controller-host>:<port>/controller/api/accounts/<account-id>/applications/<application-id>/healthrules
Response status: 200 OK

Disable HR:

Request type: DELETE
URL: http://<controller-host>:<port>/controller/api/accounts/<account-id>/applications/<application-id>/healthrules/<healthrule-id>/enabled
Response status: 204 No Content

 

Enable HR:
Request type: PUT
URL: http://<controller-host>:<port>/controller/api/accounts/<account-id>/applications/<application-id>/healthrules/<healthrule-id>/enabled
Response status: 204 No Content

 

If you want to stop evaluation for all the health rules for a particular application you can do so through UI by unchecking "Evaluate Health Rules" checkbox (refer attached screenshot).image.png

 

 

Regards,

Pratik

0 Karma
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.
Get Updates on the Splunk Community!

Tech Talk Recap | Mastering Threat Hunting

Mastering Threat HuntingDive into the world of threat hunting, exploring the key differences between ...

Observability for AI Applications: Troubleshooting Latency

If you’re working with proprietary company data, you’re probably going to have a locally hosted LLM or many ...

Splunk AI Assistant for SPL vs. ChatGPT: Which One is Better?

In the age of AI, every tool promises to make our lives easier. From summarizing content to writing code, ...