Changeset f24888a3fadc40802cd1a85d2e6c7aa416a5aadd

Show
Ignore:
Timestamp:
04/25/10 21:44:52 (5 years ago)
Author:
Jason Dixon <jdixon@omniti.com>
git-committer:
Jason Dixon <jdixon@omniti.com> 1272231892 +0000
git-parent:

[f21a9bbe574ee86efd04eca84e06053eb4525e91]

git-author:
Jason Dixon <jdixon@omniti.com> 1272231892 +0000
Message:

linux support

git-svn-id: https://labs.omniti.com/resmon/branches/resmon2@328 8c0face9-b7db-6ec6-c4b3-d5f7145c7d55

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • lib/Core/Memstat.pm

    rf21a9bb rf24888a  
    55 
    66use base 'Resmon::Module'; 
     7use Data::Dumper; 
    78 
    89use Resmon::ExtComm qw(run_command cache_command); 
     
    5859module falls back on the standard vmstat collection method. 
    5960 
     61=head1 PROC METRICS 
     62 
     63Linux configurations use /proc/meminfo for memory statistics. 
     64 
    6065=back 
    6166 
     
    98103            } 
    99104        } 
     105    } elsif ($osname eq 'linux') { 
     106        my %metrics; 
     107        open(MEMINFO, '/proc/meminfo') || die "Unable to read: /proc/meminfo\n"; 
     108        while (<MEMINFO>) { 
     109            /(\w+)\:\s+(\d+).*/; 
     110            $metrics{$1} = [$2, 'i']; 
     111        } 
     112        close(MEMINFO); 
     113        return \%metrics; 
    100114    } elsif ($osname eq 'openbsd') { 
    101115        my $output = run_command("$vmstat_path");