Coder Social home page Coder Social logo

basicpythonscript's Introduction

Network Ping Tool

This Python script (ping_ips.py) allows you to ping a range of IP addresses within a specified network to check which hosts respond. It uses the os module to execute ping commands and captures the responses. How to Use

Input Parameters:
    red: Enter the base IP address of the network (e.g., 192.168.1). If left blank, defaults to 192.168.1.
    rangoInicial: Starting number of the IP address range to ping (e.g., 1).
    rangoFinal: Ending number of the IP address range to ping (e.g., 250).

Execution:
    The script iterates through each IP address in the specified range (rangoInicial to rangoFinal).
    Uses the ping command (ping -n 1 <ip_address>) to check if an IP address responds.
    If a response is received (rep == 0), the IP address is added to listaIP.
    Prints whether each IP responded ([OK]) or not ([No responde]).

Output:
    Displays the total number of IPs that responded to ping.
    Lists all IP addresses that responded.

Example

If you run the script with:

red = "192.168.1"
rangoInicial = 1
rangoFinal = 5

It will ping 192.168.1.1 to 192.168.1.5 and output which IPs respond. Notes

Ensure your environment supports the os module and the ping command.
Adjust the network (red), initial (rangoInicial), and final (rangoFinal) values as per your requirements.

Feel free to modify and distribute this script according to your needs.

basicpythonscript's People

Contributors

takzuin avatar

Stargazers

 avatar

Watchers

 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.