Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re: Net::Telnet issue

by poj (Abbot)
on Feb 23, 2018 at 12:38 UTC ( [id://1209826]=note: print w/replies, xml ) Need Help??


in reply to Net::Telnet issue

Try add some logging for debugging

if ($t = new Net::Telnet ( Timeout => 20, Prompt => $Eleprompt, Input_Log => 'telnet.log' )){

and fix these errors

Possible unintended interpolation of @commandoutput1 in string at telnet0.pl line 23.
Possible unintended interpolation of @commandoutput2 in string at telnet0.pl line 25.
Global symbol "@commandoutput1" requires explicit package name at telnet0.pl line 22.
Global symbol "@commandoutput1" requires explicit package name at telnet0.pl line 23.
Global symbol "@commandoutput2" requires explicit package name at telnet0.pl line 24.
Global symbol "@commandoutput2" requires explicit package name at telnet0.pl line 25.
poj

Replies are listed 'Best First'.
Re^2: Net::Telnet issue
by Anonymous Monk on Feb 23, 2018 at 15:42 UTC

    i have added the log and found the following in log, we can see that it is coming as "--More--" and stopping and by this output is not getting captured. How to overcome this?
    the command output -

    ^MRP/0/RP0/CPU0:BLR-WFD-MPL-COR-RTR-42-236#show isis neighbors
    ^MFri Feb 23 18:28:48.355 IST

    IS-IS IGP neighbors:
    System Id Interface SNPA State Holdtime Type IETF-NSF

    IS-IS CORE neighbors:
    System Id Interface SNPA State Holdtime Type IETF-NSF
    BPL-CPT-MPL-COR-RTR-42-240 BE4 *PtoP* Up 22 L2 Capable
    MYS-MPL-LTE-PE-RTR-227 BE10 *PtoP* Up 24 L2 Capable
    HYD-UPP-MPL-COR-RTR-42-234 BE5 *PtoP* Up 28 L2 Capable
    KOL-GBS-MPL-COR-RTR-42-238 BE6 *PtoP* Up 28 L2 Capable
    CHN-SAN-MPL-COR-RTR-42-216 BE3 *PtoP* Up 25 L2 Capable
    --More--

      Maybe your device vendor has an option to disable the prompt for another keypress?

        Actually when i manually log in to the device and run the command i can see that the command output is huge. So in script entire output is not being able to be captured. It is able to capture first possible few lines and than "--More--" is coming up. How can i increase the capacity of the cmd function in script so that entire command output will get captured in single go please suggest

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1209826]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others studying the Monastery: (6)
As of 2024-04-24 11:05 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found