source: ocsinventory-agent/trunk/fuentes/lib/Ocsinventory/Agent/Backend/OS/AIX/Drives.pm @ 468

Last change on this file since 468 was 468, checked in by mabarracus, 4 years ago

Copyt trusty code

File size: 840 bytes
Line 
1package Ocsinventory::Agent::Backend::OS::AIX::Drives;
2
3use strict;
4sub check {can_run("df")}
5
6sub run {
7  my $params = shift;
8  my $common = $params->{common};
9
10  my $free;
11  my $filesystem;
12  my $total;
13  my $type;
14  my $volumn; 
15
16  my @fs;
17  my @fstype;
18#Looking for mount points and disk space
19# Aix option -kP
20  for(`df -kP`) {
21
22    next if /^Filesystem\s*1024-blocks.*/;
23
24    if (/^(\S+)\s+(\S+)\s+(\S+)\s+(\S+)\s+(\S+)\s+(\S+)\n/) {
25      $type = $1;
26      @fs=`lsfs -c $6`;
27      @fstype = split /:/,$fs[1];     
28      $filesystem = $fstype[2];
29      $total = sprintf("%i",($2/1024)); 
30      $free = sprintf("%i",($4/1024));
31      $volumn = $6;       
32    }
33
34    next if $filesystem =~ /procfs/;
35
36    $common->addDrive({
37        FREE => $free,
38        FILESYSTEM => $filesystem,
39        TOTAL => $total,
40        TYPE => $type,
41        VOLUMN => $volumn
42        });
43
44  }
45}
46
471;
Note: See TracBrowser for help on using the repository browser.