Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: Array not storing the result of a router command

by 2teez (Priest)
on May 09, 2013 at 18:56 UTC ( #1032819=note: print w/ replies, xml ) Need Help??


in reply to Array not storing the result of a router command

Hi Arun Kumar,
Just Curious questions:

  1. Why test for the variable $type twice in your script?
  2. for this particular router, can you test another command to see if @cmd_output would not return null? like say:
    my @output = $session->cmd('show version'); print @output;
  3. In your print line, i.e print "Array value__________________'@cmd_output'\n"; why put the variable @cmd_output in a single quote? Does other router output give output in that like?
Just thinking aloud....

If you tell me, I'll forget.
If you show me, I'll remember.
if you involve me, I'll understand.
--- Author unknown to me


Comment on Re: Array not storing the result of a router command
Select or Download Code
Re^2: Array not storing the result of a router command
by Arun Kumar (Novice) on May 09, 2013 at 19:28 UTC

    Hi 2teez, Sorry for that, it is because I have four types of routers. I will first login into the routers at the first type check and then I will execute the different commands for different again by checking the router type. But I have shortened the code here.

    I have tried the show version command,it is also not getting stored into the array

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (15)
As of 2014-07-28 15:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (204 votes), past polls