Skip to content

Python port scanner project using https://canyouseeme.org/ website which purpose is to scan your own router ports, in a way that you can monitor its state in a graphic time serie, using Prometheus and probably Grafana.

Notifications You must be signed in to change notification settings

xeviff/pyOpenPortsChecker4Prometheus

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 

Repository files navigation

pyOpenPortsChecker4Prometheus

Use

The aim of this repo is to observe the open/closed status of your own router's ports. In my case, looks like that:

image

Indeed, this is aimed to be consumed from a metrics application. I used Prometheus client in the code for later retrieve this output from Grafana.

Structure

The structure of this project is intended to have an easy Docker packaging.

However, it can be used as standalone python script, but in this case you'll need to move the config folder to the same path of the script.

Config

In the config file you'll can set:

  • service_port: the port where the metrics will be exposed. For example [IP]:9116 (and also [IP]:9116/metrics)
  • scrape_frequency: interval to scrap from canyouseeme, in seconds
  • host_to_check: I only tested using DynamincDNS domain, idk if can work with your public IP or your "direct" domain
  • ports_tocheck: list of the ports you're interested to observe

How

It's using webscraping to canyouseeme.org, so please be consious of this must be used with common sense, specially with a long scrape interval (for example I've setted it to 1h)

That's all folks :)

About

Python port scanner project using https://canyouseeme.org/ website which purpose is to scan your own router ports, in a way that you can monitor its state in a graphic time serie, using Prometheus and probably Grafana.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 97.2%
  • Dockerfile 2.8%