You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@jmeter.apache.org by raja raman <ra...@gmail.com> on 2007/08/17 09:29:07 UTC

Providing hostname for the jmx file from the command line.

Hi all,
        I am using jmeter to stress test my webserver.I start the jmx file
form the shell as, bash# ./jmeter -n -t test.jmx.I have the hostname
hardcoded in the jmx file while I created the testplan.Now, if I need to run
the jmeter for stressing another server, I replace the hostname alone for
and create a new jmx file and start the test.
        Is it possible to provide the hostname from the command line while I
start the Jmeter?

Thanks,
Rajaraman

Re: Providing hostname for the jmx file from the command line.

Posted by raja raman <ra...@gmail.com>.
Hi Andre,
             Thanks for the quick and nice reply.


regards,
Rajaraman


On 8/17/07, André van Hoorn <An...@informatik.uni-oldenburg.de>
wrote:
>
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Hi,
>
> you can pass properties on the command line using the parameter -J
> followed by name=value. Within a JMX you use ${__P(name,defaultvalue)}
> to access the property value. By providing a default value you can
> still call the test plan from the GUI without having defined a value.
>
> E.g. say you want to provide the hostname HOSTNAME by a property named
> 'srvhost' having a default value DEFAULTHOSTNAME. Do the following:
>
> 1.) Enter ${__P(srvhost,DEFAULTHOSTNAME)} in the domain field
>     of the JMX file (e.g. HTTP Request Defaults).
> 2.) Run the test by
>     $ jmeter-devel.sh -n -t testplan.jmx -Jsrvhost=HOSTNAME
>
>
> Best regards,
>
> André
>
>
>
> raja raman schrieb:
> > Hi all,
> >         I am using jmeter to stress test my webserver.I start the jmx
> file
> > form the shell as, bash# ./jmeter -n -t test.jmx.I have the hostname
> > hardcoded in the jmx file while I created the testplan.Now, if I need to
> run
> > the jmeter for stressing another server, I replace the hostname alone
> for
> > and create a new jmx file and start the test.
> >         Is it possible to provide the hostname from the command line
> while I
> > start the Jmeter?
> >
> > Thanks,
> > Rajaraman
> >
>
> - --
> André van Hoorn
> Birkenweg 21
> D-26725 Emden
>
> Telefon:  +49 (4921) 954231
> E-Mail:   Andre.van.Hoorn@Informatik.Uni-Oldenburg.DE
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.5 (GNU/Linux)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
>
> iD8DBQFGxVv/LKwmE5jzZmkRAszQAJ9dTM/E+kIX/urQuJa8O9jICY/rvgCg02KH
> jFqaFOMQy2WUs9tG2L8xofg=
> =KfZ1
> -----END PGP SIGNATURE-----
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
>
>

Re: Providing hostname for the jmx file from the command line.

Posted by André van Hoorn <An...@Informatik.Uni-Oldenburg.DE>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi,

you can pass properties on the command line using the parameter -J
followed by name=value. Within a JMX you use ${__P(name,defaultvalue)}
 to access the property value. By providing a default value you can
still call the test plan from the GUI without having defined a value.

E.g. say you want to provide the hostname HOSTNAME by a property named
'srvhost' having a default value DEFAULTHOSTNAME. Do the following:

1.) Enter ${__P(srvhost,DEFAULTHOSTNAME)} in the domain field
    of the JMX file (e.g. HTTP Request Defaults).
2.) Run the test by
    $ jmeter-devel.sh -n -t testplan.jmx -Jsrvhost=HOSTNAME


Best regards,

André



raja raman schrieb:
> Hi all,
>         I am using jmeter to stress test my webserver.I start the jmx file
> form the shell as, bash# ./jmeter -n -t test.jmx.I have the hostname
> hardcoded in the jmx file while I created the testplan.Now, if I need to run
> the jmeter for stressing another server, I replace the hostname alone for
> and create a new jmx file and start the test.
>         Is it possible to provide the hostname from the command line while I
> start the Jmeter?
> 
> Thanks,
> Rajaraman
> 

- --
 André van Hoorn
 Birkenweg 21
 D-26725 Emden

 Telefon:  +49 (4921) 954231
 E-Mail:   Andre.van.Hoorn@Informatik.Uni-Oldenburg.DE
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFGxVv/LKwmE5jzZmkRAszQAJ9dTM/E+kIX/urQuJa8O9jICY/rvgCg02KH
jFqaFOMQy2WUs9tG2L8xofg=
=KfZ1
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-user-help@jakarta.apache.org