Configuring Behavior

 



 

Overview

 

The most important part of simulation is to set up the simulated environment. You can set up the desired environment by defining the behavior of the TL1 Devices, so that they will behave like a real device. The behavior of devices is done through Jython scripts.

 

The TL1 Agent Simulator provides a TL1ScriptInterface, which defines methods to perform various TL1 operations from a JPython script . For example, you can add or delete Access ID, Response Lines and Message Payload for a specific command code, send different response messages for the same command code, get current Access ID, Message payload values, set acknowledgment and completion code, etc.

 

The javadocs for the Script API methods is provided under the <SimulatorHome >/examples/javadocs directory. The name of the Script API file is SNMP_TL1_SimScrIntf.html

 

 

Enabling/Disabling TL1 Behavior Service

 

The TL1 Agent Simulator provides option to enable/disable the execution of  behavior scripts configured for the TL1 agents, at agent runtime. If behavior service is disabled, the agent will not check for script configurations before sending the response. Hence , you can use this option to improve the performance of the TL1 agent, if behavior is not required to be executed.

 

By default, the service is enabled and the behavior scripts configured (if any), will be executed.  

 

To disable the service ,

Note: The option Operations -> Initialize Service will be disabled when the TL1 agent is started.

 

 

Configuring Behavior

 

The TL1 agent simulator, supports to configure  request based scripts to simulate real time behavior of agents. Scripts can be configured on a Command Code, Command Code - AccessID or Command Code - AccessId - MessagePayload combination.

 

The configured scripts will be copied to the configuration directory. It will be executed at run time, when a request is made for the command, before and/or after processing the request.

 

Follow the steps given below, to configure scripts :

  1. Select Configure -> Behavior Simulation. The Script Table dialog is invoked . This dialog displays the scripts that are already configured.

  2. Click Add, to configure a new script. The Configure Script dialog is invoked. This dialog displays the TCS tree on the left-frame. Expand the TCS tree.

  3. You have the option to configure the script file at the following levels.

  1. Specify the condition to execute the script. The following options are available:

  1. Browse and select the script file to be configured.  The sample scripts are available under < simulator home >/examples/scripting/tl1 directory. Click Open to configure the script file.

  2. Click OK to add the script configuration in the Script Table .

  3. Click Close to exit the dialog. 

Scripts in Examples Directory

 

The following sample scripts are defined in the <simulator home>/examples/scripting/tl1 directory. A brief overview on each of the script file is provided below.

 

1. AddAccessID.py

 

The script file AddAccessID.py uses the method addAccessID( ) to add a new AID value to the Command Code, at agent run time.  This method takes the Command code and AccessId as its parameters .

 

Format :

When this script is executed, the AID value ST1-9-1 is added for the command code ED-FAC. You can replace the sample command code and AID values with your own configuration.

 

2. AddLines.py

 

The script file AddLines.py uses the method addLines( )  to Add Response Lines to the Command Code at agent run time. This method takes the following parameters as input:

Format:

3. AddMsgPayload.py

 

The script file AddMsgPayload.py uses the method addMsgPayLoad( ) to add a new Message PayLoad for a commandCode, accessId combination. This method will also add the accessId if it is not present. It takes the following parameters as input :

Format :

4. AddAutoLines.py

 

This script file uses the method addLines ( ) to add the Autonomous Lines to the corresponding Alarm Description for a Autonomous Code at agent RunTime. It takes the following parameters as input :

Format :

4. DeleteAccessID.py

 

The script file DeleteAccessID.py uses the method deleteAccessID( ) to delete an accessId for a Command Code at agent run time.  This method takes the following parameters as input:

Format:

When this script is executed, the AID value ST1-9-1 is deleted for the command code ED-FAC. You can replace the sample command code and AID values with your own configuration.

 

5. DeleteLines.py

 

The script file DeleteLines.py uses the method delLines( ) to delete an existing Response Line configured for a Command Code, at agent run time. This method takes the following parameters as input:

Format:

You can replace the sample parameter values in the script file with your own configuration.

 

6. DeleteLineWithValue.py

 

This script file DeleteLineWithValue.py uses the method deleteLine( ) to delete the response line for the specified Param Name and Value configured for a command code, at agent runtime.

 

Format :

7. DeleteAutoLines.py

 

This script file DeleteAutoLines.py uses the method delLines( ) to delete the Autonomous Lines of the corresponding alarm description configured for a Autonomous Code, at agent runtime.

 

Format :

8. DeleteAutoLineWithValue.py

 

This script file DeleteAutoLineWithValue.py uses the method deleteLine( ) to delete the Autonomous Response Line of the corresponding Alarm Description with the specified Param Name and Value, at agaent runtime.

 

Format :

9. DeleteMsgPayLoad.py

 

The script file DeleteMsgPayLoad.py uses the method delMsgPayLoad( ) to delete a MessagePayLoad for a command code, accessid combination.  This method takes the following parameters:

Format :

10. GetCurrentAID.py

 

The script file GetCurrentAID.py uses the method getCurrentAID( ), to GET the accessId that comes in the request. If the accessId is not given in the request, this method returns an empty string.

 

Format :

11. GetCurrentMPB.py

 

The script file GetCurrentMPB.py uses the method getCurrentMPB( )  to get the msgPayLoad that comes in the request. If the msgPayLoad is not given in the request, this method returns an empty string.

 

Format:

12. GetAllAIDs.py

 

The script file GetAllAIDs.py uses the method getAllAids( ) to Get all the Access Identifier to the Command Code at agent runtime. This method takes the Command code as the input parameter  It returns the value as a Vector compound.

 

Format :

13. GetAllMPBs.py

 

The script file GetAllMPBs.py uses the method getAllMpbs( ) to get all the Message Payloads for the specified command code and access identifier at agent runtime. This method takes the following parameters as input.  It returns the value as a Vector compound.

Format :

14. GetNumberOfAIDs.py

 

The script file GetNumberOfAIDspy uses the method getNumberOfAids( ) to get the number of access identifiers to the command code at agent runtime. This method takes the following parameters as input.  It returns an integer value as the count of the AIDs.

Format :

15. GetNumberOfMPBs.py

 

The script file GetNumberOfMPBs.py uses the method getNumberOfMpbs( ) to get the number of Message Payloads to the Command Code and the AID at agent runtime. This method takes the following parameters as input.  It returns an integer value as the count of the MPBs.

Format :

16. GetLine.py

 

This script file uses the method getLine( ) to get the Response Lines to the Command Code at agent runtime.

17. GetAgentPort.py

 

This script file uses the method getPort( ) to get the port number of the agent from which the agent is started.

 

Format :

18. GetIPAddress.py

 

This script file uses the method getIPAddress() to get the IP Address of the agent. This will be very useful for the Network Simulation of TL1 Devices

  

Format :

19. getScriptCondition( )

 

    This script file returns the condition (before/after get) at which the script is executing.

 

Format :

 

20. IsAIDExists.py

 

The script file IsAIDExists.py uses the method isAidExists( ) to check whether the given Access Identifier is present in the AID list for the Command Code. This method takes the following parameters as input.  It returns a Boolean value as '0' for False and '1' for True.

Format :

21. IsMPBExists.py

 

The script file IsMPBExists.py uses the method isMpbExists( ) to check whether the given Message Payload is present in the MPB list for the Command Code and its AID combination. This method takes the following parameters as input.  It returns a Boolean value as '0' for False and '1' for True.

Format :

22. SetAckCode.py

 

The script file SetAckCode.py uses the method setAckMessage( ) to SET the acknowledgment Message for a commandCode, accessId, msgPayLoad combination.

 

Note : The script API method setAckMessage( )  cannot be configured to be executed with the 'Before processing request'  condition.  

 

This method takes the following parameters as input :

Format :

24. SetComplCode.py

 

The script file SetComplCode.py uses the method setComplCode( ) to SET the Completion Code(COMPLD,DENY) for a commandCode, accessId, msgPayLoad combination. This method takes the following parameters:

Format:

25. SendAutonomousMessage.py

 

The script file SendAutonomousMessage.py uses the method sendAutonomousMessage( )  to sent the Autonomous Message at agent runtime. This method takes the following parameters as input.

Format :

26. SendAutonomouswithNumberofTimes.py

 

The script file  SendAutonomouswithNumberofTimes.py uses the method sendAutonomousMessage( ) to send the Autonomous Message with specified number of times, at agent runtime. This method takes the following parameters :

 Format :

27. SendDenyMessage.py

 

This script file uses the method sendDenyMessage( ) to send the deny message at runtime

 

Format :

28. StopTL1Agent.py

 

This script file uses the method stopAgent( )  to stop the TL1 agent in the network.

 

Format :

29. StartTL1Agent.py

 

This script file uses the method startAgent( ) to start the TL1 agent in the network.

 

Format :

30. UpdateParamValue.py

 

This script file is to update the parameter value of a Response Line configured for a command code at runtime.

 

uniquePName & uniquePValue indicates the parameter name and value that will be unique across all the lines in the response.

 

Format :

31. UpdateAutoParamValue.py

 

This script file is to update the parameter value of a Response Line of the Autonomous code at runtime

 

Format :

 



Copyright © 1996-2006, AdventNet Inc. All Rights Reserved.