The aim of this repo is to observe the open/closed status of your own router's ports. In my case, looks like that:
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.
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.
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
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 :)