09-02-2013 02:17 PM
I am trying to implement a automated health check script on a 5300 san switch with FOS 6.3.1A
I have managed to configure public key DSA login to automate the login from from the host to the switch and the automated login works fine.
Now, once the login completes, I want the script to issue a couple of show commands like switchshow & switchstatusshow and redirect their output to text files on the host. I will then automate the mailing of this output to me so that we can perform a health check on the switch.
Since I am new to scripting, I need help on how to configure this part.
So Far my script ( which is absolutely basic) looks like this ( and obviously it does not work!)
|ssh test@switchIP||# this works and the prompt comes to the switch login and stops here|
switchshow > switchshow_results # need help in integrating this part into the script execution
|switchstatusshow > switchsstatusshow_results||# need help in integrating this part into the script execution|
Any help in this matter will be appreciated.
Thanks a ton in advance!
09-03-2013 01:28 AM
You can add command parameters to your ssh syntax to execute a command remotely.
Then you only need to capture the output.
Mind you I actually have never tried this myself.