shell script to take inputs and run some test and do some health checking
$10-30 USD
Closed
Posted over 4 years ago
$10-30 USD
Paid on delivery
Need a shell script which should run on Linux
The command step I should run is
All the values mentioned below are totally and example base
[ ./[login to view URL] dev-acs-test-blue 26.1.0+2019-06-10-232918 ]
First is the environment and second is version number
(this is just an example input to the shell values will be different each time)
Here the shell script in linux should pick the value “dev-acs-test-blue” and the version “26.1.0+2019-06-10-232918” as the input
And do steps step1:
Inputparamter= dev-acs-test-blue
inputversion= 26.1.0+2019-06-10-232918
instance_id= $(aws autoscaling describe-auto-scaling-groups --auto-scaling-group-name $Inputparamter --query 'AutoScalingGroups[*].Instances[*].[InstanceId]' --output text)
FROM THE ABOVE COMMAND WE MAY GET MULTIPLE OUTPUTS, THIS OUTPUTS ARE AWS INSTANCES ID, SO THIS ID HAVE TO RETRIVE PRIVATE IP address
private__ip = $(aws ec2 describe-instances --instance-id $instance_id --query 'Reservations[*].Instances[*].[PrivateIpAddress]' --output text)
THE PRIVATE IP OUT IS DERIVED
WE NEED TO DO TEST NOW
check1= curl 'http://'$private__ip':80/health' | jq '.status' | tr -d '"'
check2= curl 'http://'$private__ip':80/health' | jq '.version'| tr -d '"'
wait until ( check1 == “OK” && check2 == “$inputversion” )
(HERE IT HAS TO SLEEP TILL THE OUTPUTS ARE RIGHT)
(IF THE OUT PUT IS SUCCESS, WE HAVE TO START THE LOOP AGAIN AT THE INSTANCES_ID and pick the second ID)
(THIS LOOP HAS TO BE DONE TILL ALL THE INSTANCE ARE READ AND TESTED AND SUCCESSFULLY )
If all the instances are read, it will exit successfully
The end of the code, we are checking for the health of all the instances with specific parameter
Hey there,
I'm a Systems Engineer with coding skills.
I have been working with Linux/Unix-systems for years.
I had developed tons of Shell scripts.
I can help.
Regards.
Hi,
I can create a shell script for the above requirement. I just want to confirm if the commands listed in the project description are correct. If those are the steps then its easy to wrap into a shell script.
Thanks
Hello,
I am a senior linux administrator and I have written hundreds of bash scripts. I can help you write the script you need to launch instances and check every instance is up and running.
Contact me by chat for further details.
Thank you.
Hi,
My name is sachin and i am a system administrator with over 7 years of hands on experience. Along with System Administration and automation expect i am a EC-Council Certified Ethical Hacker CEH and i am aware of all of the latest critical vanuerabilies in windows environment like BlueKeep.
You can DM me to discuss more about the project and i will deliver it to you with in the specified time window. If you are not sure about hiring me then you can keep the project open and assign me 2 days of time window via. chat to deliver the project. If you like my script then you can award the project to me and proceed further with the payment.
Thanks & Warm Regards.
(sachin Etical hacker
I can work for you with respect to this script also can suggest you some ideas for other scripting as well. Here if you can do the ad and DNS mapping then without ip grasp also you can do this . Again as per your requirement we can take inputs as script arguments, but my suggestion will be to use tags and use those tags for such health check. This way if you want to test health check of let's say prod it won't have any change . It will become a interactive script you just need to enter your environment value which is also a tag value and rest of the work is done.
I am working as devops engineer in a multinational company in india. i have 10 years of experience in IT.
My suggestion is we need a threshold for checking ok status here.. if any of the instance goes wrong the script will keep on waiting till it gets a ok response and will be a trouble. One solution is to skip the wait time after particular time and provide a final report for all instances