GOPI-ADP asked how to return the Agent Group name from a Realm using the Perl API here:
GetAgent will return either an Agent (Netegrity::PolicyMgtAgent) or an Agent Group (Netegrity::PolicyMgtGroup) object depending on what is set for the Realm. The name, either if it is an Agent or Agent Group will be returned by calling the Name() method on the object returned by the Agent() method called on the realm object.
The code below will output:
domain_name->realm_name->agent_or_agentgroup_name Type=Netegrity::PolicyMgtAgent|Netegrity::PolicyMgtGroup
e.g.
mydomain->all->agentgroup_mydomain Type=Netegrity::PolicyMgtGroup
use Netegrity::PolicyMgtAPI;
use Scalar::Util qw(blessed);
$policyapi = Netegrity::PolicyMgtAPI->New();
$session = $policyapi->CreateSession("<ADMINUSER>", "<ADMINPWD>");
die "\nFATAL: Cannot create session. Please check admin credentials\n" unless ($session != undef);
$domain = $session->GetDomain("<DOMAIN>");
print $domain->Name(), "->";
$realm = $domain->GetRealm("<REALM>");
print $realm->Name(), "->";
$agent = $realm->Agent();
print $agent->Name(), " Type=";
print blessed($agent)