I am evaluating collectl to use as a system monitoring tool. I need to expose the data through a socket. I found that collectl has a -A option which can send data to a socket. But I could not find any specific details on how to do it. I believe the configuration should be done in /etc/collectl.conf
Can anyone give an idea on how to configure collectl to provide data through a socket connection?
(And if you can suggest any other handy system monitoring tool which matches the above requirement, that would also be great. Simple setting up capability is bit important since the process needs to be automated)
Getting collectl data through a socket is real easy. If you run collectl with -Aserver, it comes up in server mode, which means it listens for connections and when it receives one it started sending its output over that connection until it breaks. Since it continues to listen for connections, it can actually take to multiple clients. To test this feature, run collectl -Aserver in one window and in another, run "/usr/share/collectl/util/client.pl address-of-collectl-server" and you'll immediately start seeing output. You can run the client in as many windows or on as many other systems as you like.
The other mode collectl runs in is as a client. You give it an address to talk to like this: "collectl -Aaddress" and when it starts connects to that address and starts sending its output there. This is the way colmux works.
As for the type of output, if you do nothing more, collectl will send the same text over the socket that it would normally send to the terminal. On the other hand you can specify 'line output' with --export lexpr and if that's not good enough you can write your own export module. Just start with lexpr as a model and hack away to get virtually any form of output you like.
Hope this helps...
-mark