-
Notifications
You must be signed in to change notification settings - Fork 32
Quick guide Simple ping check on two machines
test machine 1 test machine 2
-------------- --------------
eth0 eth1 eth1 eth0
| | | |
| | +--------+ | |
| +----| SWITCH |----+ |
| +--------+ |
| |
| +--------+ |
+----------| SWITCH |----------+
+--------+
|
|
eth0
------------------
controller machine
(e.g. your laptop)
We want to ping test machine 2 (eth1) from test machine 1 (eth1).
Save the following code into file recipe.xml on your controller machine.
<lnstrecipe>
<network>
<host id="testmachine1">
<interfaces>
<eth label="tnet" id="testifc1">
<addresses>
<address value="192.168.200.2/24"/>
</addresses>
</eth>
</interfaces>
</host>
<host id="testmachine2">
<interfaces>
<eth label="tnet" id="testifc2">
<addresses>
<address value="192.168.200.3/24"/>
</addresses>
</eth>
</interfaces>
</host>
</network>
<task>
<run module="IcmpPing" host="testmachine1">
<options>
<option name="addr" value="{ip(testmachine2,testifc2)}"/>
<option name="count" value="3"/>
</options>
</run>
</task>
</lnstrecipe>
First you need to make sure that the lnst-slave daemon is running on the specified slave machines. To do this you run:
$ systemctl start lnst-slave.service
on all the slave machines. You can learn more about the LNST invocation in LNST Invocation.
After you've made sure that lnst is running on all the slave machines you just need to run the controller. For that you first need to create a pool with the two test machines that you will be using.
-
create a new directory for the pool, e.g. ~/.lnst/pool/
-
create two files describing the test machines, machine1.xml and machine2.xml
-
use this xml as a template for the previous two files, REPLACE the HOSTNAME and HWADDR in both files with an approriate value.
<slavemachine>
<params>
<param name="hostname" value="HOSTNAME"/>
</params>
<interfaces>
<eth label="A" id="1">
<params>
<param name="hwaddr" value="HWADDR"/>
</params>
</eth>
</interfaces>
</slavemachine>
And after you've created the pool just run the controller (on the controller machine) like this:
$ lnst-ctl run recipe.xml
- IcmpPing test description and options
- Function {ip()}