Try collectlfor System Monitoring

Most Linux system administrators are familiar with sar for collecting system status data. However, there's a few ways that sar shows its age and doesn't quite live up to expectations. If you're looking for a newer utility that also handles NFS, Slab data and sub-second intervals, collectl may better fit the bill.

When it comes to collecting system status data, sar is a veritable workhorse. It is not, however, without its limitations. If you're in the market for a utility that also handles NFS, Slab data, and sub-second intervals, consider collectl.

Basically, collectl collects system data that reflects the system status/performance. If you're familiar with sar, you'll be right at home with collectl. If you've never used sar or a similar tool, here's a quick example running collectl -s cn:

As you can see, the -s cn tells collectl "read the CPU and network subsystem data." By default, in interactive mode collectl will read and display data every second. You can crank that up with the -i interval option if you want. It can make data grabbable as frequent as every quarter of a second. Note that you'll also need the Time:HiRes Perl module. This might be installed by default. Check collectl -v to be sure.

Collectl has an interactive mode, playback mode, record mode, socket mode and plot mode. Interactive is pretty self-explanatory. The record mode saves to a file for use later -- and you can use the playback mode to replay the data. The plot format saves data in a delimiter separated format that can be used with plotting utilities so you can graph system performance data. Finally, the socket mode directs collectl to send its data to a port specified with the -A option.

Why would you want to use collectl instead of sar? For one thing, collectl
is supposed to have very low overhead. The author claims it's been measured
to use less than 0.1 percent when run as a daemon -- although this may not hold for
systems with massive numbers of disks and running processes.

It also handles things that sar doesn't, like Lustre file systems and Infiniband
interconnects. As mentioned already, collectl has finer-grained monitoring
intervals, so you can snarf data below the 1 second interval if you really
must.

You can also control the format collectl uses to export data, if the default ones don't work for you for some reason. And it has support (experimental) for temperature and fan sensors.

If you monitor systems on a regular basis, check out collectl. It's not yet packaged for Ubuntu and just recently made it into Debian (so expect it for Debian Wheezy), but it's available for Fedora and openSUSE (Factory, at least -- haven't checked 11.4 yet) already. The most recent release came out in May, and you can grab an RPM or source on SourceForge.

Joe 'Zonker'
Brockmeier is a freelance writer and editor with more than 10 years covering IT. Formerly the openSUSE Community Manager for Novell, Brockmeier has written for Linux Magazine, Sys Admin, Linux Pro Magazine, IBM developerWorks, Linux.com, CIO.com, Linux Weekly News, ZDNet, and many other publications. You can reach Zonker at jzb@zonker.net and follow him on Twitter.