Changeset f24888a3fadc40802cd1a85d2e6c7aa416a5aadd
- Timestamp:
- 04/25/10 21:44:52
(3 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
| rf21a9bb |
rf24888a |
|
| 5 | 5 | |
|---|
| 6 | 6 | use base 'Resmon::Module'; |
|---|
| | 7 | use Data::Dumper; |
|---|
| 7 | 8 | |
|---|
| 8 | 9 | use Resmon::ExtComm qw(run_command cache_command); |
|---|
| … | … | |
| 58 | 59 | module falls back on the standard vmstat collection method. |
|---|
| 59 | 60 | |
|---|
| | 61 | =head1 PROC METRICS |
|---|
| | 62 | |
|---|
| | 63 | Linux configurations use /proc/meminfo for memory statistics. |
|---|
| | 64 | |
|---|
| 60 | 65 | =back |
|---|
| 61 | 66 | |
|---|
| … | … | |
| 98 | 103 | } |
|---|
| 99 | 104 | } |
|---|
| | 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; |
|---|
| 100 | 114 | } elsif ($osname eq 'openbsd') { |
|---|
| 101 | 115 | my $output = run_command("$vmstat_path"); |
|---|