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.17 by tdb, Mon Jan 29 12:21:18 2001 UTC vs.
Revision 1.20 by tdb, Sun Feb 4 22:38:41 2001 UTC

# Line 21 | Line 21 | $| = 1;
21   # You'd be silly not to use this ;)
22   use strict;
23  
24 < # Path's
24 > # Paths
25   my($topbin) = "/usr/local/sbin/top";
26   my($dfbin) = "/usr/bin/df";
27   my($usersbin) = "/usr/ucb/users";
# Line 113 | Line 113 | sub include_users() {
113      chop $users;
114      my($users_count) = 0;
115      $users_count++ while $users =~ /\w+/g;
116 <    my($users_list) = $users;
116 >    my($users_list) = $users." ";
117  
118      &print_pair(1, "packet.users.count", $users_count);
119      &print_pair(0, "packet.users.list", $users_list);
# Line 131 | Line 131 | sub include_top() {
131  
132      &print_pair(1, "packet.load.load1", $top =~ /load averages:\s*([^\s]+?),/);
133      &print_pair(1, "packet.load.load5", $top =~ /load averages:\s*.+?,\s*([^\s]+?),/);
134 <    &print_pair(1, "packet.load.load15", $top =~ /load averages:\s*.+?,\s*.+?,\s*([^\s]+?)\s*/);
134 >    &print_pair(1, "packet.load.load15", $top =~ /load averages:\s*.+?,\s*.+?,\s*([^\s]+?)\s.*/);
135      &print_pair(1, "packet.processes.total", $top =~ /([^\s]+?) processes:/);
136      &print_pair(1, "packet.processes.sleeping", $top =~ / ([^\s]+?) sleeping/);
137      &print_pair(1, "packet.processes.zombie", $top =~ / ([^\s]+?) zombie/);
# Line 193 | Line 193 | sub include_osver() {
193   # sub to get system uptime.
194   sub include_uptime() {
195  
196    # Need a regexp guru to strip the junk on this line
196      my($uptime) = `$uptimebin`;
197 +    $uptime =~ /up ([0-9]+) .*, ([0-9]+:[0-9]+)/;
198 +    $uptime = "$1:$2";
199  
200      &print_pair(0, "packet.os.uptime", $uptime);
201  
202 < }
202 > }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines