Resolving IP Address Mismatch Issue in Autoscaling Groups: A Guide for Monitoring Tool Agents Example Appdynamics

This blog is applicable for all monitoring tool agents installed on machines, such as AppDynamics, Telegraf, New Relic, etc.

Taking AppDynamics as an example,

In our case, we had previously hardcoded the IP address in the controller-info.xml file. However, when autoscaling starts, a new machine is launched and the old one is terminated, resulting in a different IP address for the new machine. This prevents the new machineโ€™s data from being displayed in AppDynamics. To resolve this issue, follow these stepsโ€ฆ

STEP 1

#!/bin/bash
#Create a file
touch /root/appd_nodename.sh

#paste the below content this will update the current Ip of the machine on the provided config file in this example it's controller-info.xml
HOST_IP=$(hostname -I | awk '{print $1}')
sed -i "s/hostname = .*/hostname = \"$HOST_IP\"/" /app/appd/ver22.1.0.33445/conf/controller-info.xml

STEP 2

crontab -e

paste the below content
@reboot /root/appd_nodename.sh

STEP 3

#Validate the cron jobs get created
crontab -l

Now, you can create an Amazon Machine Image (AMI) from the instance, update the launch template, and refresh the autoscaling group. This will ensure that the new instances launched by the autoscaling group will have the correct configuration, including the updated launch template, and the issue related to the IP address mismatch can be resolved.

--

--

๐’๐š๐ค๐ž๐ญ ๐‰๐š๐ข๐ง

๐ƒ๐ž๐ฏ๐Ž๐ฉ๐ฌ/๐’๐‘๐„/๐‚๐ฅ๐จ๐ฎ๐ /๐ˆ๐ง๐Ÿ๐ซ๐š๐ฌ๐ญ๐ซ๐ฎ๐œ๐ญ๐ฎ๐ซ๐ž /๐’๐ฒ๐ฌ๐ญ๐ž๐ฆ ๐„๐ง๐ ๐ข๐ง๐ž๐ž๐ซ