Changeset f4675da920553b92729011153d400cb7e3f84d06
- Timestamp:
- 05/06/08 21:31:26
(5 years ago)
- Author:
- Mark Harrison <mark@omniti.com>
- git-committer:
- Mark Harrison <mark@omniti.com> 1210109486 +0000
- git-parent:
[11b1de2eefa207619583622f933404d66c50ea49]
- git-author:
- Mark Harrison <mark@omniti.com> 1210109486 +0000
- Message:
Adding openbsd modules and fixing INODES.pm to deal with openbsd specifics
git-svn-id: https://labs.omniti.com/resmon/trunk@76 8c0face9-b7db-6ec6-c4b3-d5f7145c7d55
-
Files:
-
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
| rce65f3a |
rf4675da |
|
| 2 | 2 | use Resmon::ExtComm qw/cache_command/; |
|---|
| 3 | 3 | use Resmon::Module; |
|---|
| | 4 | use Switch; |
|---|
| 4 | 5 | use vars qw/@ISA/; |
|---|
| 5 | 6 | @ISA = qw/Resmon::Module/; |
|---|
| 6 | 7 | |
|---|
| 7 | | my $dfcmd = ($^O eq 'solaris') ? 'df -Fufs -oi' : 'df -iP'; |
|---|
| | 8 | my $dfcmd; |
|---|
| | 9 | my $dfregex; |
|---|
| | 10 | |
|---|
| | 11 | switch ($^O) { |
|---|
| | 12 | case 'solaris' { $dfcmd = 'df -Fufs -oi'; |
|---|
| | 13 | $dfregex = '(\d+)\s+(\d+)\s+(\d+)\s+(\d+)%'} |
|---|
| | 14 | case 'openbsd' { $dfcmd = 'df -i'; |
|---|
| | 15 | $dfregex = '(\d+)\s+(\d+)\s+(\d+)\s+(\d+)%\s+(\d+)\s+(\d+)\s+(\d+)%'} |
|---|
| | 16 | else { $dfcmd = 'df -iP'; |
|---|
| | 17 | $dfregex = '(\d+)\s+(\d+)\s+(\d+)\s+(\d+)%'} |
|---|
| | 18 | } |
|---|
| 8 | 19 | |
|---|
| 9 | 20 | sub handler { |
|---|
| … | … | |
| 14 | 25 | my $output = cache_command($dfcmd, 30); |
|---|
| 15 | 26 | my ($line) = grep(/$devorpart\s*/, split(/\n/, $output)); |
|---|
| 16 | | if($line =~ /(\d+)\s+(\d+)\s+(\d+)\s+(\d+)%/) { |
|---|
| | 27 | if($line =~ /$dfregex/) { |
|---|
| 17 | 28 | if($4 <= $arg->{'limit'}) { |
|---|
| 18 | 29 | return $arg->set_status("OK($2 $4% full)"); |
|---|