This file is indexed.

/usr/share/fusioninventory/lib/FusionInventory/Agent/Tools/AIX.pm is in fusioninventory-agent 1:2.3.10.1-1.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
package FusionInventory::Agent::Tools::AIX;

use strict;
use warnings;
use base 'Exporter';

use English qw(-no_match_vars);

use FusionInventory::Agent::Tools;
use Memoize;

our @EXPORT = qw(
    getLsvpdInfos
    getAdaptersFromLsdev
);

memoize('getLsvpdInfos');
memoize('getAdaptersFromLsdev');

sub getLsvpdInfos {
    my (%params) = (
        command => 'lsvpd',
        @_
    );

    my $handle = getFileHandle(%params);
    return unless $handle;

    my @devices;
    my $device;

    # skip first lines
    while (my $line = <$handle>) {
        last if $line =~ /^\*FC \?+/;
    }

    while (my $line = <$handle>) {
        if ($line =~ /^\*FC \?+/) {
            # block delimiter
            push @devices, $device;
            undef $device;
            next;
        }

        chomp $line;
        next unless $line =~ /^\* ([A-Z]{2}) \s+ (.*\S)/x;
        $device->{$1} = $2;
    }
    close $handle;

    # last device
    push @devices, $device;

    return @devices;
}

sub getAdaptersFromLsdev {
    my (%params) = (
        command => 'lsdev -Cc adapter -F "name:type:description"',
        @_
    );

    my $handle = getFileHandle(%params);
    return unless $handle;

    my @adapters;

    while (my $line = <$handle>) {
        chomp $line;
        my @info = split(/:/, $line);
        push @adapters, {
            NAME        => $info[0],
            TYPE        => $info[1],
            DESCRIPTION => $info[2]
        };
    }
    close $handle;

    return @adapters;
}

1;
__END__

=head1 NAME

FusionInventory::Agent::Tools::AIX - AIX generic functions

=head1 DESCRIPTION

This module provides some generic functions for AIX.

=head1 FUNCTIONS

=head2 getLsvpdInfos

Returns a list of vital product data infos, extracted from lsvpd output.

@infos = (
    {
        DS => 'System VPD',
        YL => 'U9111.520.65DEDAB',
        RT => 'VSYS',
        FG => 'XXSV',
        BR => 'O0',
        SE => '65DEDAB',
        TM => '9111-520',
        SU => '0004AC0BA763',
        VK => 'ipzSeries'
    },
    ...
)

=head2 getAdaptersFromLsdev

Returns a list of adapters, extracted from lsdev -Cc adapter output