[rancid] Problems with hpuifilter / hlogin

Brian Candler b.candler at pobox.com
Fri May 19 14:54:33 UTC 2017


Back in 2015, I submitted a fix to hpuifilter:
http://www.shrubbery.net/pipermail/rancid-discuss/2015-December/008823.html

This was incorporated into rancid 3.3.0.  Unfortunately, rancid 3.3.0 
from Ubuntu 16.04 still doesn't work with HP, and it turns out there are 
a couple of problems.

(1) When the patch was merged, it seems an error was added in 
bin/hpuifilter.c, function complete_esc(). The line which now says

                 return(i + 10);

should have been

                 return(i + 1);

That's a simple fix to make, and still is apparently required in 3.6.2. [^1]

(2) hlogin from 3.3.0 was having problems with the prompt, which I was 
able to replicate like this to a J9775A:

/usr/lib/rancid/bin/hlogin -d -t 20 -c"show version;show flash;show 
system-information;show system information;show module;show stack;show 
tech transceivers;show config files;show config status;write term" 
ix-edgesw-r1b1b.int.example.net

...

send: sending "no page\r" to { exp5 }
Gate keeper glob pattern for 'ix-edgesw-r' is 'ix-edgesw-r'. Activating 
booster.
Gate keeper glob pattern for '[
]+' is ''. Not usable, disabling the performance booster.

expect: does "" (spawn_id exp5) match regular expression "ix-edgesw-r"? 
Gate "ix-edgesw-r"? gate=no
"[\n\r]+"? (No Gate, RE only) gate=yes re=no
no page
ix-edgesw-r1b1b#
expect: does "no page\r\r\nix-edgesw-r1b1b# " (spawn_id exp5) match 
regular expression "ix-edgesw-r"? Gate "ix-edgesw-r"? gate=yes re=yes
expect: set expect_out(0,string) "ix-edgesw-r"
expect: set expect_out(spawn_id) "exp5"
expect: set expect_out(buffer) "no page\r\r\nix-edgesw-r"
Gate keeper glob pattern for 
'ix-edgesw-r([^#>\r\n]+)?[#>](\\([^)\\r\\n]+\\))?' is 'ix-edgesw-r*'. 
Activating booster.
Gate keeper glob pattern for 'Invalid input: 0[
]+' is 'Invalid input: 0*'. Activating booster.
Gate keeper glob pattern for '[
]+' is ''. Not usable, disabling the performance booster.

expect: does "1b1b# " (spawn_id exp5) match regular expression 
"ix-edgesw-r([^#>\r\n]+)?[#>](\\([^)\\r\\n]+\\))?"? Gate "ix-edgesw-r*"? 
gate=no
"Invalid input: 0[\n\r]+"? Gate "Invalid input: 0*"? gate=no
"[\n\r]+"? (No Gate, RE only) gate=yes re=no
<<<hangs here>>>
expect: timed out

Error: TIMEOUT reached

However, the version of hlogin from 2.3.6 works fine (from ubuntu 
12.04), and also hlogin from 3.6.2 (current code), so I've just replaced 
hlogin with the new one rather than digging any further.

Regards,

Brian.


[^1] The same line in in the 3.6.2 tarball, but for testing purposes I'm 
just rebuilding hpuifilter from 3.3.0 like this:

apt-get install dpkg-dev
apt-get source rancid
cd rancid-3.3.0
./configure
cd bin
# apply patch by hand: vi hpuifilter.c
make hpuifilter
sudo cp -p hpuifilter /usr/lib/rancid/bin/



More information about the Rancid-discuss mailing list