04 Jun 2025 12:03 AM
i have scenario where Oneagent will be installed on both the Prod and DR sites. Our goal is to monitor only one site at a time based on our requirements to reduce the cost & Instead of performing the installation as needed, we would prefer to simply switch the monitoring on or off as required. i think by default Oneagent automatically comes up as soon as we do server reboot as well.
Could you please confirm best way to have this flexibility & would this necessitate stopping and starting the applications each time we switch between sites?
Solved! Go to Solution.
04 Jun 2025 08:14 AM
@SachinJindal You turn off the monitoring for host from Host settings instead, this way monitoring is disabled until its manually re-enabled even though OneAgent service continues to run
https://docs.dynatrace.com/docs/shortlink/host-level-settings#host-monitoring
04 Jun 2025 07:42 PM
Since i have got more than 40-50- servers it will be difficult to disable for each host manually and this activity would be on a monthly basis
04 Jun 2025 08:38 AM
You can disable the host monitoring per host.
navigate settings > Monitoring > Monitoring overview > Hosts ,
and choose the host you need, click Edit, and disable the monitoring
04 Jun 2025 10:18 AM - edited 04 Jun 2025 10:18 AM
Hi @SachinJindal
You can use an Ansible role to control the activation of OneAgent, where you can declare the argument oneagent_platform_install_args: [--set-monitoring-mode=infra-only]. For example, this ensures that OneAgent will run in infrastructure-only mode. Alternatively, you can completely disable the agent, which can then be further automated as part of a CI/CD pipeline.
https://galaxy.ansible.com/ui/repo/published/dynatrace/oneagent/content/role/oneagent/
https://docs.dynatrace.com/docs/ingest-from/dynatrace-oneagent/deployment-orchestration/ansible
04 Jun 2025 01:13 PM - edited 12 Jun 2025 09:17 AM
You can also use Workflows to switch on/off monitoring on a set of hosts.
For example you could create 2 manually triggered workflows (one for switching from Prod to DR and the other to switch from DR to Prod).
Each workflow would work something like this :
04 Jun 2025 07:45 PM
This looks to be quite good approach .. let me see if this can be done in short timescale...