Owners Manual
Perl Scripts | Actions and Adaptive CLI
OMNM 6.5.2 User Guide 591
Perl Example
The following is an example Perl script for Adaptive CLI:
#
# A script example for testing against a Cisco-XR machine.
#
# The following variables (attributes) are defined in the schema,
# and their values are assigned when the script
# is invoked from the Adaptive CLI (or Resources) manager.
# These variables will be declared with values and prepended
# to each script automatically. Something like:
#
# my $FromPort=<some number>;
# my $ToPort=<some number>;
# my $Mtu=<some number>;
# my $Desc=<some text>;
#
print("config t\n");
foreach ($FromPort .. $ToPort) {
my $Desc = "$Desc Port #$_";
my $addr = 100 + $_;
print("interface GigabitEthernet0/1/1/1.$_\n");
print("description $Desc\n");
print("ipv4 address 10.10.100.$addr 255.255.255.0\n");
print("ipv4 unreachables disable\n");
print("mtu $Mtu\n");
}
print("exit\ncommit\nexit\n");
How To:
Creating Adaptive CLI (Examples)
The examples that follow may not work for your device. They are often created with a specific
device, with specific syntax. Best practice is to telnet to the device you plan to target with your
Adaptive CLI, and test the command line there first. Then configure any extraction you plan to use
based on that testing.
The following describes the basics of creating and using Adaptive CLIs.
Example 1 - Existing Show Run
uses an existing, seeded Adaptive CLI to show protocols.
Example 2 - New Adaptive CLI
describes making and using a new Adaptive CLI.