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.8 by pjm2, Mon Jan 22 16:51:02 2001 UTC vs.
Revision 1.10 by pjm2, Mon Jan 22 17:17:48 2001 UTC

# Line 55 | Line 55 | sub print_pair($$$) {
55  
56      if (!defined $value) {
57          if ($type) {
58 <            $value = 0;
58 >            $value = "0.00";
59          }
60          else {
61              $value = "unknown";
# Line 133 | Line 133 | sub include_top() {
133      &print_pair(1, "packet.cpu.kernel", $top =~ /([^\s]+?)% kernel/);
134      &print_pair(1, "packet.cpu.iowait", $top =~ /([^\s]+?)% iowait/);
135      &print_pair(1, "packet.cpu.swap", $top =~ /([^\s]+?)% swap/);
136 <    &print_pair(1, "packet.memory.real", $top =~ /([^\s]+?)[MG] real/);
137 <    &print_pair(1, "packet.memory.free", $top =~ /([^\s]+?)[MG] free/);
138 <    &print_pair(1, "packet.memory.swap_in_use", $top =~ /([^\s]+?)[MG] swap in use/);
139 <    &print_pair(1, "packet.memory.swap_free", $top =~ /([^\s]+?)[MG] swap free/);
140 <    
136 >
137 >    # The following need to be specified in megabytes.
138 >    # If they are preceeded by a G, then multiply by 1024.  
139 >
140 >    $top =~ /([^\s]+?)([MG]) real/;
141 >    my($real) = $1*1024 if $2 eq "G";
142 >    &print_pair(1, "packet.memory.real", $real);
143 >
144 >    $top =~ /([^\s]+?)([MG]) free/;
145 >    my($free) = $1*1024 if $2 eq "G";
146 >    &print_pair(1, "packet.memory.free", $free);
147 >
148 >    $top =~ /([^\s]+?)([MG]) swap in use/;
149 >    my($swap_in_use) = $1*1024 if $2 eq "G";
150 >    &print_pair(1, "packet.memory.swap_in_use", $swap_in_use);
151 >
152 >    $top =~ /([^\s]+?)([MG]) swap free/;
153 >    my($swap_free) = $1*1024 if $2 eq "G";
154 >    &print_pair(1, "packet.memory.swap_free", $swap_free);
155   }
156  
157   # sub to get details of the machine's operating system.

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines