add 2 metoths
This commit is contained in:
13
ipscan-v2.py
13
ipscan-v2.py
@@ -15,15 +15,16 @@ os.environ['PYTHONHTTPSVERIFY'] = '0'
|
||||
nm = nmap.PortScanner()
|
||||
|
||||
# Scan the subnet for hosts (replace with your networks)
|
||||
networks = [
|
||||
"192.168.85.0/24",
|
||||
"192.168.86.0/24"
|
||||
]
|
||||
networks_env = os.getenv("NETWORKS", "192.168.85.0/24,192.168.86.0/24")
|
||||
networks = [network.strip() for network in networks_env.split(",") if network.strip()]
|
||||
|
||||
# NetBox configuration
|
||||
netbox = pynetbox.api(url='https://netbox.xxxxx.xx/', token='xxxxx')
|
||||
netbox_url = os.getenv("NETBOX_URL", "https://netbox.xxxxx.xx/")
|
||||
netbox_token = os.getenv("NETBOX_TOKEN", "xxxxx")
|
||||
ssl_verify = os.getenv("SSL_VERIFY", "false").lower() not in ("0", "false", "no", "n")
|
||||
netbox = pynetbox.api(url=netbox_url, token=netbox_token, ssl_verify=ssl_verify)
|
||||
|
||||
tenant = "Xxxxx Praha"
|
||||
tenant = os.getenv("TENANT", "Xxxxx Praha")
|
||||
|
||||
def scan_network(network):
|
||||
print(f"Scanning network: {network}")
|
||||
|
||||
Reference in New Issue
Block a user