Migrate addhost.php to lnms device:add (#13870)

* Migrate addhost.php to lnms device:add
Have snmp-scan.py call lnms device:add (make exit codes line up so this works)
Fix issue with ping only devices trying to detect os via snmp
Reorder options in device:add help and improve formatting
Update docs to remove references to addhost.php
Fix a bit of code that was in functional code

* fixes

* fix snmp version message
This commit is contained in:
Tony Murray
2022-04-04 10:41:18 -05:00
committed by GitHub
parent 96b708a10e
commit 75ba74fe5b
13 changed files with 167 additions and 187 deletions

View File

@@ -128,8 +128,8 @@ def scan_host(scan_ip):
arguments = [
"/usr/bin/env",
"php",
"addhost.php",
"lnms",
"device:add",
"-g",
POLLER_GROUP,
hostname or scan_ip,
@@ -261,7 +261,7 @@ Example: """
networks = []
for net in netargs if netargs else CONFIG.get("nets", []):
try:
networks.append(ip_network(u"%s" % net, True))
networks.append(ip_network("%s" % net, True))
debug("Network parsed: {}".format(net), 2)
except ValueError as e:
parser.error("Invalid network format {}".format(e))