automationai / nshreport

MIT License
0 stars 0 forks source link

Handle Traceback while using non-FQDN domain name (e.g. abc) #8

Open automationai opened 3 years ago

automationai commented 3 years ago

Symptom

If the domain name (e.g. abc) can be resolved to IP

The result come out as expected

If the domain name (eg. abc) cannot be resolved to IP

Traceback (most recent call last):
  File "./nshreport.py", line 159, in <module>
    main()
  File "./nshreport.py", line 64, in main
    status = portstatus(ip,port)
  File "./nshreport.py", line 11, in portstatus
    result = s.connect_ex((ip,port))
socket.gaierror: [Errno -2] Name or service not know