# Is it possible to pass a tag name(s) during agent install?

**URL:** <https://community.dynatrace.com/t/is-it-possible-to-pass-a-tag-name-s-during-agent-install/11728>\
**Category:** Open Q&A\
**Tags:** tagging\
**Created:** [April 30, 2018, 8:47pm UTC](https://community.dynatrace.com/t/is-it-possible-to-pass-a-tag-name-s-during-agent-install/11728 "2018-04-30T20:47:16Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![tom\_lagona1](https://avatars.discourse-cdn.com/v4/letter/t/58956e/32.png) [@tom\_lagona1](https://community.dynatrace.com/u/tom_lagona1)\
**Post date:** [April 30, 2018, 8:47pm UTC](https://community.dynatrace.com/t/is-it-possible-to-pass-a-tag-name-s-during-agent-install/11728/1 "2018-04-30T20:47:16Z")

</div>

I’m looking for a way to have application teams automatically get their hosts tagged by passing an argument or something during their agent install process. Is there an extra parameter they can pass when running the installer?

---

<div class="post-metadata">

**Author:** ![nj\_njoku](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/nj_njoku/32/13710_2.png) [@nj\_njoku](https://community.dynatrace.com/u/nj_njoku)\
**Post date:** [April 30, 2018, 9:04pm UTC](https://community.dynatrace.com/t/is-it-possible-to-pass-a-tag-name-s-during-agent-install/11728/2 "2018-04-30T21:04:40Z")

</div>

Hey Tom,

There is no parameter for tagging when running the installer in the command line. You do have other options though.

1. You can define an environment variable on the host/process level that get passed as a tag. See [link](https://www.dynatrace.com/support/help/insight-discovery/tagging/can-i-define-tags-based-on-environment-variables/) on how this is done.

2. You can create Automatic tagging rules in the Settings → Tags → Automatically applied tags section and any host that matches the rules created there is automatically tagged. See [link](https://www.dynatrace.com/support/help/insight-discovery/tagging/can-i-organize-services-process-groups-and-hosts-with-tags/)

Hope This Helps

NJ

---

<div class="post-metadata">

**Author:** ![tom\_lagona1](https://avatars.discourse-cdn.com/v4/letter/t/58956e/32.png) [@tom\_lagona1](https://community.dynatrace.com/u/tom_lagona1)\
**Post date:** [May 1, 2018, 12:26pm UTC](https://community.dynatrace.com/t/is-it-possible-to-pass-a-tag-name-s-during-agent-install/11728/3 "2018-05-01T12:26:12Z")

</div>

Hi NJ,

I saw the documentation for #1 but this doesn’t get the  
host tagged if I’m understanding correctly. At the end of that page it  
states, “This feature is currently only available for processes that are  
deep monitored via Dynatrace OneAgent.”

I know I could set up  
automatic tagging to tag any host that has the process tag I’m looking  
for but that requires a manual change which I’m trying to avoid.

Thanks for the help!

Tom

---

<div class="post-metadata">

**Author:** ![JamesKitson](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/jameskitson/32/22460_2.png) [@JamesKitson](https://community.dynatrace.com/u/JamesKitson)\
**Post date:** [May 1, 2018, 12:56pm UTC](https://community.dynatrace.com/t/is-it-possible-to-pass-a-tag-name-s-during-agent-install/11728/4 "2018-05-01T12:56:55Z")

</div>

I believe that just means if you’re trying to set an environment variable for a process group it will only work if they are deep monitored. It should still be usable at the host level though, see one of the first lines:

“You can define an environment variable called `DT_TAGS` on the process or host level.”

---

<div class="post-metadata">

**Author:** ![tom\_lagona1](https://avatars.discourse-cdn.com/v4/letter/t/58956e/32.png) [@tom\_lagona1](https://community.dynatrace.com/u/tom_lagona1)\
**Post date:** [May 1, 2018, 1:20pm UTC](https://community.dynatrace.com/t/is-it-possible-to-pass-a-tag-name-s-during-agent-install/11728/5 "2018-05-01T13:20:18Z")

</div>

Thanks, James. I’ll try to get an app team to do some testing today.

Do you know of any examples for linux? I have to provide exact steps for the team to follow but since I don’t have access to the box I’m not positive on what to provide.

Once the environment variable is set, I’m assuming the OneAgent would need to be restarted if it’s already running?

---

<div class="post-metadata">

**Author:** ![JamesKitson](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/jameskitson/32/22460_2.png) [@JamesKitson](https://community.dynatrace.com/u/JamesKitson)\
**Post date:** [May 1, 2018, 2:09pm UTC](https://community.dynatrace.com/t/is-it-possible-to-pass-a-tag-name-s-during-agent-install/11728/6 "2018-05-01T14:09:07Z")

</div>

NJ might have some experience with that, I haven’t personally done it yet so couldn’t say with certainty if there are any gotchas or anything. What I would do is just look up the standard way to set such variables on Linux go from there. I bet the OneAgent needs to be restarted to pick up the environment variables but again can’t say for sure.

James

---

<div class="post-metadata">

**Author:** ![gautier\_begin](https://avatars.discourse-cdn.com/v4/letter/g/e36b37/32.png) [@gautier\_begin](https://community.dynatrace.com/u/gautier_begin)\
**Post date:** [May 2, 2018, 5:53am UTC](https://community.dynatrace.com/t/is-it-possible-to-pass-a-tag-name-s-during-agent-install/11728/7 "2018-05-02T05:53:19Z")

</div>

Hello Tom,

We are currently using automatically applied tags on hosts and that’s working fine. Please, have a look to the links provided by Ugochukwu upper, especially the [second one](https://www.dynatrace.com/support/help/insight-discovery/tagging/can-i-organize-services-process-groups-and-hosts-with-tags), “automated approach” part of the article. Many other possibilities than using the hostname or a environment variable exist like the IP address, the OS type and version etc. The logical to be used can also be a regex, expending the possibilities.

To be known:

- The name of the rule is the tag that will be set.

- Click on the button “Preview” to check your rule.

Regards,

---

<div class="post-metadata">

**Author:** ![gautier\_begin](https://avatars.discourse-cdn.com/v4/letter/g/e36b37/32.png) [@gautier\_begin](https://community.dynatrace.com/u/gautier_begin)\
**Post date:** [May 2, 2018, 5:54am UTC](https://community.dynatrace.com/t/is-it-possible-to-pass-a-tag-name-s-during-agent-install/11728/8 "2018-05-02T05:54:06Z")

</div>

Hello Tom,

We are currently using automatically applied tags on hosts and that’s working fine. Please, have a look to the links provided by Ugochukwu upper, especially the [second one](https://www.dynatrace.com/support/help/insight-discovery/tagging/can-i-organize-services-process-groups-and-hosts-with-tags), “automated approach” part of the article. Many other possibilities than using the hostname or a environment variable exist like the IP address, the OS type and version etc. The logical to be used can also be a regex, expending the possibilities.

To be known:

- The name of the rule is the tag that will be set.

- Click on the button “Preview” to check your rule.

Regards,
