Solaris 10 Agent doesn´t report virtual IP
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OCS Inventory: Unified Unix Agent |
Fix Released
|
Medium
|
mortheres |
Bug Description
If you have virtual IP in your network device, the agent doesn´t report theses information.
I have changed this file above to enable the Virtual IP information, and identify which "zone" use each IP.
FILE: Ocsinventory-
package Ocsinventory:
use strict;
sub check {
can_run(
}
sub run {
my $params = shift;
my $inventory = $params-
my $description;
my $ipaddress;
my $ipgateway;
my $ipmask;
my $ipsubnet;
my $macaddr;
my $status;
my $type;
foreach (`netstat -rn`){
$ipgateway=$1 if /^default\
}
my $zone;
my $cont=1;
my $iface;
my @interface;
sub GetInterface {
my $inter = "";
my $count = 0;
my @interface_list = ();
foreach (`ifconfig -a`){
if (/^(\S+):/i){
if ($count != 0){
push(
}
$count = 1;
$inter = "";
$inter = $inter . $_;
}else{
$inter = $inter . $_;
}
}
push(
return @interface_list
}
@interface = GetInterface();
foreach (@interface){
$description = $1 if /^(\S+):/; # Interface name
$status = 1 if /<UP,/;
$ipaddress = $1 if /inet\s+(\S+)/i;
$ipmask = $1 if /\S*netmask\
if (/ether\s+(\S+)/i) {
$macaddr = sprintf "%02x:%
map hex, split /\:/, $1;
}
if (/zone\s+(\S+)/i) {
$zone = $1;
$macaddr = "zone: ".$zone;
}
if($description && $ipmask ){
$cont = 0;
#HEX TO DEC TO BIN TO IP
$ipmask = hex($ipmask);
$ipmask = sprintf("%d", $ipmask);
$ipmask = unpack("B*", pack("N", $ipmask));
$ipmask = ip_bintoip(
my $binip = &ip_iptobin ($ipaddress ,4);
my $binmask = &ip_iptobin ($ipmask ,4);
my $binsubnet = $binip & $binmask;
$ipsubnet = ip_bintoip(
$inventory-
DESCRIPTION => $description,
IPADDRESS => $ipaddress,
IPGATEWAY => $ipgateway,
IPMASK => $ipmask,
IPSUBNET => $ipsubnet,
MACADDR => $macaddr,
STATUS => $status?
TYPE => $type,
});
$description = $ipaddress = $ipmask = $ipsubnet = $macaddr = $status = $type = $zone = undef;
}
}
}
1;
Changed in ocsinventory-unix-agent: | |
assignee: | nobody → mortheres (mortheres) |
Changed in ocsinventory-unix-agent: | |
importance: | Undecided → Medium |
Changed in ocsinventory-unix-agent: | |
status: | New → Fix Committed |
Changed in ocsinventory-unix-agent: | |
milestone: | none → 2.1rc1 |
Changed in ocsinventory-unix-agent: | |
status: | Fix Committed → Fix Released |