Add support for AIX 5.x - 9.x. Many thanks to Jens Rehsack <rehsack@googlemail.com> for providing the patch for this work. Thanks!
Nasty hack to make inclusion in C++ code easier. We seem to be getting regular reports of problems with C++, and this should fix them.
Add WIN32 support via MINGW. We'll need to add stuff to the README file about what this requires to build. All the hard work done by: skel
Add more fs stats. Patches provided by: Roman Neuhauser
Change the name of the duplex value from "dup" to "duplex". This will break the ABI, but we're changing the fs stats anyway. The API change is minimal, so hopefully won't affect too many people.
Merge in patch to provide support for HP-UX 11.11. Contributed by Roy Keene - thanks Roy!
Remove extraneous consts.
Do the errno capturing in a nicer way.
Add function to allow grabbing of the current errno. Should we store errno too maybe?
Make sure statgrab.h can't be included twice.
Add comparison functions for names where that's likely to be useful. Make the network_iface_stats example show how to use bsearch to find an interface by name.
Nuke sg_process_sort, and make the process stats example demonstrate how to sort using the compare functions and qsort.
s/sg_sort_method/sg_process_sort_method/
Name change for future friendlyness.
Added some generic sorting methods for process_stats.
Remove a couple of FIXMEs that have been dealt with.
Add sg_get_error_arg. It uses a static buffer for storage rather than sg_update_string because we can't do anything about a malloc failure at that point. Remove the default case in the switch, so GCC will give an "unhandled enum value in switch" warning if we add a new error code without a string.
The rest of the error handling stuff (except the vector code). I've been extremely unimaginative with the string names in error.c, but they're all in one place so much easier to tidy up. I'm also beginning to wonder if we actually needed an SG_ERROR_SYSTEM_CALL to indicate some call into the system failed - because the majority of our errors are those :-) Still to do, then: - vector code - better string names in error.c - deal with arg string in some way - make use of the error status in statgrab/saidar/examples
Error reporting for disk_stats.
Whitespace tidyup - change spaces to tabs.
Add error reporting to cpu_stats.
Add sg_realloc, and a macro fo sg_malloc.
Add SG_ERROR_NONE. Make sg_str_error return const char *.
Some very basic startings of error handling stuff. I've not put much thought into this yet, it's basically just the idea we've discussed. Of course, this is the easy task. The hard job is creating a whole list of different errors and using them across libstatgrab :-)
Add compatibility code. This provides a working pre-0.10 API for old applications. To use simply change the #include line to: #define SG_ENABLE_DEPRECATED #include <statgrab.h> This can be disabled at build time completely using --disable-deprecated.
Update name of project at the top of all soure files. These files now exist in their own right, rather than as part of the "CMS".
Rename all the functions, types and enums in the API to be consistent. Types are now of the form "sg_mem_stats"; functions of the form "sg_get_mem_stats"; enums of the form "SG_PROCESS_STATE_RUNNING". (The old get_proc_snapshot follows the usual calling convention now.) Make internal functions static where possible. Rename non-static internal functions to have an sg_ prefix so they don't collide with those from other libraries. In particular, strlcpy and strlcat are now called sg_strlcpy and sg_strlcat and are always included. Fix saidar and statgrab to use the new API.
Add support for FreeBSD 4. I suspect this may work on OpenBSD and NetBSD too, although I'll need to verify that. Also add an additional process state of UNKNOWN.
The startings of the BSD code. Only works on FreeBSD 5 so far. Doesn't yet do command line arguments, or CPU percentages correctly.
Modifying the type of process states to an enum. The names maybe a touch unfriendly however..?
The start of the rework for process_stats to give more information, and to become a standard proc interface.
An "idea" what the network stats might look like with extra stuff in. Pete, please approve/fix then I'll do the BSD code :-)
Added up/down interface detection. Not tested (or even compiled) on any os. So that really needs to be done :)
Couple of name changes, and a tidy up.
Added code for freebsd to do the network interface speeds. I've put it under the label ALLBSD however, as i suspect it will work on all the BSD's of intrest.
Added the ability to get the interface speed/duplex for solaris. Not really checked code, but it appears to work.
A whole bunch of minor cosmetic changes.
Alter the licensing of libstatgrab. The library part is now under the LGPL, whilst the tools/examples are under the GPL. Both licenses are included in the distribution (and are both now in CVS). Also made a minor alteration to the webpage where it said everything was licensed under the GPL.
As pointed out by azz.... time_t will be needed, thus the #include of sys/types.h
Removed #ifdef's as they should not be there.
Moving the MAX_LOGIN_NAME_SIZE to where it should be.
Replace duplicated code for dropping privileges with a library function that always drops setuid/setgid privileges.
Fix a couple of Cygwin build issues. Not all the #ifdef LINUX's were changed in a previous commit.
Add support for cygwin. This is a bit limited, there's a few things that can't be retrieved on cygwin such as load averages, diskio, network io, and process stats. The package compiles and runs, and both saidar and statgrab work. Taken from a patch submitted by Ron Arts <raarts@netland.nl>. Thanks Ron!
Move MAX_LOGIN_NAME_SIZE definition to the right place.
Added statgrab_init() This function just calls the get_kvm type functions so all special privilages can be dropped after this function has been called. It currently only does stuff on *bsd (and needs testing on netbsd). All other OS's will just have a function that returns 0 Solaris at somepoint may need to do something here so we can do the drive mappings.
Tidy up of lots of little things. :)
Ported to work onto freebsd.
Removed getting of some data we didn't really need or use. Updated page_stats to work with linux. Fixed tools.h to compile nicely :)
Added linux support for cpu stats
Made cpu stats to a type a bit more cross platform :)
changed user_stats to return something more useful for ihost, and prob something more useful to everyone else too. Although, they can't just itterate thru it now, they got to find ' ' :)
Changed function name changed to be consistent.
Added a diff diskio_stats and fixed a bug. This is the last thing needed for the solaris version of the new libstatgrab, bar bug fixes.
Added support for read/write stats on a per disk basis. This does not count metadisks as disks. I will also add io transfer for mounted devices, and the ususal diff() function that gives you the differences since last time you called it.
network stats now returns a diff() style function, to make it easy to show the exact average network traffic over a period of time.
Added get_page_stats_diff() which returns the number of pages in/out etc since last time it was called, and the time difference since last time it was called. This makes it very easy for a host to know how many pages averaged over a period of time.
Finished page stats. It returns 2 things. One, number of pages swapped in and out, 2, the number of pageins and pageouts. As to if this is actually correct or not, im not 100% sure, but tests seem to imply it is. from: http://www.sun.com/sun-on-net/itworld/UIR960901perf.html ulong pgin; /* pageins */ ulong pgpgin; /* pages paged in */ ulong pgout; /* pageouts */ ulong pgpgout; /* pages paged out */ ulong swapin; /* swapins */ ulong pgswapin; /* pages swapped in */ ulong swapout; /* swapouts I am *not* using swapins and swapouts. I did this in the orginal libstatgrab, and it didn't work. Looking at it more closely, it always seems to have 0 in it, so my guess is its broke. :)
The new revesion of libstatgrab, which is a complete rewrite essentially. Firstly the data is now returned in structures rather than xml strings. The structures returned are all static, so what ever calls the library doesn't have to deal with the memory management of it. Secondly the general efficency of the code is now significantly faster. It no longer needs to fork a process, connect file descriptors and run ps, and then parse the output like it used to. Now it walks /proc and reads it into the correct data structures. This works without needing any special privilages, so it can still run as a normal mortal without needing any special group. (Freebsd will be an exception to this, but this commit only works with solaris, and that requires nothing special) Thridly it has more functionality than it used to. It not for instance is capable of showing network traffic stats, (although its not completely finished yet). It also in the near future be able to disk io stats as well. Several bug fixes have been aplied over the original version. For example the cpu_stats used to only reply the stats for the first processor. This now will report the total stats of all of them. Paging stats will also be fixed, but haven't been done yet.
This form allows you to request diffs between any two revisions of this file. For each of the two "sides" of the diff, select a symbolic revision name using the selection box, or choose 'Use Text Field' and enter a numeric revision.