Changeset 137adeacfa90491a37b256709b3f05d793547d6e
- Timestamp:
- 05/20/10 02:32:10
(3 years ago)
- Author:
- Mark Harrison <mark@omniti.com>
- git-committer:
- Mark Harrison <mark@omniti.com> 1274322730 +0000
- git-parent:
[e607684de2bdbf415825c461584e8c8437511ab4]
- git-author:
- Mark Harrison <mark@omniti.com> 1274322730 +0000
- Message:
Convert the Core::ZpoolFree? module to be a wildcard module (refs #8)
git-svn-id: https://labs.omniti.com/resmon/branches/resmon2@388 8c0face9-b7db-6ec6-c4b3-d5f7145c7d55
-
Files:
-
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
| rc3d87d4 |
r137adea |
|
| 17 | 17 | |
|---|
| 18 | 18 | Core::ZpoolFree { |
|---|
| 19 | | zpools: noop |
|---|
| | 19 | * : noop |
|---|
| 20 | 20 | } |
|---|
| 21 | 21 | |
|---|
| 22 | 22 | Core::ZpoolFree { |
|---|
| 23 | | zpools: zfs_path = '/sbin/zfs' |
|---|
| | 23 | * : zfs_path => '/sbin/zfs' |
|---|
| 24 | 24 | } |
|---|
| 25 | 25 | |
|---|
| … | … | |
| 60 | 60 | =head1 METRICS |
|---|
| 61 | 61 | |
|---|
| 62 | | A set of metrics is returned for each pool on the system, with the name of the |
|---|
| 63 | | pool being used as a prefix. For example, if you have rpool and data pools, |
|---|
| 64 | | then you will end up with both rpool_free_KB and data_free_KB (as well as the |
|---|
| 65 | | rest of the metrics for each pool). |
|---|
| | 62 | A set of metrics is returned for each pool on the system. |
|---|
| 66 | 63 | |
|---|
| 67 | 64 | =over |
|---|
| 68 | 65 | |
|---|
| 69 | | =item poolname_free_MB |
|---|
| | 66 | =item free_MB |
|---|
| 70 | 67 | |
|---|
| 71 | 68 | The amount of free space in the pool, measured in megabytes. |
|---|
| 72 | 69 | |
|---|
| 73 | | =item poolname_used_MB |
|---|
| | 70 | =item used_MB |
|---|
| 74 | 71 | |
|---|
| 75 | 72 | The amount of used space in the pool, measured in megabytes. |
|---|
| 76 | 73 | |
|---|
| 77 | | =item poolname_percent_full |
|---|
| | 74 | =item percent_full |
|---|
| 78 | 75 | |
|---|
| 79 | 76 | The amount of used space in the pool, expressed as a percentage of the total |
|---|
| … | … | |
| 95 | 92 | ); |
|---|
| 96 | 93 | |
|---|
| 97 | | sub handler { |
|---|
| | 94 | sub wildcard_handler { |
|---|
| 98 | 95 | my $self = shift; |
|---|
| 99 | 96 | my $config = $self->{config}; # All configuration is in here |
|---|
| … | … | |
| 119 | 116 | |
|---|
| 120 | 117 | my $percent_full = sprintf("%.2f", ($used / ($used + $free)) * 100); |
|---|
| 121 | | $status->{"${name}_used_MB"} = [int($used/1048576), "i"]; |
|---|
| 122 | | $status->{"${name}_free_MB"} = [int($free/1048576), "i"]; |
|---|
| 123 | | $status->{"${name}_percent_full"} = [$percent_full, "n"]; |
|---|
| | 118 | $status->{$name}->{"used_MB"} = [int($used/1048576), "i"]; |
|---|
| | 119 | $status->{$name}->{"free_MB"} = [int($free/1048576), "i"]; |
|---|
| | 120 | $status->{$name}->{"percent_full"} = [$percent_full, "n"]; |
|---|
| 124 | 121 | } |
|---|
| 125 | 122 | |
|---|