Skip Menu |

This queue is for tickets about the Net-Appliance-Session CPAN distribution.

Report information
The Basics
Id: 75201
Status: resolved
Priority: 0/
Queue: Net-Appliance-Session

People
Owner: Nobody in particular
Requestors: ssb [...] umn.edu
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 3.113610
Fixed in: (no value)



Subject: need print / waitfor functionality in v3
One of the other programmers here heavily uses print / waitfor in v2 to parallelize retrieval of information from our routing and switching infrastructure (~6000 devices). Is there any way to get this functionality in v3?
On Tue Feb 21 14:42:54 2012, https://openid.umn.edu/ssb wrote: Show quoted text
> One of the other programmers here heavily uses print / waitfor in v2 to > parallelize retrieval of information from our routing and switching > infrastructure (~6000 devices). > > Is there any way to get this functionality in v3?
A little more detail: he opens a session to each of many devices, sends a command using "print" to each of them (up to 50 typically), then rolls back around and does a waitfor to retrieve the results.
On Tue Feb 21 17:29:58 2012, https://openid.umn.edu/ssb wrote: Show quoted text
> On Tue Feb 21 14:42:54 2012, https://openid.umn.edu/ssb wrote:
> > One of the other programmers here heavily uses print / waitfor in v2 to > > parallelize retrieval of information from our routing and switching > > infrastructure (~6000 devices). > > > > Is there any way to get this functionality in v3?
> > A little more detail: he opens a session to each of many devices, sends a > command using "print" to each of them (up to 50 typically), then rolls > back around and does a waitfor to retrieve the results.
This functionality is not available. However it's a good suggestion so I'll have a think about it - I hope not too much effort to implement. In the meantime, I do suggest your colleague look at the excellent Parallel::ForkManager module, which might be a good alternative. regards, oliver.
On Thu Feb 23 02:46:08 2012, OLIVER wrote: Show quoted text
> On Tue Feb 21 17:29:58 2012, https://openid.umn.edu/ssb wrote:
> > On Tue Feb 21 14:42:54 2012, https://openid.umn.edu/ssb wrote:
> > > One of the other programmers here heavily uses print / waitfor in
> v2 to
> > > parallelize retrieval of information from our routing and
> switching
> > > infrastructure (~6000 devices). > > > > > > Is there any way to get this functionality in v3?
> > > > A little more detail: he opens a session to each of many devices,
> sends a
> > command using "print" to each of them (up to 50 typically), then
> rolls
> > back around and does a waitfor to retrieve the results.
> > This functionality is not available. However it's a good suggestion so > I'll have a think about it > - I hope not too much effort to implement. > > In the meantime, I do suggest your colleague look at the excellent > Parallel::ForkManager > module, which might be a good alternative. > > regards, > oliver.
He would have to create around 1500 processes if he were to retrieve from each device individually. The structure of his programs is such that this wouldn't be that hard to do, but in terms of efficiency, he's found that the print / waitfor approach has worked very very well for sessions to many devices from each of his gathering processes. Is there any way to create a phrasebook that returns early with a followup command actually looking for the prompt and gathering the results, is there? Could we specify a prompt of something crazy like /^/ or // to get the particular macro (I assume this would have to be a macro) to return? Would we actually be able to match nothing? I assume that's what we'd have to do because I assume the newline received after the command is entered gets gobbled implicitly.
After some thought I've implemented a put() method to send a command and a gather() method to get the response (which is similar to print/waitfor, in essence). These are in a development release on CPAN, 3.120580_001, and documented here: https://metacpan.org/module/OLIVER/Net-Appliance-Session- 3.120580_001/lib/Net/Appliance/Session.pm#ASYNCHRONOUS-BEHAVIOUR Please let me know how you get on, regards, oliver.
Subject: Re: [rt.cpan.org #75201] need print / waitfor functionality in v3
Date: Mon, 27 Feb 2012 18:20:09 -0600
To: bug-Net-Appliance-Session [...] rt.cpan.org
From: Scott Bertilson <ssb [...] umn.edu>
Thanks very much. We'll try it out and let you know. Scott On Mon, Feb 27, 2012 at 4:11 PM, Oliver Gorwits via RT < bug-Net-Appliance-Session@rt.cpan.org> wrote: Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=75201 > > > > After some thought I've implemented a put() method to send a command and a > gather() method to get the response > (which is similar to print/waitfor, in essence). > > These are in a development release on CPAN, 3.120580_001, and documented > here: > > https://metacpan.org/module/OLIVER/Net-Appliance-Session- > 3.120580_001/lib/Net/Appliance/Session.pm#ASYNCHRONOUS-BEHAVIOUR > > Please let me know how you get on, > > regards, > oliver. >
I've now released proper the version of N::A::S with the feature you requested (something like print/waitfor). Note that I've called them say/gather instead, however the method put() which was in my original fix will still work if your code is using that. BTW I found an issue with gather() in that the original command from say/put is echoed. Right now I can't think of an easy way to fix that in the module, but I'm sure it's easy enough to handle in your scripts. regards, oliver.
CC: Jon Buerge <buerge [...] umn.edu>
Subject: Re: [rt.cpan.org #75201] need print / waitfor functionality in v3
Date: Tue, 5 Jun 2012 15:18:20 -0500
To: bug-Net-Appliance-Session [...] rt.cpan.org
From: Scott Bertilson <ssb [...] umn.edu>
I reminded my co-worker, Jon Buerge, when I got your comments on the ticket earlier. He had lost track of it but will try to squeeze it in before too long. I can't see the the version you're describing here, what I have appears to be the newest, but seems to be missing "say". I did notice that my Net::CLI::Interact was 1.120042 and have now upgraded to 1.120670 but I still don't see "say". Thanks, Scott On Tue, Jun 5, 2012 at 1:59 PM, Oliver Gorwits via RT < bug-Net-Appliance-Session@rt.cpan.org> wrote: Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=75201 > > > I've now released proper the version of N::A::S with the feature you > requested (something like > print/waitfor). Note that I've called them say/gather instead, however the > method put() which > was in my original fix will still work if your code is using that. > > BTW I found an issue with gather() in that the original command from > say/put is echoed. Right > now I can't think of an easy way to fix that in the module, but I'm sure > it's easy enough to handle > in your scripts. > > regards, > oliver. >
RT-Send-CC: buerge [...] umn.edu
Hi Scott, On Tue Jun 05 16:18:33 2012, ssb@umn.edu wrote: Show quoted text
> I can't see the the version you're describing here, what I have appears to > be the newest, but seems to be missing "say". I did notice that my > Net::CLI::Interact was 1.120042 and have now upgraded to 1.120670 but I > still don't see "say".
Sometimes the CPAN index is a little slow to update. The metacpan.org site is often quicker, and seems to have the new versions already. The ones you're looking for are Net-Appliance-Session-3.121570 and Net-CLI-Interact- 1.121570. regards, oliver.