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.32 by tdb, Tue Feb 13 11:57:48 2001 UTC vs.
Revision 1.33 by tdb, Tue Feb 13 12:18:07 2001 UTC

# Line 225 | Line 225 | sub include_top() {
225          $swap_free*=1024 if $2 eq "G";
226          &print_pair(0, "packet.swap.free", $swap_free);
227      }
228 +    elsif ($ostype eq "Linux") {
229 +        &print_pair(0, "packet.processes.total", $top =~ /([^\s]+?) processes:/);
230 +        &print_pair(0, "packet.processes.sleeping", $top =~ / ([^\s]+?) sleeping/);
231 +        &print_pair(0, "packet.processes.zombie", $top =~ / ([^\s]+?) zombie/);
232 +        &print_pair(0, "packet.processes.stopped", $top =~ / ([^\s]+?) stopped/);
233 +        &print_pair(0, "packet.processes.cpu", $top =~ /([^\s]+?)\s*running/);
234 +        &print_pair(0, "packet.cpu.idle", $top =~ /([^\s]+?)% idle/);
235 +        &print_pair(0, "packet.cpu.user", $top =~ /([^\s]+?)% user/);
236 +        &print_pair(0, "packet.cpu.kernel", $top =~ /([^\s]+?)% system/);
237 +        &print_pair(0, "packet.cpu.iowait", $top =~ /([^\s]+?)% interrupt/);
238 +        &print_pair(0, "packet.cpu.swap", $top =~ /([^\s]+?)% swap/);
239 +        
240 +        # The following need to be specified in megabytes.
241 +        # If they are preceeded by a G, then multiply by 1024.  
242 +        
243 +        $top =~ / ([^\s]+?)([KMG]) av/;
244 +        my($real) = $1;
245 +        $real*=1024 if $2 eq "G";
246 +        $real/=1024 if $2 eq "K";
247 +        &print_pair(0, "packet.memory.total", int($real));
248 +        
249 +        $top =~ / ([^\s]+?)([KMG]) free/;
250 +        my($free) = $1;
251 +        $free*=1024 if $2 eq "G";
252 +        $free/=1024 if $2 eq "K";
253 +        &print_pair(0, "packet.memory.free", int($free));
254 +        
255 +        $top =~ /Swap:\s+([^\s]+?)([KMG]) av/;
256 +        my($swap_total) = $1;
257 +        $swap_total*=1024 if $2 eq "G";
258 +        $swap_total/=1024 if $2 eq "K";
259 +        &print_pair(0, "packet.swap.total", int($swap_total));
260 +        
261 +        $top =~ /Swap:.*, ([^\s]+?)([KMG]) free/;
262 +        my($swap_free) = $1;
263 +        $swap_free*=1024 if $2 eq "G";
264 +        $swap_free/=1024 if $2 eq "K";
265 +        &print_pair(0, "packet.swap.free", int($swap_free));
266 +    }
267      else {
268          # we could have some catchall here
269 +        # but as it stands this means we'll just skip top stuff
270 +        # for unknown systems
271      }
272   }
273  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines