Project Description:
I need a perl script that will look at the IP address of the local machine and then execute command(s) on a _remote host_ that has a shared SSH key and verify that the commands executed successfully before the script continues.
1. Get Localhost IP address (ie. 10.1.2.60)
2. Via SSH Remove host from LVS Pool (lvs pool should be a variable ie. 10.1.1.110)
a. ipvsadm -e -t 10.1.1.110:80 -r 10.1.2.60:80 -w 0 (if the command executed successfully then wait 5 minutes)
3. On Localhost stop tomcat, if tomcat does not stop gracefully kill tomcat
4. Verify no Java or Tomcat processes are running
5. Start tomcat
6. Via SSH Add host to LVS Pool (lvs pool is 1.1.1.110)
a. ipvsadm -e -t 10.1.1.110:80 -r 10.1.2.60:80 -w 1