Changeset e8ef2ccfb09720067735cf322b3805842b653a77

Show
Ignore:
Timestamp:
06/02/10 15:08:58 (4 years ago)
Author:
Jason Dixon <jdixon@omniti.com>
git-committer:
Jason Dixon <jdixon@omniti.com> 1275491338 +0000
git-parent:

[4fa114606e56b9593852bf076826c06a05edcad0]

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

use negative indexes, duh. fixes freebsd and openbsd

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

Files:

Legend:

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

    r515adc1 re8ef2cc  
    7070    $output =~ s/\s+/ /g; 
    7171    if ($osname eq 'solaris') { 
    72         @values = (split(/\s+/, $output))[19..21]; 
     72        @values = (split(/\s+/, $output))[-3..-1]; 
    7373    } elsif ($osname eq 'linux') { 
    74         @values = (split(/\s+/, $output))[12..14]; 
     74        @values = (split(/\s+/, $output))[-5..-3]; 
    7575    } elsif ($osname eq 'openbsd') { 
    76         @values = (split(/\s+/, $output))[16..18]; 
     76        @values = (split(/\s+/, $output))[-3..-1]; 
    7777    } elsif ($osname eq 'freebsd') { 
    78         @values = (split(/\s+/, $output))[16..18]; 
     78        @values = (split(/\s+/, $output))[-3..-1]; 
    7979    } else { 
    8080        die "Unknown platform: $osname";