Discussion:
[rancid] Can someone tell me why the second expect isn't being executed ?
Mr. James W. Laferriere
2008-05-20 21:41:02 UTC
Permalink
Hello All , This one is not making sense to me , expect see's
"$prompt" & and sends "show version\r" , But neither see's the regexp
"^Image.stamp.*" nor (of course) follows up with the send ...
Any insights are helpful . Tia , JimL

send "\r"
expect {
"$prompt" { send "show version\r" }
-re "^Image.stamp.*" { send "this stinks\r\n\n" }
}


Given the Following output ...
VH-SW01# show version
Image stamp: /sw/code/build/info(s02)
Feb 26 2007 09:30:56
F.05.59
1194
VH-SW01#
--
+------------------------------------------------------------------+
| James W. Laferriere | System Techniques | Give me VMS |
| Network&System Engineer | 2133 McCullam Ave | Give me Linux |
| ***@baby-dragons.com | Fairbanks, AK. 99701 | only on AXP |
+------------------------------------------------------------------+
Austin Schutz
2008-05-20 22:01:22 UTC
Permalink
Post by Mr. James W. Laferriere
Hello All , This one is not making sense to me , expect see's
"$prompt" & and sends "show version\r" , But neither see's the regexp
"^Image.stamp.*" nor (of course) follows up with the send ...
Any insights are helpful . Tia , JimL
send "\r"
expect {
"$prompt" { send "show version\r" }
-re "^Image.stamp.*" { send "this stinks\r\n\n" }
^

I would suspect the anchor is probably not valid, since the buffer
probably contains data before that. A health dose of the -d flag (sets
exp_internal) would help show what is being matched.

Austin
Mr. James W. Laferriere
2008-05-21 00:00:09 UTC
Permalink
Hello (whomever, tho probaby) JohnH ,
I've made an attempt to check between switch & routers of the procurve
persuasion with this patch to this script .
There are probably better ways of doing this than I have implemented ,
Please comment with code (even pseudeo) .
Find it attached to prevent mailer mangle .

Tia , JimL
--
+------------------------------------------------------------------+
| James W. Laferriere | System Techniques | Give me VMS |
| Network&System Engineer | 2133 McCullam Ave | Give me Linux |
| ***@baby-dragons.com | Fairbanks, AK. 99701 | only on AXP |
+------------------------------------------------------------------+
Mr. James W. Laferriere
2008-05-21 18:09:23 UTC
Permalink
Hello All ,
Post by Mr. James W. Laferriere
I've made an attempt to check between switch & routers of the
procurve persuasion with this patch to this script .
There are probably better ways of doing this than I have implemented
, Please comment with code (even pseudeo) .
Find it attached to prevent mailer mangle .
An updated patch to try & shorten the path & make the checks a bit more
portable for the varying hp devices . please comment .

Again , Find it attached to prevent mailer mangle .
Tia , JimL
--
+------------------------------------------------------------------+
| James W. Laferriere | System Techniques | Give me VMS |
| Network&System Engineer | 2133 McCullam Ave | Give me Linux |
| ***@baby-dragons.com | Fairbanks, AK. 99701 | only on AXP |
+------------------------------------------------------------------+
Mr. James W. Laferriere
2008-05-21 20:26:47 UTC
Permalink
Hello All , Can someone among you's point at where in hlogin may be the
culprit ? My diagnostic skill(s) are faded today , insufficient sleep .

# hlogin -c "show run" vh-sw01a > hlogin-chomp.log

The chomp off is quite visiable . Below is the part that is missing .
I don't see anything in the output that might cause this to happen .
This is with the patch I sent earier today , I'll try it without as
well .
Tia , JimL

VH-SW01# sh run

Running configuration:

; J4813A Configuration Editor; Created on release #F.05.59

hostname "VH-SW01"
snmp-server contact "HelpDesk ***@denalistatebank.com x300"
snmp-server location "VH - switch room - 1st Fl
--
+------------------------------------------------------------------+
| James W. Laferriere | System Techniques | Give me VMS |
| Network&System Engineer | 2133 McCullam Ave | Give me Linux |
| ***@baby-dragons.com | Fairbanks, AK. 99701 | only on AXP |
+------------------------------------------------------------------+
Mr. James W. Laferriere
2008-05-21 23:52:32 UTC
Permalink
Hello All ,
Post by Mr. James W. Laferriere
Hello All , Can someone among you's point at where in hlogin may be
the culprit ? My diagnostic skill(s) are faded today , insufficient sleep .
# hlogin -c "show run" vh-sw01a > hlogin-chomp.log
The chomp off is quite visiable . Below is the part that is missing .
I don't see anything in the output that might cause this to happen .
This is with the patch I sent earier today , I'll try it without as
well .
An updated patch(attached) that (seems) to fix the chomp'ng .
Please review & Comment .

Tia , JimL
--
+------------------------------------------------------------------+
| James W. Laferriere | System Techniques | Give me VMS |
| Network&System Engineer | 2133 McCullam Ave | Give me Linux |
| ***@baby-dragons.com | Fairbanks, AK. 99701 | only on AXP |
+------------------------------------------------------------------+
Loading...