cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1755
Views
5
Helpful
1
Replies

Nexus 7000 / 5000 : Running commands from script on Linux server

seba
Level 1
Level 1

Hello

We have several scripts to get certain information from Catalyst 6500 , 4500 and 3750 swichtes. We use rcmd.

We're trying to modify those scripts so we can get information from New NExus 7000 (version 6.0(3)) and NExus 5548.

I'm afraid that Nexus don't support rcmd or rsh.

Is there any other way to run a command (for example "show interface ethernet 1/14 | include discard") from an external server so we can develop new scripts.

Thank you

1 Reply 1

Oleksandr Nesterov
Cisco Employee
Cisco Employee

Hi Seba.

I use expect to get outputs from boxes in the lab:

#!/usr/bin/expect #Where the script should be run from.

foreach x {nex1 nex2 nex3} {

set name $x

set user your_USERNAME

set password your_PASS

spawn telnet -K $name

expect "login:"

send "$user\n"

expect "Password:"

send "$password\n"

send "sh version | egrep kickstart:|system: \n"

send "exit\n"

interact

}

#done

HTH,

Alex

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: