libstatgrab

a cross platform library for accessing system statistics

libstatgrab

What is libstatgrab?

libstatgrab is a library that provides cross platform access to statistics about the system on which it’s run. It’s written in C and presents a selection of useful interfaces which can be used to access key system statistics. The current list of statistics includes CPU usage, memory utilisation, disk usage, process counts, network traffic, disk I/O, and more.

The current list of supported and tested platforms includes FreeBSD, Linux, NetBSD, OpenBSD, Solaris, DragonFly BSD, HP-UX and AIX. We are always happy to accept patches to extend support to other operating systems.

The package also includes a couple of useful tools. The first, saidar, provides a curses-based interface to viewing the current state of the system. The second, statgrab, gives a sysctl-style interface to the statistics gathered by libstatgrab. This extends the use of libstatgrab to people writing scripts or anything else that can’t easily make C function calls. Included with statgrab is a script to generate an MRTG configuration file to use statgrab.

The library part of libstatgrab is licensed under the GNU LGPL, but the tools and examples are licensed under the GNU GPL.

Current version

The current release is libstatgrab 0.92.1 released on 27 July 2021.

This release includes minor bugfixes and is API and ABI compatible with 0.92.

Downloading

All versions of libstatgrab can be downloaded from GitHub. Downloads are signed using our key (download here):

pub   rsa4096/0xA12F416AA37F3BD7 2013-08-07 [SC] [expires: 2027-08-29]
      Key fingerprint = 4AD8 6566 CAD0 3297 A980  4702 A12F 416A A37F 3BD7
uid                   [  full  ] i-scream Development Team <dev@i-scream.org>
sub   rsa4096/0x29E38BE8BCE83B45 2013-08-07 [E] [expires: 2027-08-29]

For installation instructions see the README file contained within the archive.

Bug reporting and development

If you found a bug or an issue with libstatgrab then you can report it on the project’s GitHub issues page. If you have a fix you can make a pull request there too. Bugs with a detailed description or a fix are likely to be committed sooner.

We’re happy to accept patches that fix, improve, or extend libstatgrab.

Language bindings

Here are links to bindings for higher level languages that provide access to libstatgrab. If you’ve written a binding for another language, please get in touch so we can add a link here.

Packages of libstatgrab

These are various pre-packaged versions of libstatgrab that you can get for your favourite operating system. If we’ve missed any out, please let us know.

We’ve noticed that Google throws up some RPMs relating to Mandrake and Suse, but no webpage for them.

Documentation

The only online documentation we have at the moment is the manual pages converted in to HTML format. First are the manual pages for the command line tools:

We also have an overview page for the library:

Then we have the manual pages for each function:

Screenshot

Here’s what saidar looks like when it’s running:

saidar screenshot