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?
@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
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
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.
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 :
- a task to provide or generate (via DQL) the 2 lists of hosts
- a task to generate the lists of json settings objects for enabling monitoring on one list of hosts and disabling monitoring on the other list of hosts
- a task to send the list of settings objects using the Dynatrace JS SDK
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
This looks to be quite good approach .. let me see if this can be done in short timescale…