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

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

Copyt trusty code

File size: 475 bytes
Line 
1package Ocsinventory::Agent::Backend::OS::AIX::IPv4;
2
3sub check {can_run("ifconfig")}
4
5# Initialise the distro entry
6sub run {
7  my $params = shift;
8  my $common = $params->{common};
9  my @ip;
10
11  #Looking for ip addresses with ifconfig, except loopback
12  # AIX need -a option
13  for(`ifconfig -a`){#ifconfig in the path
14    # AIX ligne inet
15    if(/^\s*inet\s+(\S+).*/){($1=~/127.+/)?next:push @ip, $1};
16  }
17  $ip=join "/", @ip;
18  $common->setHardware({IPADDR => $ip});
19}
20
211;
Note: See TracBrowser for help on using the repository browser.