Changeset 07e57339baf73dce759db70f8a82a904d445e142

Show
Ignore:
Timestamp:
04/24/10 20:24:24 (5 years ago)
Author:
Jason Dixon <jdixon@omniti.com>
git-committer:
Jason Dixon <jdixon@omniti.com> 1272140664 +0000
git-parent:

[f1a3f12622bdf36010ca348049c0a10a2ecb11cb]

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

add Linux support

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

Files:

Legend:

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

    rf1a3f12 r07e5733  
    4949=over 
    5050 
    51 =item read_sec 
     51=item reads_sec 
    5252 
    5353Reads per second. 
    5454 
    55 =item write_sec 
     55=item writes_sec 
    5656 
    5757Writes per second. 
     
    109109Seconds spent in disk activity. 
    110110 
     111=item xfrs_sec 
     112 
     113Disk transfers per second. 
     114 
    111115=back 
    112116 
     
    125129        if ($line =~ /$disk\s+(\S+)\s+(\S+)\s+(\S+)\s+(\S+)\s+(\S+)\s+(\S+)\s+(\S+)\s+(\d+)\s+(\d+)\s+(\d+)\s+(\d+)\s+(\d+)\s+(\d+).*/) { 
    126130            return { 
    127                 'read_sec' => [$1, 'i'], 
    128                 'write_sec' => [$2, 'i'], 
     131                'reads_sec' => [$1, 'i'], 
     132                'writes_sec' => [$2, 'i'], 
    129133                'kb_read_sec' => [$3, 'i'], 
    130134                'kb_write_sec' => [$4, 'i'], 
     
    138142                'txport_errors' => [$12, 'i'], 
    139143                'total_errors' => [$13, 'i'] 
     144            }; 
     145        } else { 
     146            die "Unable to find disk: $disk\n"; 
     147        } 
     148    } elsif ($osname eq 'linux') { 
     149        my $output = run_command("$iostat_path $disk"); 
     150        my ($line) = grep(/$disk\s*/, split(/\n/, $output)); 
     151        if ($line =~ /^$disk\s+(\S+)\s+(\S+)\s+(\S+)\s+(\d+)\s+(\d+).*/) { 
     152            return { 
     153                'xfrs_sec' => [$1, 'i'], 
     154                'reads_sec' => [$2, 'i'], 
     155                'writes_sec' => [$3, 'i'] 
    140156            }; 
    141157        } else {