The IP addresses are put through a loop and the ping command is executed using the popen constructor of subprocess module. A network is defined using this information and all available IP addresses in that network is obtained as a list. The ipaddress module is used to define the network and to get the IP addresses that are available on that network.Īt first, the program asks the user to input a network address using the CIDR notation (network address/prefix) format. The subprocess module lets you spawn new processes on which you run the ping command. You need two Python modules - subprocess and ipaddress. This is a simple and very useful Python script for network administrators to monitor the devices on a network by pinging every IP address on a subnet.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |