13 Jan 2021 01:42 PM
Dears,
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.
Regards,
Babar
Solved! Go to Solution.
13 Jan 2021 02:59 PM
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.
14 Jan 2021 06:15 AM
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.
Regards,
Babar
13 Jan 2021 07:51 PM
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:
14 Jan 2021 06:28 AM
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?
Regards,
Babar
14 Jan 2021 09:15 AM
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.
14 Jan 2021 10:53 AM
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:
Regards,
Babar
14 Jan 2021 02:00 PM
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 😉
14 Jan 2021 02:50 PM
Hello @Antonio S.
Once again thank you for your kind explanation.
One more clarification required for the /etc/crontab configuration. Will this done on the Dynatrace Cluster Nodes/ or the monitoring hosts?
Regards,
Babar
14 Jan 2021 08:16 PM
You can do this in any Linux machine that can connect to the API endpoints of your environments, be it Managed or SaaS. In our case, we do it on AG machines.
14 Jan 2021 08:28 PM
Hello @Antonio S.
Thank you for the clarification of one more point. With this flexibility, we can use whether the AG or one of the cluster nodes.
I will test in the UAT environment and will come back to you in case of any challenge.
Regards,
Babar
09 Nov 2021 10:33 AM
Thanks for sharing this idea,
Very helpful.
In some cases (some Technologies) processes need to be restarted after OFF/ON of the monitoring, what you are doing for the same?
With this case, you will save HU consumption? or which kind of license you keep?
Thanks.
09 Nov 2021 06:18 PM
When we stop, the servers are stopped. When they start, we haven't had problems with starting the process, as it already comes instrumented. We are using this because we are really stopping the servers.
If this is used for controlling licensing with hosts that keep on running, you probably need to consider restarting those processes. But am not absolutely sure about it.
08 Nov 2021 06:39 PM
After disable\enable do the processes need restarting? If so wouldn't an entry in the hosts file to send that traffic to 127.0.0.1? So that it cannot communicate to SAAS.? There is scripting to rem\unrem a comment in the hosts file and manage that by a batch file and use the windows scheduler. Similar with Linux using different processes.
04 Mar 2024 11:45 AM
Hi,
API V1 is not deprecated:
Are you using API V2 for same purpuse? I would like to confirm if we can disable OneAgent vía API actually.
Thank you!
Best regards