Book Image

Hands-On Enterprise Automation with Python

By : Bassem Aly
Book Image

Hands-On Enterprise Automation with Python

By: Bassem Aly

Overview of this book

Hands-On Enterprise Automation with Python starts by covering the set up of a Python environment to perform automation tasks, as well as the modules, libraries, and tools you will be using. We’ll explore examples of network automation tasks using simple Python programs and Ansible. Next, we will walk you through automating administration tasks with Python Fabric, where you will learn to perform server configuration and administration, along with system administration tasks such as user management, database management, and process management. As you progress through this book, you’ll automate several testing services with Python scripts and perform automation tasks on virtual machines and cloud infrastructure with Python. In the concluding chapters, you will cover Python-based offensive security tools and learn how to automate your security tasks. By the end of this book, you will have mastered the skills of automating several system administration tasks with Python.
Table of Contents (20 chapters)

Extracting Useful Data from Network Devices

We have already seen in the previous chapter how to access a network device using different methods and protocols, then execute commands on the remote device to get an output back to Python. Now, it's time to extract some useful data from this output.

In this chapter, you'll learn how to use different tools and libraries in Python to extract useful data from returned output and act on it using regular expressions. Also, we will use a special library called CiscoConfParse to audit the configuration, then we will learn how to visualize data to generate visually appealing graphs and reports using the matplotlib library.

We will cover the following topics in this chapter:

  • Understanding parsers
  • Introduction to regular expressions
  • Configuration auditing using Ciscoconfparse
  • Visualizing returned data with matplotlib