Giter VIP home page Giter VIP logo

ping_script's Introduction

Ping Script, ping a network device to verify if the device is up or down

This is a script that leverages the os library to ping a network device to verify if the device is up or down and output the status to results.txt. Use this script to learn the basics of python.

Download the Code

To get started: Download the code and cd the ping_script directory

git clone https://github.com/labeveryday/ping_script.git
cd ping_script

Python Virtual Environment

When executing python code or installing python applications you should get into the practice of creating and managing python virtual environments. This will allow you to run different versions of a python library while avoiding version conflicts. My preferred tool for python virtual environments is venv There are tools out there. Remember to find what works best for you.

On Linux or Mac

python3 -m venv venv
source venv/bin/activate

On Windows

python3 -m venv venv
.\venv\Scripts\activate.bat

Example: Script in action

Now that you have everything installed and updated you can execute the script

(venv) duan@ubuntu ping_script$ python tool.py
Down 192.168.23.1 Ping Unsuccessful
Down 192.168.23.2 Ping Unsuccessful
Up 192.168.23.142 Ping successful
Up 192.168.23.143 Ping successful
Up 192.168.23.144 Ping successful

NOTE: To modify the subnets and the range change the starting digit and the ending digit in line 18.

ping_range

Walk through

Here is a video walk through of the ping_script in action.

Watch the video

About me

Introverted Network Automation Engineer that is changing lives as a Developer Advocate for Cisco DevNet. Pythons scripts are delicious. Especially at 2am on a Saturday night.

My hangouts:

ping_script's People

Contributors

labeveryday avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  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.