cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Skip One Agent Deployment for Iinux hosts where One Agent already exists

kgrimes
Visitor

We have a situation where there are 2 new linux servers added to a server farm. We would like to install One Agent on the new hosts and skip the installation on the hosts where Dynatrace exists already.

 Looking for the best solution for installation of One Agent on the new hosts and skip the existing linux hosts where the One Agent already exists.  

 

5 REPLIES 5

ryan_ott
Dynatrace Mentor
Dynatrace Mentor

It sounds like you are referring to an automated method of install - what is your usual method of installing the OneAgent? My initial thought is to write a check to see if OneAgent service is already running on a host, and if not then install. Or, have a list of all Linux hosts that have OneAgent installed, and if host is not in that list then install OneAgent. I am just spitballing here though, interested to hear more about your current instrumentation method.

ACE Consultant, Dynatrace Services
Dynatrace Certified Professional

Yes, we are using Octopus to perform automated deployments of One Agent to the environments. We currently use this script which performs an uninstall on hosts where One Agent exists. We believe a better method would be to skip hosts where the agent is installed and install on the hosts which were added for additional capacity. 

uninstall=$(get_octopusvariable "Uninstall")

 

If [ $Uninstall -eq "1" ]

then

 

            if [ -f "/opt/dynatrace/oneagent/agent/uninstall.sh" ]

    then

           

                        cd "/opt/dynatrace/oneagent/agent"

              echo "Removing Dynatrace agent"

   

         sudo chmod 777 uninstall.sh   

         sudo ./uninstall.sh

   

            else

            echo "Dynatrace agent uninstallation not found"

            fi

else

echo "Set Uninstall to False"

fi

ryan_ott
Dynatrace Mentor
Dynatrace Mentor

Okay, I would think that there may be a way to script out the options I have listed above then. If this is a script that would be run on every server, then I would edit the script to have it check to see if Dynatrace OneAgent files exist, and if they do not, then install the OneAgent. I am not as familiar with Octopus scripting, but it may logically be something like this:

if [ -f "/opt/dynatrace/oneagent/agent/uninstall.sh" ]

    then

              echo "Dynatrace OneAgent already installed."   

    else

            echo "Dynatrace agent uninstallation not found"

            {Insert Linux OneAgent install script}

    fi

ACE Consultant, Dynatrace Services
Dynatrace Certified Professional

Logically it would be similar to what you mentioned.   

 

1. Check if One Agent present.

2. If present (skip host)

3. else Perform One Agent install.

4. Exit script 

 

Do you know the best method to skip the install if agent prresent and install if agent does not exist?

ryan_ott
Dynatrace Mentor
Dynatrace Mentor

The method of checking for the uninstall.sh script would still work, as if that script isn't there you may want to reinstall anyways. 🙂 Otherwise, there is an 'installer.version' file that you could check is present within dynatrace/oneagent/agent directory.

ACE Consultant, Dynatrace Services
Dynatrace Certified Professional

Featured Posts