cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1157
Views
9
Helpful
9
Replies

Used ports export to a file

msfch4geneva
Level 1
Level 1

Hi all,

I need to know which ports are used on my switches and I want to export the result in a file. I tried the following command:

sh int | include connected | tee tftp://myIp/test.txt

The command execute itself without error but also doesn't create the test.txt file on the computer assigned by myIp.

When I tried:

sh int | tee tftp://myIp/test.txt it worked well, but the file is way too big and I have to work on it to extract the informations I need.

Is there a way to obtain the desired result in one command.

Thanks in advance, bye

1 Accepted Solution

Accepted Solutions

You're welcome.

Unfortunately you can't use the pipe like it can be used in Linux that's why your first command didn't write anything on the tftp server. But you can grep the output of sh int status for the word connected and it should be good.

Regards.

Alain.

Don't forget to rate helpful posts.

View solution in original post

9 Replies 9

cadet alain
VIP Alumni
VIP Alumni

Hi,

You could try sh int status | tee tftp://x.x.x.x

Regards.

Alain.

Don't forget to rate helpful posts.

Thanks Alain,

It is not the exact result I would, but this command creates a file easier to manage for me. Thanks a lot for your fast answer.

Regards

You're welcome.

Unfortunately you can't use the pipe like it can be used in Linux that's why your first command didn't write anything on the tftp server. But you can grep the output of sh int status for the word connected and it should be good.

Regards.

Alain.

Don't forget to rate helpful posts.

Yes, it is the solution I used

One more thanks, Alain.

Regards

Balthazar,

You could give this a try, it should give you what you want.

add this to the config

alias exec sisc show interface status | include connected

then run this to get the output.

sisc | tee tftp://mylp/test.txt

That should work.

Mike

Hi mike,

Well thought off indeed 

I rate you 5 for this.  Oups i can't rate you at least I can't see the rating

Regards.

Alain.

Don't forget to rate helpful posts.

Mike, that was a good idea.  Alain, I'll take care of Mike's rating for you.

This opens up a random question for me, Mike. In lieu of the multi-piping grep ablility that you have in linux, is it possible to create an alias that references another alias to get a similar effect?

Hello Mike (Burleyman),

I am sorry, I tried your solution, but I have the same result as described in my first message. I don't receive any error message, but I don't receive desired result.

Have you tried your solution ? Does it work for you ?

Thanks in advance