A management protocol exists between agents and the Policy Server. An agent uses this protocol to manage its caches and encryption keys in a manner consistent with policies and administrative changes on the Policy Server.
When Policy Server changes occur that require corresponding agent changes, the Policy Server issues commands for the agent to make the changes. You can retrieve these commands by calling DoManagement(). DoManagement() returns an array of AgentResponseAttr objects. Call GetID() in this object to retrieve any management commands that might be pending from the Policy Server.
The following script checks for pending management commands. If any commands are found, the script prints out each command ID and, if appropriate, the value associated with a command:
use Netegrity::AgentAPI; $agentname="agent1"; $ip="127.0.0.1"; $secret="oursecret"; $agentapi = Netegrity::AgentAPI‑>New($agentname,$secret); $serverconfig = $agentapi‑>AddServerConfig($ip); $agentapi‑>Connect(); @attr = $agentapi‑>DoManagement(); if (@attr == undef) { print "No commands are pending from the Policy Server."; } else { print "IDs of commands pending from the Policy Server:"; foreach $attr(@attr) { if ($attr‑>GetID()==SM_AGENTAPI_AFFILIATE_KEY_UPDATE || $attr‑>GetID()==SM_AGENTAPI_CACHE_FLUSH_THIS_USER || $attr‑>GetID()==SM_AGENTAPI_CACHE_FLUSH_THIS_REALM) { print "\n Command ID: " . $attr‑>GetID(); print "\n \tValue: " . $attr‑>GetValue(); } else { #No need to print values for the IDs below. Value #will contain either binary data or no data. print "\nCommand ID: " . $attr‑>GetID(); } } }
Copyright © 2010 CA. All rights reserved. | Email CA about this topic |