Socket Interface


Collectl actually provides 2 different mechanisms for socket communications and depending on which style you intend to use, you should pick the appropriate one. Regardless of which style you choose, collectl will send all data that might normally go to a terminal to that interface, prepended with the hostname for easy recognition at the other end. One should also note that you can simultaneously record the data locally in a raw file, a file in plot format or even both depending on your needs.

Short-lived communications

The model for this type of communications is one in which some other tool such as colmux starts collectl on one or more remote systems, instructing it to send its output back to the initiator until the initiator terminates the connection. At this time collectl will permanently exist. Using this style the initiator of the communications opens the socket and then typically starts collectl using ssh and includes its address/port in the command string using collectl's -A switch. The key things to note when using this style are:

Long-lived communications

This mechanism has collectl create the initial socket and listen for a remote connection. In this mode, collectl continues to collect data and at the beginning of each monitoring interval looks for a new socket connection request. If it receives a request, collectl then creates a connection back to the requestor and immediately starts sending data to it. If that connection terminates collectl closes down its side and then goes back to listening for a new connection. The key points about this style are:
updated Feb 21, 2011