Do we have a way to schedule the on-demand enabling/disabling monitoring of the host?
I read the below news, there are many API options, but I could not find the schedule option.
I dont think you can schedule it within the API, but you could use an application like Jenkins or Postman to create a playlist where at a scheduled time, the application of choice would trigger an api call thus enabling or disabling a Dynatrace Oneagent on a host or set of hosts.
Hello @Chad T.
Thank you for sharing the alternatives. In the lighter node, I would like to share my experience with the customers, that mostly they do not like to ask them for other tools to fulfill the basic requirements, which can be provided by the main vendor very easily. Especially when they do not have the requested tools already in their environment.
Yes, we also do it in some cases, as Chad has noted, especially with HU/hours.
The relevant API call we use, along simple crontab configurations, is the Configuration API, "OneAgent on a host", as seen below:
Hello @Antonio S.
Yes. I had gone through with these configurations API, but what I am looking to provide the scheduled time e.g. host monitoring will be turned off from 1:00 AM to 4:00 AM etc.
If you do not mind, please share the crontab configurations. Also, how to use the crontab configurations?
On my side, I do it this way:
I have this running in the context of controlling the consumption of HU/hours. Please beware that some additional features might be required. I have not had those issues, but one improvement I'll be doing in the near future is confirming if effectively the change was implemented.
Hello @Antonio S.
Thank you for the details.
Point # 1:
00 * * * 1-5 nnnnnnnnnn cd /home/nnnnnnnnnn/APIdyna && ./startHosts.sh
58 * * * 1-5 nnnnnnnnnn cd /home/nnnnnnnnnn/APIdyna && ./stopHosts.sh
Point # 2:
Regarding Point #1,
Regarding Point #2, it seems clear to me now that I didn't express myself like I should. The curl command has to be put inside the shell script as stated in the two points above. The curl that starts has to be in the script that starts, and the one that stops, in the stopping script. Hope it's clearer now 😉