ViewVC Help
View File | Revision Log | Show Annotations | Revision Graph | Root Listing
root/i-scream/projects/cms/source/host/generic/statgrab.pl
(Generate patch)

Comparing projects/cms/source/host/generic/statgrab.pl (file contents):
Revision 1.1 by pjm2, Fri Jan 19 19:37:59 2001 UTC vs.
Revision 1.3 by tdb, Sat Jan 20 20:04:46 2001 UTC

# Line 21 | Line 21 | $| = 1;
21   # You'd be silly not to use this ;)
22   use strict;
23  
24 + &print_ident();
25 + &include_osver();
26   &include_users();
27   &include_top();
28  
# Line 28 | Line 30 | exit(0);
30  
31  
32  
33 + # prints out an identifier for this version of statgrab.pl
34 + # the host should check this when reading data
35 + # means the host must be checked and updated to work with newer versions.
36 + sub print_ident() {
37 +    print '# statgrab.pl $Revision$';
38 +    print "\n";
39 + }
40  
41   # sub to print pairs of data, separated by a single space character.
42   sub print_pair($$) {
# Line 84 | Line 93 | sub include_top() {
93      &print_pair("packet.memory.swap_in_use", $top =~ /([^\s]+?)[MG] swap in use/);
94      &print_pair("packet.memory.swap_free", $top =~ /([^\s]+?)[MG] swap free/);
95      
96 + }
97 +
98 + sub include_osver() {
99 +
100 +    # Find out details about the operating system
101 +    my($os_name) = `uname -s`;
102 +    my($os_release) = `uname -r`;
103 +    my($os_platform) = `uname -m`;
104 +    my($os_sysname) = `uname -n`;
105 +    my($os_version) = `uname -v`;
106 +
107 +    &print_pair("packet.os.name", $os_name);
108 +    &print_pair("packet.os.release", $os_release);
109 +    &print_pair("packet.os.platform", $os_platform);
110 +    &print_pair("packet.os.sysname", $os_sysname);
111 +    &print_pair("packet.os.version", $os_version);
112 +
113   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines