Discussion Feed
12-04-2019
09:23 AM
1 Kudo
You need to create a startup script. If you're using SysV, you'd just need to create a script in /etc/init.d, and then create a link to that in /etc/rc3.d, starting with a capital 'S', and following with a number, following the standard (the 'S' scrips are executed in order, starting with the lower numbers first). Here's the startup script we use. I believe we got this from AppDynamics directly, but it's been a long while, so it's possible we created it and I just forgot. 🙂 . Sorry for the formatting.. Couldn't get cut and paste to work well. #!/bin/bash # chkconfig: - 85 15 # description: Start and stop AppD Machine Agent # Source function library. . /etc/rc.d/init.d/functions APP_DYN_DIR=/opt/appdynamics APP_DYN_PID=`ps -ef | grep machineagent.jar | grep -v grep | awk ' { print $2 } '` start () { /opt/appdynamics/machineagent/bin/machine-agent -d -p /var/run/agent.pid -j /opt/appdynamics/machineagent/jre } stop () { if [ $APP_DYN_PID ]; then kill -9 $APP_DYN_PID fi } status () { if [ ! -d $APP_DYN_DIR ]; then echo Appdynamics is not installed exit 0 fi if [ $APP_DYN_PID ]; then echo Appdynamics pid $APP_DYN_PID is running else echo Appdynamics is not running fi } case "$1" in start) start ;; stop) stop ;; restart) stop start ;; status) status RETVAL=$? ;; *) echo $"Usage: $0 {start|stop|restart|status}" RETVAL=1 esac exit $RETVAL Put that script in /etc/init.d, make sure it's executable by the root user like so: -rwxr-xr-x. 1 root root 1521 Jun 3 2019 /etc/init.d/appdynamics Then, create a sym link to that file in /etc/rc3.d: /etc/rc3.d/S85appdynamics -> ../init.d/appdynamics If you run chkconfig commands ( chkconfig --add appdynamics, chkconfig --on appdynamics, etc) as well, but I prefer to create the links manually so I can control the startup level. Make sure it starts up after your network services so DNS is up and running before the machine agent attempts to connect to the controller, unless you have a hosts entry for that. You can validate that it's working by running the standard service commands as well: sudo service appdynamics status This will also work with SystemD, though I don't have a sample script as we don't use SystemD on our Linux servers here. Try that, and let me know if you have any other questions on this, ~Ken
... View more
11-27-2019
10:48 PM
1 Kudo
Quick answer as I'm browsing via an intermittent internet connection at the moment.
Are you running this under windows, or a linux environment? For linux, we use the appdynamics service for the machine agent, and have that linked to /etc/rc3.d as a typical service.. I imagine you could do the same via a systemd service as well, though we haven't done so ourselves as of yet. Either way, if you have the service installed, it's pretty straightforward to set up. I'd recommend you start it after your network services though, as it will probably need DNS to function to find the controller, or the agent won't start.
For windows, I believe it's a service so you could set it to auto-start via the services application.
Hope that helps,
~ken
... View more
Latest Activity
- Got a Kudo for Re: Machine Agent not working after Server reboot. 12-04-2019 01:18 PM
- Posted Re: Machine Agent not working after Server reboot on Java (Java Agent, Installation, JVM, and Controller Installation). 12-04-2019 09:23 AM
- Got a Kudo for Re: Does the machine agent restart automatically restart after a server reboot?. 12-02-2019 10:37 AM
- Posted Re: Does the machine agent restart automatically restart after a server reboot? on Java (Java Agent, Installation, JVM, and Controller Installation). 11-27-2019 10:48 PM
Community Stats
Date Registered | 12-17-2012 02:03 PM |
Date Last Visited | 12-13-2019 12:03 AM |
Total Messages Posted | 3 |
Total Kudos Received | 2 |