Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

 
 

Paragon Planner Keywords For Use Within a Rule

The following are built-in convenient keywords available that can be used within a rule.

Keyword

Supported Vendor

Description and Example

$(hostname)

All

This keyword returns node’s hostname.

$(os)

All

This keyword returns node’s operating system name.

$(version)

Vendors, whose configs contains the version.

This keyword returns node’s operating system version

Note:

Huawei and IOS-XR are example vendors where version cannot be determined from configuration files, and thus this keyword is not applicable for them.

$(node.isis_system_id)

All

This keyword returns the node’s ISIS system id.

$(node.hardware) or $(node.type)

All

This keyword returns the node’s hardware type.

$(instance)

All

This keyword is used to return the name of the instance you are currently in. For example if your instance is family inet, $(instance) will return “family inet”.

$(instance.name)

All

Only applicable when your instance name has two or more words separated by space. This keyword is used to return the name of the instance you are in minus the first word. For example if your instance is family inet, $(instance.name) will return “inet”.

Note:

If your instance has two or more words separated by a space, $(instance.name) will only return the second word. For example, if your instance is interface ge-1/8/1/2 l2type vlan, $(instance.name) will return “ge-1/8/1/2”.

$(instance.value)

All

Only applicable when your instance name has two or more words separated by space. This keyword is used to return the name of the instance you are currently in minus the first word. For example, if your instance is “family inet”, $(instance.value) will return “inet”

If your instance has more than two words separated by space, $(instance.value) will return everything minus the first word. For example, if your instance is “interface ge-1/8/1/2 l2type vlan”, $(instance.value) will return “ge-1/8/1/2 l2type vlan”.

$(instance.[n]) where n is 0 to unlimited.

All

Useful when your instance name has two or more words separated by space, and you want to choose which word you would like to return. For example if your instance is “address-family ipv4 vrf SHIELD_1”, $(instance.3) will return “SHIELD_1”.

$(keyword_instance.na me) where keyword_instance is the first word of the instance name

All

Only applicable when your instance name has two or more words separated by space. This keyword is similar to $(instance.name). For example if your instance name is “family inet”, $(family.name) will return “inet”. However, unlike $(instance.name) It can be used to return not only the current instance name, but also the name of the instance at the higher hierarchical level. For example:

policy-map core class 5002 bandwidth percent 2 If your current instance is class 5002, $(policy-map.name) will return “core”, while $(class.name) will return “5002”

Another example:

snmp { 
v3 {
 usm {
 local-engine { 
user wandl_usr {
 authentication-md5 { 
authentication-key "$xxxx";

If your current instance is authentication-md5, $(user.name) will return wandl_usr.If your current instance is authentication-md5, $(user.name) will return wandl_usr.

$(keyword_instance.val ue) where keyword_instance is the first word of the instance name.

All

Only applicable when your instance name has two or more words separated by space.

Similar to $(instance.value), for example if you instance name is “interface ge-1/8/1/2 l2type vlan”, $(interface.value) will return “ge-1/8/1/2 l2type vlan”.

However, unlike $(instance.value), this keyword can be used to return not only the current instance name, but also the name of the instance at the higher hierarchical level.

Example: router bgp 88 address-family ipv4 vrf wandl2012 redistribute ospf 919 vrf wandl2012 match internal external 1 external 2 no synchronization exit-address-family ! If your current instance is “address-family ipv4 vrf wandl2012”, $(router.value) will return “bgp 88”.

$(keyword_instance.chi ld) where keyword_instance is the parent name of an instance.

Junos

This keyword is useful when your instance has higher hierarchical level of 2 or more and you want to return instance name of the higher instance, excluding the top one.

In the following example, the “authentication-md5” instance has a hierarchical level of 5 (snmp -> v3 -> usm -> local-engine -> user wandl_usr).

snmp { 
v3 {
 usm {
 local-engine { 
user wandl_usr {
 authentication-md5 { 
authentication-key "$xxxx";

When your instance is authentication-md5 , $(snmp.child) will return “v3”, $(v3.child) will return usm, $(local-engine.child) will return “user wandl_usr”.

Note:

This variable does not work when the higher instance name has two or more words separated by space. For example $(user.child) is not valid as the instance has two words: “user wandl_usr”. Basically, if your higher instance has a name (i.e user.name), then it doesn’t have a child (i.e. user.child)

$(keyword)

Junos

Keyword is the first word of a line inside an instance. It is used to return a line inside an instance minus the keyword.

In the following example, when your instance is system, then $(host-name) will return J5, $(time-zone) will return EST, and $(authentication-order) will return [ tacplus password ]

system {
    host-name J5;
    time-zone EST;
    authentication-order [ tacplus password ];
}

$(keyword) will only return one line. If you have multiple lines with the same keyword at the beginning of the line, only the first one will be return

$(keyword) can also be used to return a line in the instance above your current instance. For example:

firewall {
    policer 10m {
        if-exceeding {
            bandwidth-limit 10m;
            burst-size-limit 3k;
        }
        then discard;
    }
}

When your instance is if-exceeding, $(then) will return “discard”. It is not recommended to refer line in the higher instance using $(keyword) directly. See $(keyword_instance.keyword).

$(keyword_instance.ke yword) where keyword_instance is the first word of an instance, and keyword is the first word of a line inside an instance.

Junos

It is used to return a line inside an instance, specified by keyword_instance, minus the keyword. For example,

interfaces {
    ge-0/0/0 {
        description “physical interface”
        unit 0 {
            description "management interface for J1";
        }
    }
}

When your instance is unit 0, $(description) will return “management interface” for j1, while $(ge-0/0/0.description) will return “physical interface”. Note that $(unit.description) will also return “management interface for j1”

While it is not recommended usage, when you are not inside any instance, you can also use $(keyword_instance.instance) to return a line inside a direct underneath instance. For example:

system {
    host-name J1;
    time-zone EST;
    authentication-order [ tacplus password ];
}
routing-options {
    router-id 22.22.0.5;
}

When your instance is global, $(system.host-name) will return “J1”, $(system.timezone) will return “EST”, $(system.authentication-order) will return “[ tacplus password ]”, $(routing-options.route r-id) will return “22.22.0.5”

The following are possible #conform statements that may appear in the template.

Table 1: Header Syntax - Conform Statements

#conform name <template_name>

(Required) Identifies the template name.

#conform type <cisco ios| cisco ios-xr juniper junos|alu timos| huawei|redback|zte>

(Required) Indicates the vendor and operating system of the configuration files for which the template will be used, e.g., Cisco IOS, IOS-XR, Juniper Junos, etc.

#conform use regular-expression

(Optional) Recognizes regular expression syntax in the template

#conform ignore escchars [](){}|+^$

(Optional) Characters specified after the “#conform ignore escchars” will be treated as is, and not as special regular expression characters, when regular expression use has been enabled. Without this line, you would need to precede those text characters with a backslash ‘\’ to avoid interpretation of the character as a regular expression. The default characters that are ignored are: [](){}|+^$. You can customize the list, or add additional ones as you see fit.

#conform apply_model <model1> <model2> etc or #conform include_model <model1> <model2> etc

(Optional) To perform checking only for the specified hardware family.

#conform apply_model mx320 ptx5000 will only do checking on hardware type mx320 and ptx5000

#conform exclude_model <model1> <model2> etc

(Optional) To exclude checking for the specified hardware family.

#conform exclude_model mx320 ptx5000 will not do checking on mx320 and ptx5000