Dynatrace automatically identifies and monitors the infrastructure on which it’s deployed, including all detected hosts. It detects hosts, technologies, locations, services, applications, and dependencies between those entities. Every hosts gets a name automatically.
However, detected host names can be unintuitive or confusing, especially within large and dynamic deployments that include frequently changing host instances and names (for example, within AWS, Azure, or Google Cloud).
To help you out with this, Dynatrace lets you rename hosts manually and programmatically so you see more human-friendly names in the Dynatrace web interface.
This functionality offers you ways to apply a more readable or useful display name to a host.
See below for details.
If you're monitoring a relatively static environment in which host instances are stable, you can enter a custom host name on the Host settings page for the selected host.
You can create one or more host naming rules in Dynatrace to automatically rename monitored hosts that match the rules.
To create a host naming rule that will be applied automatically to all matching hosts
Go to Settings > Monitoring > Host naming.
On the Host naming page, select Add a new rule.
Enter a Rule name.
Set Host name format to the name you want to display. This can include:
Example: type CPU cores =
and then select the {Host:CpuCores}
placeholder from the edit box list. That would generate the host name CPU cores = 8
for a host with 8 CPU cores.
optional Under Rule applies to entities matching the following properties, focus your rule on a specific host group or technology.
optional Under Conditions, use the lists to build a condition for the naming rule.
Example: to apply this rule only to Windows hosts
OS type
equals
Windows
To add another condition, select Add condition and repeat this step.
Select Preview to list matching entities by the current Name and the New name that will be displayed after the rule is applied.
optional To add another rule, repeat the procedure.
OneAgent version 1.189+
Use the oneagentctl
command-line tool with the --set-host-name
parameter to override an automatically detected host name. A host name must not contain the <
, >
, &
, CR
(carriage return), or LF
(line feed) characters. The maximum length is 256 characters.
This command adds a custom host name to display in the UI, but the detected host name is not changed. For details, see Set custom host names.
To change the host name:
./oneagentctl --set-host-name=myhostname
.\oneagentctl.exe --set-host-name=myhostname
To revert to the auto-detected host name, set the --set-host-name
parameter to an empty value, as in --set-host-name=""
. For example:
./oneagentctl --set-host-name=""
.\oneagentctl.exe --set-host-name=""
The change might not be reflected in the Dynatrace web UI for up to 6 minutes.
Using --set-host-name
requires restart of OneAgent. Add --restart-service
to the command to restart OneAgent automatically (version 1.189+) or stop and start the OneAgent process manually. For OS-specific instructions, see Linux, Windows, or AIX.
To show the host name:
./oneagentctl --get-host-name
.\oneagentctl.exe --get-host-name
For more information on oneagentctl
, see OneAgent configuration via command-line interface
OneAgent version 1.187 and earlier
Use the configuration file only for OneAgent version 1.187 and earlier. For later versions, use the oneagentctl
command-line tool as explained in the previous section.
To override an automatically detected host name using a configuration file
Create a simple hostname.conf
file on the monitored host (must be OneAgent version 1.187 or earlier).
For Windows, create the file in %PROGRAMDATA%\dynatrace\oneagent\agent\config
Note that Unicode encoding is not available on Windows.
For Linux, create the file in /var/lib/dynatrace/oneagent/agent/config
Create a host naming rule in the hostname.conf
file:
Example:
My App Server
After you restart the Dynatrace OneAgent service, Dynatrace will pick up the new host name and apply it to the host. Note that the host name entered on the Host settings page takes precedence over the name stored in the hostname.conf
configuration file.