Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses

Re: Array not storing the result of a router command

by 2teez (Vicar)
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

Replies are listed 'Best First'.
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?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1032819]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (3)
As of 2018-02-26 03:35 GMT
Find Nodes?
    Voting Booth?
    When it is dark outside I am happiest to see ...

    Results (316 votes). Check out past polls.