cleanup + log fixes

This commit is contained in:
Jokob-sk
2024-03-11 07:57:49 +11:00
parent 8817f8d0e9
commit 27ae11c1bc
3 changed files with 21 additions and 16 deletions

View File

@@ -116,9 +116,14 @@ def execute_nslookup (ip, timeout):
return domain_name, dns_server
except subprocess.CalledProcessError as e:
# An error occured, handle it
mylog('verbose', [f'[{pluginName}]', e.output])
# An error occurred, handle it
if "NXDOMAIN" in e.output.decode():
mylog('verbose', [f'[{pluginName}]', f"No PTR record found for IP: {ip}"])
else:
mylog('verbose', [f'[{pluginName}]', e.output])
# Handle other errors here
# mylog('verbose', [f'[{pluginName}] ⚠ ERROR - check logs'])
except subprocess.TimeoutExpired as timeErr:
mylog('verbose', [f'[{pluginName}] TIMEOUT - the process forcefully terminated as timeout reached'])