Deploy Lotus Notes Agent on different Domino Servers
For enterprise company with use many Domino Server for share load. If you create an agent you intend to deploy on multiple systems, you may find:
- The server names on which you need to deploy are different from the name of your server. In addition, you may not know the server names in advance.
- The agent developer’s signature is different from the end user’s signature.
- The development server does not have a certificate in common with the production server.
We will look at several approaches to solving the first two issues, which in turn, will make the certification issue irrelevant.
Changing the server name
When you create an agent, the name of the server on which the agent is supposed to run is stored in the agent. By default, the server name is the server on which you’re developing the agent. For the agent to run on a different server, the server name needs to change. There are three ways to do this. The first approach is to deploy your agent as disabled. Click the Schedule button in the Agent Properties box and select the option “Choose server when agent is enabled.” When the user first enables the agent, a prompt appears from which the user can choose a server name for running the agent.
The second approach is to specify that the agent can run on any server. To do this, you can click the Schedule button in the Agent Properties box, and select Any Server in the Run on field. Note that if you have replication set up between different servers and the agent modifies the same documents on those servers, you may end up with replication conflicts. The following screen illustrates both of these options.
The third approach is to write an agent that programmatically sets the server name of another agent. To do this, you can use the following code fragment:
agent.ServerName="ServerName"
Call agent.save()
where ServerName is the new server name, which you can read from a database or obtain from the end user. You need to save the agent to update the server name.
Prior to Notes/Domino , agents could not manipulate and save other agents running on the server. An agent saving another agent was only allowed to run on the client. If the agent ran on the server and attempted to modify and then save the agent, the following error message was generated:
11/04/02 05:14:35 PM AMgr: Agent ('DoEnable' in 'test1.nsf') error message: Restricted operation on a server
This was because we did not have a way to preserve the user identity associated with the agent being changed on the server. (The user ID was not present on the server to re-sign the agent with that ID.) In Notes/Domino , it is now possible to do this, if you have the proper rights. An agent can change and save another agent if both have the same effective user (the identity under which the agent is running) or if the agents’ signers are privileged and are listed in the “Sign agents to run on behalf of someone else” field (a new field that has been added to the Programmability Restrictions section of the Server document’s Security tab). In other words, users can change their own agents without any special rights, but need special authority to manipulate agents written by others.
Signing the agent
When you develop an agent, your signature is stored in the agent. You need the user’s signature to replace yours in the agent, so the agent can run in the background with the user’s rights. There are two ways to do this. Both are based on the fact that enabling an agent re-signs that agent with the signature of the person who enabled it. In addition, both approaches require that you deploy the agent as disabled. The first way relies on the end user to manually enable the agent by clicking on the enable checkbox.
The second approach is to enable the agents programmatically. This is more appropriate if you need to deploy a large number of agents. In that case, you may prefer to write an agent that enables other agents. The end user will run this agent, which then enables all the other agents. Here is the code that you need to include in your agent to programmatically enable other agents:
agent.IsEnabled = True
Call agent.save()
You need to save the agent in order to update the IsEnabled property. As mentioned previously, prior to Notes/Domino agents could not manipulate and save other agents running on the server. An agent saving another agent was only allowed to run on the client. This restriction has been removed in Notes/Domino , as long as the user has proper rights.
Viewed 13164 times by 3678 viewers













