Changeset 07e57339baf73dce759db70f8a82a904d445e142
- Timestamp:
- 04/24/10 20:24:24
(3 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
| rf1a3f12 |
r07e5733 |
|
| 49 | 49 | =over |
|---|
| 50 | 50 | |
|---|
| 51 | | =item read_sec |
|---|
| | 51 | =item reads_sec |
|---|
| 52 | 52 | |
|---|
| 53 | 53 | Reads per second. |
|---|
| 54 | 54 | |
|---|
| 55 | | =item write_sec |
|---|
| | 55 | =item writes_sec |
|---|
| 56 | 56 | |
|---|
| 57 | 57 | Writes per second. |
|---|
| … | … | |
| 109 | 109 | Seconds spent in disk activity. |
|---|
| 110 | 110 | |
|---|
| | 111 | =item xfrs_sec |
|---|
| | 112 | |
|---|
| | 113 | Disk transfers per second. |
|---|
| | 114 | |
|---|
| 111 | 115 | =back |
|---|
| 112 | 116 | |
|---|
| … | … | |
| 125 | 129 | 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+).*/) { |
|---|
| 126 | 130 | return { |
|---|
| 127 | | 'read_sec' => [$1, 'i'], |
|---|
| 128 | | 'write_sec' => [$2, 'i'], |
|---|
| | 131 | 'reads_sec' => [$1, 'i'], |
|---|
| | 132 | 'writes_sec' => [$2, 'i'], |
|---|
| 129 | 133 | 'kb_read_sec' => [$3, 'i'], |
|---|
| 130 | 134 | 'kb_write_sec' => [$4, 'i'], |
|---|
| … | … | |
| 138 | 142 | 'txport_errors' => [$12, 'i'], |
|---|
| 139 | 143 | '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'] |
|---|
| 140 | 156 | }; |
|---|
| 141 | 157 | } else { |
|---|