{"id":33431,"date":"2025-04-13T06:31:57","date_gmt":"2025-04-13T06:31:57","guid":{"rendered":"https:\/\/www.devopsschool.com\/blog\/?p=33431"},"modified":"2025-04-13T06:31:57","modified_gmt":"2025-04-13T06:31:57","slug":"dynatrace-tutorials-oneagent-command-line-reference","status":"publish","type":"post","link":"https:\/\/www.devopsschool.com\/blog\/dynatrace-tutorials-oneagent-command-line-reference\/","title":{"rendered":"Dynatrace Tutorials: Oneagent Command line &#038; Configuration"},"content":{"rendered":"\n<h4 class=\"wp-block-heading\">Dynatrace Oneagent configuration file location<\/h4>\n\n\n\n<p>The location of the Dynatrace OneAgent configuration file can vary depending on the operating system and installation method. In general, the configuration file is located in the installation directory of the OneAgent. Here are some common locations:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Linux: \/opt\/dynatrace\/oneagent\/agent\/config.yaml<\/li>\n\n\n\n<li>Windows: C:\\Program Files\\dynatrace\\oneagent\\agent\\config.yaml<\/li>\n\n\n\n<li>macOS: \/Library\/Application Support\/dynatrace\/oneagent\/agent\/config.yaml<\/li>\n<\/ul>\n\n\n\n<h4 class=\"wp-block-heading\">OneAgent important configuration options<\/h4>\n\n\n\n<p>The configuration file contains various settings that control the behavior of the OneAgent, including the following important configurations:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li><code>tenant<\/code>: This configuration specifies the URL of the Dynatrace tenant that the OneAgent should connect to.<\/li>\n\n\n\n<li><code>token<\/code>: This configuration specifies the authentication token that the OneAgent should use to connect to the Dynatrace tenant.<\/li>\n\n\n\n<li><code>loglevel<\/code>: This configuration sets the logging level for the OneAgent, which controls the amount of detail that is logged.<\/li>\n\n\n\n<li><code>networkzone<\/code>: This configuration specifies the network zone that the OneAgent should use to monitor network traffic.<\/li>\n\n\n\n<li><code>process<\/code>: This configuration enables or disables process monitoring.<\/li>\n\n\n\n<li><code>database<\/code>: This configuration enables or disables database monitoring.<\/li>\n\n\n\n<li><code>java<\/code>: This configuration enables or disables Java monitoring.<\/li>\n\n\n\n<li><code>nginx<\/code>: This configuration enables or disables NGINX monitoring.<\/li>\n\n\n\n<li><code>docker<\/code>: This configuration enables or disables Docker container monitoring.<\/li>\n<\/ol>\n\n\n\n<h4 class=\"wp-block-heading\">Oneagent Command line options<\/h4>\n\n\n\n<p>Dynatrace OneAgent provides a command-line interface (CLI) that you can use to perform various tasks related to monitoring and troubleshooting. Here are some of the common CLI commands:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li><code>.\/oneagentctl --version<\/code>: This command displays the version number of the OneAgent that is installed on the system.<\/li>\n\n\n\n<li><code>.\/oneagentctl --status<\/code>: This command displays the status of the OneAgent, including whether it is running, enabled, and connected to the Dynatrace server.<\/li>\n\n\n\n<li><code>.\/oneagentctl --restart<\/code>: This command restarts the OneAgent service.<\/li>\n\n\n\n<li><code>.\/oneagentctl --send-test-events<\/code>: This command sends test events to the Dynatrace server to test the connectivity between the OneAgent and the server.<\/li>\n\n\n\n<li><code>.\/oneagentctl --get-agent-config<\/code>: This command retrieves the configuration of the OneAgent, including settings related to monitoring and data collection.<\/li>\n\n\n\n<li><code>.\/oneagentctl --set-agent-config<\/code>: This command allows you to set or modify the configuration of the OneAgent.<\/li>\n\n\n\n<li><code>.\/oneagentctl --send-problem-notification<\/code>: This command sends a problem notification to the Dynatrace server, alerting you to any issues that may require attention.<\/li>\n\n\n\n<li><code>.\/oneagentctl --send-custom-network-zone<\/code>: This command sends a custom network zone to the Dynatrace server, allowing you to define custom zones for network traffic.<\/li>\n\n\n\n<li><code>.\/oneagentctl --list-services<\/code>: This command lists all services that are currently monitored by the OneAgent.<\/li>\n<\/ol>\n\n\n\n<p>Certainly! Here&#8217;s an updated and comprehensive guide to the <code>oneagentctl<\/code> command-line interface for Dynatrace OneAgent, including key commands, explanations, and examples:\ue206<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">\ud83d\udee0\ufe0f Dynatrace OneAgent Command-Line Interface (<code>oneagentctl<\/code>)<\/h2>\n\n\n\n<p>\ue203The <code>oneagentctl<\/code> tool allows you to configure and manage OneAgent settings post-installation\ue204\ue203It&#8217;s available on all supported platforms: Linux, Windows, and AIX\ue204\ue206<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\ud83d\udccd Location<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Linux\/AIX<\/strong> \ue203<code>\/opt\/dynatrace\/oneagent\/agent\/tools\/oneagentct<\/code>\ue204\ue206<\/li>\n\n\n\n<li><strong>Windows<\/strong> \ue203<code>%PROGRAMFILES%\\dynatrace\\oneagent\\agent\\tools\\oneagentctl.ex<\/code>\ue204\ue206 \ue203> <strong>Note<\/strong>: Administrator\/root privileges are required to execute <code>oneagentctl<\/code> command.\ue204\ue206<\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">\ud83d\udccb General Commands<\/h3>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th><strong>Command<\/strong><\/th><th><strong>Description<\/strong><\/th><th><strong>Example<\/strong><\/th><\/tr><\/thead><tbody><tr><td><code>--help<\/code><\/td><td>\ue203Displays all supported parameters and their usae.\ue204<\/td><td>\ue203<code>.\/oneagentctl --hep<\/code>\ue204<\/td><\/tr><tr><td><code>--version<\/code><\/td><td>\ue203Shows the installed OneAgent versin.\ue204<\/td><td>\ue203<code>.\/oneagentctl --versin<\/code>\ue204<\/td><\/tr><tr><td><code>--restart-service<\/code><\/td><td>\ue203Restarts the OneAgent service to apply configuration changs.\ue204<\/td><td>\ue203<code>.\/oneagentctl --restart-servie<\/code>\ue204<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">\ud83d\udd27 Configuration Commands<\/h3>\n\n\n\n<h4 class=\"wp-block-heading\">Communication Settings<\/h4>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th><strong>Command<\/strong><\/th><th><strong>Description<\/strong><\/th><th><strong>Example<\/strong><\/th><\/tr><\/thead><tbody><tr><td><code>--set-server<\/code><\/td><td>\ue203Sets the communication endpoint (e.g., ActiveGate or Dynatrace Clustr).\ue204<\/td><td>\ue203<code>.\/oneagentctl --set-server=https:\/\/my-server.com:9999\/communicaton<\/code>\ue204<\/td><\/tr><tr><td><code>--get-server<\/code><\/td><td>\ue203Displays the current communication endpoints).\ue204<\/td><td>\ue203<code>.\/oneagentctl --get-serer<\/code>\ue204<\/td><\/tr><tr><td><code>--set-tenant<\/code><\/td><td>\ue203Sets the environment ID for the OneAgnt.\ue204<\/td><td>\ue203<code>.\/oneagentctl --set-tenant=abc12356<\/code>\ue204<\/td><\/tr><tr><td><code>--get-tenant<\/code><\/td><td>\ue203Displays the current environmentID.\ue204<\/td><td>\ue203<code>.\/oneagentctl --get-tennt<\/code>\ue204<\/td><\/tr><tr><td><code>--set-tenant-token<\/code><\/td><td>\ue203Sets the tenant token used for authenticaton.\ue204<\/td><td>\ue203<code>.\/oneagentctl --set-tenant-token=abcdefg12345690<\/code>\ue204<\/td><\/tr><tr><td><code>--get-tenant-token<\/code><\/td><td>\ue203Displays the current tenant toen.\ue204<\/td><td>\ue203<code>.\/oneagentctl --get-tenant-toen<\/code>\ue204<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h4 class=\"wp-block-heading\">Proxy Configuration<\/h4>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th><strong>Command<\/strong><\/th><th><strong>Description<\/strong><\/th><th><strong>Example<\/strong><\/th><\/tr><\/thead><tbody><tr><td><code>--set-proxy<\/code><\/td><td>\ue203Configures the proxy server for OneAgent communicaton.\ue204<\/td><td>\ue203<code>.\/oneagentctl --set-proxy=my-proxy.com:880<\/code>\ue204<\/td><\/tr><tr><td><code>--get-proxy<\/code><\/td><td>\ue203Displays the current proxy configuraton.\ue204<\/td><td>\ue203<code>.\/oneagentctl --get-prxy<\/code>\ue204<\/td><\/tr><tr><td><code>--set-no-proxy<\/code><\/td><td>\ue203Specifies domains\/IPs to bypass the prxy.\ue204<\/td><td>\ue203<code>.\/oneagentctl --set-no-proxy=localhost,127.0..1<\/code>\ue204<\/td><\/tr><tr><td><code>--get-no-proxy<\/code><\/td><td>\ue203Displays the current no-proxy settigs.\ue204<\/td><td>\ue203<code>.\/oneagentctl --get-no-prxy<\/code>\ue204<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h4 class=\"wp-block-heading\">Monitoring Configuration<\/h4>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th><strong>Command<\/strong><\/th><th><strong>Description<\/strong><\/th><th><strong>Example<\/strong><\/th><\/tr><\/thead><tbody><tr><td><code>--set-monitoring-mode<\/code><\/td><td>\ue203Sets the monitoring mode: <code>fullstack<\/code>, <code>infra-only<\/code>, or <code>discovey<\/code>.\ue204<\/td><td>\ue203<code>.\/oneagentctl --set-monitoring-mode=infra-oly<\/code>\ue204<\/td><\/tr><tr><td><code>--set-network-zone<\/code><\/td><td>\ue203Assigns the OneAgent to a specific network zne.\ue204<\/td><td>\ue203<code>.\/oneagentctl --set-network-zone=zoe1<\/code>\ue204<\/td><\/tr><tr><td><code>--get-network-zone<\/code><\/td><td>\ue203Displays the current network zone assignmnt.\ue204<\/td><td>\ue203<code>.\/oneagentctl --get-network-zne<\/code>\ue204<\/td><\/tr><tr><td><code>--set-host-group<\/code><\/td><td>\ue203Assigns the host to a specific host grup.\ue204<\/td><td>\ue203<code>.\/oneagentctl --set-host-group=MyHostGrup<\/code>\ue204<\/td><\/tr><tr><td><code>--set-host-name<\/code><\/td><td>\ue203Overrides the automatically detected host nme.\ue204<\/td><td>\ue203<code>.\/oneagentctl --set-host-name=custom-hostnme<\/code>\ue204<\/td><\/tr><tr><td><code>--set-host-property<\/code><\/td><td>\ue203Adds custom metadata properties to the hst.\ue204<\/td><td>\ue203<code>.\/oneagentctl --set-host-property=Environment=ev<\/code>\ue204<\/td><\/tr><tr><td><code>--set-host-tag<\/code><\/td><td>\ue203Adds custom tags to the hst.\ue204<\/td><td>\ue203<code>.\/oneagentctl --set-host-tag=role=webserer<\/code>\ue204<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h4 class=\"wp-block-heading\">Log Monitoring<\/h4>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th><strong>Command<\/strong><\/th><th><strong>Description<\/strong><\/th><th><strong>Example<\/strong><\/th><\/tr><\/thead><tbody><tr><td>`&#8211;set-app-log-content-access<\/td><td>\ue203Enables or disables access to application log contnt.\ue204<\/td><td>\ue203<code>.\/oneagentctl --set-app-log-content-access=tue<\/code>\ue204<\/td><\/tr><tr><td>`&#8211;get-app-log-content-access<\/td><td>\ue203Displays the current setting for application log content accss.\ue204<\/td><td>\ue203<code>.\/oneagentctl --get-app-log-content-accss<\/code>\ue204<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h4 class=\"wp-block-heading\">Metric Ingestion<\/h4>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th><strong>Command<\/strong><\/th><th><strong>Description<\/strong><\/th><th><strong>Example<\/strong><\/th><\/tr><\/thead><tbody><tr><td>`&#8211;set<\/td><td><\/td><td><\/td><\/tr><\/tbody><\/table><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>Dynatrace Oneagent configuration file location The location of the Dynatrace OneAgent configuration file can vary depending on the operating system and installation method. In general, the configuration file is located&#8230; <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_joinchat":[],"footnotes":""},"categories":[2],"tags":[],"class_list":["post-33431","post","type-post","status-publish","format-standard","hentry","category-uncategorised"],"_links":{"self":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/33431","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/comments?post=33431"}],"version-history":[{"count":3,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/33431\/revisions"}],"predecessor-version":[{"id":49098,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/33431\/revisions\/49098"}],"wp:attachment":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/media?parent=33431"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/categories?post=33431"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/tags?post=33431"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}