Dell PowerConnect OpenManage Network Manager OpenManage Network Manager User G - Page 338
Using Adaptive CLI, Using Perl in Adaptive CLI
View all Dell PowerConnect OpenManage Network Manager manuals
Add to My Manuals
Save this manual to your list of manuals |
Page 338 highlights
Using Adaptive CLI You can quickly take a set of commands or configuration file snippet from a device, copy it directly into the Script editor, mark it up, and save it as a working CLI. When using the CLI Format, The Adaptive CLI tool will prompt you to create new attributes based upon your script markup. This lets you quickly create a script and schema to create an ACLI. If you have attributes that are mainly simple String attributes, this is a very quick and automated approach. Using Perl in Adaptive CLI If you need conditional logic that goes beyond simple scripting, you can use Perl in Adaptive CLI. The example below checks to see if a String Attribute is empty (null) or not. If the String attribute (ShowCmdString) has content, the show command with ShowCmdString as a parameter goes to the device. Otherwise, the Perl script skips or excludes this statement. Embedded CLI Example: [IF ShowCmdString] Show [ShowCmdString] [ENDIF ShowCmdString] You could use the CLI format for the above example, but if you need to check attributes of other types, besides String, then you must switch to Perl. For example: Boolean myFlag equals True: if ($myFlag) { ... } Integer myInt greater than zero: Example: if ($myInt > 0) { ... } To check whether a string is a particular value-like from a valid values list entry assigned to the String attribute-then you must also use Perl. The CLI format only can test if the String exists. It cannot validate its value when populated. For example: EncapsulationType = "VLAN-CCC", "VLAN-TCC", ... You can not do this check with the CLI Format: [IF EncapsulationType = "VLAN-TCC"]. Instead, use a Perl script with a statement like this: If ($EncapsulationType eq "VLAN-TCC") 338 Introducing Actions and Adaptive CLI | Actions and Adaptive CLI