Observed since 20 Oct, 21:00 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
Nothing but a human leveraging the power of threads to save time. See the below diagram and try to get it.
Nothing but a human leveraging the power of threads to save time. See the below diagram and try to get it.
This script is an example of how to leverage the AutoFetcher Python library to remotely connect to a list of network devices (DUTs - Devices Under Test) and determine if OSPF (Open Shortest Path First) routing protocol is configured on them. It's designed for efficient, concurrent checking across a large number of devices.
AutoFetcher Integration: Demonstrates the use of DutFetcher for retrieving device lists and DutGrabber for parallel execution of custom logic.AutoFetchException for connectivity/command issues and general exceptions for unexpected errors.This script requires the AutoFetcher library. You can install it via pip:
pip install AFAD
To get started with this script, follow these steps:
Save the provided Python code into a file named check_ospf.py (or any other .py file name you prefer).
strings.jsonIn the same directory as your check_ospf.py script, create a file named strings.json. This file stores your TAC server credentials, which AutoFetcher uses to authenticate and retrieve the device list.
strings.json Format:{
"TAC_ART_SERVER": "your_tac_server_address",
"TAC_HOST": "your_tac_host_username",
"PASSWORD": "your_tac_host_password"
}
"your_tac_server_address" with the actual TAC server address."your_tac_host_username" with your TAC username."your_tac_host_password" with your TAC password.
strings.jsoncontains sensitive credentials. Please:
Once you have set up the script and the strings.json file, run the OSPF configuration checker:
python check_ospf.py
DutFetcher with credentials from strings.json.Art list --domain=all.filter_for_affected_dut for each device concurrently (default: 500 threads).output.json.output.jsonThe file will look like this:
{
...,
"[AUTO-FETCH] Failure: OSPF is not configured!": [
"dut123",
"dut456"
],
...,
"[AUTO-FETCH] Success: OSPF is configured!": [
"dut-a",
"dut-b",
"dut-x"
],
...
}
Each key is a reason/message string, and the value under that key is list of DUTs affected for that key.
filter_for_affected_dut FunctionHere’s the core logic used for checking OSPF config:
def filter_for_affected_dut(device: str, grabber: DutGrabber):
try:
show_running_config_output = grabber.execute_to_dut(device, ['enable', 'show running-config'])
commands = show_running_config_output[1]['cmds']
is_ospf_configured = any(line.startswith("router ospf ") for line in commands)
if is_ospf_configured:
return "[AUTO-FETCH] Success: OSPF is configured!"
else:
return "[AUTO-FETCH] Failure: OSPF is not configured!"
except AutoFetchException as e:
return f"[AUTO-FETCH] Exception from command execution : {e}"
except Exception as e:
print("[AUTO-FETCH] Exception occurred!")
return f"[AUTO-FETCH] Exception : {e}"
This function:
show running-config"router ospf "Contributions, issues, and feature requests are welcome! Feel free to check the issues page or open a pull request.
Download counts and popularity will appear here as the collector receives them.
| Version | Published | Direct dependencies | Open version |
|---|---|---|---|
| 1.0.0 | 14 Aug 2025 | 4 |
This describes our collected data; it is not a security assessment.
Observed since 20 Oct, 21:00 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
package:be168cf75ba851453fc335e837218cc635618496b505ad8d137f4b247fdfda3c