/usr/share/doc/collectl/html/Sockets.html is in collectl 3.6.9-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 | <html>
<head>
<link rel=stylesheet href="style.css" type="text/css">
<title>Socket Interface</title>
</head>
<body>
<center><h1>Socket Interface</h1></center>
<p>
<h3>Introduction</h3>
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 <i>raw</i>
file, a file in <i>plot format</i> or even <i>both</i> depending on your needs.
<p>
<h3>Short-lived communications</h3>
The model for this type of communications is one in which some other tool such as
<a href=collectl-utils/colmux.html>colmux</a> 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:
<ul>
<li>This mechanism will never survive a reboot without extra work on the initiator's
part which must include restarting collectl</li>
<li>As soon as it starts, collectl will open a socket to the specified address and immediately start sending
its output back to it</li>
<li>If the other end of the socket goes away, collectl will exit</li>
<li>If collectl is unexpectedly terminated (such as sigint or reboot), it will
close the socket without warning the other end and therefore the program at the
other end of the communication path must be prepared to deal with it</li>
</ul>
<p>
<h3>Long-lived communications</h3>
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:
<ul>
<li>This style of communications will survive a reboot if configured in <i>collectl.conf</i></li>
<li>The switch to put collectl into this mode is also -A but rather than supplying an
address as the argument use the text <i>server</i>
<li>The other end of the connection needs to periodically try to connect and if it fails
must try again. If that connection exits, it must clean up its end and go back to
trying to reconnect again.
<li>If you want collectl to terminate you much manually do so, noting after a reboot it
will restart.
<li>To verify collectl is functioning as expected, run the utility
<i>/usr/share/collectl/util/client.pl</i> passing it the address of the system collectl is
running on. It will display anything collectl sends to it over the socket.
</ul>
<table width=100%><tr><td align=right><i>updated Feb 21, 2011</i></td></tr></colgroup></table>
</body>
</html>
|