hi!
you want a serial port tap. as long as it is just RS232 serial traffic, tapping is pretty easy. if you do it on the usb side of things it gets more complicated, and if there are usb-serial converters in the mix the timing could become an issue.
there are a few approaches. you can make or purchase a hardware serial port tap. or you can use software to sniff the serial port traffic then make it available to another process.
here are some commercial serial taps:
you can make your own by connect to the tx/rx lines. here is a simple example:
the most basic software approach is to use 'socat'. here's a stack exchange posting with some socat examples, as well as links to some other linux software to tap your serial connection:
i've used socat to reverse engineer serial comms, but i typically build a hardware tap if i need to sniff a serial connection for 'production' purposes.
m