Commit 04640c07 authored by Romain Courteaud's avatar Romain Courteaud

Provide hostname and resolver info

parent 01ff7ab4
...@@ -13,6 +13,7 @@ setup( ...@@ -13,6 +13,7 @@ setup(
"forcediphttpsadapter", "forcediphttpsadapter",
"peewee>2.10.1", "peewee>2.10.1",
"click>=7.0", "click>=7.0",
"dnspython",
], ],
entry_points={ entry_points={
"console_scripts": ["urlchecker=urlchecker_cli:runUrlChecker "] "console_scripts": ["urlchecker=urlchecker_cli:runUrlChecker "]
......
...@@ -5,9 +5,10 @@ import sys ...@@ -5,9 +5,10 @@ import sys
import traceback import traceback
import time import time
from forcediphttpsadapter.adapters import ForcedIPHTTPSAdapter from forcediphttpsadapter.adapters import ForcedIPHTTPSAdapter
import dns.resolver
__version__ = "0.0.2" __version__ = "0.0.3"
PREFERRED_TYPE = "text/html" PREFERRED_TYPE = "text/html"
TIMEOUT = 2 TIMEOUT = 2
...@@ -104,6 +105,10 @@ class WebBot: ...@@ -104,6 +105,10 @@ class WebBot:
def run(self, url): def run(self, url):
print(time.strftime("%Y-%m-%d %H:%M:%S")) print(time.strftime("%Y-%m-%d %H:%M:%S"))
print("Hostname", socket.gethostname())
myresolver = dns.resolver.Resolver()
print("Resolvers", myresolver.nameservers)
try: try:
self.check(url) self.check(url)
except KeyboardInterrupt: except KeyboardInterrupt:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment