Table Of Contents
Bean Shell Commands
Telnet Examples
SNMP Examples
Bean Shell Commands
This appendix describes the methods that should be used for Bean Shell in Cisco ANA commands when you want to interact with devices. In addition, it provides Telnet and SNMP environment object examples.
This appendix includes the following sections:
•
Telnet Examples—Provides examples of the available predefined Telnet environment objects.
•
SNMP Examples—Provides examples of the available predefined SNMP environment objects.
The diagram below describes the methods that should be used for Bean Shell in Cisco ANA commands when interacting with devices for Telnet and SNMP interfaces.
Figure B-1 Bean Shell Methods
Telnet Examples
This section provides examples of the available predefined Telnet environment objects that you can use to interact with a device.
•
telnetInterface.config ("prompt","telnet command")—Where "prompt" is the expected prompt after command completes and "telnet command" is the actual command to be execute
•
telnetInterface.setStatus (1 or 2)—Where 1=success and 2=fail, used for example to signal to work flow manager that a configuration command has succeeded or failed
SNMP Examples
This section provides examples of the available predefined SNMP environment objects that you can use to interact with a device.
snmpInterface.get ("OID",true/false);
Gets OID, and displays or hides results
snmpInterface.getNext ("OID",true/false);
Gets next OID, displays or hides results
snmpInterface.set ("OID",variable type,"value");
Sets OID to specified value
snmpInterface.walk("OID",true/false);
Returns vector of strings
snmpInterface.setStatus (1 or 2);
Where 1=success and 2=fail, used for example to signal to work flow manager that a configuration command has succeeded or failed
For additional information about general scripting language refer to http://www.beanshell.org/.