Discussion:
[rancid] Custom Device Login File (mrvlogin)
Keith Calligan
2009-07-08 15:20:48 UTC
Permalink
Hi,



I'm trying to modify the existing mrvlogin script to work with MRV
terminal server devices. It appears that this (original) script and
mrvrancid may have been written for another device by the same
manufacturer. I've made some progress, but am having issues saving any
output and exiting completely.



I'm issuing the following command

./mrvlogin -d -t 90 -c "show version" $devicename



Here is some debug information. I'm showing the last line of the "show
version" and the parts that are failing. The prompt for these devices
is set to "InReach:0 >". The exit is getting sent, but I'm seeing lots
of empty lines trying to be matched (""). Please note that I replaced
the real hostname with $device in this debug output.





expect: set expect_out(buffer) " Software Version (Flash):
Software Version (Flash):
3.9.0

Ppciboot Version:
3.9.0

InReach:0 >}



expect: does "" (spawn_id exp6) match regular expression "^[^\n\r
*]*InReach:0 ([^#>\r\n]+)?>(\([^)\r\n]+\))?"? no

"[\n\r]+"? no

exit

expect: does "exit" (spawn_id exp6) match regular expression "^[^\n\r
*]*InReach:0 ([^#>\r\n]+)?>(\([^)\r\n]+\))?"? no

"[\n\r]+"? no



Disconnected



expect: does "exit\u001b[H\u001b[2J\r\nDisconnected\r\n" (spawn_id exp6)
match regular expression "^[^\n\r *]*InReach:0
([^#>\r\n]+)?>(\([^)\r\n]+\))?"? no

"[\n\r]+"? yes

expect: set expect_out(0,string) "\r\n"

expect: set expect_out(spawn_id) "exp6"

expect: set expect_out(buffer) "exit\u001b[H\u001b[2J\r\n"

expect: continuing expect



expect: does "Disconnected\r\n" (spawn_id exp6) match regular expression
"^[^\n\r *]*InReach:0 ([^#>\r\n]+)?>(\([^)\r\n]+\))?"? no

"[\n\r]+"? yes

expect: set expect_out(0,string) "\r\n"

expect: set expect_out(spawn_id) "exp6"

expect: set expect_out(buffer) "Disconnected\r\n"

expect: continuing expect



expect: does "" (spawn_id exp6) match regular expression "^[^\n\r
*]*InReach:0 ([^#>\r\n]+)?>(\([^)\r\n]+\))?"? no

"[\n\r]+"? no

Connection to nmd-mgmt-jfk-tsrv1 closed.



expect: does "Connection to $device \r\r\n" (spawn_id exp6) match
regular expression "^[^\n\r *]*InReach:0
([^#>\r\n]+)?>(\([^)\r\n]+\))?"? no

"[\n\r]+"? yes

expect: set expect_out(0,string) "\r\r\n"

expect: set expect_out(spawn_id) "exp6"

expect: set expect_out(buffer) "Connection to nmd-mgmt-jfk-tsrv1
closed.\r\r\n"

expect: continuing expect



expect: does "" (spawn_id exp6) match regular expression "^[^\n\r
*]*InReach:0 ([^#>\r\n]+)?>(\([^)\r\n]+\))?"? no

"[\n\r]+"? no

expect: read eof

expect: set expect_out(spawn_id) "exp6"

expect: set expect_out(buffer) ""

write() failed to write anything - will sleep(1) and retry...



I'm still new to using Rancid so please bear with me. If you need me to
send my mrvlogin script, I can do that as well. I think I'm pretty
close to getting it working but not sure what I'm missing.





Thanks,



Keith Calligan

***@ptgcorp.com




---------------------------------------------
This e-mail, along with any documents, files or attachments, is confidential and may contain
legally privileged information, and is intended only for the use of the recipient(s) on
the distribution. If you are not the intended recipient(s), you are hereby notified that
any dissemination, distribution or copying of any information contained in or attached
to this communication is strictly prohibited; instructed to immediately notify the sender
by return email or by a phone call to the sender; and required to delete this message from
your computer and network.
Note: e-mails are susceptible to corruption, interception and unauthorized amendment;
we do not accept liability for any such changes, or for their consequences.
We reserve the right to monitor all e-mails and their content.
john heasley
2009-07-08 17:44:15 UTC
Permalink
Post by Keith Calligan
expect: does "" (spawn_id exp6) match regular expression "^[^\n\r
*]*InReach:0 ([^#>\r\n]+)?>(\([^)\r\n]+\))?"? no
"[\n\r]+"? no
expect: read eof
expect: set expect_out(spawn_id) "exp6"
expect: set expect_out(buffer) ""
write() failed to write anything - will sleep(1) and retry...
you've tried to write to a dead/closed pty.
Gil
2013-06-04 14:51:19 UTC
Permalink
Post by john heasley
Post by Keith Calligan
expect: does "" (spawn_id exp6) match regular expression "^[^\n\r
*]*InReach:0 ([^#>\r\n]+)?>(\([^)\r\n]+\))?"? no
"[\n\r]+"? no
expect: read eof
expect: set expect_out(spawn_id) "exp6"
expect: set expect_out(buffer) ""
write() failed to write anything - will sleep(1) and retry...
you've tried to write to a dead/closed pty.
_______________________________________________
Rancid-discuss mailing list
Rancid-discuss <at> shrubbery.net
http://www.shrubbery.net/mailman/listinfo.cgi/rancid-discuss
Hi ,

I created a new file rancid with commands for mrv Os-9xx
When I try :

[***@nms-rancid bin]mrvlogin cust-52428-os912dc2-1

The process is fine …

cust-52428-os912dc2-1
spawn telnet cust-52428-os912dc2-1
Trying 172.20.101.16...
Connected to cust-52428-os912dc2-1.
Escape character is '^]'.

************************************************
*you are connection to CUST-CL52428-OS912DC2-sw-1*
*unauthorized access is strictly prohibited ****
************************************************

CUST-CL52428-OS912DC2-sw-1 login: admin
Password:
Last login: Tue Jun 4 17:29:27 2013 on pts/0

ATTENTION: LOGOUT timeout is set to 20 min.
CUST-CL52428-OS912DC2-sw-1>

In this stage when I need to enter a command there is no response !!!

CUST-CL52428-OS912DC2-sw-1>show clock
(nothing happened)

sh
sdfgsdfg
gdgdfg
hfghfgh
fghfh
^C or Error: TIMEOUT reached

Do someone familiar with this problem ?

Any ideas ?

Loading...