ViewVC Help
View File | Revision Log | Show Annotations | Revision Graph | Root Listing
root/i-scream/projects/cms/source/host/generic/statgrab.pl
Revision 1.49
Mon Jun 10 14:10:44 2002 UTC (22 years, 5 months ago) by tdb
Branch: MAIN
CVS Tags: HEAD
Changes since 1.48: +2 -2 lines
FILE REMOVED
Tidy up of files. These are all old things that are not only no longer used
but are also probably useless to anyone other than us. This saves checking
them out all the time, and makes the "cms/source" tree contain only current
stuff. They'll still exist in the attic's though :)

Revision 1.48 - (view) (annotate) - [select for diffs]
Tue May 21 16:47:11 2002 UTC (22 years, 6 months ago) by tdb
Branch: MAIN
Changes since 1.47: +3 -2 lines
Diff to previous 1.47 , to selected 1.32
Added URL to GPL headers.

Revision 1.47 - (view) (annotate) - [select for diffs]
Sat May 18 18:15:56 2002 UTC (22 years, 6 months ago) by tdb
Branch: MAIN
Changes since 1.46: +22 -3 lines
Diff to previous 1.46 , to selected 1.32
i-scream is now licensed under the GPL. I've added the GPL headers to every
source file, and put a full copy of the license in the appropriate places.
I think I've covered everything. This is going to be a mad commit ;)

Revision 1.46 - (view) (annotate) - [select for diffs]
Wed Nov 14 15:18:25 2001 UTC (23 years ago) by tdb
Branch: MAIN
Changes since 1.45: +2 -2 lines
Diff to previous 1.45 , to selected 1.32
It seems you're only meant to have one top level tag in XML. But, then
again, maybe I shouldn't use IE6 to debug XML... ;)

Revision 1.45 - (view) (annotate) - [select for diffs]
Tue Oct 16 10:48:08 2001 UTC (23 years, 1 month ago) by tdb
Branch: MAIN
Changes since 1.44: +3 -3 lines
Diff to previous 1.44 , to selected 1.32
Added the -l flag to df. This tells df to only look at local filesystems. In
practice not doing so means that NFS file systems are checked, and this was not
sensible for a couple of reasons:
1. Should the remote machine go down, df hangs while the nfs client tries to
   reconnect. This then hangs statgrab and ihost, which then flags an incorrect
   'heartbeat' alert on the cms.
2. It is likely the remote machine will be monitored too, which means data is
   being processed for the remote disk more than once. This is a waste of
   resources, and also means any alerts are replicated.

Revision 1.44 - (view) (annotate) - [select for diffs]
Fri May 25 19:42:26 2001 UTC (23 years, 6 months ago) by tdb
Branch: MAIN
Changes since 1.43: +5 -5 lines
Diff to previous 1.43 , to selected 1.32
Some linux distributions use a different top output (sigh). This fixes it for
another distribution that it's been tested on.

Thanks to nuked (Fred Barnes) for pointing this out and testing it.

Revision 1.43 - (view) (annotate) - [select for diffs]
Wed Mar 21 15:38:01 2001 UTC (23 years, 8 months ago) by tdb
Branch: MAIN
CVS Tags: PROJECT_COMPLETION
Changes since 1.42: +4 -4 lines
Diff to previous 1.42 , to selected 1.32
"brackets are the most evil thing in the world" - pjm2

Revision 1.42 - (view) (annotate) - [select for diffs]
Wed Mar 21 10:51:32 2001 UTC (23 years, 8 months ago) by pjm2
Branch: MAIN
Changes since 1.41: +6 -6 lines
Diff to previous 1.41 , to selected 1.32
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.

Revision 1.41 - (view) (annotate) - [select for diffs]
Tue Mar 20 13:04:22 2001 UTC (23 years, 8 months ago) by tdb
Branch: MAIN
Changes since 1.40: +16 -6 lines
Diff to previous 1.40 , to selected 1.32
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.

Revision 1.40 - (view) (annotate) - [select for diffs]
Mon Mar 19 23:05:55 2001 UTC (23 years, 8 months ago) by tdb
Branch: MAIN
Changes since 1.39: +28 -28 lines
Diff to previous 1.39 , to selected 1.32
Fixed the >1000 processes bug. It now doesn't care about a space, and makes sure
what it's grabbing is a number.

Revision 1.39 - (view) (annotate) - [select for diffs]
Mon Mar 19 22:38:20 2001 UTC (23 years, 8 months ago) by tdb
Branch: MAIN
Changes since 1.38: +24 -16 lines
Diff to previous 1.38 , to selected 1.32
Now finally gets RAM total. Also uses a new command to get RAM free, and the
load values. Anything other than parsing top really :)

Revision 1.38 - (view) (annotate) - [select for diffs]
Thu Mar 15 10:45:15 2001 UTC (23 years, 8 months ago) by pjm2
Branch: MAIN
Changes since 1.37: +13 -10 lines
Diff to previous 1.37 , to selected 1.32
Fixed the regexps to match K on memory details from top

Revision 1.37 - (view) (annotate) - [select for diffs]
Sun Mar 11 12:51:52 2001 UTC (23 years, 8 months ago) by pjm2
Branch: MAIN
Changes since 1.36: +6 -2 lines
Diff to previous 1.36 , to selected 1.32
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.

Revision 1.36 - (view) (annotate) - [select for diffs]
Sat Mar 3 21:26:55 2001 UTC (23 years, 8 months ago) by tdb
Branch: MAIN
Changes since 1.35: +8 -3 lines
Diff to previous 1.35 , to selected 1.32
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.

Revision 1.35 - (view) (annotate) - [select for diffs]
Wed Feb 28 12:26:36 2001 UTC (23 years, 8 months ago) by tdb
Branch: MAIN
Changes since 1.34: +3 -3 lines
Diff to previous 1.34 , to selected 1.32
Now looks at all disks, not just those with devices starting with a /. This adds
swap devices to our list of monitored stuff.

Revision 1.34 - (view) (annotate) - [select for diffs]
Mon Feb 26 23:58:42 2001 UTC (23 years, 9 months ago) by tdb
Branch: MAIN
Changes since 1.33: +5 -5 lines
Diff to previous 1.33 , to selected 1.32
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.

Revision 1.33 - (view) (annotate) - [select for diffs]
Tue Feb 13 12:18:07 2001 UTC (23 years, 9 months ago) by tdb
Branch: MAIN
Changes since 1.32: +43 -2 lines
Diff to previous 1.32
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.

Revision 1.32 - (view) (annotate) - [selected]
Tue Feb 13 11:57:48 2001 UTC (23 years, 9 months ago) by tdb
Branch: MAIN
Changes since 1.31: +80 -38 lines
Diff to previous 1.31
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.

Revision 1.31 - (view) (annotate) - [select for diffs]
Mon Feb 5 20:27:59 2001 UTC (23 years, 9 months ago) by tdb
Branch: MAIN
Changes since 1.30: +7 -7 lines
Diff to previous 1.30 , to selected 1.32
Moved the top paramenters to the platform dependent section, due to the fact
that the top on Linux is different.

Revision 1.30 - (view) (annotate) - [select for diffs]
Mon Feb 5 19:59:35 2001 UTC (23 years, 9 months ago) by tdb
Branch: MAIN
Changes since 1.29: +39 -13 lines
Diff to previous 1.29 , to selected 1.32
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.

Revision 1.29 - (view) (annotate) - [select for diffs]
Mon Feb 5 17:51:56 2001 UTC (23 years, 9 months ago) by pjm2
Branch: MAIN
Changes since 1.28: +6 -5 lines
Diff to previous 1.28 , to selected 1.32
Load information is now obtained from the 'uptime' command rather than
'top' - top is not as quick and rather more inconsistent across platforms.

Revision 1.28 - (view) (annotate) - [select for diffs]
Mon Feb 5 17:43:45 2001 UTC (23 years, 9 months ago) by tdb
Branch: MAIN
Changes since 1.27: +36 -39 lines
Diff to previous 1.27 , to selected 1.32
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.

Revision 1.27 - (view) (annotate) - [select for diffs]
Mon Feb 5 17:21:04 2001 UTC (23 years, 9 months ago) by tdb
Branch: MAIN
Changes since 1.26: +53 -9 lines
Diff to previous 1.26 , to selected 1.32
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.

Revision 1.26 - (view) (annotate) - [select for diffs]
Mon Feb 5 17:13:26 2001 UTC (23 years, 9 months ago) by pjm2
Branch: MAIN
Changes since 1.25: +5 -5 lines
Diff to previous 1.25 , to selected 1.32
Changed the names of the XML fields that were clashing with the names in
teh XMLPacket definition.

Revision 1.25 - (view) (annotate) - [select for diffs]
Mon Feb 5 17:05:22 2001 UTC (23 years, 9 months ago) by pjm2
Branch: MAIN
Changes since 1.24: +36 -41 lines
Diff to previous 1.24 , to selected 1.32
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.

Revision 1.24 - (view) (annotate) - [select for diffs]
Mon Feb 5 08:33:51 2001 UTC (23 years, 9 months ago) by pjm2
Branch: MAIN
Changes since 1.23: +4 -4 lines
Diff to previous 1.23 , to selected 1.32
Removed the unnecessary + at the end of the load regexp.

Revision 1.23 - (view) (annotate) - [select for diffs]
Mon Feb 5 08:27:38 2001 UTC (23 years, 9 months ago) by pjm2
Branch: MAIN
Changes since 1.22: +3 -3 lines
Diff to previous 1.22 , to selected 1.32
A slightly more robust way of ensuring that the end of packet.load.load15
is not chopped off.

Revision 1.22 - (view) (annotate) - [select for diffs]
Mon Feb 5 00:08:45 2001 UTC (23 years, 9 months ago) by tdb
Branch: MAIN
Changes since 1.21: +6 -10 lines
Diff to previous 1.21 , to selected 1.32
A slightely neater way of doing the uptime bit.

Revision 1.21 - (view) (annotate) - [select for diffs]
Sun Feb 4 23:40:39 2001 UTC (23 years, 9 months ago) by tdb
Branch: MAIN
Changes since 1.20: +30 -4 lines
Diff to previous 1.20 , to selected 1.32
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.

Revision 1.20 - (view) (annotate) - [select for diffs]
Sun Feb 4 22:38:41 2001 UTC (23 years, 9 months ago) by tdb
Branch: MAIN
Changes since 1.19: +4 -4 lines
Diff to previous 1.19 , to selected 1.32
Fixed a problem with load15 loosing it's two floating point values.

Revision 1.19 - (view) (annotate) - [select for diffs]
Thu Feb 1 03:14:35 2001 UTC (23 years, 9 months ago) by tdb
Branch: MAIN
Changes since 1.18: +5 -4 lines
Diff to previous 1.18 , to selected 1.32
Tidied up the uptime. Format is DAYS:HOURS:MINUTES.

Revision 1.18 - (view) (annotate) - [select for diffs]
Mon Jan 29 17:09:04 2001 UTC (23 years, 9 months ago) by pjm2
Branch: MAIN
Changes since 1.17: +6 -6 lines
Diff to previous 1.17 , to selected 1.32
User list now has a trailing space, including the empty list.

Revision 1.17 - (view) (annotate) - [select for diffs]
Mon Jan 29 12:21:18 2001 UTC (23 years, 9 months ago) by tdb
Branch: MAIN
Changes since 1.16: +14 -2 lines
Diff to previous 1.16 , to selected 1.32
Added getting of uptime.

Revision 1.16 - (view) (annotate) - [select for diffs]
Sun Jan 28 19:57:40 2001 UTC (23 years, 9 months ago) by pjm2
Branch: MAIN
Changes since 1.15: +4 -4 lines
Diff to previous 1.15 , to selected 1.32
Got the ordering wrong ;-/

Revision 1.15 - (view) (annotate) - [select for diffs]
Sun Jan 28 19:53:39 2001 UTC (23 years, 9 months ago) by pjm2
Branch: MAIN
Changes since 1.14: +4 -3 lines
Diff to previous 1.14 , to selected 1.32
Fixed uninitialized value use on zero users.

Revision 1.14 - (view) (annotate) - [select for diffs]
Sun Jan 28 19:50:15 2001 UTC (23 years, 9 months ago) by pjm2
Branch: MAIN
Changes since 1.13: +6 -6 lines
Diff to previous 1.13 , to selected 1.32
Fixed the error on splitting the user list when there are no users logged
in ;-)

Revision 1.13 - (view) (annotate) - [select for diffs]
Mon Jan 22 23:21:34 2001 UTC (23 years, 10 months ago) by tdb
Branch: MAIN
Changes since 1.12: +16 -10 lines
Diff to previous 1.12 , to selected 1.32
Moved the location of binaries to the top of the file. This will make moving
to other operating systems a touch easier.

Revision 1.12 - (view) (annotate) - [select for diffs]
Mon Jan 22 17:29:28 2001 UTC (23 years, 10 months ago) by pjm2
Branch: MAIN
Changes since 1.11: +6 -3 lines
Diff to previous 1.11 , to selected 1.32
For assisting AJ with his client, this version now reports the total swap
rather than the swap in use.

Revision 1.11 - (view) (annotate) - [select for diffs]
Mon Jan 22 17:23:25 2001 UTC (23 years, 10 months ago) by pjm2
Branch: MAIN
Changes since 1.10: +10 -6 lines
Diff to previous 1.10 , to selected 1.32
Megabyte values for memory are no longer undefined ;)

Revision 1.10 - (view) (annotate) - [select for diffs]
Mon Jan 22 17:17:48 2001 UTC (23 years, 10 months ago) by pjm2
Branch: MAIN
Changes since 1.9: +21 -7 lines
Diff to previous 1.9 , to selected 1.32
Values in gigabytes are now reported in megabytes.

Revision 1.9 - (view) (annotate) - [select for diffs]
Mon Jan 22 16:58:12 2001 UTC (23 years, 10 months ago) by pjm2
Branch: MAIN
Changes since 1.8: +3 -3 lines
Diff to previous 1.8 , to selected 1.32
Undefined numbers are now shown as "0.00" rather than "0".  This might
just be a temporary thing while we test its use...

Revision 1.8 - (view) (annotate) - [select for diffs]
Mon Jan 22 16:51:02 2001 UTC (23 years, 10 months ago) by pjm2
Branch: MAIN
Changes since 1.7: +40 -34 lines
Diff to previous 1.7 , to selected 1.32
Values that are not defined, yet are still supposed to be numbers, shall
now be displayed as "0" rather than the string "unknown".

Revision 1.7 - (view) (annotate) - [select for diffs]
Mon Jan 22 16:28:57 2001 UTC (23 years, 10 months ago) by pjm2
Branch: MAIN
Changes since 1.6: +11 -14 lines
Diff to previous 1.6 , to selected 1.32
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

Revision 1.6 - (view) (annotate) - [select for diffs]
Mon Jan 22 10:03:30 2001 UTC (23 years, 10 months ago) by pjm2
Branch: MAIN
Changes since 1.5: +10 -3 lines
Diff to previous 1.5 , to selected 1.32
Just minor changes.

Revision 1.5 - (view) (annotate) - [select for diffs]
Mon Jan 22 09:59:09 2001 UTC (23 years, 10 months ago) by pjm2
Branch: MAIN
Changes since 1.4: +40 -2 lines
Diff to previous 1.4 , to selected 1.32
Added disk information for selected partitions.

Revision 1.4 - (view) (annotate) - [select for diffs]
Mon Jan 22 04:09:41 2001 UTC (23 years, 10 months ago) by tdb
Branch: MAIN
Changes since 1.3: +2 -2 lines
Diff to previous 1.3 , to selected 1.32
Just changed the format of the version tag, so it's the same as the data.

Revision 1.3 - (view) (annotate) - [select for diffs]
Sat Jan 20 20:04:46 2001 UTC (23 years, 10 months ago) by tdb
Branch: MAIN
Changes since 1.2: +10 -2 lines
Diff to previous 1.2 , to selected 1.32
Added a version identifier. The host could/should check this.

Revision 1.2 - (view) (annotate) - [select for diffs]
Sat Jan 20 18:50:28 2001 UTC (23 years, 10 months ago) by tdb
Branch: MAIN
Changes since 1.1: +20 -2 lines
Diff to previous 1.1 , to selected 1.32
Added grabbing of some useful operating system information.

Revision 1.1 - (view) (annotate) - [select for diffs]
Fri Jan 19 19:37:59 2001 UTC (23 years, 10 months ago) by pjm2
Branch: MAIN
Diff to selected 1.32
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.

Convenience Links

Links to HEAD: (view) (annotate) Links to MAIN: (view) (annotate)

Compare Revisions

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.

  Diffs between and
  Type of Diff should be a