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

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

Copyt trusty code

File size: 638 bytes
Line 
1package Ocsinventory::Agent::Backend::OS::Solaris::Controllers;
2use strict;
3
4sub check { can_run ("cfgadm") }
5
6sub run {
7  my $params = shift;
8  my $common = $params->{common};
9
10  my $name;
11  my $type;
12  my $manufacturer;
13
14  foreach(`cfgadm -s cols=ap_id:type:info`){
15    next if (/^Ap_Id/);         
16    if(/^(\S+)\s+/){
17      $name = $1;
18    }
19    if(/^\S+\s+(\S+)/){
20      $type = $1;
21    }
22#No manufacturer, but informations about controller
23    if(/^\S+\s+\S+\s+(\S+)/){
24      $manufacturer = $1;
25    }                           
26    $common->addController({
27        'NAME'          => $name,
28        'MANUFACTURER'  => $manufacturer,
29        'TYPE'          => $type,
30        });
31  }
32}
331
Note: See TracBrowser for help on using the repository browser.