Skip to content

A program that checks for port open from a list of hosts

License

Notifications You must be signed in to change notification settings

lenfree/CheckPort

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CheckTcpPort

A program that checks if TCP port is open or closed from a list of hosts and port defined in a YAML file.

Problem

In some complex organistaions there are multiple environemnts, network, firewall and etc that are maintained by some manual process. I am doing some discovery to find out about network connectivity for upstream and downstream for my application and I have a huge list of systems that I need to connect to. This small program is to help me check for network access from a list of hosts and produce a small table for a better presentation.

Requirements

Follow below format:

dev: # a key identifier that would print as part of table header
  - port: 80
    hosts:
      - www.google.com
      - www.facebook.com
      - localhost
  - port: 443
    hosts:
      - www.google.com
      - www.facebook.com
  - port: 8000
    hosts:
      - 8.8.8.8
      - www.facebook.com

Usage

$ mix compile && mix help
$ mix start --timeout 10 --file ./hosts/list.yml

+-------------------------------------------------+
|               TCP Check for test                |
+------------------+------+--------+--------------+
| Host             | Port | Status | Reason       |
+------------------+------+--------+--------------+
| 8.8.8.8          | 8000 | closed | timeout      |
| www.facebook.com | 8000 | closed | timeout      |
| www.google.com   | 443  | open   | N/A          |
| www.facebook.com | 443  | open   | N/A          |
| localhost        | 80   | closed | econnrefused |
+------------------+------+--------+--------------+

About

A program that checks for port open from a list of hosts

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages