Sponsored Content
Top Forums Shell Programming and Scripting Bash script failed with expect on cisco routers Post 302649695 by bedomon on Friday 1st of June 2012 02:06:32 AM
Old 06-01-2012
I try "send en\r" instead of spawn en but it didn't work too.

edit : Yes the en command is an alias for the enable password on cisco (like sudo on linux)

Last edited by bedomon; 06-01-2012 at 04:13 AM..
 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Need help with Expect script for Cisco IPS Sensors, Expect sleep and quoting

This Expect script provides expect with a list of IP addresses to Cisco IPS sensors and commands to configure Cisco IPS sensors. The user, password, IP addresses, prompt regex, etc. have been anonymized. In general this script will log into the sensors and send commands successfully but there are... (1 Reply)
Discussion started by: genewolfe
1 Replies

2. Shell Programming and Scripting

Expect/telnet/testing tacacs on a cisco

At times I find the need to test that the tacacs port 49 is open. The code below works but is painfully slow because I have to wait on the timeouts. Examples of possible responds router1#telnet 10.11.20.14 49 Trying 206.112.204.140, 49 ... Open route1#telnet 10.11.19.14 49 Trying... (1 Reply)
Discussion started by: popeye
1 Replies

3. Shell Programming and Scripting

expect in bash script

Hi, I'm writing a shell script that calls a few commands that prompt the user for two simple yes/no questions. if the answers are consistent (the first is a yes, the second is a no), what would my expect script look like? Google is only giving me answers for scripts where I telnet or ssh. right now... (3 Replies)
Discussion started by: js741
3 Replies

4. Shell Programming and Scripting

Perl Telnet cisco routers

Hi all i have little problem finding solution about simple telnet script .... i have 250 routers and on some i have different password and on some they ask just for password no username. So for example 1,2,3 have username and password (user,password) 4, and 5 have different username and password... (0 Replies)
Discussion started by: IvanMP
0 Replies

5. Shell Programming and Scripting

Expect script to show cisco configs

I know there are better ways to do this. I prefer snmp. I do not have the proper perl modules loaded on the platorm. Snmp isnt loaded on the platform. Telnet is not an option. I need to write an expect script to pull cisco equipment configs. The following code is executed once I gain... (0 Replies)
Discussion started by: popeye
0 Replies

6. Shell Programming and Scripting

Bash script with expect

Dear all Hi I want use expect in bash so that we can not use these with each other /bin/bash. With. /usr/bin/expect How can use these with on script or how can call a script from other script #!/bin/bash clear echo "================================== " echo "Enter your Esxi IP"... (3 Replies)
Discussion started by: Baber
3 Replies

7. Shell Programming and Scripting

Bash Script Locate Word Failed

I'm using CentOS 7 and I would like to know of a way to read each line and search for a specific word. For example, if it finds the word "Fail" it sends it to a variable, and pipes it to a folder on the network. What would be the best way in making this work in a Linux environment? I wrote a... (1 Reply)
Discussion started by: SysAdminRialto
1 Replies

8. UNIX for Advanced & Expert Users

Bash script + expect

im very happy to back for this forum I have servers with alias of double dns extentions: sample: servera.test.com servera.test1.com serverb.test.com serverb.test1.com I need to login to that severs and executing the set of commands if test.com failed then try to login via... (0 Replies)
Discussion started by: prakash0106
0 Replies

9. Shell Programming and Scripting

Cisco, 2 ssh logins for expect /bash

HI all i need to connect to about 900 cisco routers and switch to do some configs changes. the issue i am having is that half the devices have one set of username and password and the other half have another username and password. From expect or bash script i can ssh into a device and make... (0 Replies)
Discussion started by: quintin
0 Replies
Net::CLI::Interact::Manual::Phrasebook(3pm)		User Contributed Perl Documentation	       Net::CLI::Interact::Manual::Phrasebook(3pm)

NAME
Net::CLI::Interact::Manual::Phrasebook - List of Supported CLIs INTRODUCTION
The bundled phrasebook includes support for a variety of network device CLIs. Many were contributed by users of the module. If you set up a new CLI dictionary, please consider contributing it back! The phrasebook specification is given in Net::CLI::Interact::Phrasebook. For each supported CLI, there is a name which must be passed in the "personality" option to Net::CLI::Interact's "new()" method. After that, you can call the included Macros, and the module will use the included Prompt to match the current state of the CLI. More information is available in the Tutorial and Cookbook. Below is a list of all current bundled CLI dictionaries. Each lists its name, the available Prompts, Macros and Continuations, and from which other CLI dictionaries it inherits. IOS # Cisco IOS CatOS # for older, pre-IOS Cisco devices PIXOS # for PIX OS-based devices PIXOS7 # Slightly different commands from other PIXOS versions FWSM # currently the same as 'PIXOS' FWSM3 # for FWSM Release 3.x devices (slightly different to FWSM 2.x) JunOS # Juniper JUNOS support HP # HP support Nortel # Nortel support ExtremeOS # Extreme Networks support Foundry # Foundry/Brocade device support PERSONALITIES
Cisco This personality goes by the name of "cisco" and provides a basis for many other CLI dictionaries. Prompts are "basic", "privileged", "configure", "user", and "pass". Macros are "begin_privileged", "end_privileged", "begin_configure", "end_configure", and "disconnect". CatOS This personality goes by the name of "catos" and inherits from the "cisco" dictionary. Additionally it provides the "privileged" Prompt. Additionally it also provides the "paging" Macro to set the terminal page size. ExtremeOS This personality goes by the name of "extremeos" and inherits from the "cisco" dictionary. Additional Prompts are "basic", "privileged", "configure", "user", and "pass". Additional Macros are "begin_privileged", "end_privileged", and "disconnect". Foundry / Brocade This personality goes by the name of "foundry" and inherits from the "cisco" dictionary. Before connecting to the device you probably want to set the output separator to be: $nci->transport->ors(" "); For users of Net::Appliance::Session this should be: $session_obj->nci->transport->ors(" "); IOS This personality goes by the name of "ios" and inherits from the "cisco" dictionary. Additionally it provides the "paging" Macro to set the terminal page size. HP This personality goes by the name of "hp" and inherits from the "cisco" dictionary. Additionally it provides the "basic" and "user" Prompts. JunOS This personality goes by the name of "junos" and inherits from the "cisco" dictionary. Additionally it provides the "privileged", "configure", and "user" Prompts. Additionally it also provides the "begin_configure" and "paging" Macros. Nortel This personality goes by the name of "nortel" and inherits from the "cisco" dictionary. Additionally it provides the "user" Prompt. PIXOS This personality goes by the name of "pixos" and inherits from the "cisco" dictionary. Additionally it provides the "paging" Macro to set the terminal page size. It can be used in its own right for Cisco PIX firewalls, but is also used as a base for other dictionaries. PIXOS 7 This personality goes by the name of "pixos7" and inherits from the "pixos" dictionary. Additionally it provides the "paging" Macro to set the terminal page size. FWSM This personality goes by the name of "fwsm" and inherits from the "pixos" dictionary. It provides no further functionality, as Cisco FWSM software version 1 and 2 was the same as the PIX OS. FWSM 3 This personality goes by the name of "fwsm3" and inherits from the "pixos" dictionary. Additionally it provides the "paging" Macro to set the terminal page size. perl v5.14.2 2012-06-12 Net::CLI::Interact::Manual::Phrasebook(3pm)
All times are GMT -4. The time now is 12:43 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy