Giter Site home page Giter Site logo

ccie18643 / netwolf Goto Github PK

View Code? Open in Web Editor NEW
1.0 2.0 0.0 27 KB

NetWolf is a proof of concept for the distributed real time network monitoring and automation system capable of simultaneously interacting with thousands of network devices using vertical and horizontal scaling of resources. It consists of the manager program and number of agents. Agents can be spread out over multiple machines and bind separate processes to every available CPU core. Each of those processes maintains SSH connectivity to multiple network devices. To achieve high number of connections per core and the same time consume least amount of memory possible agent is internally based on Asyncio. Agent registers with manager and receives jobs that contain the hostname for the network device it's supposed to connect to and the set of commands that need execute on it. For the purpose of monitoring job can also contain filters that need to be applied to command output before its sent back to the manager.

Python 100.00%
python automation horizontal-scaling vertical-scaling parallel-computing asyncio

netwolf's Introduction

NetWolf

Distributed network automation concept


NetWolf is a proof of concept for the distributed real-time network monitoring and automation system capable of simultaneously interacting with thousands of network devices using vertical and horizontal scaling resources. It consists of the manager program and the number of agents. Agents can be spread over multiple machines and bind separate processes to every available CPU core. Each of those processes maintains SSH connectivity to multiple network devices. To achieve a high number of connections per core and simultaneously consume the least possible memory, the agent is internally based on Asyncio. Agent registers with the manager and receives jobs containing the hostname for the network device it's supposed to connect to and the set of commands that need to execute. For monitoring, the job can also contain filters that must be applied to the command output before it's sent back to the manager.

For PoC, I have set it up to retrieve the CPU load from a couple hundred Cisco switches and routers. Currently, I was able to maintain around 350 SSH sessions using a single core and pulling fresh data from each device every second. With this approach, the number of monitored devices scales nicely with the number of CPU cores and the number of machines used by agents. NetWolf is in a very early stage of development and is nothing more than just a toy project. However, it also has an excellent potential to be helpful in the production environment once it's mature enough.

Already implemented:

  • Simple hash-based load balancing of the monitored devices across multiple agents - load is being spread out over multiple agents dynamically to account for the number of agents registered with the manager at a given time.
  • Stateless job execution, SSH session to the monitored device is maintained as long as the agent periodically receives the 'job refresh' command. Once the agent stops being available, all the jobs it was responsible for are transferred to other agents. If the manager stops being available, agents age out the jobs and wait until the connectivity to the manager can be restored.
  • Simple management protocol transfers jobs and results between manager and agents (the NetJson class).
  • Ability for the agents to work on their jobs not being able to communicate with the manager for a limited time.
  • Currently, agents display the output data locally instead of sending it back to the manager. This is more convenient for debugging purposes at this early stage.

To be implemented:

  • Load balancing based on a consistent hash algorithm - this is not particularly useful for monitoring but may be more beneficial for automation purposes
  • Stateful job execution, the manager sends the job to the agent and keeps track of it till the report of completion is sent back, or it times out - useful for automation purposes

netwolf's People

Contributors

ccie18643 avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.