Closed mamingzhi945 closed 1 year ago
In NetBox -> Other -> Jobs you can see details. Please copy and paste. From what I read, the NetDoc tried to discover 10.62.192.6 and something working, but I cannot say what.
log:
Line | Level | Message |
---|---|---|
1 | Info | Starting discovery on 10.62.192.6 |
2 | Failure | Nornir inventory is empty |
output None
source
class Discover(Script):
"""Script used to start discovery."""
class Meta:
"""Script metadata."""
name = "Discover"
description = "Start discovery on one, many or all discoverables."
commit_default = True
# Discoverable
discoverables = MultiObjectVar(
model=Discoverable_m,
query_params={
"discoverable": True
}, # TODO: not working, discoverable=False are also showed (cosmetic).
description="Devices to be discovered (leave empty to discover everything).",
required=False,
)
# Ingested?
undiscovered_only = BooleanVar(
description="Undiscovered devices only (the above setting is ignored).",
required=False,
default=True,
)
def run(self, data, commit):
"""Start the script."""
discoverable_ip_addresses = []
discoverables = data.get("discoverables")
# Filtering out discoverable=False is done at Nornir inventory level.
if data.get("undiscovered_only"):
# Get only undiscovered IP addresses
discoverables = discoverable.get_list(last_discovered_at__isnull=True)
for discoverable_o in discoverables:
discoverable_ip_addresses.append(discoverable_o.address)
self.log_info(
f"Starting first discovery on {', '.join(discoverable_ip_addresses)}"
)
output = discovery(discoverable_ip_addresses, script_handler=self)
elif discoverables:
for discoverable_o in discoverables:
discoverable_ip_addresses.append(discoverable_o.address)
self.log_info(
f"Starting discovery on {', '.join(discoverable_ip_addresses)}"
)
output = discovery(discoverable_ip_addresses, script_handler=self)
else:
self.log_info("Starting discovery on all IP addresses")
output = discovery(None, script_handler=self)
seems your discoverable has not the "discoverable=True" flag. Can you post a screenshot of NetDoc -> Discoverable?
thanks,I overlooked this optional field.
However, there is a new Ingest error. I will first take a look at the logs myself.
The route table of nxos has a similar protocol:
*via 10.122.208.xx, Eth1/2, [110/0], 16w3d, ospf-UNDERLAY, type-2
Maybe this regular expression needs to be modified。
/opt/netbox/venv/lib/python3.10/site-packages/netdoc/ingestors/netmiko_cisco_nxos_show_ip_route_vrf_all.py", line 29, in ingest
Because this is an ingestion issue, could you open a separated issue and attach logs and full exception?
@mamingzhi945 you have closed this issue, but I don't get if you are still encountering the issue or everything is fine.
environment:Install using docker comment: After clicking discoverable, the business does not change the data. Execute the command docker-compose logs netbox-worker。
what to do in this situation?