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

Comparing projects/cms/source/host/ihost-perl/plugins/perl/i-scream_top.pl (file contents):
Revision 1.2 by tdb, Tue Dec 18 04:07:17 2001 UTC vs.
Revision 1.5 by tdb, Sat May 18 18:15:57 2002 UTC

# Line 1 | Line 1
1   #!/usr/bin/perl -w
2  
3 + #
4 + # i-scream central monitoring system
5 + # Copyright (C) 2000-2002 i-scream
6 + #
7 + # This program is free software; you can redistribute it and/or
8 + # modify it under the terms of the GNU General Public License
9 + # as published by the Free Software Foundation; either version 2
10 + # of the License, or (at your option) any later version.
11 + #
12 + # This program is distributed in the hope that it will be useful,
13 + # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 + # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15 + # GNU General Public License for more details.
16 + #
17 + # You should have received a copy of the GNU General Public License
18 + # along with this program; if not, write to the Free Software
19 + # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
20 + #
21 +
22   #-----------------------------------------------------------------
23   # i-scream host plugin - top parsing (cpu, proc, mem, & swap)
24   #     $Author$
# Line 32 | Line 51 | if ($ostype eq "SunOS") {
51   }
52   elsif ($ostype eq "Linux") {
53      # covers: Debian r2.2
54 <    $topbin = "/usr/bin/top -d1 -n2 -b -p0";
54 >    $topbin = "/usr/bin/top -d1 -n2 -b";
55   }
56   elsif ($ostype eq "FreeBSD") {
57      # covers: FreeBSD 4.X
# Line 146 | Line 165 | sub include_top() {
165          
166          # get RAM slightly differently
167          my($real) = `$sysctlbin -n hw.physmem`;
168 <        my($free) = $real - `$sysctlbin -n hw.usermem`;
168 >        my($v_free_count) = `$sysctlbin -n vm.stats.vm.v_free_count`;
169 >        my($v_page_size) = `$sysctlbin -n vm.stats.vm.v_page_size`;
170 >        my($free) = $v_free_count * $v_page_size;
171          
172          # turn bytes to megabytes
173          $real = ($real / 1024) / 1024;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines