SIGAR is a cross-platform API to gather system-specific performance-data. It is developed by Hyperic and released under the GPL. We use it at MySQL as the backend for our monitoring agent.

Sadly SIGAR requires ant for building as it is meant to be used with a JNI-wrapper in Java applications. Real men use C, so we need something else for building: cmake.

cmake

cmake is a cross-platform, autotools replacement. It works on Unix and win32 and generates native Makefiles. On Unix it is make, on win32 it is nmake, on macosx uses the XCode framework.

That keeps even the build portable. You can get a binary from http://cmake.org/

libsigar.a


$ wget http://downloads.sourceforge.net/sigar/hyperic-sigar-1.3.0.0-src.tar.gz
$ gzip -cd hyperic-sigar-1.3.0.0-src.tar.gz | tar xf -
$ cd hyperic-sigar-1.3.0.0-src
$ wget http://jan.kneschke.de/downloads/sigar/hyperic-sigar-1.3.0.0-src-cmake.tar.gz
$ gzip -cd hyperic-sigar-1.3.0.0-src-cmake.tar.gz | tar xf -
$ cmake .
$ make

It should build a sigar-test-all and the build/libsigar.a as static library for your own applications.

sigar-test-all

sigar-test-all is a test-app which calls all sigar functions and prints their output to stderr.


Comments

Enable javascript to load comments.