/NetworkPingComparator

Ping all hosts on two networks and identify hosts that replied on one subnet but not on the other

Primary LanguagePython

NetworkPingComparator

NetworkPingComparator is a Python module for pinging two networks and displaying the difference in host reponses.

Installation

Requires pytest~=6.2.4

Use the package manager pip to install requirements.

pip install -r requirements

Usage

from network_ping_comparator import NetworkPingComparator

# define networks to test
NETWORK_1 = "192.168.1.0/24"
NETWORK_2 = "192.168.2.0/24"

# list of excluded addresses
EXCLUDED_HOST = ["0", "255"]

comparator = NetworkPingComparator(NETWORK_1, NETWORK_2)
comparator.exclude_host(EXCLUDED_HOST)
comparator.run()
result = comparator.output()

Test

Unit tests are in ./tests/

Run using pytest at root project directory

./pytest

License

[None]