On 06/06/2008, Derek Gill (dergill) <[EMAIL PROTECTED]> wrote:
>
>
>
> Hi,
>
> I have a number of  Perl scripts I launch using the beanshell sampler.  The 
> Perl scripts  generally do some remote logging and print general information 
> from a database  running on a remote server.  Is there anyway that I can pipe 
> the output of  the Perl script so that it is caught in my Jmeter listener.  I 
> can see that  it is possible to catch the the Perl script return value in the 
> listener, but I  can't see if it is even possible to pipe the entire script 
> output back into the  Jmeter listener.
>

This is a Java question.

Provided that you can capture the output from the  exec() command, you
can return it from BeanShell.

Have a look at the Process Javadoc, in particular getOutputStream()

http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Process.html#getOutputStream()

> Typically I launch  the script as follows from the bean shell:
>
> import  java.util;
> import java.lang;
>
> String test_script =  "/usr/bin/perl /root/test.pl \"select count(*) from  
> CLIENTSESSIONS;\"";
> Runtime currentruntime = Runtime.getRuntime();
> Process  testingprocess =  currentruntime.exec(test_script);
> testingprocess.waitFor();
>
> Thanks,
> Derek.
>
>
>
>
>
> Derek              Gill
> Software Test              Engineer
> IP Communications.
>
> [EMAIL PROTECTED]
> Phone              :+353 91 384650
>
>
> Cisco              Internetworking Ltd.,
> Block 10,
> Galway Technology              Park,
> Parkmore,
> Galway,
> Ireland.
> www.cisco.com
>            This              e-mail may contain confidential and privileged 
> material for the sole              use of the intended recipient. Any review, 
> use, distribution or              disclosure by others is strictly 
> prohibited. If you are not the              intended recipient (or authorized 
> to receive for the recipient),              please contact the sender by 
> reply e-mail and delete all copies of              this message.
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to