[rancid] Assistance creating a perl module to use with ZPE Systems NodegridOS Devices
heasley
heas at shrubbery.net
Fri Oct 15 16:40:10 UTC 2021
Fri, Oct 15, 2021 at 02:59:01PM +0000, Mick O'Donovan:
> rancid at rancid-staging:~/bin$ diff rancid zperancid
> 140a141,143
> > # I don't care if it sees "exit"
> > $clean_run = 1;
> >
>
> ^^^ It was recommended to me several weeks back to make this change but I can't for the life of me remember why.
IMO, it is part of the conversation and is further confirmation that was
normal. Various devices have had cli bugs over time. Does not hurt to
remove it for debugging.
> rancid -d -t zpe <redacted>
> loadtype: device type zpe
> loadtype: found device type zpe in /etc/rancid/rancid.types.base
> executing zpelogin -t 90 -c"show system/about;export_settings;show_settings" <redacted>
> PROMPT MATCH: \[heanet@<redacted> /\]#
I'm curious about the redacted bit; if it contains regex atoms that were
not escaped by the login or perl script, that could be the problem.
> HIT COMMAND:[heanet@<redacted> /]# show system/about
> In ShowSoftware: [heanet@<redacted> /]# show system/about
> <redacted>: missed cmd(s): export_settings,show_settings
> <redacted>: missed cmd(s): export_settings,show_settings
> <redacted>: End of run not found
> <redacted>: End of run not found
>
> My reading of the above is that the module in question can properly understand the output received from the "show system/about" command and therefore stops and doesn't run the subsequent command. I would like to either get this sorted using pre-existing modules (probably not possible) or create a new perl module specific to zpe (happy to share with the community for others to use if needed).
>
I would first verify that the login script is running successfully.
eval `rancid -C -t zpe` >& raw
Look at the raw file to ensure that it has collected the complete output,
not prematurely sent commands, etc - ie: it looks normal. My guess is
that it is not matching the prompts promptly and sending command prematurely.
Look for them
[heanet@<redacted> /]# show system/about/
[heanet@<redacted> /]# export_settings
[heanet@<redacted> /]# show_settings
[heanet@<redacted> /]# exit
if the regex match in the perl module is not correct, it might not be
matching the prompt and therefore ShowSoftware() might be eating too
much of the input - ie: the entire input.
More information about the Rancid-discuss
mailing list