python basic script
Budget: €30 – €250 EUR
I would like to create a script that prompt the user the type of product and the component of it, and as a result he provide the list of commands to use for the troubleshooting
I do have already the list of products, components and related troubleshooting commands
what the script supposed to do:
the script prompt for: which product you are troubleshooting?
the user should see the list of products with a number close to each product
user is supposed to select the product by typing the related number close to it
the script is supposed to ask: which is the component you are troubleshooting?
the user should see the list of components with a number close to each component
user supposed to select the component typing the related number close to it
the script suppose to provide the list of commands to use during the troubleshooting
the script supposed to ask for:
which is your name?
save the value in a variable
which is your lastname?
save the value in a variable
which is the ip of the server you are troubleshooting?
user is supposed to insert the ip address
which is the server access_id?
save the value in a variable
the script supposed to start and ssh session into the server (considering the hostname is always the same)
the command supposed to be something like
ssh name.lastname,access_id@server_ip -p 2222
sample list of products:
1 email_gateway
2 web_gateway
sample list of component
1 authentication
2 proxy
sample list of troubleshooting commands: (note the authentication commands changes according to the product selection)
tcpdump -envvi any -s0 -w /tmp/capture_$(date +"%Y_%m_%d_%I_%M_%p").pcapng -b &tail -f /var/log/httpd.log > /tmp/httpd_$(date +"%Y_%m_%d_%I_%M_%p").log & tail -f /var/log/http.log > /tmp/http_$(date +"%Y_%m_%d_%I_%M_%p").log & tcpdump -envvi <wan_interface> -s0 -w /tmp/capture_wan_$(date +"%Y_%m_%d_%I_%M_%p").pcap -b & tcpdump -envvi <local_interface> -s0 -w /tmp/capture_lan_$(date +"%Y_%m_%d_%I_%M_%p").pcap -b & tail -f /var/log/packetfilter.log > /tmp/packetfilter_$(date +"%Y_%m_%d_%I_%M_%p").log
jobs
kill %1
kill %2
kill %3
kill %4
kill %5
jobs
curl --ftp-ssl ftp://ftp.sophos.com:990 -u <username>:<password> -v -T {/tmp/capture*.pcapng,/tmp/httpd*.log,/tmp/http*.log,/tmp/capture_wan*,/tmp/capture_lan*}
I do have already the list of products, components and related troubleshooting commands
what the script supposed to do:
the script prompt for: which product you are troubleshooting?
the user should see the list of products with a number close to each product
user is supposed to select the product by typing the related number close to it
the script is supposed to ask: which is the component you are troubleshooting?
the user should see the list of components with a number close to each component
user supposed to select the component typing the related number close to it
the script suppose to provide the list of commands to use during the troubleshooting
the script supposed to ask for:
which is your name?
save the value in a variable
which is your lastname?
save the value in a variable
which is the ip of the server you are troubleshooting?
user is supposed to insert the ip address
which is the server access_id?
save the value in a variable
the script supposed to start and ssh session into the server (considering the hostname is always the same)
the command supposed to be something like
ssh name.lastname,access_id@server_ip -p 2222
sample list of products:
1 email_gateway
2 web_gateway
sample list of component
1 authentication
2 proxy
sample list of troubleshooting commands: (note the authentication commands changes according to the product selection)
tcpdump -envvi any -s0 -w /tmp/capture_$(date +"%Y_%m_%d_%I_%M_%p").pcapng -b &tail -f /var/log/httpd.log > /tmp/httpd_$(date +"%Y_%m_%d_%I_%M_%p").log & tail -f /var/log/http.log > /tmp/http_$(date +"%Y_%m_%d_%I_%M_%p").log & tcpdump -envvi <wan_interface> -s0 -w /tmp/capture_wan_$(date +"%Y_%m_%d_%I_%M_%p").pcap -b & tcpdump -envvi <local_interface> -s0 -w /tmp/capture_lan_$(date +"%Y_%m_%d_%I_%M_%p").pcap -b & tail -f /var/log/packetfilter.log > /tmp/packetfilter_$(date +"%Y_%m_%d_%I_%M_%p").log
jobs
kill %1
kill %2
kill %3
kill %4
kill %5
jobs
curl --ftp-ssl ftp://ftp.sophos.com:990 -u <username>:<password> -v -T {/tmp/capture*.pcapng,/tmp/httpd*.log,/tmp/http*.log,/tmp/capture_wan*,/tmp/capture_lan*}