Description
Nornir scrapli is another nornir plugin that we can use to send monitoring and configuration commands.
Nornir scrapli send command is used to send monitoring and troubleshooting commands which will be discussed in this section.
Nornir scrapli configuration commands is used to send configuration commands which will be discussed in the next section.
Network automation data structure for separating data and configuration is what we discuss in this module.
Each configuration has some data that may be different or the same between devices. SNMP community, IP address of NTP servers, network addresses in EIGRP configuration and IP address and AS number of neighbors in BGP configuration are some examples of data in network automation.
How to store and access the data of the configuration of various network devices is what we call network automation data structure
In this section, we use inventory files to store and access the configuration data as well.
But in the next section we will store and access data of configurations via its own specific data structure.
Nornir data structure in network automation gives us the ability to separate the data configuration from the configuration itself and also from the automation Python code.
In the previous section, we used Nornir inventory files to keep also configuration data. In this section we use Nornir specific data structure to store and acces configuration data.
Nornir Napalm getter and Send Commands are two methods to send monitoring and troubleshooting commands to network devices in napalm plugin.
Nornir Napalm getters are vendor independent show commands common to all supported vendors and it is invented by Napalm. This is the topic of this section.
Nornir napalm send command is normal CLI command that we send to network devices when no getter is provided and it is the topic of the next section.
We also discuss the structured output of Napalm getter and CLI commands and how it differs from Netmiko and Scrapli plugin.
Nornir Napalm structured output is another benefit of the Napalm plugin, which gives the capability to parse the output of show commands without using regular expressions.
structured ouput applies to both napalm getters and CLI commands.
Nornir Napalm send configuration through “napalm_configure” task is what we demonstrate in this section.
We will also discuss the difference between “merge” and “replace” when sending the configuration to network devices.
“Napalm backup config” is the keyword.
Automating config backup and restore is one of the most important applications of network automation that is the topic of this section.
We will learn how to backup configuration of network devices using Nornir getter, “napalm_get” from “nornir_napalm” plugin and “write_file” from “nornir_utils” plugin and also restore the configuration to the network devices using “napalm_configure” with “replace” option from “nornir_napalm” plugin.
Nornir Napalm validate task is used to automate compliance check of configuration of network devices.
Compliance check means to make sure that the network device have compatible configuration for example in DNS and NTP servers.
Avoid clear-text passwords in Nornir inventory, which we didn’t consider from the start of the course, but which in practice must be considered as a very important security concern.
In this section, we will learn the methods to avoid storing clear text passwords in Nornir inventory files.
Python sys argv or system arguments are used to get the arguments from the command line in Python scripts.
We use system arguments in network automation to get the password of network devices from the command line to avoid storing clear text passwords in Nornir inventory files.
GPG process to encrypt password is another method to avoid clear text password in nornir inventory files or python script.
In this section we will learn to use GPG to encrypt passwords used to connect to network devices in network automation.
Public key authentication is another method of authentication in which we do not need to give any password. Therefore there is no need to store any clear text password in network automation inventory or script.
In this section we will implement public key authentication on cisco IOS device and use nornir scrapli plugin to connect to devices through public key authentication.
Nornir filter inventory gives the capability to limit the execution of automation scripts on a specific network device or group of network devices.
In this section we will learn about two different types of Nornir filter, basic filtering using the filter method and advanced filtering using the F object.
Using google TextFSM parser in Nornir automation scripts helps us get structured output when sending show monitoring commands to network devices from which any information can be easily extracted.
In this section we show how to use textfsm in nornir Netmiko and Scrapli plugins.
In the next section, we will introduce the Genie parser, which belongs to the Cisco Company.
Cisco genie parser in network automation gives the capability to convert the output of monitoring commands into a structured JSON output where any specific information can be easily extracted without using regular expressions.
In this section, we demonstrate the genie parser in the nornir netmiko and nornir scrapli automation scripts.
Genie Dq (Dictionary Query) is a Python pyATS library and part of genie.utils to easily query a python dictionary without having to traverse through the dictionary to get a value.
Python Jinja2 template in the simplest form is a file containing the configuration of devices, but using variables instead of configuration data that differ between devices.
Python jinja2 template help us to keep the configuration and data separate from the automation script.
In this section, we will learn how to create and use a simple jinja2 template configuration file alongside any Python Nornir automation script to make the automation more professional.
In the next section, we will introduce more advanced capability of jinja2 template configuration file.
Python Jinja2 template also has loops, conditionals, and some other features in addition to the variable substitution discussed in the previous section.
In this section, we demonstrate a jinja2 configuration template with all these features.
Reviews
There are no reviews yet.