I have a PC A where LTTng tracing is running with live view
lttng create trace-session --live
# Traces will be output to tcp4://127.0.0.1:5342/ [data: 5343]
Another PC B is directly connected with A with a Ethernet cable. At the same time, B is connected to a local network.
Now how can I view the live trace events from a third PC C, which is in the same local network as B, for example with
babeltrace2 "net://${B_IP}/host/${B_HOSTNAME}/trace-session"
I ran the following command on PC C, to make a tunnel to PC *A.
ssh -L 5342:${A_IP}:5342 -N user_name@${B_IP}
However, it seems not to have worked. I would like to ask:
- What have I done wrong here?
- What is the standard way to "forward" LTTng live tracing events to be viewed by
babeltrace2?
Babeltrace2connects tolttng-relaydusing theliveport of thelttng-relaydprocess not the data and control ports.When the command line report the following:
It means that the
lttng-sessiondandlttng-consumerdprocess will communicate with alttng-relaydprocess listening on the127.0.0.1:5342for control message and127.0.0.1:5343for trace data exchange. A viewer, in this caseBabeltrace2can connect to theliveport of alttng-relaydprocess to stream live session. You can take a deeper look at the component graph here.The default live port is 5344 and the default behavior for the
lttng-relaydprocess is to bind on all interfaces to listen. NaturallyBabeltrace2also default on using that port if none is specified to communicate with thelttng-relaydprocess.See the man page of lttng-relayd for more details.
In your scenario you need to tunnel the 5344 port. Note that I'm not versed in ssh tunneling so I cannot validate the ssh approach here.
Babeltrace2andlttng-relayduse TCP for communication. Hence, all TCP "forwarding" methods are acceptable here. As you probably noticed, LTTng does not encrypt communication and trace data in any way. I would say that using a ssh tunnel is appropriate here if you need to move data across non-trusted network.