Announcements:

Nornir Course starts October 24th.

Sign-up here

Live Training Session in San Francisco, November 19th - 22nd

Sign-up here
Kirk Byers Image
Kirk Byers Image

Articles:

Email-List:

StackStorm + Nagios event-driven Automation (Part1)

By Carl Montanari

In an earlier post, we created and executed our first action in Stackstorm. The action didn't do much, however. It was just a simple script that printed a message.

In this article, we'll ramp things up a bit and execute an action based upon on a "trigger". A "trigger" is a Stackstorm term that pretty much does what you expect! A trigger will get...triggered and then execute an action.

Read More

StackStorm + Nagios event-driven Automation (Part2)

By Carl Montanari

Previously, we configured Nagios to send a webhook to StackStorm. This will notify StackStorm of any downed hosts and will include the hostname in the Nagios message. In response to this event, StackStorm is currently setup to run our simple "hello world" action.

Our task now is to build not just a simple action—but a "workflow", that orchestrates the checking, remediation, and verification (to confirm that the device is now back online) of any failed hosts. Let's jump right into it...

Read More

Join Email-List

If you are interested in my Python courses or in learning more about network automation—sign up for my email-list.

Starting in December—a free, email-course on Learning Python (More Details)

StackStorm: Hello World

By Carl Montanari

Writing scripts or playbooks is only one piece of the greater puzzle that is automation. When do these scripts get executed, what arguments get passed, how can they be made consumable by non-developer team members, and best of all--how can they automatically be executed in response to some event?

Recently we have began to address some of these challenges internally--specifically, how can we abstract away, or simplify, some of our script argument passing, and how can we automate execution of scripts in response to events.

Read More

Nornir using an Ansible Inventory (Part1)

By Carl Montanari

Several months ago I presented at the Packet Pushers Virtual Design Clinic (VDC) 3, my session was titled, "CI/CD for Networking".

In this presentation, I demonstrated leveraging Jenkins and Ansible to provide a repeatable and automatable method for managing network device configurations.

I selected Ansible, more specifically NAPALM-Ansible, as the network automation tool of choice for a few reasons:

Read More

Nornir using an Ansible Inventory (Part2)

By Carl Montanari

In Part 1 of this series we covered: installing Nornir, using Ansible inventory in Nornir, Nornir tasks and results, and using Jinja2 for configuration rendering.

In this post, we'll start with our rendered Jinja2 configurations and write these configurations to disk. We'll also use Nornir plus NAPALM to retrieve and save the current device configurations. Finally, we will stage a set of configuration changes, obtain a live diff between the current and proposed configurations, and then commit these changes to the devices.

Read More

An Introduction to Nornir

By Kirk Byers

Recently David Barroso and others (including me) have created a new network automation framework named Nornir. The vast majority of the credit belongs to David, however.

Nornir is a Python framework that provides inventory management and concurrency. It belongs in the same category as Ansible and Salt.

I am excited about Nornir and the possibility of an all Python automation framework. Note, while I refer to an all 'Python framework', this is referring to the execution environment. In other words, what you write your program in and what you execute.

Read More

Using Nornir for OS Upgrades (Part 1)

By Kirk Byers

Previously I wrote an article that Introduces Nornir

In this article, I want to expand on the Nornir introduction and do something more interesting. In particular, I want to use Nornir to Secure Copy files to a set of network devices. I then want to use that file transfer process and some additional code to perform an OS upgrade on two Cisco IOS routers (part 2).

Unfortunately, I am going to switch from using Nornir 1.1 to using Nornir 2.0. There are some meaningful differences between the two versions. Additionally, Nornir 2.0 is not released yet so I am going to be working out of the 2.0 branch in GitHub.

Read More

Using Nornir for OS Upgrades (Part 2)

By Kirk Byers

In Part1, I wrote about Nornir's inventory and about using Nornir and the netmiko_file_transfer plugin to transfer a file to twelve devices across three different platforms.

Now we are going to continue this OS upgrade process. In this article, we are going to do the following: expand the file transfer to select different files (based on the platform); set the boot variable; save of the running configuration; reload the device.

For the first task (expanding the file transfer), we will use all twelve devices. For the remaining three tasks, we will only focus on Cisco IOS. In other words, we will actually perform the OS upgrade on the two Cisco IOS devices.

Read More

Netmiko SSH Proxy Support

By Kirk Byers

Netmiko supports SSH proxies.

By this I mean you can 'bounce' through an intermediate server while connecting to a remote network device.

This article will demonstrate how to use this feature.

Read More

Netmiko and what constitutes done

By Kirk Byers

Screen-scraping suffers from two fundamental problems—the first is that screen-scraping returns unstructured data (i.e. a big, block of text) and the second is that the communication channel has no good notion of being done. While people frequently bring up the former, the latter is probably a bigger issue.

Let's discuss the second issue in some more detail (and what it implies).

The communication channel has no good notion of being done.

Read More

The Python Debugger (pdb)

By Kirk Byers

In order to debug effectively, you need to be able to:

1. Extract information from your system. This information can be messages printed to standard output, logging messages, stack traces, or analysis through using a debugger.

2. Make changes to your program and see how it affects the information extracted in step1.

Read More

StackStorm + Nagios event-driven Automation (Part1)

By Carl Montanari

In an earlier post, we created and executed our first action in Stackstorm. The action didn't do much, however. It was just a simple script that printed a message.

In this article, we'll ramp things up a bit and execute an action based upon on a "trigger". A "trigger" is a Stackstorm term that pretty much does what you expect! A trigger will get...triggered and then execute an action.

Read More

Join Email-List

If you are interested in my Python for Network Engineers courses or in learning more about using Python for network automation—sign up for my email-list.

Starting in December—a free email course on Learning Python (More Details)

StackStorm + Nagios event-driven Automation (Part2)

By Carl Montanari

Previously, we configured Nagios to send a webhook to StackStorm. This will notify StackStorm of any downed hosts and will include the hostname in the Nagios message. In response to this event, StackStorm is currently setup to run our simple "hello world" action.

Our task now is to build not just a simple action—but a "workflow", that orchestrates the checking, remediation, and verification (to confirm that the device is now back online) of any failed hosts. Let's jump right into it...

Read More

StackStorm: Hello World

By Carl Montanari

Writing scripts or playbooks is only one piece of the greater puzzle that is automation. When do these scripts get executed, what arguments get passed, how can they be made consumable by non-developer team members, and best of all--how can they automatically be executed in response to some event?

Recently we have began to address some of these challenges internally--specifically, how can we abstract away, or simplify, some of our script argument passing, and how can we automate execution of scripts in response to events.

Read More

Nornir using an Ansible Inventory (Part1)

By Carl Montanari

Several months ago I presented at the Packet Pushers Virtual Design Clinic (VDC) 3, my session was titled, "CI/CD for Networking".

In this presentation, I demonstrated leveraging Jenkins and Ansible to provide a repeatable and automatable method for managing network device configurations.

I selected Ansible, more specifically NAPALM-Ansible, as the network automation tool of choice for a few reasons:

Read More

Nornir using an Ansible Inventory (Part2)

By Carl Montanari

In Part 1 of this series we covered: installing Nornir, using Ansible inventory in Nornir, Nornir tasks and results, and using Jinja2 for configuration rendering.

In this post, we'll start with our rendered Jinja2 configurations and write these configurations to disk. We'll also use Nornir plus NAPALM to retrieve and save the current device configurations. Finally, we will stage a set of configuration changes, obtain a live diff between the current and proposed configurations, and then commit these changes to the devices.

Read More

An Introduction to Nornir

By Kirk Byers

Recently David Barroso and others (including me) have created a new network automation framework named Nornir. The vast majority of the credit belongs to David, however.

Nornir is a Python framework that provides inventory management and concurrency. It belongs in the same category as Ansible and Salt.

I am excited about Nornir and the possibility of an all Python automation framework. Note, while I refer to an all 'Python framework', this is referring to the execution environment. In other words, what you write your program in and what you execute.

Read More

Using Nornir for OS Upgrades (Part 1)

By Kirk Byers

Previously I wrote an article that Introduces Nornir

In this article, I want to expand on the Nornir introduction and do something more interesting. In particular, I want to use Nornir to Secure Copy files to a set of network devices. I then want to use that file transfer process and some additional code to perform an OS upgrade on two Cisco IOS routers (part 2).

Unfortunately, I am going to switch from using Nornir 1.1 to using Nornir 2.0. There are some meaningful differences between the two versions. Additionally, Nornir 2.0 is not released yet so I am going to be working out of the 2.0 branch in GitHub.

Read More

Using Nornir for OS Upgrades (Part 2)

By Kirk Byers

In Part1, I wrote about Nornir's inventory and about using Nornir and the netmiko_file_transfer plugin to transfer a file to twelve devices across three different platforms.

Now we are going to continue this OS upgrade process. In this article, we are going to do the following: expand the file transfer to select different files (based on the platform); set the boot variable; save of the running configuration; reload the device.

For the first task (expanding the file transfer), we will use all twelve devices. For the remaining three tasks, we will only focus on Cisco IOS. In other words, we will actually perform the OS upgrade on the two Cisco IOS devices.

Read More

Netmiko SSH Proxy Support

By Kirk Byers

Netmiko supports SSH proxies.

By this I mean you can 'bounce' through an intermediate server while connecting to a remote network device.

This article will demonstrate how to use this feature.

Read More

Netmiko and what constitutes done

By Kirk Byers

Screen-scraping suffers from two fundamental problems—the first is that screen-scraping returns unstructured data (i.e. a big, block of text) and the second is that the communication channel has no good notion of being done. While people frequently bring up the former, the latter is probably a bigger issue.

Let's discuss the second issue in some more detail (and what it implies).

The communication channel has no good notion of being done.

Read More

The Python Debugger (pdb)

By Kirk Byers

In order to debug effectively, you need to be able to:

1. Extract information from your system. This information can be messages printed to standard output, logging messages, stack traces, or analysis through using a debugger.

2. Make changes to your program and see how it affects the information extracted in step1.

Read More

Join Email-List

If you are interested in my Python for Network Engineers courses or in learning more about using Python for network automation—sign up for my email-list.

Starting in December—a free email course on Learning Python (More Details)

Articles:

StackStorm + Nagios event-driven Automation (Part1)

By Carl Montanari

In an earlier post, we created and executed our first action in Stackstorm. The action didn't do much, however. It was just a simple script that printed a message.

In this article, we'll ramp things up a bit and execute an action based upon on a "trigger". A "trigger" is a Stackstorm term that pretty much does what you expect! A trigger will get...triggered and then execute an action.

Read More

StackStorm + Nagios event-driven Automation (Part2)

By Carl Montanari

Previously, we configured Nagios to send a webhook to StackStorm. This will notify StackStorm of any downed hosts and will include the hostname in the Nagios message. In response to this event, StackStorm is currently setup to run our simple "hello world" action.

Our task now is to build not just a simple action—but a "workflow", that orchestrates the checking, remediation, and verification (to confirm that the device is now back online) of any failed hosts. Let's jump right into it...

Read More

StackStorm: Hello World

By Carl Montanari

Writing scripts or playbooks is only one piece of the greater puzzle that is automation. When do these scripts get executed, what arguments get passed, how can they be made consumable by non-developer team members, and best of all--how can they automatically be executed in response to some event?

Recently we have began to address some of these challenges internally--specifically, how can we abstract away, or simplify, some of our script argument passing, and how can we automate execution of scripts in response to events.

Read More

Nornir using an Ansible Inventory (Part1)

By Carl Montanari

Several months ago I presented at the Packet Pushers Virtual Design Clinic (VDC) 3, my session was titled, "CI/CD for Networking".

In this presentation, I demonstrated leveraging Jenkins and Ansible to provide a repeatable and automatable method for managing network device configurations.

I selected Ansible, more specifically NAPALM-Ansible, as the network automation tool of choice for a few reasons:

Read More

Nornir using an Ansible Inventory (Part2)

By Carl Montanari

In Part 1 of this series we covered: installing Nornir, using Ansible inventory in Nornir, Nornir tasks and results, and using Jinja2 for configuration rendering.

In this post, we'll start with our rendered Jinja2 configurations and write these configurations to disk. We'll also use Nornir plus NAPALM to retrieve and save the current device configurations. Finally, we will stage a set of configuration changes, obtain a live diff between the current and proposed configurations, and then commit these changes to the devices.

Read More

An Introduction to Nornir

By Kirk Byers

Recently David Barroso and others (including me) have created a new network automation framework named Nornir. The vast majority of the credit belongs to David, however.

Nornir is a Python framework that provides inventory management and concurrency. It belongs in the same category as Ansible and Salt.

I am excited about Nornir and the possibility of an all Python automation framework. Note, while I refer to an all 'Python framework', this is referring to the execution environment. In other words, what you write your program in and what you execute.

Read More

Using Nornir for OS Upgrades (Part 1)

By Kirk Byers

Previously I wrote an article that Introduces Nornir

In this article, I want to expand on the Nornir introduction and do something more interesting. In particular, I want to use Nornir to Secure Copy files to a set of network devices. I then want to use that file transfer process and some additional code to perform an OS upgrade on two Cisco IOS routers (part 2).

Unfortunately, I am going to switch from using Nornir 1.1 to using Nornir 2.0. There are some meaningful differences between the two versions. Additionally, Nornir 2.0 is not released yet so I am going to be working out of the 2.0 branch in GitHub.

Read More

Using Nornir for OS Upgrades (Part 2)

By Kirk Byers

In Part1, I wrote about Nornir's inventory and about using Nornir and the netmiko_file_transfer plugin to transfer a file to twelve devices across three different platforms.

Now we are going to continue this OS upgrade process. In this article, we are going to do the following: expand the file transfer to select different files (based on the platform); set the boot variable; save of the running configuration; reload the device.

For the first task (expanding the file transfer), we will use all twelve devices. For the remaining three tasks, we will only focus on Cisco IOS. In other words, we will actually perform the OS upgrade on the two Cisco IOS devices.

Read More

Netmiko SSH Proxy Support

By Kirk Byers

Netmiko supports SSH proxies.

By this I mean you can 'bounce' through an intermediate server while connecting to a remote network device.

This article will demonstrate how to use this feature.

Read More

Netmiko and what constitutes done

By Kirk Byers

Screen-scraping suffers from two fundamental problems—the first is that screen-scraping returns unstructured data (i.e. a big, block of text) and the second is that the communication channel has no good notion of being done. While people frequently bring up the former, the latter is probably a bigger issue.

Let's discuss the second issue in some more detail (and what it implies).

The communication channel has no good notion of being done.

Read More

The Python Debugger (pdb)

By Kirk Byers

In order to debug effectively, you need to be able to:

1. Extract information from your system. This information can be messages printed to standard output, logging messages, stack traces, or analysis through using a debugger.

2. Make changes to your program and see how it affects the information extracted in step1.

Read More