How To Create a Ping Verification Script in Python Part 1

preview_player
Показать описание
How To Create a Ping Verification Script in Python Part 1

In this video we quick and easy ping script that you can use to verify devices in your network are up or down. We hope you enjoyed the video and would love to hear your thoughts in the comment section below.

💥💥💥 Resources 💥💥💥

1. LabEveryday more info:

2. Learn Python - Full Course for Beginners:

3. MIT Python Course:

4. Cisco Devnet StartNow:

5. Hank Preston Start your network programmability journey:

6. Cisco Devnet Learning Labs:

7. Python For Network Engineers:

8. Python Network Programming for Network Engineers David Bombal:

9. Network Automation using Python and Netmiko:

💥💥💥BOOKS💥💥💥

💥CONTACT INFO
I genuinely wish I could reply to everyone's messages! The best way to contact me is to message me on Twitter.

For business inquiries, please contact
with BUSINESS INQUIRY - YOUTUBE CHANNEL in the subject line.

💥DISCLAIMER 💥
This video and description contains affiliate links, which means that if you click on one of the product links, I’ll receive a small commission. This helps support the channel and allows us to continue to make videos like this.

Thank you for the support!

#LabEveryday #Python #NetworkAutomation
Рекомендации по теме
Комментарии
Автор

Thanks for sharing, one of goals for next year is learn Python scripting and get my CCNA, I’m in infosec but I want a stronger IT network background/skill set . Your efforts on your channel help motivate me man! #labeveryday

johnonyeyiri.
Автор

Hi' Du'An. I just stumbled on your Python ping verification and to be frank this was how I learned PowerShell Scripting. Bu watching what others do with it and figuring to how to apply it in my environment. I have gone through numerous Phyton tutorials and they all sound the same. It always starts with "This is how to install Python" This is Python 2 and now Python 3" and this is String, Tuple, and so on. Just watching what you did in this Ping verification has given me an idea of how I can apply such in my day-to-day environment. If you have anywhere that I can see more of such I will greatly appreciate it. I am tired of going through the same process with every instructor/Video tutorial.

ZeroneSolutions
Автор

A bit off-topic but I love the sounds of your keyboard. It's so satisfying.

HJSDGCE
Автор

Perfect!!! It doesn't get any more straight-forward than that. I appreciate it.

ravenmirabeau
Автор

I did not know about this! Please make more videos that show/exposes how you can use Python in IT.

KGates-jkmw
Автор

Thanks for sharing relevant information always.

Which book do you recommend for learning Python Scripting

blessingonutube
Автор

Very cool. Starting my associates in Net Admin soon. Have a python class and didn't know why. Now I do. Very cool

Squirrelnumberone
Автор

Yo this was dope ! We need more Python man. Can you do one where we can get backup configs from our switches ?

gilbertsabina
Автор

Hello, Du'An simply demonstrated, definitely useful and awesome, I would like to step back a bit and understand the context of what needs to be done before creating the script, for example, the PC you are executing the script from needs to be in certain network? needs to have internet access? This is pure python running an ICMP test right? so I guess there is no communication with the network devices in this network. Definitely looking forward for more daily automation examples my friend, awesome! Thank you!!!

jairusan
Автор

Lightfoot you are a bad dude!!!! Keep the scripts coming, because the future Network Engineer MUST know how to use Python and write scripts!!! BOOM :)

andrewbaldwin
Автор

Cool script. Interesting.
In some cases though, you could get 4 'destination host unreachable' packets from a router but Windows ping statistics would display '4 packets received'; and the script would be misleading.
Perhaps you could look for the substring f''reply from {ip}'' in the response and count the occurrence...

edemdadanema
Автор

Well finally I found one that I can actually use and work, check again windows commands and it works actually 100% correct. no more Advance IP Scanner or any of the junk, thank you sir, Great video.

andreslopez
Автор

Thank you for the code! I had to change the ping command on Linux to limit the number of pings. response = os.popen(f"ping -c 4 {ip}")

codieausten
Автор

Cool script! Definitely want to see more python

AlmightyMek
Автор

Awesome video as always.

Might I recommend using the ipaddress module?

you can specify that a given is a ip address which allows you to do more. You can scan a network or you a can verify the given is a valid IP address.


example of network scan


import ipaddress


user_input = raw_input("Enter subnet/cidr, 192.168.0.160/27: ")
network =


for ip in network.hosts():
response = os.popen(f "ping {ip}").read()


this will iterate through each IP in the given network.

Chicostix
Автор

Definitely enjoyed. Would like to see more. Thanks

navarachi
Автор

Thank you - I am learning something new each day and I can also confirm this will work from a YAML file if you have an external file with the IP addresses in it.

microsoftsurfacegeekdetail
Автор

you should use "subprocess" for reading command lines. its fast and easier. example: "subprocess.getouput('echo %username%')" and it will return it.

ssl
Автор

Precise and to the point. Keep it up bro

GetUmJ
Автор

I would love to see more python content, it's always nice to add another tool to your belt.

NetworkMamba