"brackets are the most evil thing in the world" - pjm2
statgrab should now return the correct values for swap and memory, i.e. not swapped round as a result of the regexping of the reversed top output. Each line must begin with either Mem: or Swap: and a non-greedy match is made of all characters before the bit of data we're interested in, so it should read the correct numbers each time.
statgrab now gets the Linux CPU times correctly. This was done by runing top for 2 iterations, and reversing the output. This allowed the correct times to be grabbed. Bodge city :P Also got "nice" cpu time on Linux, and add it to user cpu time. Same as was earlier done on FreeBSD.
Fixed the >1000 processes bug. It now doesn't care about a space, and makes sure what it's grabbing is a number.
Now finally gets RAM total. Also uses a new command to get RAM free, and the load values. Anything other than parsing top really :)
Fixed the regexps to match K on memory details from top
Fix for the solaris(?) problem where memory values drop below 10mb. If there is a "K" after the number, then we now divide the value by 1024.
I noticed that FreeBSD seems to put some cpu time under "nice". This is as good as "user", so we just add it on to that.
Now looks at all disks, not just those with devices starting with a /. This adds swap devices to our list of monitored stuff.
Some cases weren't working. This was due to me using .* instead of [^\s]+, whic I gather is "greedy". It was getting the number of users instead of the minutes. This should fix those erratic spikes we've seen.
Added some basic support for Linux. Linux top chucks out values in K's, so we need to strip down to Megabytes (to be inline with the others). Also, not convinced about the output of top, it seems to be stating that only a couple of % of CPU is in use, when I can see clearly this isn't correct.
Some rather basic multi-platforming. Things still to do; - FreeBSD section can not get total RAM - May be common sections in both sections of top - Need to add Linux support - Need to check for the odd cases when, for example, there isn't a space between the processes: and the next number.
Moved the top paramenters to the platform dependent section, due to the fact that the top on Linux is different.
The starts of some "os deciding" code. At present it only sets the paths to the appropriate location (for the test systems I've tried). The $ostype variable is set to the output of "uname -s", so it can be used at other points in this code in the future.
Load information is now obtained from the 'uptime' command rather than 'top' - top is not as quick and rather more inconsistent across platforms.
Made the uptime checking much more efficient. It now, more or less, checks for patterns in the "most likely first" sort of order... at least for the three most common ones.
The uptimes section now works, and accounts for every permutation. The only one we have been unable to verify is if the uptime is < 1min. There is some debugging code at the top, this allows each permutation to easily be checked. This is not efficient, it needs to be reordered to make the most common case come first.
Changed the names of the XML fields that were clashing with the names in teh XMLPacket definition.
Changed the print_pair method to accept any default value other than zero and "unknown". All the calls to this method have been altered accordingly.
Removed the unnecessary + at the end of the load regexp.
A slightly more robust way of ensuring that the end of packet.load.load15 is not chopped off.
A slightely neater way of doing the uptime bit.
Now gets the uptime in a way that should work for all those "odd" cases. This could probably be done much neater than it is right now. Also not tested on other platforms yet, just Solaris.
Fixed a problem with load15 loosing it's two floating point values.
Tidied up the uptime. Format is DAYS:HOURS:MINUTES.
User list now has a trailing space, including the empty list.
Added getting of uptime.
Got the ordering wrong ;-/
Fixed uninitialized value use on zero users.
Fixed the error on splitting the user list when there are no users logged in ;-)
Moved the location of binaries to the top of the file. This will make moving to other operating systems a touch easier.
For assisting AJ with his client, this version now reports the total swap rather than the swap in use.
Megabyte values for memory are no longer undefined ;)
Values in gigabytes are now reported in megabytes.
Undefined numbers are now shown as "0.00" rather than "0". This might just be a temporary thing while we test its use...
Values that are not defined, yet are still supposed to be numbers, shall now be displayed as "0" rather than the string "unknown".
Now using df -ak for obtaining disk information. This provides a few more details and the formatting seems to be a lot more consistent across various *nix platforms/versions of df.x
Just minor changes.
Added disk information for selected partitions.
Just changed the format of the version tag, so it's the same as the data.
Added a version identifier. The host could/should check this.
Added grabbing of some useful operating system information.
A Perl script to return various information about a host machine by examining the output of some common Unix/Linux commands. This is a stopgap to act as a generic way of collecting the data. It is perhaps more reliable than the current Java host at doing this and it can obviously be used by a C++ program as well until the C++ host is ready to find the information out itself.
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.