Hello Artem,
Would be great if you can explain your use case as Joseph mention, so we can take a look to solutions for that.
If you just look for single answers:
- How I can determine oneagent version on hosts via Saas API?
You can retrieve all agents and each agent version using the REST call /entity/infrastructure/hosts
Think that even if you have the last version downloaded, some agents could still are running in older versions if they were not restarted in a long time, that is why you cannot get a single value for all the hosts. But if you are interested in general oneagent version, you could retrieve the version running on the cluster and agent will be one behind (so cluster 164, the last oneagent version will be 163)
- How I can deploy custom version of oneagent via API? Or we can do it only through GUI?
Again in the API you can find different endpoints like in the Deployment section, the /deployment/installer/agent/{osType}/{installerType}/latest endpoint to download the latest agent version, or another call like /deployment/installer/agent/{osType}/{installerType}/version/{version} that allow you to select the version
- Can we trigger oneagent update on host group via API?
Not sure about this one, I think it is not possible.
- How we can track new releases of oneagent? I found rss feed with releases, but I would like a better solution
A new Release is expected every month, if you have enabled autoupdate, it will be available in your environment as soon as it is published.
You can get more information about the new releases by
https://www.dynatrace.com/support/help/whats-new/dynatrace-release-notes/
- After onegant updated, it wants to restart services, how I can avoid this? I don’t want restarted my services, after upgrade oneagent.
After an upgrade the agent want to restart the services to start using the new version, but it will not restart them. You will have to do it and in the meantime the old agent will still work and capture/report information as normal.
See the doc: Update OneAgent on Linux — Dynatrace Docs
Following Dynatrace OneAgent auto-updates, you must restart all server processes, as some components of Dynatrace OneAgent keep running in processes that are monitored by Dynatrace (for example, Java, .NET, Apache, and IIS). These processes will continue to be monitored with the previous version of Dynatrace OneAgent until they are restarted. Following restart, these processes will be monitored with the latest version of Dynatrace OneAgent.
Regards