User Tools

Site Tools


guides:user:scenarios:cfg_parse_cisco
LDAP: couldn't connect to LDAP server

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
guides:user:scenarios:cfg_parse_cisco [2020/07/29 07:40] bdorlandtguides:user:scenarios:cfg_parse_cisco [2022/11/01 08:38] (current) pgels
Line 1: Line 1:
 +===== Config parsing =====
 +> <color orange>Config parsing is temporarily disabled </color>
 +
 +/*
 +Create a new Command job with a desired name.
 +
 +==== Command job ====
 +<code>
 +!
 +</code>
 +
 +==== Job scenario ====
 +<code>
 +Description Parse config for <node>
 +vendor_type := Cisco_IOS
 +context := interfaces
 +task := interface_cfg_parse
 +</code>
 +
 +==== Parsing template Interfaces_Cisco_IOS ====
 +<code>
 +[interface]
 +interface <if_name>
 + description <if_description:>
 +</code>
 +
 +==== Parsing template Interface_details_Cisco_IOS ====
 +
 +<code>
 +[interface <>]
 + description <if_description:>
 + ip address <if_address> <if_netmask>
 + ip ospf message-digest-key <if_message_digest_key> md5 7 <if_message_digest_md5>
 + ip ospf <if_ospf> area <if_ospf_area>
 +</code>
 +
 +==== Scenario ====
 +<code>
 +Description Interface config parsing on <node>
 +
 +# Test whether node is live and reachable
 +reachable -n <node>
 +if <error>
 +     log -m "<node> is not reachable"
 +    stop
 +endif
 +log -m "<node> is reachable"
 +<interfaces> := Parse_run -n <node> -t Interfaces_<vendor_type> -c <context> -v if_name
 +log -m "interfaces: <interfaces>"
 +
 +foreach <interface> in <interfaces> 
 +    log -m <interface>
 +    <context> := "interface <interface>"
 +    <description> := Parse_run -n <node> -t Interface_details_<vendor_type> -c <context> -v if_description
 +    if <description>
 +        log -m "Interface <interface> has description <description>"
 +    endif
 +endeach
 +</code>
 +
 +**NOTE**: during the scenario the full configuration is only retrieved once. No matter the amount of parse_run commands you use in the scenario. This way the device will not be overloaded.
 +*/
  
guides/user/scenarios/cfg_parse_cisco.txt · Last modified: 2022/11/01 08:38 by pgels