01-08-2013 02:44 AM
I am trying to send the output from our brocade switches to a remote host. I want to be able to write scripts that will use awk, sed, grep etc to filter out information. Maybe I can scp to the brocade switch from a remote unix host and run commands but I would need to have an authorized_hosts and allow remote logins configured on the brocade. Is any of this possible?
01-08-2013 03:31 PM
I'm not sure if I understood what you want to do... If I would like to do that I would simply log in via root. There you have most of the little helpers from the underlying Linux.
02-19-2013 06:43 AM
From within FOS, is there anything available similar to the following:
uptime > c:\testing\uptime.txt (to create)
uptime >> c:\testing\uptime.txt (to append)
I have several commands I'd like to run and output to individual files.
02-19-2013 06:49 AM
This is what is displayed when attempted
switch1:FID128:admin> uptime > c:\healthcheck\uptime.txt
rbash: c:healthcheckuptime.txt: restricted: cannot redirect output
02-19-2013 07:31 AM
two reasons for what you see:
1) that's linux, so things like c:\ do not exist there
2) that's rbash - Restricted shell - Wikipedia, the free encyclopedia
to use redirection right inside the switch prompt, you have to be root.
alternatively, you can use on your workstation something like:
ssh admin@your_switch_name_or_ipaddress uptime >> uptime.txt
this will create uptime.txt - on your workstation.
02-19-2013 07:39 AM
Well that answers a portion of my question. The problem is, is that I am creating custom scripts for automation of 6 or 7 commands with custom save files for each command to run daily, so this wont work.
I am using Putty accessed through a spreadsheet with hundreds of devices. Simple macros call each device and start the command process with pointers to hostname, date, time, and command.txt files as output.
It's been a while since I've puttied into a linux box from a windows system, but I could swear I could redirect the output to my windows system...
02-21-2013 01:32 PM
In order to redirect the output to a text file you need plink:
Then you need to either add the directory where you have saved plink to the path in your environment variables or just go to the right directory.
With plink you can execute ssh commands in batch mode.
For switchshow it would like that:
plink.exe -ssh -pw password user@switch switchshow > c:\brocade\switchshow.txt