Skip to content

This script will read a comma-separated file and ping machines to them. It will generate a JSON format report file.

Notifications You must be signed in to change notification settings

lolostt/coPinger

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 

Repository files navigation

coPinger

This script will read HOSTS_FILE and ping machines to them. It will generate a REPORT_FILE.

Prerequisites

  • Python3-capable system, minimum version: Python 3.3. Tested on macOS 13 running Python 3.12.
  • ping utility avaiable from PATH.

Installing

  1. Place script wherever you want and set execution permission. User executing script must have write permission in working folder.
  2. Provide HOSTS_FILE. This is a plaint text file with comma separated entries. Ex:
router,192.168.1.1
machine,192.168.1.2

Default file name is 'machines.txt'. This can be customized in VARIABLES section inside the script.

Usage

Execute as any other script.

./coPinger.py

or

python3 coPinger.py

Script will generate a JSON report. Ex:

[
  [
    "router",
    true
  ],
  [
    "machine",
    false
  ]
]

Default file name is 'copinger_report.json'. This can be customized in VARIABLES section inside the script.

Script behaviour

You can set some variables to customize script behaviour:

  • DEBUG. Set to '1' to get verbose mode. Default value is 0.
  • SIMULTANEOUS_PINGS. Sets simultaneous pings to launch. Excesive simultaneous pings can be problematic in some systems. Default value is 4. If set to '1' script runs in sync mode. Any value greater than 1 makes sript run in async mode using multiple threads.
  • SIMULTANEOUS_MAX_PINGS. Sets simultaneous pings limit. This prevents problems if SIMULTANEOUS_PINGS is set too high. Default value is 51.
  • REPORT_INDENT. Set blank space indentation depth in report. Default value is 2.

Authors

License

This project is licensed under the Zero Clause BSD license.

About

This script will read a comma-separated file and ping machines to them. It will generate a JSON format report file.

Topics

Resources

Stars

Watchers

Forks

Languages