#!/sbin/perl -w use strict; use InCharge::session; # Input credentials for the connection to DOMAIN my $domain = 'IP'; my $user = 'admin'; my $passwd = "asdfgh"; my $broker= 'localhost:426'; my $session = ""; # Setting up the connection to console/domain manager.... $session = eval {InCharge::session->new( broker => $broker, domain => $domain, username => $user, password => $passwd) }; if($@){ print "Could not Connect to $domain \n......."; exit 2; } my $sourceDomainName=eval{$session->getServerName}; if($@){ print "Script Failed to get ServerName....Exiting the Script\n"; exit 1; } print "Server is....... $sourceDomainName \n"; # Reading the Key Value from ini Files my @providerCloudSequence; open(my $iniFH, '<', '/tmp/user_defined_connection.ini') or die "Unable to open file:$!\n"; while(<$iniFH>) { chomp; my @providerCloudClass=split('=',$_); push @providerCloudSequence,$providerCloudClass[0]; if($@){ print "Script Failed to get the Sequence....Exiting the Script\n"; exit 1; } } my %idlcodes = map { split /=|\s+/; } <$iniFH>; if($@){ print "Script Failed to create the hash....Exiting the Script\n"; exit 1; } close $iniFH; I get the file into hash and sequence (keys) into array as hash doesnt follow sequence , idea is to use keys from array and get value from hash and compare againt the instances i get below. Incharge session is a 3rd part API my @networkAdapterInstances=$session->getInstances("NetworkAdapter"); for (my $index=0;$index<=$#networkAdapterInstances;$index++){ my $interfaceObject=$session->object("NetworkAdapter",$networkAdapterInstances[$index]); ( my $interfaceAlias,my $systemName,my $deviceID)=$interfaceObject->get("InterfaceAlias","SystemName","DeviceID"); if($@){ print "Script Failed \n"; exit 1; } exit 1; print "$interfaceAlias \n"; }