├── CLUS-2024-CISCOU-2039 ├── .gitignore ├── requirements.txt ├── netbox_inv.yml ├── CL2024_US_CISCOU-2039.pptx ├── images │ ├── ccc_netbox_cf_1.png │ ├── ccc_netbox_cf_2.png │ ├── meraki-devices.png │ ├── ccc_cf_choice_set.png │ └── ccc_netbox_device_details.png ├── ansible.cfg ├── set_meraki_mgnt_ip.yml ├── get_device_details.yml └── get_device_config.yml ├── netbox-ansible-cisco-cc ├── .gitignore ├── requirements.txt ├── netbox_inv.yml ├── images │ ├── ccc_netbox_cf_1.png │ ├── ccc_netbox_cf_2.png │ ├── ccc_cf_choice_set.png │ └── ccc_netbox_device_details.png ├── NetBox_Labs_CLEUR_2024_CISCOU-1014.pdf ├── ansible.cfg ├── show_ip_int_brief.yml ├── get_device_details.yml └── get_device_config.yml ├── netbox-event-driven-architectures ├── agents │ ├── __init.py__ │ ├── helpers │ │ └── __init.py__ │ ├── reachability_alerter │ │ ├── example.env │ │ └── README.md │ ├── config_backuper │ │ ├── example.env │ │ └── README.md │ ├── ping_devices │ │ ├── example.env │ │ └── README.md │ ├── get_running_config │ │ └── example.env │ ├── device_alerter │ │ ├── example.env │ │ └── README.md │ └── discover_network │ │ ├── example.env │ │ └── README.md ├── .gitignore ├── setup.py ├── requirements.txt └── lab │ └── event_driven_webinar.clab.yml ├── vxlan-workflows ├── requirements.txt └── README.md ├── CODEOWNERS ├── autocon3-workshop-guide ├── sections │ ├── Section-1 │ │ ├── images │ │ │ └── .gitkeep │ │ └── Section-1.md │ ├── Section-2 │ │ ├── images │ │ │ └── .gitkeep │ │ └── Section-2.md │ ├── Section-3 │ │ ├── images │ │ │ └── .gitkeep │ │ ├── .gitignore │ │ ├── network │ │ │ └── srl.clab.yml │ │ └── scripts │ │ │ ├── 2_start_network.sh │ │ │ └── 3_start_network_discovery.sh │ ├── Section-4 │ │ └── images │ │ │ └── .gitkeep │ ├── Section-5 │ │ ├── images │ │ │ └── .gitkeep │ │ ├── port_scan.yaml │ │ ├── ping_scan.yaml │ │ ├── port_scan_fast.yaml │ │ ├── selector.yaml │ │ └── agent-git.yaml │ ├── Section-6 │ │ ├── images │ │ │ └── .gitkeep │ │ ├── ccc_integration.yaml │ │ ├── selector.yaml │ │ └── agent-vault.yaml │ └── Section-7 │ │ ├── images │ │ ├── .gitkeep │ │ ├── project-layout.png │ │ ├── empty-orb-runner.png │ │ ├── Controller-Diagram.png │ │ ├── section3_deviations.png │ │ └── section4_deviations.png │ │ └── code │ │ ├── step-2 │ │ ├── workers.txt │ │ ├── README.md │ │ ├── lab-integration │ │ │ ├── lab_integration │ │ │ │ └── __init__.py │ │ │ └── pyproject.toml │ │ └── agent.yaml │ │ ├── step-3 │ │ ├── workers.txt │ │ ├── README.md │ │ ├── ourdata.csv │ │ ├── lab-integration │ │ │ ├── lab_integration │ │ │ │ └── __init__.py │ │ │ └── pyproject.toml │ │ └── agent.yaml │ │ └── step-1 │ │ ├── README.md │ │ ├── lab-integration │ │ ├── lab_integration │ │ │ ├── __init__.py │ │ │ └── runner.py │ │ └── pyproject.toml │ │ └── agent.yaml ├── .gitignore └── README.md ├── .learning-meta ├── requirements.txt └── README.md ├── netbox-ansible-collection-quick-start ├── .gitignore ├── requirements.txt ├── roles │ ├── create_rirs │ │ ├── vars │ │ │ └── main.yml │ │ └── tasks │ │ │ └── main.yml │ ├── create_prefix_and_vlan_roles │ │ ├── vars │ │ │ └── main.yml │ │ └── tasks │ │ │ └── main.yml │ ├── create_aggregates │ │ ├── vars │ │ │ └── main.yml │ │ └── tasks │ │ │ └── main.yml │ └── create_prefixes │ │ ├── tasks │ │ └── main.yml │ │ └── vars │ │ └── main.yml ├── netbox_inv.yml ├── images │ ├── ansible_collection.png │ └── Cisco Live Sites and Devices.png ├── NetBox-Integration-with-Ansible-Automation-Platform-CLUS-2024.pdf ├── Webinar-Exploring-the-Red-Hat-Ansible-Certified-Collection-for-NetBox.pdf ├── ansible.cfg ├── populate_netbox_ipam.yml ├── lookup_devices.yml └── lookup_site_and_device_data.yml ├── custom-objects-quickstart ├── .gitignore └── 1_set_envvars.sh ├── autocon2-workshop ├── ansible │ ├── requirements.txt │ ├── collections │ │ └── requirements.yml │ ├── roles │ │ └── requirements.yml │ ├── ansible.cfg │ ├── playbooks │ │ ├── test.yml │ │ ├── set-hostname.yml │ │ └── set-ntp.yml │ └── inventory │ │ ├── static │ │ └── netbox.yml ├── workshop_setup │ ├── requirements.txt │ └── icinga │ │ └── check_nokia_ping.sh ├── docs │ ├── images │ │ ├── videos │ │ │ ├── Summary.png │ │ │ ├── DiscoRecon.png │ │ │ ├── Installation.png │ │ │ ├── IntentBased.png │ │ │ ├── Introduction.png │ │ │ ├── NetBox-SoT.png │ │ │ ├── TheHardWay.png │ │ │ ├── ConfigAssurance.png │ │ │ ├── MonitoringIcinga.png │ │ │ └── AutomatedNetworkChanges.png │ │ ├── netbox │ │ │ ├── create_site.png │ │ │ ├── imported_devices.png │ │ │ └── imported_interfaces.png │ │ ├── netpicker │ │ │ ├── ntp_diff.png │ │ │ ├── backup_details.png │ │ │ ├── backup_devices.png │ │ │ ├── create_policy.png │ │ │ ├── device_backups.png │ │ │ ├── device_mapping.png │ │ │ ├── hostname_diff.png │ │ │ ├── policy_success.png │ │ │ ├── second_backup.png │ │ │ ├── add_devices_menu.png │ │ │ ├── create_python_rule.png │ │ │ ├── create_simple_rule.png │ │ │ ├── homepage_add_device.png │ │ │ ├── netbox_api_details.png │ │ │ ├── python_rule_fails.png │ │ │ ├── simple_rule_fails.png │ │ │ ├── configure_python_rule.png │ │ │ └── configure_simple_rule.png │ │ ├── slurpit │ │ │ ├── plugin_menu.png │ │ │ ├── device_finder.png │ │ │ ├── device_overview.png │ │ │ ├── device_schedule.png │ │ │ ├── imported_devices.png │ │ │ ├── interface_drift.png │ │ │ ├── plugin_settings.png │ │ │ ├── reconcile_ipam.png │ │ │ ├── device_onboarding.png │ │ │ ├── discovered_interfaces.png │ │ │ ├── reconcile_interfaces.png │ │ │ ├── run_interfaces_task.png │ │ │ ├── device_onboarding_import.png │ │ │ └── plugin_planning_settings.png │ │ ├── icinga │ │ │ ├── DirectorHosts.png │ │ │ ├── netbox-icinga.png │ │ │ ├── DirectorAddHost.png │ │ │ ├── IcingaLabDevices.png │ │ │ ├── IcingaManualPing.png │ │ │ ├── ServicesOverview.png │ │ │ └── TacticalOverview.png │ │ └── automated_network_changes │ │ │ └── ntp_servers.png │ ├── 8_Summary.md │ ├── 2_Introducing_Intent_Based_Network_Automation.md │ └── 3_Source_Of_Truth_NetBox.md ├── .gitignore ├── 99_stop_all.sh ├── network │ ├── 1_the_hard_way │ │ ├── autocon2.clab.yml │ │ ├── srl1.cfg │ │ └── srl2.cfg │ ├── 5.1_monitoring │ │ └── autocon2.clab.yml │ ├── 5.2_monitoring │ │ └── autocon2.clab.yml │ ├── 6.1_assurance │ │ ├── autocon2.clab.yml │ │ ├── srl1.cfg │ │ └── srl2.cfg │ ├── 6.2_assurance │ │ └── autocon2.clab.yml │ ├── 7_automated_network_changes │ │ ├── autocon2.clab.yml │ │ ├── srl1.cfg │ │ └── srl2.cfg │ ├── 4.1_discovery_reconciliation │ │ ├── autocon2.clab.yml │ │ ├── srl1.cfg │ │ └── srl2.cfg │ └── 4.2_discovery_reconciliation │ │ ├── autocon2.clab.yml │ │ ├── srl1.cfg │ │ └── srl2.cfg ├── slurpit │ ├── sync_to_netbox.sh │ └── docker-compose.override.yml ├── 6_start_netpicker.sh ├── 2_start_slurpit.sh ├── deploy_changes.sh ├── 0_set_envvars.sh └── 3_start_network.sh ├── netbox-discovery-webinar ├── workers.txt ├── .gitignore ├── worker-example │ ├── requirements.txt │ ├── worker_example │ │ └── __init__.py │ ├── .gitignore │ └── README.md ├── policies │ ├── mist-discovery-policy.yaml │ ├── worker-discovery-policy.yaml │ ├── network-discovery-policy.yaml │ └── device-discovery-policy.yaml ├── configs │ ├── mist-discovery.yaml │ ├── device-discovery.yaml │ ├── worker-discovery.yaml │ └── network-discovery.yaml ├── example-commands.md └── README.md ├── autocon-workshop ├── .gitignore ├── requirements.txt ├── Dockerfile ├── docker-compose.yml ├── lab │ └── workshop_lab.yml └── README.md ├── netbox-diode-webinar └── examples │ ├── python │ ├── sample-orb-worker │ │ ├── workers.txt │ │ ├── README.md │ │ ├── ourdata.csv │ │ ├── lab-integration │ │ │ ├── lab_integration │ │ │ │ └── __init__.py │ │ │ └── pyproject.toml │ │ └── agent.yaml │ ├── requirements.txt │ ├── ourdata.csv │ ├── skeleton.py │ └── 1_direct.py │ └── go │ ├── go.mod │ ├── diode-webinar.go │ └── go.sum ├── netbox-ansible-webinar ├── roles │ ├── ACTUAL_STATE │ │ ├── vars │ │ │ └── main.yml │ │ └── tasks │ │ │ └── main.yml │ ├── COMPARE_STATES │ │ ├── vars │ │ │ └── main.yml │ │ └── tasks │ │ │ └── main.yml │ └── INTENDED_STATE │ │ ├── vars │ │ └── main.yml │ │ └── tasks │ │ └── main.yml ├── requirements.txt ├── group_vars │ └── platforms_eos.yml ├── Ansible Webinar Jan 2024.pptx ├── netbox_inv.yml ├── get_facts.yml ├── compare_intended_vs_actual.yml ├── get_lldp_neighbors.yml ├── show_version.yml ├── generate_report.yml ├── ansible.cfg ├── reports │ └── report_template.j2 ├── containerlab │ └── webinar.clab.yaml ├── config_templates │ └── cEOSLab.j2 └── backup_configs.yml ├── netbox-pyats-webinar ├── requirements.txt ├── images │ ├── topology.png │ └── pyats-webinar-devices.png ├── initial_device_configs.md ├── generate_testbed_file.py └── ospf_neighbor_table.py ├── nornir-netbox-webinar ├── defaults.yaml ├── config.yaml ├── inventory.py ├── get_facts.py ├── containerlab │ └── testlab.clab.yaml ├── get_lldp_neighbors.py ├── requirements.txt ├── README.md └── backup_device_configs.py ├── images ├── youtube.jpeg ├── nbl_square_logo.png ├── cisco-cc-thumbnail.png ├── netbox-labs-logo-small.png └── netboxlabs_logo_color-dark-4.png ├── autocon4-workshop ├── banner.png ├── .gitignore ├── modules │ ├── module_0 │ │ └── images │ │ │ ├── gitea.png │ │ │ ├── netbox.png │ │ │ └── prometheus.png │ └── module_2 │ │ └── images │ │ ├── prometheus_alerts_all_green.png │ │ ├── httpcheck_duration_milliseconds.png │ │ └── prometheus_alerts_not_reachable.png ├── config-templates │ ├── prometheus │ │ ├── prometheus.yaml │ │ ├── docker-compose.yaml │ │ └── alerts │ │ │ └── httpcheck.yaml │ ├── orb-policies │ │ ├── clab_networks.yaml │ │ ├── selector.yaml │ │ ├── srl_devices.yaml │ │ └── web_monitor.yaml │ └── orb-agent │ │ ├── agent.yaml │ │ └── startup.sh ├── ansible │ ├── inventory.yaml │ └── README.md ├── network │ ├── orb-agent │ │ ├── agent.yaml │ │ └── startup.sh │ └── workshop.clab.yaml ├── 2_start_diode.sh ├── create_orb_env_file.sh ├── run_ansible.sh ├── 6_start_prometheus.sh └── 1_set_envvars.sh ├── netbox-devops-onug-fall ├── netbox_inv.yml ├── ansible.cfg ├── roles │ └── deploy_vlans │ │ ├── vars │ │ └── main.yml │ │ └── tasks │ │ └── main.yml ├── deploy_vlans.yaml └── README.md ├── netbox-event-driven-ansible └── playbooks │ ├── templates │ ├── ntp_config.j2 │ └── vlan_config.j2 │ ├── configure_login_banner.yml │ └── configure_ntp.yml ├── netbox-discovery-quickstart ├── images │ ├── diode_settings.png │ ├── ingested_srl1.png │ ├── ingested_devices.png │ ├── diode_reconciled_ip.png │ ├── ingested_interfaces.png │ ├── device_ingestion_logs.png │ ├── diode_ingestion_logs.png │ └── ingested_ethernet_1_1.png ├── .gitignore ├── network │ ├── ios.clab.yml │ └── srl.clab.yml ├── 2_start_diode.sh ├── 4_start_network.sh ├── 1_set_envvars.sh └── 5_start_network_discovery.sh ├── netbox-netpicker └── lab │ └── cisco.clab.yml ├── .github └── workflows │ ├── pr_labeler.yml │ └── build_readme.yaml ├── netbox-discovery └── agent.yaml ├── diode └── examples │ ├── csv │ └── inventory.csv │ └── containerlab │ └── containerlab.yaml └── selector.yaml /CLUS-2024-CISCOU-2039/.gitignore: -------------------------------------------------------------------------------- 1 | /venv/ 2 | .vscode -------------------------------------------------------------------------------- /netbox-ansible-cisco-cc/.gitignore: -------------------------------------------------------------------------------- 1 | /venv/ 2 | .vscode -------------------------------------------------------------------------------- /netbox-event-driven-architectures/agents/__init.py__: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /vxlan-workflows/requirements.txt: -------------------------------------------------------------------------------- 1 | requests==2.32.4 2 | -------------------------------------------------------------------------------- /CODEOWNERS: -------------------------------------------------------------------------------- 1 | * @richbibby @mrmrcoleman @rboucher-me -------------------------------------------------------------------------------- /autocon3-workshop-guide/sections/Section-1/images/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /autocon3-workshop-guide/sections/Section-2/images/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /autocon3-workshop-guide/sections/Section-3/images/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /autocon3-workshop-guide/sections/Section-4/images/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /autocon3-workshop-guide/sections/Section-5/images/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /autocon3-workshop-guide/sections/Section-6/images/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /autocon3-workshop-guide/sections/Section-7/images/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /netbox-event-driven-architectures/agents/helpers/__init.py__: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.learning-meta/requirements.txt: -------------------------------------------------------------------------------- 1 | feedparser 2 | jinja2 3 | requests -------------------------------------------------------------------------------- /CLUS-2024-CISCOU-2039/requirements.txt: -------------------------------------------------------------------------------- 1 | pynetbox 2 | ansible 3 | pytz -------------------------------------------------------------------------------- /netbox-ansible-collection-quick-start/.gitignore: -------------------------------------------------------------------------------- 1 | /venv/ 2 | .vscode -------------------------------------------------------------------------------- /autocon3-workshop-guide/sections/Section-3/.gitignore: -------------------------------------------------------------------------------- 1 | environment 2 | -------------------------------------------------------------------------------- /custom-objects-quickstart/.gitignore: -------------------------------------------------------------------------------- 1 | netbox-docker/ 2 | environment 3 | -------------------------------------------------------------------------------- /netbox-ansible-cisco-cc/requirements.txt: -------------------------------------------------------------------------------- 1 | pynetbox 2 | ansible 3 | pytz -------------------------------------------------------------------------------- /netbox-event-driven-architectures/.gitignore: -------------------------------------------------------------------------------- 1 | lab/*.bak 2 | lab/clab*/ 3 | -------------------------------------------------------------------------------- /autocon2-workshop/ansible/requirements.txt: -------------------------------------------------------------------------------- 1 | pynetbox 2 | pytz 3 | ansible 4 | -------------------------------------------------------------------------------- /netbox-ansible-collection-quick-start/requirements.txt: -------------------------------------------------------------------------------- 1 | ansible 2 | pynetbox -------------------------------------------------------------------------------- /netbox-discovery-webinar/workers.txt: -------------------------------------------------------------------------------- 1 | ./worker-example 2 | ./nbl-mist-worker -------------------------------------------------------------------------------- /autocon-workshop/.gitignore: -------------------------------------------------------------------------------- 1 | *.bak 2 | clab-*/ 3 | venv/ 4 | configs/ 5 | .env 6 | -------------------------------------------------------------------------------- /autocon3-workshop-guide/sections/Section-7/code/step-2/workers.txt: -------------------------------------------------------------------------------- 1 | ./lab-integration -------------------------------------------------------------------------------- /autocon3-workshop-guide/sections/Section-7/code/step-3/workers.txt: -------------------------------------------------------------------------------- 1 | ./lab-integration -------------------------------------------------------------------------------- /netbox-diode-webinar/examples/python/sample-orb-worker/workers.txt: -------------------------------------------------------------------------------- 1 | ./lab-integration -------------------------------------------------------------------------------- /netbox-ansible-webinar/roles/ACTUAL_STATE/vars/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | backup_root: ./backups -------------------------------------------------------------------------------- /netbox-pyats-webinar/requirements.txt: -------------------------------------------------------------------------------- 1 | pyats[library] 2 | pyats.contrib 3 | prettytable -------------------------------------------------------------------------------- /nornir-netbox-webinar/defaults.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | username: admin 4 | password: admin 5 | -------------------------------------------------------------------------------- /autocon2-workshop/workshop_setup/requirements.txt: -------------------------------------------------------------------------------- 1 | requests 2 | pynetbox 3 | requests-toolbelt -------------------------------------------------------------------------------- /netbox-ansible-webinar/requirements.txt: -------------------------------------------------------------------------------- 1 | pynetbox 2 | ansible 3 | pytz 4 | ansible-pylibssh -------------------------------------------------------------------------------- /netbox-diode-webinar/examples/python/requirements.txt: -------------------------------------------------------------------------------- 1 | netboxlabs-diode-sdk 2 | google 3 | -------------------------------------------------------------------------------- /autocon-workshop/requirements.txt: -------------------------------------------------------------------------------- 1 | pynetbox 2 | napalm 3 | ping3 4 | python-dotenv 5 | napalm-srl -------------------------------------------------------------------------------- /images/youtube.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/netboxlabs/netbox-learning/HEAD/images/youtube.jpeg -------------------------------------------------------------------------------- /autocon2-workshop/ansible/collections/requirements.yml: -------------------------------------------------------------------------------- 1 | --- 2 | collections: 3 | - name: community.network 4 | -------------------------------------------------------------------------------- /autocon4-workshop/banner.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/netboxlabs/netbox-learning/HEAD/autocon4-workshop/banner.png -------------------------------------------------------------------------------- /images/nbl_square_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/netboxlabs/netbox-learning/HEAD/images/nbl_square_logo.png -------------------------------------------------------------------------------- /images/cisco-cc-thumbnail.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/netboxlabs/netbox-learning/HEAD/images/cisco-cc-thumbnail.png -------------------------------------------------------------------------------- /images/netbox-labs-logo-small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/netboxlabs/netbox-learning/HEAD/images/netbox-labs-logo-small.png -------------------------------------------------------------------------------- /netbox-discovery-webinar/.gitignore: -------------------------------------------------------------------------------- 1 | # Ignore nbl-mist-worker directory and its contents 2 | nbl-mist-worker/ 3 | nbl-mist-worker/** 4 | -------------------------------------------------------------------------------- /images/netboxlabs_logo_color-dark-4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/netboxlabs/netbox-learning/HEAD/images/netboxlabs_logo_color-dark-4.png -------------------------------------------------------------------------------- /netbox-ansible-collection-quick-start/roles/create_rirs/vars/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | ipam_rirs: 3 | 4 | - name: RFC 1918 5 | is_private: yes -------------------------------------------------------------------------------- /netbox-pyats-webinar/images/topology.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/netboxlabs/netbox-learning/HEAD/netbox-pyats-webinar/images/topology.png -------------------------------------------------------------------------------- /CLUS-2024-CISCOU-2039/netbox_inv.yml: -------------------------------------------------------------------------------- 1 | plugin: netbox.netbox.nb_inventory 2 | validate_certs: False 3 | group_by: 4 | - device_roles 5 | - sites -------------------------------------------------------------------------------- /autocon4-workshop/.gitignore: -------------------------------------------------------------------------------- 1 | diode/ 2 | gitea/ 3 | netbox-docker/ 4 | network/clab-workshop/ 5 | /prometheus/ 6 | environment 7 | diode_creds 8 | -------------------------------------------------------------------------------- /netbox-ansible-cisco-cc/netbox_inv.yml: -------------------------------------------------------------------------------- 1 | plugin: netbox.netbox.nb_inventory 2 | validate_certs: False 3 | group_by: 4 | - device_roles 5 | - sites -------------------------------------------------------------------------------- /netbox-devops-onug-fall/netbox_inv.yml: -------------------------------------------------------------------------------- 1 | plugin: netbox.netbox.nb_inventory 2 | validate_certs: False 3 | group_by: 4 | - device_roles 5 | - sites -------------------------------------------------------------------------------- /CLUS-2024-CISCOU-2039/CL2024_US_CISCOU-2039.pptx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/netboxlabs/netbox-learning/HEAD/CLUS-2024-CISCOU-2039/CL2024_US_CISCOU-2039.pptx -------------------------------------------------------------------------------- /CLUS-2024-CISCOU-2039/images/ccc_netbox_cf_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/netboxlabs/netbox-learning/HEAD/CLUS-2024-CISCOU-2039/images/ccc_netbox_cf_1.png -------------------------------------------------------------------------------- /CLUS-2024-CISCOU-2039/images/ccc_netbox_cf_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/netboxlabs/netbox-learning/HEAD/CLUS-2024-CISCOU-2039/images/ccc_netbox_cf_2.png -------------------------------------------------------------------------------- /CLUS-2024-CISCOU-2039/images/meraki-devices.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/netboxlabs/netbox-learning/HEAD/CLUS-2024-CISCOU-2039/images/meraki-devices.png -------------------------------------------------------------------------------- /autocon2-workshop/docs/images/videos/Summary.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/netboxlabs/netbox-learning/HEAD/autocon2-workshop/docs/images/videos/Summary.png -------------------------------------------------------------------------------- /netbox-ansible-webinar/group_vars/platforms_eos.yml: -------------------------------------------------------------------------------- 1 | ansible_user: admin 2 | ansible_password: admin 3 | ansible_become: yes 4 | ansible_become_password: admin -------------------------------------------------------------------------------- /netbox-event-driven-ansible/playbooks/templates/ntp_config.j2: -------------------------------------------------------------------------------- 1 | servers: 2 | {% for server in ntp_servers %} 3 | - server: "{{ server }}" 4 | {% endfor %} 5 | -------------------------------------------------------------------------------- /CLUS-2024-CISCOU-2039/images/ccc_cf_choice_set.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/netboxlabs/netbox-learning/HEAD/CLUS-2024-CISCOU-2039/images/ccc_cf_choice_set.png -------------------------------------------------------------------------------- /netbox-ansible-cisco-cc/images/ccc_netbox_cf_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/netboxlabs/netbox-learning/HEAD/netbox-ansible-cisco-cc/images/ccc_netbox_cf_1.png -------------------------------------------------------------------------------- /netbox-ansible-cisco-cc/images/ccc_netbox_cf_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/netboxlabs/netbox-learning/HEAD/netbox-ansible-cisco-cc/images/ccc_netbox_cf_2.png -------------------------------------------------------------------------------- /netbox-devops-onug-fall/ansible.cfg: -------------------------------------------------------------------------------- 1 | [defaults] 2 | inventory = ./netbox_inv.yml 3 | host_key_checking = false 4 | retry_files_enabled = false 5 | forks = 4 6 | -------------------------------------------------------------------------------- /netbox-event-driven-architectures/setup.py: -------------------------------------------------------------------------------- 1 | from setuptools import setup, find_packages 2 | 3 | setup(name='agents', version='1.0', packages=find_packages()) 4 | -------------------------------------------------------------------------------- /autocon2-workshop/docs/images/netbox/create_site.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/netboxlabs/netbox-learning/HEAD/autocon2-workshop/docs/images/netbox/create_site.png -------------------------------------------------------------------------------- /autocon2-workshop/docs/images/netpicker/ntp_diff.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/netboxlabs/netbox-learning/HEAD/autocon2-workshop/docs/images/netpicker/ntp_diff.png -------------------------------------------------------------------------------- /autocon2-workshop/docs/images/slurpit/plugin_menu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/netboxlabs/netbox-learning/HEAD/autocon2-workshop/docs/images/slurpit/plugin_menu.png -------------------------------------------------------------------------------- /autocon2-workshop/docs/images/videos/DiscoRecon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/netboxlabs/netbox-learning/HEAD/autocon2-workshop/docs/images/videos/DiscoRecon.png -------------------------------------------------------------------------------- /autocon2-workshop/docs/images/videos/Installation.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/netboxlabs/netbox-learning/HEAD/autocon2-workshop/docs/images/videos/Installation.png -------------------------------------------------------------------------------- /autocon2-workshop/docs/images/videos/IntentBased.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/netboxlabs/netbox-learning/HEAD/autocon2-workshop/docs/images/videos/IntentBased.png -------------------------------------------------------------------------------- /autocon2-workshop/docs/images/videos/Introduction.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/netboxlabs/netbox-learning/HEAD/autocon2-workshop/docs/images/videos/Introduction.png -------------------------------------------------------------------------------- /autocon2-workshop/docs/images/videos/NetBox-SoT.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/netboxlabs/netbox-learning/HEAD/autocon2-workshop/docs/images/videos/NetBox-SoT.png -------------------------------------------------------------------------------- /autocon2-workshop/docs/images/videos/TheHardWay.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/netboxlabs/netbox-learning/HEAD/autocon2-workshop/docs/images/videos/TheHardWay.png -------------------------------------------------------------------------------- /autocon4-workshop/modules/module_0/images/gitea.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/netboxlabs/netbox-learning/HEAD/autocon4-workshop/modules/module_0/images/gitea.png -------------------------------------------------------------------------------- /autocon4-workshop/modules/module_0/images/netbox.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/netboxlabs/netbox-learning/HEAD/autocon4-workshop/modules/module_0/images/netbox.png -------------------------------------------------------------------------------- /netbox-ansible-cisco-cc/images/ccc_cf_choice_set.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/netboxlabs/netbox-learning/HEAD/netbox-ansible-cisco-cc/images/ccc_cf_choice_set.png -------------------------------------------------------------------------------- /netbox-ansible-webinar/Ansible Webinar Jan 2024.pptx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/netboxlabs/netbox-learning/HEAD/netbox-ansible-webinar/Ansible Webinar Jan 2024.pptx -------------------------------------------------------------------------------- /netbox-discovery-quickstart/images/diode_settings.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/netboxlabs/netbox-learning/HEAD/netbox-discovery-quickstart/images/diode_settings.png -------------------------------------------------------------------------------- /netbox-discovery-quickstart/images/ingested_srl1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/netboxlabs/netbox-learning/HEAD/netbox-discovery-quickstart/images/ingested_srl1.png -------------------------------------------------------------------------------- /netbox-netpicker/lab/cisco.clab.yml: -------------------------------------------------------------------------------- 1 | name: cisco_lab 2 | 3 | topology: 4 | nodes: 5 | access01: 6 | kind: vr-csr 7 | image: mrmrcoleman/vr-csr:17.03.06 -------------------------------------------------------------------------------- /netbox-pyats-webinar/images/pyats-webinar-devices.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/netboxlabs/netbox-learning/HEAD/netbox-pyats-webinar/images/pyats-webinar-devices.png -------------------------------------------------------------------------------- /nornir-netbox-webinar/config.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | inventory: 3 | plugin: NetBoxInventory2 4 | options: 5 | ssl_verify: False 6 | 7 | logging: 8 | enabled: False 9 | -------------------------------------------------------------------------------- /autocon2-workshop/ansible/roles/requirements.yml: -------------------------------------------------------------------------------- 1 | --- 2 | collections: 3 | - name: community.network 4 | - name: nokia.srlinux 5 | - name: netbox.netbox 6 | 7 | 8 | -------------------------------------------------------------------------------- /autocon2-workshop/docs/images/icinga/DirectorHosts.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/netboxlabs/netbox-learning/HEAD/autocon2-workshop/docs/images/icinga/DirectorHosts.png -------------------------------------------------------------------------------- /autocon2-workshop/docs/images/icinga/netbox-icinga.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/netboxlabs/netbox-learning/HEAD/autocon2-workshop/docs/images/icinga/netbox-icinga.png -------------------------------------------------------------------------------- /autocon2-workshop/docs/images/slurpit/device_finder.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/netboxlabs/netbox-learning/HEAD/autocon2-workshop/docs/images/slurpit/device_finder.png -------------------------------------------------------------------------------- /netbox-ansible-collection-quick-start/netbox_inv.yml: -------------------------------------------------------------------------------- 1 | --- 2 | plugin: netbox.netbox.nb_inventory 3 | validate_certs: False 4 | group_by: 5 | - device_roles 6 | - sites 7 | -------------------------------------------------------------------------------- /netbox-discovery-quickstart/images/ingested_devices.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/netboxlabs/netbox-learning/HEAD/netbox-discovery-quickstart/images/ingested_devices.png -------------------------------------------------------------------------------- /CLUS-2024-CISCOU-2039/images/ccc_netbox_device_details.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/netboxlabs/netbox-learning/HEAD/CLUS-2024-CISCOU-2039/images/ccc_netbox_device_details.png -------------------------------------------------------------------------------- /autocon2-workshop/docs/images/icinga/DirectorAddHost.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/netboxlabs/netbox-learning/HEAD/autocon2-workshop/docs/images/icinga/DirectorAddHost.png -------------------------------------------------------------------------------- /autocon2-workshop/docs/images/icinga/IcingaLabDevices.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/netboxlabs/netbox-learning/HEAD/autocon2-workshop/docs/images/icinga/IcingaLabDevices.png -------------------------------------------------------------------------------- /autocon2-workshop/docs/images/icinga/IcingaManualPing.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/netboxlabs/netbox-learning/HEAD/autocon2-workshop/docs/images/icinga/IcingaManualPing.png -------------------------------------------------------------------------------- /autocon2-workshop/docs/images/icinga/ServicesOverview.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/netboxlabs/netbox-learning/HEAD/autocon2-workshop/docs/images/icinga/ServicesOverview.png -------------------------------------------------------------------------------- /autocon2-workshop/docs/images/icinga/TacticalOverview.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/netboxlabs/netbox-learning/HEAD/autocon2-workshop/docs/images/icinga/TacticalOverview.png -------------------------------------------------------------------------------- /autocon2-workshop/docs/images/netbox/imported_devices.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/netboxlabs/netbox-learning/HEAD/autocon2-workshop/docs/images/netbox/imported_devices.png -------------------------------------------------------------------------------- /autocon2-workshop/docs/images/netpicker/backup_details.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/netboxlabs/netbox-learning/HEAD/autocon2-workshop/docs/images/netpicker/backup_details.png -------------------------------------------------------------------------------- /autocon2-workshop/docs/images/netpicker/backup_devices.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/netboxlabs/netbox-learning/HEAD/autocon2-workshop/docs/images/netpicker/backup_devices.png -------------------------------------------------------------------------------- /autocon2-workshop/docs/images/netpicker/create_policy.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/netboxlabs/netbox-learning/HEAD/autocon2-workshop/docs/images/netpicker/create_policy.png -------------------------------------------------------------------------------- /autocon2-workshop/docs/images/netpicker/device_backups.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/netboxlabs/netbox-learning/HEAD/autocon2-workshop/docs/images/netpicker/device_backups.png -------------------------------------------------------------------------------- /autocon2-workshop/docs/images/netpicker/device_mapping.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/netboxlabs/netbox-learning/HEAD/autocon2-workshop/docs/images/netpicker/device_mapping.png -------------------------------------------------------------------------------- /autocon2-workshop/docs/images/netpicker/hostname_diff.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/netboxlabs/netbox-learning/HEAD/autocon2-workshop/docs/images/netpicker/hostname_diff.png -------------------------------------------------------------------------------- /autocon2-workshop/docs/images/netpicker/policy_success.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/netboxlabs/netbox-learning/HEAD/autocon2-workshop/docs/images/netpicker/policy_success.png -------------------------------------------------------------------------------- /autocon2-workshop/docs/images/netpicker/second_backup.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/netboxlabs/netbox-learning/HEAD/autocon2-workshop/docs/images/netpicker/second_backup.png -------------------------------------------------------------------------------- /autocon2-workshop/docs/images/slurpit/device_overview.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/netboxlabs/netbox-learning/HEAD/autocon2-workshop/docs/images/slurpit/device_overview.png -------------------------------------------------------------------------------- /autocon2-workshop/docs/images/slurpit/device_schedule.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/netboxlabs/netbox-learning/HEAD/autocon2-workshop/docs/images/slurpit/device_schedule.png -------------------------------------------------------------------------------- /autocon2-workshop/docs/images/slurpit/imported_devices.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/netboxlabs/netbox-learning/HEAD/autocon2-workshop/docs/images/slurpit/imported_devices.png -------------------------------------------------------------------------------- /autocon2-workshop/docs/images/slurpit/interface_drift.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/netboxlabs/netbox-learning/HEAD/autocon2-workshop/docs/images/slurpit/interface_drift.png -------------------------------------------------------------------------------- /autocon2-workshop/docs/images/slurpit/plugin_settings.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/netboxlabs/netbox-learning/HEAD/autocon2-workshop/docs/images/slurpit/plugin_settings.png -------------------------------------------------------------------------------- /autocon2-workshop/docs/images/slurpit/reconcile_ipam.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/netboxlabs/netbox-learning/HEAD/autocon2-workshop/docs/images/slurpit/reconcile_ipam.png -------------------------------------------------------------------------------- /autocon2-workshop/docs/images/videos/ConfigAssurance.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/netboxlabs/netbox-learning/HEAD/autocon2-workshop/docs/images/videos/ConfigAssurance.png -------------------------------------------------------------------------------- /autocon2-workshop/docs/images/videos/MonitoringIcinga.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/netboxlabs/netbox-learning/HEAD/autocon2-workshop/docs/images/videos/MonitoringIcinga.png -------------------------------------------------------------------------------- /autocon4-workshop/modules/module_0/images/prometheus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/netboxlabs/netbox-learning/HEAD/autocon4-workshop/modules/module_0/images/prometheus.png -------------------------------------------------------------------------------- /netbox-discovery-quickstart/images/diode_reconciled_ip.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/netboxlabs/netbox-learning/HEAD/netbox-discovery-quickstart/images/diode_reconciled_ip.png -------------------------------------------------------------------------------- /netbox-discovery-quickstart/images/ingested_interfaces.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/netboxlabs/netbox-learning/HEAD/netbox-discovery-quickstart/images/ingested_interfaces.png -------------------------------------------------------------------------------- /autocon2-workshop/docs/images/netbox/imported_interfaces.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/netboxlabs/netbox-learning/HEAD/autocon2-workshop/docs/images/netbox/imported_interfaces.png -------------------------------------------------------------------------------- /autocon2-workshop/docs/images/netpicker/add_devices_menu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/netboxlabs/netbox-learning/HEAD/autocon2-workshop/docs/images/netpicker/add_devices_menu.png -------------------------------------------------------------------------------- /autocon2-workshop/docs/images/slurpit/device_onboarding.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/netboxlabs/netbox-learning/HEAD/autocon2-workshop/docs/images/slurpit/device_onboarding.png -------------------------------------------------------------------------------- /netbox-ansible-cisco-cc/images/ccc_netbox_device_details.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/netboxlabs/netbox-learning/HEAD/netbox-ansible-cisco-cc/images/ccc_netbox_device_details.png -------------------------------------------------------------------------------- /netbox-discovery-quickstart/images/device_ingestion_logs.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/netboxlabs/netbox-learning/HEAD/netbox-discovery-quickstart/images/device_ingestion_logs.png -------------------------------------------------------------------------------- /netbox-discovery-quickstart/images/diode_ingestion_logs.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/netboxlabs/netbox-learning/HEAD/netbox-discovery-quickstart/images/diode_ingestion_logs.png -------------------------------------------------------------------------------- /netbox-discovery-quickstart/images/ingested_ethernet_1_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/netboxlabs/netbox-learning/HEAD/netbox-discovery-quickstart/images/ingested_ethernet_1_1.png -------------------------------------------------------------------------------- /autocon2-workshop/docs/images/netpicker/create_python_rule.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/netboxlabs/netbox-learning/HEAD/autocon2-workshop/docs/images/netpicker/create_python_rule.png -------------------------------------------------------------------------------- /autocon2-workshop/docs/images/netpicker/create_simple_rule.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/netboxlabs/netbox-learning/HEAD/autocon2-workshop/docs/images/netpicker/create_simple_rule.png -------------------------------------------------------------------------------- /autocon2-workshop/docs/images/netpicker/homepage_add_device.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/netboxlabs/netbox-learning/HEAD/autocon2-workshop/docs/images/netpicker/homepage_add_device.png -------------------------------------------------------------------------------- /autocon2-workshop/docs/images/netpicker/netbox_api_details.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/netboxlabs/netbox-learning/HEAD/autocon2-workshop/docs/images/netpicker/netbox_api_details.png -------------------------------------------------------------------------------- /autocon2-workshop/docs/images/netpicker/python_rule_fails.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/netboxlabs/netbox-learning/HEAD/autocon2-workshop/docs/images/netpicker/python_rule_fails.png -------------------------------------------------------------------------------- /autocon2-workshop/docs/images/netpicker/simple_rule_fails.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/netboxlabs/netbox-learning/HEAD/autocon2-workshop/docs/images/netpicker/simple_rule_fails.png -------------------------------------------------------------------------------- /autocon2-workshop/docs/images/slurpit/discovered_interfaces.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/netboxlabs/netbox-learning/HEAD/autocon2-workshop/docs/images/slurpit/discovered_interfaces.png -------------------------------------------------------------------------------- /autocon2-workshop/docs/images/slurpit/reconcile_interfaces.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/netboxlabs/netbox-learning/HEAD/autocon2-workshop/docs/images/slurpit/reconcile_interfaces.png -------------------------------------------------------------------------------- /autocon2-workshop/docs/images/slurpit/run_interfaces_task.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/netboxlabs/netbox-learning/HEAD/autocon2-workshop/docs/images/slurpit/run_interfaces_task.png -------------------------------------------------------------------------------- /autocon4-workshop/config-templates/prometheus/prometheus.yaml: -------------------------------------------------------------------------------- 1 | global: 2 | evaluation_interval: 10s 3 | 4 | # Load alert rules 5 | rule_files: 6 | - '/etc/prometheus/alerts/*.yaml' 7 | -------------------------------------------------------------------------------- /netbox-ansible-cisco-cc/NetBox_Labs_CLEUR_2024_CISCOU-1014.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/netboxlabs/netbox-learning/HEAD/netbox-ansible-cisco-cc/NetBox_Labs_CLEUR_2024_CISCOU-1014.pdf -------------------------------------------------------------------------------- /netbox-event-driven-ansible/playbooks/templates/vlan_config.j2: -------------------------------------------------------------------------------- 1 | {% for vlan in vlans.json.results %} 2 | - vlan_id: {{ vlan.vid }} 3 | name: "{{ vlan.name }}" 4 | {% endfor %} 5 | -------------------------------------------------------------------------------- /autocon2-workshop/docs/images/netpicker/configure_python_rule.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/netboxlabs/netbox-learning/HEAD/autocon2-workshop/docs/images/netpicker/configure_python_rule.png -------------------------------------------------------------------------------- /autocon2-workshop/docs/images/netpicker/configure_simple_rule.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/netboxlabs/netbox-learning/HEAD/autocon2-workshop/docs/images/netpicker/configure_simple_rule.png -------------------------------------------------------------------------------- /autocon2-workshop/docs/images/videos/AutomatedNetworkChanges.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/netboxlabs/netbox-learning/HEAD/autocon2-workshop/docs/images/videos/AutomatedNetworkChanges.png -------------------------------------------------------------------------------- /autocon3-workshop-guide/sections/Section-7/code/step-1/README.md: -------------------------------------------------------------------------------- 1 | # ac3-integration-tutorial 2 | Related files for the AutoCon3 - NetBox Discovery and Assurance 101 (Discovery Integration) 3 | -------------------------------------------------------------------------------- /autocon3-workshop-guide/sections/Section-7/code/step-2/README.md: -------------------------------------------------------------------------------- 1 | # ac3-integration-tutorial 2 | Related files for the AutoCon3 - NetBox Discovery and Assurance 101 (Discovery Integration) 3 | -------------------------------------------------------------------------------- /autocon3-workshop-guide/sections/Section-7/code/step-3/README.md: -------------------------------------------------------------------------------- 1 | # ac3-integration-tutorial 2 | Related files for the AutoCon3 - NetBox Discovery and Assurance 101 (Discovery Integration) 3 | -------------------------------------------------------------------------------- /autocon3-workshop-guide/sections/Section-7/code/step-3/ourdata.csv: -------------------------------------------------------------------------------- 1 | name,manufacturer,model,management_ip,serial 2 | pdu03,APC,APC6732,10.163.3.3,345678 3 | pdu04,APC,APC6734,10.163.3.4,456789 -------------------------------------------------------------------------------- /netbox-diode-webinar/examples/python/sample-orb-worker/README.md: -------------------------------------------------------------------------------- 1 | # ac3-integration-tutorial 2 | Related files for the AutoCon3 - NetBox Discovery and Assurance 101 (Discovery Integration) 3 | -------------------------------------------------------------------------------- /netbox-diode-webinar/examples/python/sample-orb-worker/ourdata.csv: -------------------------------------------------------------------------------- 1 | name,manufacturer,model,management_ip,serial 2 | pdu03,APC,APC6732,10.163.3.3,345678 3 | pdu04,APC,APC6734,10.163.3.4,456789 -------------------------------------------------------------------------------- /autocon2-workshop/docs/images/slurpit/device_onboarding_import.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/netboxlabs/netbox-learning/HEAD/autocon2-workshop/docs/images/slurpit/device_onboarding_import.png -------------------------------------------------------------------------------- /autocon2-workshop/docs/images/slurpit/plugin_planning_settings.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/netboxlabs/netbox-learning/HEAD/autocon2-workshop/docs/images/slurpit/plugin_planning_settings.png -------------------------------------------------------------------------------- /autocon3-workshop-guide/sections/Section-5/port_scan.yaml: -------------------------------------------------------------------------------- 1 | network_discovery: 2 | port_scan: 3 | config: 4 | scope: 5 | targets: 6 | - 10.114.0.1-100 -------------------------------------------------------------------------------- /autocon3-workshop-guide/sections/Section-7/images/project-layout.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/netboxlabs/netbox-learning/HEAD/autocon3-workshop-guide/sections/Section-7/images/project-layout.png -------------------------------------------------------------------------------- /netbox-ansible-collection-quick-start/images/ansible_collection.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/netboxlabs/netbox-learning/HEAD/netbox-ansible-collection-quick-start/images/ansible_collection.png -------------------------------------------------------------------------------- /autocon3-workshop-guide/sections/Section-7/images/empty-orb-runner.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/netboxlabs/netbox-learning/HEAD/autocon3-workshop-guide/sections/Section-7/images/empty-orb-runner.png -------------------------------------------------------------------------------- /netbox-devops-onug-fall/roles/deploy_vlans/vars/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | netbox_url: "{{ lookup('ansible.builtin.env', 'NETBOX_API') }}" 3 | netbox_token: "{{ lookup('ansible.builtin.env', 'NETBOX_TOKEN') }}" -------------------------------------------------------------------------------- /autocon2-workshop/docs/images/automated_network_changes/ntp_servers.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/netboxlabs/netbox-learning/HEAD/autocon2-workshop/docs/images/automated_network_changes/ntp_servers.png -------------------------------------------------------------------------------- /autocon3-workshop-guide/sections/Section-7/images/Controller-Diagram.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/netboxlabs/netbox-learning/HEAD/autocon3-workshop-guide/sections/Section-7/images/Controller-Diagram.png -------------------------------------------------------------------------------- /autocon3-workshop-guide/sections/Section-7/images/section3_deviations.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/netboxlabs/netbox-learning/HEAD/autocon3-workshop-guide/sections/Section-7/images/section3_deviations.png -------------------------------------------------------------------------------- /autocon3-workshop-guide/sections/Section-7/images/section4_deviations.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/netboxlabs/netbox-learning/HEAD/autocon3-workshop-guide/sections/Section-7/images/section4_deviations.png -------------------------------------------------------------------------------- /autocon4-workshop/modules/module_2/images/prometheus_alerts_all_green.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/netboxlabs/netbox-learning/HEAD/autocon4-workshop/modules/module_2/images/prometheus_alerts_all_green.png -------------------------------------------------------------------------------- /netbox-diode-webinar/examples/python/ourdata.csv: -------------------------------------------------------------------------------- 1 | name,manufacturer,model,management_ip,serial,software_version 2 | "PDU 03",APC,APC6732,10.163.3.3,345678,"1.3" 3 | "PDU 04",APC,APC6734,10.163.3.4,456789,"1.4" -------------------------------------------------------------------------------- /netbox-discovery-quickstart/.gitignore: -------------------------------------------------------------------------------- 1 | netbox-docker/ 2 | *.bak 3 | clab-*/ 4 | device_discovery/ 5 | diode/ 6 | network_discovery/ 7 | environment 8 | .docker/ 9 | .sudo_as_admin_successful 10 | -------------------------------------------------------------------------------- /netbox-discovery-webinar/worker-example/requirements.txt: -------------------------------------------------------------------------------- 1 | # Required in production environment 2 | # netboxlabs.diode.sdk 3 | # worker 4 | 5 | # Testing and development 6 | pytest>=7.0.0 7 | pytest-cov>=4.0.0 -------------------------------------------------------------------------------- /autocon2-workshop/.gitignore: -------------------------------------------------------------------------------- 1 | netbox-docker/ 2 | *.bak 3 | clab-*/ 4 | icinga2-docker-stack/ 5 | slurpit/certs/ 6 | slurpit/db/ 7 | slurpit/logs/ 8 | setup 9 | */venv/ 10 | workshop_setup/icinga/menu.ini -------------------------------------------------------------------------------- /autocon4-workshop/modules/module_2/images/httpcheck_duration_milliseconds.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/netboxlabs/netbox-learning/HEAD/autocon4-workshop/modules/module_2/images/httpcheck_duration_milliseconds.png -------------------------------------------------------------------------------- /autocon4-workshop/modules/module_2/images/prometheus_alerts_not_reachable.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/netboxlabs/netbox-learning/HEAD/autocon4-workshop/modules/module_2/images/prometheus_alerts_not_reachable.png -------------------------------------------------------------------------------- /netbox-ansible-collection-quick-start/images/Cisco Live Sites and Devices.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/netboxlabs/netbox-learning/HEAD/netbox-ansible-collection-quick-start/images/Cisco Live Sites and Devices.png -------------------------------------------------------------------------------- /netbox-discovery-webinar/worker-example/worker_example/__init__.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # Copyright 2025 NetBox Labs Inc 3 | 4 | from worker_example.runner import WorkerExample 5 | 6 | __all__ = ["WorkerExample"] 7 | -------------------------------------------------------------------------------- /autocon3-workshop-guide/sections/Section-7/code/step-1/lab-integration/lab_integration/__init__.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # 3 | 4 | from lab_integration.runner import LabIntegration 5 | 6 | __all__ = ["LabIntegration"] 7 | -------------------------------------------------------------------------------- /autocon3-workshop-guide/sections/Section-7/code/step-2/lab-integration/lab_integration/__init__.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # 3 | 4 | from lab_integration.runner import LabIntegration 5 | 6 | __all__ = ["LabIntegration"] 7 | -------------------------------------------------------------------------------- /autocon3-workshop-guide/sections/Section-7/code/step-3/lab-integration/lab_integration/__init__.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # 3 | 4 | from lab_integration.runner import LabIntegration 5 | 6 | __all__ = ["LabIntegration"] 7 | -------------------------------------------------------------------------------- /netbox-diode-webinar/examples/python/sample-orb-worker/lab-integration/lab_integration/__init__.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # 3 | 4 | from lab_integration.runner import LabIntegration 5 | 6 | __all__ = ["LabIntegration"] 7 | -------------------------------------------------------------------------------- /netbox-event-driven-architectures/requirements.txt: -------------------------------------------------------------------------------- 1 | nats-py 2 | python-dotenv 3 | PyGithub 4 | napalm 5 | pythonping 6 | ipaddress 7 | python-nmap 8 | pynetbox 9 | prettytable 10 | slack_sdk 11 | fastapi 12 | uvicorn 13 | -------------------------------------------------------------------------------- /netbox-ansible-webinar/roles/COMPARE_STATES/vars/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | actual_conf_dir: "./backups/{{ inventory_hostname }}" 3 | intended_conf_dir: "./intended_configs/{{ inventory_hostname }}" 4 | exclusion_pattern: "(^! Command:)|(^! device:)" -------------------------------------------------------------------------------- /netbox-ansible-webinar/netbox_inv.yml: -------------------------------------------------------------------------------- 1 | plugin: netbox.netbox.nb_inventory 2 | validate_certs: False 3 | 4 | compose: 5 | ansible_network_os: platform.slug 6 | 7 | group_by: 8 | - device_roles 9 | - sites 10 | - platforms 11 | -------------------------------------------------------------------------------- /netbox-ansible-webinar/roles/INTENDED_STATE/vars/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | netbox_url: "{{ lookup('ansible.builtin.env', 'NETBOX_API') }}" 3 | netbox_token: "{{ lookup('ansible.builtin.env', 'NETBOX_TOKEN') }}" 4 | intended_configs_root: ./intended_configs -------------------------------------------------------------------------------- /autocon3-workshop-guide/sections/Section-5/ping_scan.yaml: -------------------------------------------------------------------------------- 1 | network_discovery: 2 | ping_scan: 3 | config: 4 | scope: 5 | targets: 6 | - 10.114.0.1-100 7 | ping_scan: true 8 | timing: 5 -------------------------------------------------------------------------------- /autocon3-workshop-guide/sections/Section-5/port_scan_fast.yaml: -------------------------------------------------------------------------------- 1 | network_discovery: 2 | fast_port_scan: 3 | config: 4 | scope: 5 | targets: 6 | - 10.114.0.1-100 7 | fast_mode: true 8 | timing: 5 -------------------------------------------------------------------------------- /netbox-ansible-collection-quick-start/NetBox-Integration-with-Ansible-Automation-Platform-CLUS-2024.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/netboxlabs/netbox-learning/HEAD/netbox-ansible-collection-quick-start/NetBox-Integration-with-Ansible-Automation-Platform-CLUS-2024.pdf -------------------------------------------------------------------------------- /netbox-ansible-collection-quick-start/roles/create_prefix_and_vlan_roles/vars/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | ipam_roles: 3 | 4 | - name: Branch_Data 5 | - name: Branch_Voice 6 | - name: Branch_WiFi 7 | - name: Guest_WiFi 8 | - name: Network_Management 9 | - name: Point_to_Point -------------------------------------------------------------------------------- /netbox-ansible-webinar/get_facts.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Gather Arista EOS Facts 3 | hosts: ceos-sw-1 4 | connection: network_cli 5 | gather_facts: no 6 | 7 | tasks: 8 | - name: Gather all facts 9 | arista.eos.eos_facts: 10 | gather_subset: all -------------------------------------------------------------------------------- /netbox-discovery-webinar/policies/mist-discovery-policy.yaml: -------------------------------------------------------------------------------- 1 | worker: 2 | mist_worker: 3 | config: 4 | # schedule: "30 * * * *" # every 30 minutes 5 | package: nbl_mist 6 | mist_apitoken: ${MIST_APITOKEN} 7 | mist_org_id: ${MIST_ORG_ID} 8 | scope: -------------------------------------------------------------------------------- /netbox-ansible-collection-quick-start/Webinar-Exploring-the-Red-Hat-Ansible-Certified-Collection-for-NetBox.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/netboxlabs/netbox-learning/HEAD/netbox-ansible-collection-quick-start/Webinar-Exploring-the-Red-Hat-Ansible-Certified-Collection-for-NetBox.pdf -------------------------------------------------------------------------------- /netbox-ansible-collection-quick-start/roles/create_aggregates/vars/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | ipam_aggregates: 3 | 4 | - prefix: 10.0.0.0/8 5 | rir: RFC 1918 6 | 7 | - prefix: 172.16.0.0/12 8 | rir: RFC 1918 9 | 10 | - prefix: 192.168.0.0/16 11 | rir: RFC 1918 -------------------------------------------------------------------------------- /netbox-discovery-webinar/policies/worker-discovery-policy.yaml: -------------------------------------------------------------------------------- 1 | worker: 2 | worker_example: 3 | config: 4 | package: worker_example 5 | scope: 6 | name: example device 7 | device_type: generic type 8 | manufacturer: acme 9 | site: example site 10 | role: generic 11 | -------------------------------------------------------------------------------- /netbox-discovery-quickstart/network/ios.clab.yml: -------------------------------------------------------------------------------- 1 | name: discovery-quickstart-cisco 2 | 3 | mgmt: 4 | network: discovery-quickstart 5 | ipv4-subnet: 172.24.0.0/24 6 | 7 | topology: 8 | nodes: 9 | ios1: 10 | kind: vr-csr 11 | image: mrmrcoleman/vr-csr:17.03.06 12 | mgmt-ipv4: 172.24.0.102 -------------------------------------------------------------------------------- /autocon2-workshop/ansible/ansible.cfg: -------------------------------------------------------------------------------- 1 | [defaults] 2 | inventory = inventory/ 3 | host_key_checking = False 4 | timeout = 30 5 | retry_files_enabled = False 6 | 7 | [privilege_escalation] 8 | become = False 9 | 10 | [ssh_connection] 11 | pipelining = True 12 | ssh_args = -o ControlMaster=auto -o ControlPersist=60s 13 | 14 | -------------------------------------------------------------------------------- /netbox-ansible-webinar/compare_intended_vs_actual.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Compare intended state in NetBox to actual device state and show delta 3 | hosts: sites_container_lab 4 | gather_facts: false 5 | connection: network_cli 6 | 7 | roles: 8 | - role: ACTUAL_STATE 9 | - role: INTENDED_STATE 10 | - role: COMPARE_STATES -------------------------------------------------------------------------------- /autocon4-workshop/config-templates/orb-policies/clab_networks.yaml: -------------------------------------------------------------------------------- 1 | #-- version 1 2 | network_discovery: 3 | clab_networks: 4 | config: 5 | schedule: "* * * * *" 6 | scope: 7 | fast_mode: true 8 | timing: 5 9 | targets: 10 | - 172.24.0.0/24 11 | - 192.168.1.0/30 12 | - 192.168.2.0/30 -------------------------------------------------------------------------------- /autocon2-workshop/docs/8_Summary.md: -------------------------------------------------------------------------------- 1 | # Section 8 - Summary 2 | 3 | ## Video Guide (Click to launch :rocket:) 4 | [![Summary](images/videos/Summary.png)](https://www.youtube.com/watch?v=sy0CjkoErUA) 5 | 6 | ___ 7 | 8 | Congratulations, you've reached the end of Network Automation Hero to Zero. We hope it was useful and we look forward to your feedback. -------------------------------------------------------------------------------- /autocon3-workshop-guide/sections/Section-3/network/srl.clab.yml: -------------------------------------------------------------------------------- 1 | name: discovery-assurance 2 | 3 | mgmt: 4 | network: discovery-quickstart 5 | ipv4-subnet: 172.24.0.0/24 6 | 7 | topology: 8 | nodes: 9 | srl1: 10 | kind: nokia_srlinux 11 | type: ixrd3 12 | image: ghcr.io/nokia/srlinux:24.7.2 13 | mgmt-ipv4: 172.24.0.100 -------------------------------------------------------------------------------- /autocon3-workshop-guide/sections/Section-6/ccc_integration.yaml: -------------------------------------------------------------------------------- 1 | worker: 2 | catalyst_center_worker: 3 | config: 4 | package: nbl_cisco_catalyst_center 5 | CCC_HOST: ${vault://kv/workshop/CCC_HOST} 6 | CCC_USER: ${vault://kv/workshop/CCC_USER} 7 | CCC_PWD: ${vault://kv/workshop/CCC_PWD} 8 | scope: -------------------------------------------------------------------------------- /autocon2-workshop/99_stop_all.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #stop all the stuff 3 | # 4 | pushd slurpit 5 | docker compose down 6 | popd 7 | 8 | pushd network 9 | sudo clab destroy 10 | popd 11 | 12 | pushd netbox-docker 13 | docker compose down 14 | popd 15 | 16 | pushd icinga2-docker-stack 17 | docker compose down 18 | popd 19 | 20 | pushd netpicker 21 | docker compose down 22 | popd 23 | -------------------------------------------------------------------------------- /netbox-ansible-webinar/get_lldp_neighbors.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Get LLDP Neighbors 3 | hosts: sites_container_lab 4 | connection: network_cli 5 | gather_facts: no 6 | 7 | tasks: 8 | - name: Gather LLDP neighbor information 9 | arista.eos.eos_facts: 10 | gather_subset: 11 | - interfaces 12 | 13 | - name: debug 14 | debug: 15 | var: ansible_net_neighbors -------------------------------------------------------------------------------- /autocon2-workshop/docs/2_Introducing_Intent_Based_Network_Automation.md: -------------------------------------------------------------------------------- 1 | # Section 2 - Introducing Intent Based Network Automation 2 | 3 | ## Video Guide (Click to launch :rocket:) 4 | [![Introducing Intent Based Network Automation](images/videos/IntentBased.png)](https://www.youtube.com/watch?v=ZZuiMBjgnts) 5 | 6 | ___ 7 | 8 | Next Section - [**NetBox - Our Network Source of Truth**](./3_Source_Of_Truth_NetBox.md) 9 | -------------------------------------------------------------------------------- /autocon4-workshop/ansible/inventory.yaml: -------------------------------------------------------------------------------- 1 | all: 2 | children: 3 | srlinux: 4 | hosts: 5 | srl1: 6 | ansible_host: 172.24.0.101 7 | srl2: 8 | ansible_host: 172.24.0.102 9 | vars: 10 | ansible_connection: ansible.netcommon.httpapi 11 | ansible_network_os: nokia.srlinux.srlinux 12 | ansible_user: admin 13 | ansible_password: NokiaSrl1! -------------------------------------------------------------------------------- /netbox-ansible-webinar/show_version.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Show Version 3 | hosts: sites_container_lab 4 | gather_facts: false 5 | connection: network_cli 6 | 7 | tasks: 8 | - name: Run 'show version' command on remote devices 9 | eos_command: 10 | commands: "show version" 11 | register: show_version 12 | 13 | - name: debug 14 | debug: 15 | var: show_version.stdout.0 -------------------------------------------------------------------------------- /netbox-discovery-webinar/policies/network-discovery-policy.yaml: -------------------------------------------------------------------------------- 1 | network_discovery: 2 | lab_network: 3 | config: 4 | schedule: "* * * * *" 5 | timeout: 5 6 | defaults: 7 | description: "Discovered by NetBox Discovery agent" 8 | tags: 9 | - network-discovery 10 | scope: 11 | targets: 12 | - 172.24.0.0/24 13 | fast_mode: True 14 | timing: 5 -------------------------------------------------------------------------------- /netbox-devops-onug-fall/deploy_vlans.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Deploy VLANs From NetBox 3 | connection: network_cli 4 | hosts: sites_container-lab 5 | gather_facts: False 6 | become: true 7 | 8 | vars: 9 | ansible_user: admin 10 | ansible_password: admin 11 | ansible_become: yes 12 | ansible_become_password: admin 13 | ansible_network_os: arista.eos.eos 14 | 15 | roles: 16 | - role: deploy_vlans -------------------------------------------------------------------------------- /netbox-ansible-collection-quick-start/roles/create_rirs/tasks/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Create RIRs 3 | netbox.netbox.netbox_rir: 4 | netbox_url: "{{ lookup('ansible.builtin.env', 'NETBOX_API') }}" 5 | netbox_token: "{{ lookup('ansible.builtin.env', 'NETBOX_TOKEN') }}" 6 | data: "{{ rir }}" 7 | state: present 8 | loop: "{{ ipam_rirs }}" 9 | loop_control: 10 | loop_var: rir 11 | label: "{{ rir['name']}}" -------------------------------------------------------------------------------- /autocon2-workshop/ansible/playbooks/test.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Retrieve hostname from Nokia SR OS router 3 | hosts: all 4 | gather_facts: no 5 | tasks: 6 | - name: Get /system/information container 7 | nokia.srlinux.get: 8 | paths: 9 | - path: /system/information 10 | datastore: state 11 | yang_models: srl 12 | register: response 13 | 14 | - debug: 15 | var: response 16 | -------------------------------------------------------------------------------- /autocon2-workshop/ansible/inventory/static: -------------------------------------------------------------------------------- 1 | all: 2 | hosts: 3 | clab-autocon2-srl1: 4 | ansible_user: admin 5 | ansible_password: NokiaSrl1! 6 | ansible_network_os: nokia.srlinux.srlinux 7 | ansible_connection: ansible.netcommon.httpapi 8 | clab-autocon2-srl2: 9 | ansible_user: admin 10 | ansible_password: NokiaSrl1! 11 | ansible_network_os: nokia.srlinux.srlinux 12 | ansible_connection: ansible.netcommon.httpapi 13 | 14 | -------------------------------------------------------------------------------- /netbox-ansible-collection-quick-start/roles/create_prefixes/tasks/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Create Prefixes within NetBox 3 | netbox.netbox.netbox_prefix: 4 | netbox_url: "{{ lookup('ansible.builtin.env', 'NETBOX_API') }}" 5 | netbox_token: "{{ lookup('ansible.builtin.env', 'NETBOX_TOKEN') }}" 6 | data: "{{ prefix }}" 7 | first_available: yes 8 | loop: "{{ prefixes }}" 9 | loop_control: 10 | loop_var: prefix 11 | label: "{{ prefix['description']}}" -------------------------------------------------------------------------------- /netbox-event-driven-architectures/lab/event_driven_webinar.clab.yml: -------------------------------------------------------------------------------- 1 | name: event-driven-webinar 2 | 3 | topology: 4 | kinds: 5 | nokia_srlinux: 6 | type: ixrd3 7 | image: ghcr.io/nokia/srlinux 8 | nodes: 9 | RCM-WR1: 10 | kind: nokia_srlinux 11 | mgmt-ipv4: 172.20.20.2 12 | 13 | RCM-WR2: 14 | kind: nokia_srlinux 15 | mgmt-ipv4: 172.20.20.3 16 | 17 | RCM-WR3: 18 | kind: nokia_srlinux 19 | mgmt-ipv4: 172.20.20.4 20 | -------------------------------------------------------------------------------- /netbox-ansible-collection-quick-start/roles/create_aggregates/tasks/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Create Aggregates within NetBox 3 | netbox.netbox.netbox_aggregate: 4 | netbox_url: "{{ lookup('ansible.builtin.env', 'NETBOX_API') }}" 5 | netbox_token: "{{ lookup('ansible.builtin.env', 'NETBOX_TOKEN') }}" 6 | data: "{{ aggregate }}" 7 | state: present 8 | loop: "{{ ipam_aggregates }}" 9 | loop_control: 10 | loop_var: aggregate 11 | label: "{{ aggregate['prefix']}}" -------------------------------------------------------------------------------- /netbox-devops-onug-fall/README.md: -------------------------------------------------------------------------------- 1 | # netbox-devops 2 | NetDevOps with NetBox 3 | 4 | Ansible playbooks that form part of a simple CI/CD pipeline with NetBox as the Source of Truth. 5 | 6 | This code was demonstrated in a talk given by Rich Bibby at ONUG Fall in NYC, October 24, 2023 - ["NetBox Labs Proof of Concept: Network Automation Success Relies on a Network Source of Truth"](https://onug.net/events/netbox-labs-proof-of-concept-network-automation-success-relies-on-a-network-source-of-truth/). -------------------------------------------------------------------------------- /nornir-netbox-webinar/inventory.py: -------------------------------------------------------------------------------- 1 | #!./venv/bin/python 2 | 3 | # Import required libraries 4 | 5 | from nornir import InitNornir 6 | import json 7 | 8 | # Initialize Nornir with config file 9 | 10 | nr = InitNornir(config_file="config.yaml") 11 | 12 | # Loop over all hosts from NetBox and print the output 13 | 14 | for host in nr.inventory.hosts.values(): 15 | host_data = host.dict() 16 | formatted_json = json.dumps(host_data, indent=4) 17 | print(formatted_json) 18 | -------------------------------------------------------------------------------- /.github/workflows/pr_labeler.yml: -------------------------------------------------------------------------------- 1 | name: PR labeler 2 | on: 3 | - pull_request_target 4 | 5 | concurrency: 6 | group: ${{ github.workflow }} 7 | cancel-in-progress: false 8 | 9 | jobs: 10 | triage: 11 | permissions: 12 | contents: read 13 | pull-requests: write 14 | runs-on: ubuntu-latest 15 | steps: 16 | - uses: actions/checkout@v4 17 | - uses: actions/labeler@v5 18 | with: 19 | configuration-path: '.github/pull_request_labeler.yml' -------------------------------------------------------------------------------- /autocon3-workshop-guide/sections/Section-5/selector.yaml: -------------------------------------------------------------------------------- 1 | ping_scan_selector: 2 | selector: 3 | ping_scan: true 4 | policies: 5 | default: 6 | path: ping_scan.yaml 7 | 8 | port_scan_selector: 9 | selector: 10 | discovery_type: port scan 11 | policies: 12 | default: 13 | path: port_scan.yaml 14 | 15 | port_scan_fast_selector: 16 | selector: 17 | discovery_type: fast port scan 18 | policies: 19 | default: 20 | path: port_scan_fast.yaml -------------------------------------------------------------------------------- /netbox-ansible-collection-quick-start/roles/create_prefix_and_vlan_roles/tasks/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Create Prefix and VLAN Roles within NetBox 3 | netbox.netbox.netbox_ipam_role: 4 | netbox_url: "{{ lookup('ansible.builtin.env', 'NETBOX_API') }}" 5 | netbox_token: "{{ lookup('ansible.builtin.env', 'NETBOX_TOKEN') }}" 6 | data: "{{ role }}" 7 | state: present 8 | loop: "{{ ipam_roles }}" 9 | loop_control: 10 | loop_var: role 11 | label: "{{ role['name']}}" -------------------------------------------------------------------------------- /netbox-discovery/agent.yaml: -------------------------------------------------------------------------------- 1 | orb: 2 | config_manager: 3 | active: local 4 | backends: 5 | network_discovery: 6 | common: 7 | diode: 8 | target: grpc://localhost:80/diode 9 | client_id: ${DIODE_CLIENT_ID} 10 | client_secret: ${DIODE_CLIENT_SECRET} 11 | agent_name: test_agent 12 | policies: 13 | network_discovery: 14 | loopback_policy: 15 | config: 16 | scope: 17 | targets: 18 | - 127.0.0.1 19 | -------------------------------------------------------------------------------- /netbox-event-driven-architectures/agents/reachability_alerter/example.env: -------------------------------------------------------------------------------- 1 | NATS_SERVER="127.0.0.1:4222" # NATs server to connect to 2 | SUBSCRIBE_SUBJECT="network.devices.reachable" # NATs subject to subscribe to. The agent runs when a message is receieved 3 | SLACK_TOKEN="YOUR SLACK TOKEN" # Slack App Token 4 | SLACK_USERNAME="YOUR SLACK BOT USERNAME" # Slack username to publish as 5 | SLACK_CHANNEL="YOUR SLACK CHANNEL" # Slack channel to publish to -------------------------------------------------------------------------------- /netbox-discovery-quickstart/network/srl.clab.yml: -------------------------------------------------------------------------------- 1 | name: discovery-quickstart-nokia 2 | 3 | mgmt: 4 | network: discovery-quickstart 5 | ipv4-subnet: 172.24.0.0/24 6 | 7 | topology: 8 | nodes: 9 | srl1: 10 | kind: nokia_srlinux 11 | image: ghcr.io/nokia/srlinux:24.7.2 12 | mgmt-ipv4: 172.24.0.100 13 | srl2: 14 | kind: nokia_srlinux 15 | image: ghcr.io/nokia/srlinux:24.7.2 16 | mgmt-ipv4: 172.24.0.101 17 | 18 | links: 19 | - endpoints: ["srl1:e1-1", "srl2:e1-1"] -------------------------------------------------------------------------------- /netbox-ansible-webinar/generate_report.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Generate Device Report For Host, IP Address, OS, Version and Serial Numbers 3 | hosts: sites_container_lab 4 | gather_facts: no 5 | connection: network_cli 6 | 7 | tasks: 8 | - name: 1 - Gather device facts for report 9 | arista.eos.eos_facts: 10 | gather_subset: all 11 | 12 | - name: 2- Generate markdown report using device facts 13 | template: 14 | src: "./reports/report_template.j2" 15 | dest: "./reports/device_report.md" -------------------------------------------------------------------------------- /autocon2-workshop/network/1_the_hard_way/autocon2.clab.yml: -------------------------------------------------------------------------------- 1 | name: autocon2 2 | 3 | mgmt: 4 | network: autocon-workshop 5 | 6 | topology: 7 | nodes: 8 | srl1: 9 | kind: nokia_srlinux 10 | image: ghcr.io/nokia/srlinux:24.7.2 11 | mgmt-ipv4: 172.24.0.100 12 | startup-config: srl1.cfg 13 | srl2: 14 | kind: nokia_srlinux 15 | image: ghcr.io/nokia/srlinux:24.7.2 16 | mgmt-ipv4: 172.24.0.101 17 | startup-config: srl2.cfg 18 | 19 | links: 20 | - endpoints: ["srl1:e1-1", "srl2:e1-1"] -------------------------------------------------------------------------------- /autocon2-workshop/network/5.1_monitoring/autocon2.clab.yml: -------------------------------------------------------------------------------- 1 | name: autocon2 2 | 3 | mgmt: 4 | network: autocon-workshop 5 | 6 | topology: 7 | nodes: 8 | srl1: 9 | kind: nokia_srlinux 10 | image: ghcr.io/nokia/srlinux:24.7.2 11 | mgmt-ipv4: 172.24.0.100 12 | startup-config: srl1.cfg 13 | srl2: 14 | kind: nokia_srlinux 15 | image: ghcr.io/nokia/srlinux:24.7.2 16 | mgmt-ipv4: 172.24.0.101 17 | startup-config: srl2.cfg 18 | 19 | links: 20 | - endpoints: ["srl1:e1-1", "srl2:e1-1"] -------------------------------------------------------------------------------- /autocon2-workshop/network/5.2_monitoring/autocon2.clab.yml: -------------------------------------------------------------------------------- 1 | name: autocon2 2 | 3 | mgmt: 4 | network: autocon-workshop 5 | 6 | topology: 7 | nodes: 8 | srl1: 9 | kind: nokia_srlinux 10 | image: ghcr.io/nokia/srlinux:24.7.2 11 | mgmt-ipv4: 172.24.0.100 12 | startup-config: srl1.cfg 13 | srl2: 14 | kind: nokia_srlinux 15 | image: ghcr.io/nokia/srlinux:24.7.2 16 | mgmt-ipv4: 172.24.0.101 17 | startup-config: srl2.cfg 18 | 19 | links: 20 | - endpoints: ["srl1:e1-1", "srl2:e1-1"] -------------------------------------------------------------------------------- /autocon2-workshop/network/6.1_assurance/autocon2.clab.yml: -------------------------------------------------------------------------------- 1 | name: autocon2 2 | 3 | mgmt: 4 | network: autocon-workshop 5 | 6 | topology: 7 | nodes: 8 | srl1: 9 | kind: nokia_srlinux 10 | image: ghcr.io/nokia/srlinux:24.7.2 11 | mgmt-ipv4: 172.24.0.100 12 | startup-config: srl1.cfg 13 | srl2: 14 | kind: nokia_srlinux 15 | image: ghcr.io/nokia/srlinux:24.7.2 16 | mgmt-ipv4: 172.24.0.101 17 | startup-config: srl2.cfg 18 | 19 | links: 20 | - endpoints: ["srl1:e1-1", "srl2:e1-1"] -------------------------------------------------------------------------------- /autocon2-workshop/network/6.2_assurance/autocon2.clab.yml: -------------------------------------------------------------------------------- 1 | name: autocon2 2 | 3 | mgmt: 4 | network: autocon-workshop 5 | 6 | topology: 7 | nodes: 8 | srl1: 9 | kind: nokia_srlinux 10 | image: ghcr.io/nokia/srlinux:24.7.2 11 | mgmt-ipv4: 172.24.0.100 12 | startup-config: srl1.cfg 13 | srl2: 14 | kind: nokia_srlinux 15 | image: ghcr.io/nokia/srlinux:24.7.2 16 | mgmt-ipv4: 172.24.0.101 17 | startup-config: srl2.cfg 18 | 19 | links: 20 | - endpoints: ["srl1:e1-1", "srl2:e1-1"] -------------------------------------------------------------------------------- /autocon2-workshop/ansible/inventory/netbox.yml: -------------------------------------------------------------------------------- 1 | --- 2 | plugin: netbox.netbox.nb_inventory 3 | api_endpoint: http://MY_EXTERNAL_IP:NETBOX_PORT 4 | token: 1234567890 5 | 6 | max_uri_length: 1000 7 | fetch_all: true 8 | config_context: true 9 | flatten_config_context: true 10 | racks: false 11 | services: false 12 | query_filters: 13 | - status: 'active' 14 | device_query_filters: 15 | - has_primary_ip: 'true' 16 | 17 | group_by: 18 | - device_roles 19 | - sites 20 | - tags 21 | 22 | cache: true 23 | site_data: true 24 | interfaces: true -------------------------------------------------------------------------------- /diode/examples/csv/inventory.csv: -------------------------------------------------------------------------------- 1 | Device_Type,Device_Name,Serial_Number,Site_Name,Vendor,Device_Model 2 | Router,Core_Router_HQ_01,ABC123456789,HQ,Cisco,Cisco 2921 3 | Switch,Access_Switch_Branch1_01,DEF987654321,Branch1,Juniper,Juniper EX4300 4 | Router,Edge_Router_Branch2_02,GHI456789012,Branch2,Cisco,Cisco 4321 5 | Switch,Distribution_Switch_Branch3_01,JKL123456789,Branch3,Arista,Arista 7050X 6 | Wireless_AP,Conference_Room_AP_01,MNO987654321,HQ,Cisco,Cisco Aironet 3802 7 | Wireless_AP,Conference_Room_AP_02,PQR456789012,HQ,Cisco,Cisco Aironet 3802 8 | -------------------------------------------------------------------------------- /autocon2-workshop/network/7_automated_network_changes/autocon2.clab.yml: -------------------------------------------------------------------------------- 1 | name: autocon2 2 | 3 | mgmt: 4 | network: autocon-workshop 5 | 6 | topology: 7 | nodes: 8 | srl1: 9 | kind: nokia_srlinux 10 | image: ghcr.io/nokia/srlinux:24.7.2 11 | mgmt-ipv4: 172.24.0.100 12 | startup-config: srl1.cfg 13 | srl2: 14 | kind: nokia_srlinux 15 | image: ghcr.io/nokia/srlinux:24.7.2 16 | mgmt-ipv4: 172.24.0.101 17 | startup-config: srl2.cfg 18 | 19 | links: 20 | - endpoints: ["srl1:e1-1", "srl2:e1-1"] -------------------------------------------------------------------------------- /autocon-workshop/Dockerfile: -------------------------------------------------------------------------------- 1 | # Use an appropriate base image 2 | FROM python:3.9-slim 3 | 4 | # Set the working directory 5 | WORKDIR /app 6 | 7 | # Copy the requirements file and install dependencies 8 | COPY requirements.txt . 9 | RUN pip install --no-cache-dir -r requirements.txt 10 | 11 | # Install git 12 | RUN apt-get update && apt-get install -y git 13 | 14 | # Copy the rest of the application code 15 | COPY . . 16 | 17 | # Define the entry point and default command for the container 18 | ENTRYPOINT ["python", "main.py"] 19 | CMD ["fiber", "plane"] -------------------------------------------------------------------------------- /autocon2-workshop/network/4.1_discovery_reconciliation/autocon2.clab.yml: -------------------------------------------------------------------------------- 1 | name: autocon2 2 | 3 | mgmt: 4 | network: autocon-workshop 5 | 6 | topology: 7 | nodes: 8 | srl1: 9 | kind: nokia_srlinux 10 | image: ghcr.io/nokia/srlinux:24.7.2 11 | mgmt-ipv4: 172.24.0.100 12 | startup-config: srl1.cfg 13 | srl2: 14 | kind: nokia_srlinux 15 | image: ghcr.io/nokia/srlinux:24.7.2 16 | mgmt-ipv4: 172.24.0.101 17 | startup-config: srl2.cfg 18 | 19 | links: 20 | - endpoints: ["srl1:e1-1", "srl2:e1-1"] -------------------------------------------------------------------------------- /autocon2-workshop/network/4.2_discovery_reconciliation/autocon2.clab.yml: -------------------------------------------------------------------------------- 1 | name: autocon2 2 | 3 | mgmt: 4 | network: autocon-workshop 5 | 6 | topology: 7 | nodes: 8 | srl1: 9 | kind: nokia_srlinux 10 | image: ghcr.io/nokia/srlinux:24.7.2 11 | mgmt-ipv4: 172.24.0.100 12 | startup-config: srl1.cfg 13 | srl2: 14 | kind: nokia_srlinux 15 | image: ghcr.io/nokia/srlinux:24.7.2 16 | mgmt-ipv4: 172.24.0.101 17 | startup-config: srl2.cfg 18 | 19 | links: 20 | - endpoints: ["srl1:e1-1", "srl2:e1-1"] -------------------------------------------------------------------------------- /netbox-discovery-webinar/configs/mist-discovery.yaml: -------------------------------------------------------------------------------- 1 | orb: 2 | labels: 3 | agent: mist-worker 4 | environment: lab 5 | config_manager: 6 | active: git 7 | sources: 8 | git: 9 | url: "https://github.com/netboxlabs/netbox-learning" 10 | schedule: "* * * * *" # Check for updates every minute 11 | branch: main 12 | backends: 13 | worker: 14 | common: 15 | diode: 16 | target: grpc://webinar.netboxlabs.tech:8080/diode 17 | api_key: "${DIODE_API_KEY}" 18 | agent_name: agent04 -------------------------------------------------------------------------------- /netbox-discovery-webinar/configs/device-discovery.yaml: -------------------------------------------------------------------------------- 1 | orb: 2 | labels: 3 | agent: device 4 | environment: lab 5 | config_manager: 6 | active: git 7 | sources: 8 | git: 9 | url: "https://github.com/netboxlabs/netbox-learning" 10 | schedule: "* * * * *" # Check for updates every minute 11 | branch: main 12 | backends: 13 | device_discovery: 14 | common: 15 | diode: 16 | target: grpc://webinar.netboxlabs.tech:8080/diode 17 | api_key: "${DIODE_API_KEY}" 18 | agent_name: agent02 -------------------------------------------------------------------------------- /netbox-discovery-webinar/configs/worker-discovery.yaml: -------------------------------------------------------------------------------- 1 | orb: 2 | labels: 3 | agent: example-worker 4 | environment: demo 5 | config_manager: 6 | active: git 7 | sources: 8 | git: 9 | url: "https://github.com/netboxlabs/netbox-learning" 10 | schedule: "* * * * *" # Check for updates every minute 11 | branch: main 12 | backends: 13 | worker: 14 | common: 15 | diode: 16 | target: grpc://webinar.netboxlabs.tech:8080/diode 17 | api_key: "${DIODE_API_KEY}" 18 | agent_name: agent03 -------------------------------------------------------------------------------- /netbox-discovery-webinar/configs/network-discovery.yaml: -------------------------------------------------------------------------------- 1 | orb: 2 | labels: 3 | agent: network 4 | environment: lab 5 | config_manager: 6 | active: git 7 | sources: 8 | git: 9 | url: "https://github.com/netboxlabs/netbox-learning" 10 | schedule: "* * * * *" # Check for updates every minute 11 | branch: main 12 | backends: 13 | network_discovery: 14 | common: 15 | diode: 16 | target: grpc://webinar.netboxlabs.tech:8080/diode 17 | api_key: "${DIODE_API_KEY}" 18 | agent_name: agent01 -------------------------------------------------------------------------------- /autocon3-workshop-guide/sections/Section-7/code/step-1/agent.yaml: -------------------------------------------------------------------------------- 1 | orb: 2 | backends: 3 | worker: 4 | host: 0.0.0.0 5 | common: 6 | diode: 7 | target: grpc://:8080/diode 8 | client_id: ${DIODE_CLIENT_ID} 9 | client_secret: ${DIODE_CLIENT_SECRET} 10 | agent_name: agent01 11 | policies: 12 | worker: 13 | custom_policy: 14 | config: 15 | package: lab_integration 16 | schedule: "* * * * *" 17 | custom_config: custom 18 | scope: 19 | custom: any -------------------------------------------------------------------------------- /autocon3-workshop-guide/sections/Section-7/code/step-2/agent.yaml: -------------------------------------------------------------------------------- 1 | orb: 2 | backends: 3 | worker: 4 | host: 0.0.0.0 5 | common: 6 | diode: 7 | target: grpc://:8080/diode 8 | client_id: ${DIODE_CLIENT_ID} 9 | client_secret: ${DIODE_CLIENT_SECRET} 10 | agent_name: agent01 11 | policies: 12 | worker: 13 | custom_policy: 14 | config: 15 | package: lab_integration 16 | schedule: "* * * * *" 17 | custom_config: custom 18 | scope: 19 | custom: any -------------------------------------------------------------------------------- /autocon4-workshop/config-templates/orb-policies/selector.yaml: -------------------------------------------------------------------------------- 1 | web_monitor: 2 | selector: 3 | agent_name: orb-agent 4 | policies: 5 | web_monitor: 6 | path: web_monitor.yaml 7 | enabled: true 8 | 9 | srlinux_discovery: 10 | selector: 11 | agent_name: orb-agent 12 | policies: 13 | srl_devices: 14 | path: srl_devices.yaml 15 | enabled: false 16 | 17 | clab_network_discovery: 18 | selector: 19 | agent_name: orb-agent 20 | policies: 21 | clab_networks: 22 | path: clab_networks.yaml 23 | enabled: false 24 | -------------------------------------------------------------------------------- /autocon4-workshop/network/orb-agent/agent.yaml: -------------------------------------------------------------------------------- 1 | orb: 2 | labels: 3 | agent_name: &agent_name "orb-agent" 4 | config_manager: 5 | active: git 6 | sources: 7 | git: 8 | url: ${GIT_TARGET} 9 | schedule: "* * * * *" 10 | branch: main 11 | backends: 12 | network_discovery: 13 | device_discovery: 14 | opentelemetry_infinity: 15 | common: 16 | diode: 17 | target: ${DIODE_TARGET} 18 | client_id: ${DIODE_CLIENT_ID} 19 | client_secret: ${DIODE_CLIENT_SECRET} 20 | agent_name: *agent_name -------------------------------------------------------------------------------- /autocon4-workshop/config-templates/orb-agent/agent.yaml: -------------------------------------------------------------------------------- 1 | orb: 2 | labels: 3 | agent_name: &agent_name "orb-agent" 4 | config_manager: 5 | active: git 6 | sources: 7 | git: 8 | url: ${GIT_TARGET} 9 | schedule: "* * * * *" 10 | branch: main 11 | backends: 12 | network_discovery: 13 | device_discovery: 14 | opentelemetry_infinity: 15 | common: 16 | diode: 17 | target: ${DIODE_TARGET} 18 | client_id: ${DIODE_CLIENT_ID} 19 | client_secret: ${DIODE_CLIENT_SECRET} 20 | agent_name: *agent_name -------------------------------------------------------------------------------- /autocon4-workshop/config-templates/orb-policies/srl_devices.yaml: -------------------------------------------------------------------------------- 1 | #-- version 1 2 | device_discovery: 3 | srl_devices: 4 | config: 5 | defaults: 6 | site: Workshop 7 | if_type: "25gbase-t" 8 | scope: 9 | - driver: srl 10 | hostname: 172.24.0.101 11 | username: admin 12 | password: NokiaSrl1! 13 | optional_args: 14 | insecure: True 15 | - driver: srl 16 | hostname: 172.24.0.102 17 | username: admin 18 | password: NokiaSrl1! 19 | optional_args: 20 | insecure: True -------------------------------------------------------------------------------- /netbox-event-driven-architectures/agents/config_backuper/example.env: -------------------------------------------------------------------------------- 1 | NATS_SERVER="127.0.0.1:4222" # NATs server to connect to 2 | SUBSCRIBE_SUBJECT="network.devices.running_config" # NATs subject to subscribe to. The agent runs when a message is receieved 3 | GITHUB_TOKEN="YOUR GITHUB TOKEN" # GitHub API token 4 | GITHUB_ORG="YOUR GITHUB ORG" # GitHub Organization that running configs will be committed to 5 | GITHUB_REPO="YOUR GITHUB REPO" # GitHub Repo that running configs will be committed to -------------------------------------------------------------------------------- /autocon-workshop/docker-compose.yml: -------------------------------------------------------------------------------- 1 | version: '3.8' 2 | 3 | services: 4 | netbox-napalm: 5 | build: 6 | context: . 7 | dockerfile: Dockerfile 8 | volumes: 9 | - .:/app 10 | environment: 11 | - NETBOX_URL=https://yournetbox.com/ 12 | - NETBOX_TOKEN= 13 | - NAPALM_USERNAME=admin # Nokia SR Linux Default 14 | - NAPALM_PASSWORD=NokiaSrl1! # Nokia SR Linux Default 15 | networks: 16 | - autocon_workshop 17 | command: ["fiber", "plane"] 18 | 19 | networks: 20 | autocon_workshop: 21 | external: true -------------------------------------------------------------------------------- /CLUS-2024-CISCOU-2039/ansible.cfg: -------------------------------------------------------------------------------- 1 | [defaults] 2 | inventory = ./netbox_inv.yml 3 | host_key_checking = false 4 | retry_files_enabled = false 5 | forks = 4 6 | stdout_callback = community.general.yaml 7 | 8 | #transform (without warning) invalid characters in group names supplied by inventory sources eg. netbox dynamic inventory. it will replace any invalid characters with ‘_’ (underscore) 9 | force_valid_group_names = silently 10 | 11 | #avoid displaying warnings about the python interpreter when running playbooks against the localhost using the netbox dynamic inventory 12 | interpreter_python = auto_silent -------------------------------------------------------------------------------- /netbox-ansible-cisco-cc/ansible.cfg: -------------------------------------------------------------------------------- 1 | [defaults] 2 | inventory = ./netbox_inv.yml 3 | host_key_checking = false 4 | retry_files_enabled = false 5 | forks = 4 6 | stdout_callback = community.general.yaml 7 | 8 | #transform (without warning) invalid characters in group names supplied by inventory sources eg. netbox dynamic inventory. it will replace any invalid characters with ‘_’ (underscore) 9 | force_valid_group_names = silently 10 | 11 | #avoid displaying warnings about the python interpreter when running playbooks against the localhost using the netbox dynamic inventory 12 | interpreter_python = auto_silent -------------------------------------------------------------------------------- /netbox-event-driven-architectures/agents/ping_devices/example.env: -------------------------------------------------------------------------------- 1 | NATS_SERVER="127.0.0.1:4222" # NATs server to connect to 2 | PUBLISH_SUBJECT="network.devices.reachable" # NATs subject to publish ping results to 3 | SUBSCRIBE_SUBJECT="network.actions.ping_devices" # NATs subject to subscribe to. The agent runs when a message is receieved 4 | NETBOX_URL="https://yournetbox.instance.com/" # NetBox instance to pull device inventory from 5 | NETBOX_TOKEN="YOUR NETBOX TOKEN" # NetBox API token. Must have at least `read` permission on `dcim/device` -------------------------------------------------------------------------------- /autocon3-workshop-guide/sections/Section-1/Section-1.md: -------------------------------------------------------------------------------- 1 | # Why Operational Drift is Inevitable 2 | 3 | This section covers why operational drift occurs in network environments and how controlling it is key to succeeding in your network automation initiatives. It sets the tone for the workshop by establishing the fundamental problem that needs to be solved. 4 | 5 | This content will reuse material from the drift webinar and establish the scope of the workshop by focusing on the big problem that we're solving here. 6 | 7 | ## Instructions 8 | 9 | Sit back and relax. We will introduce the core concepts during this section. -------------------------------------------------------------------------------- /autocon3-workshop-guide/sections/Section-5/agent-git.yaml: -------------------------------------------------------------------------------- 1 | orb: 2 | labels: 3 | ping_scan: true 4 | discovery_type: port scan 5 | config_manager: 6 | active: git 7 | sources: 8 | git: 9 | url: "https://github.com/netboxlabs/autocon3_workshop_config.git" 10 | schedule: "* * * * *" 11 | branch: develop 12 | backends: 13 | network_discovery: 14 | common: 15 | diode: 16 | target: grpc:///diode 17 | client_id: ${DIODE_CLIENT_ID} 18 | client_secret: ${DIODE_CLIENT_SECRET} 19 | agent_name: agent-git 20 | -------------------------------------------------------------------------------- /netbox-ansible-webinar/ansible.cfg: -------------------------------------------------------------------------------- 1 | [defaults] 2 | inventory = ./netbox_inv.yml 3 | host_key_checking = false 4 | retry_files_enabled = false 5 | forks = 4 6 | stdout_callback = community.general.yaml 7 | 8 | #transform (without warning) invalid characters in group names supplied by inventory sources eg. netbox dynamic inventory. it will replace any invalid characters with ‘_’ (underscore) 9 | force_valid_group_names = silently 10 | 11 | #avoid displaying warnings about the python interpreter when running playbooks against the localhost using the netbox dynamic inventory 12 | interpreter_python = auto_silent 13 | -------------------------------------------------------------------------------- /netbox-event-driven-architectures/agents/get_running_config/example.env: -------------------------------------------------------------------------------- 1 | NATS_SERVER="127.0.0.1:4222" # NATs server to connect to 2 | PUBLISH_SUBJECT="network.devices.running_config" # NATs subject to publish running configs to 3 | SUBSCRIBE_SUBJECT="network.actions.get_running_config" # NATs subject to subscribe to. The agent runs when a message is receieved 4 | NETBOX_URL="https://yournetbox.instance.com/" # NetBox instance to pull device inventory from 5 | NETBOX_TOKEN="YOUR NETBOX TOKEN" # NetBox API token. Must have at least `read` permission on `dcim/device` -------------------------------------------------------------------------------- /nornir-netbox-webinar/get_facts.py: -------------------------------------------------------------------------------- 1 | #!./venv/bin/python 2 | 3 | # Import required libraries 4 | 5 | from nornir import InitNornir 6 | from nornir_napalm.plugins.tasks import napalm_get 7 | from nornir_utils.plugins.functions import print_result 8 | 9 | # Initialize Nornir with config file 10 | 11 | nr = InitNornir(config_file="config.yaml") 12 | 13 | # Define a function to get the device facts using napalm_get 14 | 15 | def napalm_get_facts(task): 16 | task.run(task=napalm_get, getters=["facts"]) 17 | 18 | # Display the results 19 | 20 | results=nr.run(task=napalm_get_facts) 21 | 22 | print_result(results) 23 | -------------------------------------------------------------------------------- /netbox-ansible-collection-quick-start/ansible.cfg: -------------------------------------------------------------------------------- 1 | [defaults] 2 | inventory = ./netbox_inv.yml 3 | host_key_checking = false 4 | retry_files_enabled = false 5 | forks = 4 6 | stdout_callback = community.general.yaml 7 | 8 | #transform (without warning) invalid characters in group names supplied by inventory sources eg. netbox dynamic inventory. it will replace any invalid characters with ‘_’ (underscore) 9 | force_valid_group_names = silently 10 | 11 | #avoid displaying warnings about the python interpreter when running playbooks against the localhost using the netbox dynamic inventory 12 | interpreter_python = auto_silent -------------------------------------------------------------------------------- /netbox-ansible-webinar/reports/report_template.j2: -------------------------------------------------------------------------------- 1 | # Device Information Report 2 | 3 | | Hostname | IPv4 | Model | OS | Software Version | Serial Number | 4 | |----------------|--------------|-------|-------|--------------------------------------|-------------------------------------| 5 | {% for host in ansible_play_hosts %} 6 | {% set host_facts = hostvars[host] %} 7 | | {{ host }} | {{ host_facts['primary_ip4'] }} | {{ host_facts.ansible_net_model }} | {{ host_facts.ansible_net_system }} | {{ host_facts.ansible_net_version }} | {{ host_facts.ansible_net_serialnum }} | 8 | {% endfor %} 9 | -------------------------------------------------------------------------------- /nornir-netbox-webinar/containerlab/testlab.clab.yaml: -------------------------------------------------------------------------------- 1 | name: testlab 2 | 3 | mgmt: 4 | network: lab-net 5 | ipv4-subnet: 172.21.21.0/24 6 | 7 | topology: 8 | 9 | nodes: 10 | ceos-sw-1: 11 | kind: ceos 12 | image: ceos:4.29.0.2F 13 | mgmt-ipv4: 172.21.21.2 14 | ceos-sw-2: 15 | kind: ceos 16 | image: ceos:4.29.0.2F 17 | mgmt-ipv4: 172.21.21.3 18 | ceos-sw-3: 19 | kind: ceos 20 | image: ceos:4.29.0.2F 21 | mgmt-ipv4: 172.21.21.4 22 | 23 | links: 24 | - endpoints: ["ceos-sw-1:eth1", "ceos-sw-2:eth1"] 25 | - endpoints: ["ceos-sw-1:eth2", "ceos-sw-3:eth1"] 26 | -------------------------------------------------------------------------------- /netbox-diode-webinar/examples/go/go.mod: -------------------------------------------------------------------------------- 1 | module netboxlabs.com/diode_webinar 2 | 3 | go 1.23.4 4 | 5 | toolchain go1.23.10 6 | 7 | require ( 8 | github.com/envoyproxy/protoc-gen-validate v1.0.4 // indirect 9 | github.com/google/uuid v1.6.0 // indirect 10 | github.com/netboxlabs/diode-sdk-go v1.1.0 // indirect 11 | golang.org/x/net v0.38.0 // indirect 12 | golang.org/x/sys v0.31.0 // indirect 13 | golang.org/x/text v0.23.0 // indirect 14 | google.golang.org/genproto/googleapis/rpc v0.0.0-20240227224415-6ceb2ff114de // indirect 15 | google.golang.org/grpc v1.63.2 // indirect 16 | google.golang.org/protobuf v1.33.0 // indirect 17 | ) 18 | -------------------------------------------------------------------------------- /autocon3-workshop-guide/sections/Section-6/selector.yaml: -------------------------------------------------------------------------------- 1 | ping_scan_selector: 2 | selector: 3 | ping_scan: true 4 | policies: 5 | default: 6 | path: ping_scan.yaml 7 | 8 | port_scan_selector: 9 | selector: 10 | discovery_type: port scan 11 | policies: 12 | default: 13 | path: port_scan.yaml 14 | 15 | port_scan_fast_selector: 16 | selector: 17 | discovery_type: fast port scan 18 | policies: 19 | default: 20 | path: port_scan_fast.yaml 21 | 22 | ccc_integration_selector: 23 | selector: 24 | ccc_integration: true 25 | policies: 26 | default: 27 | path: ccc_integration.yaml -------------------------------------------------------------------------------- /autocon3-workshop-guide/sections/Section-7/code/step-3/agent.yaml: -------------------------------------------------------------------------------- 1 | orb: 2 | backends: 3 | worker: 4 | host: 0.0.0.0 5 | common: 6 | diode: 7 | target: grpc://:8080/diode 8 | client_id: ${DIODE_CLIENT_ID} 9 | client_secret: ${DIODE_CLIENT_SECRET} 10 | agent_name: agent01 11 | policies: 12 | worker: 13 | custom_policy: 14 | config: 15 | package: lab_integration 16 | schedule: "* * * * *" 17 | custom_config: custom 18 | csv_filename: ${CSV_FILENAME} 19 | method: ${METHOD} 20 | scope: 21 | custom: any -------------------------------------------------------------------------------- /netbox-diode-webinar/examples/python/sample-orb-worker/agent.yaml: -------------------------------------------------------------------------------- 1 | orb: 2 | backends: 3 | worker: 4 | host: 0.0.0.0 5 | common: 6 | diode: 7 | target: grpc://:8080/diode 8 | client_id: ${DIODE_CLIENT_ID} 9 | client_secret: ${DIODE_CLIENT_SECRET} 10 | agent_name: agent01 11 | policies: 12 | worker: 13 | custom_policy: 14 | config: 15 | package: lab_integration 16 | schedule: "* * * * *" 17 | custom_config: custom 18 | csv_filename: ${CSV_FILENAME} 19 | method: ${METHOD} 20 | scope: 21 | custom: any -------------------------------------------------------------------------------- /.learning-meta/README.md: -------------------------------------------------------------------------------- 1 | # Learning repo dev 2 | 3 | The README.md in the root of this repo is generated from a Jinja2 template, this is to allow for inclusion of dynamic elements. Such as blog posts and OSS releases. 4 | 5 | To setup up your dev environment; 6 | 7 | ``` 8 | python3 -m venv .venv 9 | source .venv/bin/activate 10 | pip3 install -r .learning-meta/requirements.txt 11 | ``` 12 | 13 | Generate the README manually locally: 14 | 15 | ```python 16 | .learning-meta/regenerate.py 17 | ``` 18 | 19 | The README is auto-committed by Github when... 20 | 21 | - A push is made to `.learning-meta/**` on the `develop` branch 22 | - Once a day at 3am. -------------------------------------------------------------------------------- /diode/examples/containerlab/containerlab.yaml: -------------------------------------------------------------------------------- 1 | name: diode 2 | 3 | mgmt: 4 | network: diode-net 5 | ipv4-subnet: 10.90.0.32/27 6 | 7 | topology: 8 | nodes: 9 | CSR1: 10 | kind: vr-csr 11 | image: mrmrcoleman/vr-csr:17.03.06 12 | mgmt-ipv4: 10.90.0.50 13 | SRL1: 14 | kind: nokia_srlinux 15 | image: ghcr.io/nokia/srlinux 16 | mgmt-ipv4: 10.90.0.51 17 | CEOS1: 18 | kind: ceos 19 | image: ceos:4.29.0.2F 20 | mgmt-ipv4: 10.90.0.52 21 | 22 | links: 23 | - endpoints: ["SRL1:e1-1", "CSR1:eth2"] 24 | - endpoints: ["SRL1:e1-2", "CEOS1:eth2"] 25 | - endpoints: ["CSR1:eth1", "CEOS1:eth1"] -------------------------------------------------------------------------------- /netbox-ansible-collection-quick-start/populate_netbox_ipam.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: PLAY 1 - Create RIRs 3 | connection: local 4 | hosts: localhost 5 | gather_facts: False 6 | 7 | roles: 8 | - role: create_rirs 9 | tags: rirs 10 | 11 | - name: PLAY 2 - Create Aggregates 12 | connection: local 13 | hosts: localhost 14 | gather_facts: False 15 | 16 | roles: 17 | - role: create_aggregates 18 | tags: aggregates 19 | 20 | - name: PLAY 3 - Create Prefix and VLAN Roles 21 | connection: local 22 | hosts: localhost 23 | gather_facts: False 24 | 25 | roles: 26 | - role: create_prefix_and_vlan_roles 27 | tags: prefix_and_roles -------------------------------------------------------------------------------- /autocon-workshop/lab/workshop_lab.yml: -------------------------------------------------------------------------------- 1 | name: autocon_workshop 2 | 3 | mgmt: 4 | network: autocon_workshop # management network name 5 | ipv4-subnet: 192.168.20.0/24 # ipv4 range 6 | #ipv6-subnet: 2001:172:100:100::/80 # ipv6 range (optional) 7 | 8 | topology: 9 | nodes: 10 | fiber: 11 | kind: srl 12 | image: ghcr.io/nokia/srlinux 13 | mgmt-ipv4: 192.168.20.18 14 | startup-config: configs/fiber.txt 15 | plane: 16 | kind: srl 17 | image: ghcr.io/nokia/srlinux 18 | mgmt-ipv4: 192.168.20.17 19 | startup-config: configs/plane.txt 20 | 21 | links: 22 | - endpoints: ["fiber:e1-1", "plane:e1-1"] -------------------------------------------------------------------------------- /nornir-netbox-webinar/get_lldp_neighbors.py: -------------------------------------------------------------------------------- 1 | #!./venv/bin/python 2 | 3 | # Import required libraries 4 | 5 | from nornir import InitNornir 6 | from nornir_napalm.plugins.tasks import napalm_get 7 | from nornir_utils.plugins.functions import print_result 8 | 9 | # Initialize Nornir with config file 10 | 11 | nr = InitNornir(config_file="config.yaml") 12 | 13 | 14 | # Define a function to get the LLDP neighbor information using napalm_get 15 | 16 | def napalm_get_lldp_neighbors(task): 17 | task.run(task=napalm_get, getters=["lldp_neighbors"]) 18 | 19 | 20 | # Display the results 21 | 22 | results=nr.run(task=napalm_get_lldp_neighbors) 23 | 24 | print_result(results) 25 | -------------------------------------------------------------------------------- /autocon4-workshop/config-templates/orb-policies/web_monitor.yaml: -------------------------------------------------------------------------------- 1 | #-- version 1 2 | opentelemetry_infinity: 3 | web_monitor: 4 | receivers: 5 | httpcheck: 6 | collection_interval: 10s 7 | targets: 8 | - endpoint: http://192.168.2.2 9 | processors: 10 | batch: 11 | send_batch_max_size: 1000 12 | send_batch_size: 100 13 | timeout: 10s 14 | exporters: 15 | prometheusremotewrite: 16 | endpoint: ${env:PROMETHEUS_TARGET} 17 | service: 18 | pipelines: 19 | metrics: 20 | receivers: [httpcheck] 21 | processors: [batch] 22 | exporters: [prometheusremotewrite] 23 | -------------------------------------------------------------------------------- /netbox-ansible-webinar/containerlab/webinar.clab.yaml: -------------------------------------------------------------------------------- 1 | name: webinar 2 | 3 | mgmt: 4 | network: webinar-net 5 | ipv4-subnet: 172.21.21.0/24 6 | 7 | topology: 8 | 9 | nodes: 10 | ceos-sw-1: 11 | kind: ceos 12 | image: ceos:4.29.0.2F 13 | mgmt-ipv4: 172.21.21.2 14 | ceos-sw-2: 15 | kind: ceos 16 | image: ceos:4.29.0.2F 17 | mgmt-ipv4: 172.21.21.3 18 | ceos-sw-3: 19 | kind: ceos 20 | image: ceos:4.29.0.2F 21 | mgmt-ipv4: 172.21.21.4 22 | 23 | links: 24 | - endpoints: ["ceos-sw-1:eth1", "ceos-sw-2:eth1"] 25 | - endpoints: ["ceos-sw-1:eth2", "ceos-sw-3:eth1"] 26 | - endpoints: ["ceos-sw-2:eth2", "ceos-sw-3:eth2"] -------------------------------------------------------------------------------- /netbox-ansible-collection-quick-start/lookup_devices.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Lookup NetBox Device Data Based on Role 3 | hosts: localhost 4 | gather_facts: no 5 | 6 | vars: 7 | netbox_url: "{{ lookup('ansible.builtin.env', 'NETBOX_API') }}" 8 | netbox_token: "{{ lookup('ansible.builtin.env', 'NETBOX_TOKEN') }}" 9 | 10 | tasks: 11 | 12 | - name: "Query NetBox for all sites" 13 | debug: 14 | msg: > 15 | "Device {{ item.value.name }} (ID: {{ item.key }}) was 16 | manufactured by {{ item.value.device_type.manufacturer.name }}" 17 | loop: "{{ query('netbox.netbox.nb_lookup', 'devices', api_filter='role=firewall', api_endpoint=netbox_url, token=netbox_token)}}" 18 | -------------------------------------------------------------------------------- /netbox-event-driven-architectures/agents/device_alerter/example.env: -------------------------------------------------------------------------------- 1 | NATS_SERVER="127.0.0.1:4222" # NATs server to connect to 2 | SUBSCRIBE_SUBJECT="network.devices" # NATs subject to subscribe to. The agent runs when a message is receieved 3 | SLACK_TOKEN="YOUR SLACK BOT" # Slack App Token 4 | SLACK_USERNAME="YOUR SLACK BOT USERNAME" # Slack username to publish as 5 | SLACK_CHANNEL="YOUR SLACK CHANNEL" # Slack channel to publish to 6 | NETBOX_URL="https://yournetbox.instance.com/" # NetBox instance to pull device inventory from 7 | NETBOX_TOKEN="YOUR NETBOX TOKEN" # NetBox API token. Must have at least `read` permission on `dcim/device` -------------------------------------------------------------------------------- /netbox-ansible-webinar/roles/ACTUAL_STATE/tasks/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: 1 - Run 'show running-config' on remote devices 3 | eos_command: 4 | commands: "show running-config" 5 | register: running_config 6 | 7 | - name: 2 - Ensure backup folder is created 8 | file: 9 | path: "{{ backup_root }}" 10 | state: directory 11 | run_once: yes 12 | 13 | - name: 3 - Ensure device folder is created 14 | file: 15 | path: "{{ backup_root }}/{{ inventory_hostname }}" 16 | state: directory 17 | 18 | - name: 4 - Write the device configuration to file 19 | copy: 20 | content: "{{ running_config.stdout[0] }}" 21 | dest: "{{ backup_root }}/{{ inventory_hostname }}/{{ inventory_hostname }}_running.conf" -------------------------------------------------------------------------------- /netbox-event-driven-architectures/agents/discover_network/example.env: -------------------------------------------------------------------------------- 1 | cat agents/discover_network/example.env 2 | NATS_SERVER="127.0.0.1:4222" # NATs server to connect to 3 | PUBLISH_SUBJECT="network.devices" # NATs subject to publish discovered devices to 4 | SUBSCRIBE_SUBJECT="network.actions.discover_network" # NATs subject to subscribe to. The agent runs when a message is receieved. 5 | SUBNET_CIDR="172.20.20.0/24" # Which subnet to scan for devices. 172.20.20.0/24 is the ContainerLab default 6 | IGNORE_IPS="172.20.20.1" # Specify multiple comma separated IPs to ignore. 172.20.20.1 is the default ContainerLab gateway, so we ignore it -------------------------------------------------------------------------------- /autocon3-workshop-guide/.gitignore: -------------------------------------------------------------------------------- 1 | # macOS system files 2 | .DS_Store 3 | .AppleDouble 4 | .LSOverride 5 | Icon 6 | 7 | # Thumbnails 8 | ._* 9 | 10 | # Vagrant cache files 11 | .vagrant/ 12 | 13 | # ContainerLab cache files 14 | .containerlab/ 15 | clab-*/ 16 | 17 | # Orb cache files 18 | device_discovery/ 19 | network_discovery/ 20 | 21 | # Backup files 22 | *.bak 23 | 24 | # Files that might appear in the root of a volume 25 | .DocumentRevisions-V100 26 | .fseventsd 27 | .Spotlight-V100 28 | .TemporaryItems 29 | .Trashes 30 | .VolumeIcon.icns 31 | .com.apple.timemachine.donotpresent 32 | 33 | # Directories potentially created on remote AFP share 34 | .AppleDB 35 | .AppleDesktop 36 | Network Trash Folder 37 | Temporary Items 38 | .apdisk -------------------------------------------------------------------------------- /autocon3-workshop-guide/sections/Section-7/code/step-1/lab-integration/lab_integration/runner.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | import logging 3 | 4 | from collections.abc import Iterable 5 | from netboxlabs.diode.sdk.ingester import Entity 6 | from worker.backend import Backend 7 | from worker.models import Metadata, Policy 8 | 9 | 10 | class LabIntegration(Backend): 11 | 12 | def setup(self) -> Metadata: 13 | return Metadata(name="lab_integration", app_name="lab_integration_app", app_version="1.0.0") 14 | 15 | def run(self, policy_name: str, policy: Policy) -> Iterable[Entity]: 16 | logging.info(f"Running policy: {policy_name}") 17 | entities = [] 18 | 19 | logging.info(f"{len(entities)} entities to be ingested") 20 | return entities -------------------------------------------------------------------------------- /netbox-discovery-webinar/example-commands.md: -------------------------------------------------------------------------------- 1 | # Commands to Start Orb Agents for NetBox Discovery 2 | 3 | ## Network Discovery Agent 4 | ``` 5 | docker run -u root --rm \ 6 | -v ${PWD}:/opt/orb/ \ 7 | -e DIODE_API_KEY \ 8 | netboxlabs/orb-agent:develop run -c /opt/orb/network-discovery.yaml 9 | ``` 10 | 11 | ## Device Discovery Agent 12 | ``` 13 | docker run -u root --rm \ 14 | -v ${PWD}:/opt/orb/ \ 15 | -e DIODE_API_KEY \ 16 | -e SSH_USERNAME \ 17 | -e SSH_PASSWORD \ 18 | netboxlabs/orb-agent:develop run -c /opt/orb/device-discovery.yaml 19 | ``` 20 | 21 | ## Custom Worker Discovery Agent 22 | ``` 23 | docker run -u root --rm -v ${PWD}:/opt/orb/ -e DIODE_API_KEY -e INSTALL_DRIVERS_PATH=/opt/orb/workers.txt netboxlabs/orb-agent:develop run -c /opt/orb/worker-discovery.yaml 24 | ``` -------------------------------------------------------------------------------- /CLUS-2024-CISCOU-2039/set_meraki_mgnt_ip.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - hosts: SEC-APP-1 3 | gather_facts: false 4 | tasks: 5 | 6 | - name: Set management IP address 7 | cisco.meraki.devices_management_interface: 8 | state: present 9 | serial: "{{ serial }}" 10 | wan1: 11 | staticGatewayIp: 192.168.20.1 12 | staticIp: "{{ primary_ip4 }}" 13 | staticSubnetMask: 255.255.255.0 14 | staticDns: 15 | - 8.8.8.8 16 | usingStaticIp: true 17 | 18 | - name: Get Device Management Information 19 | cisco.meraki.devices_management_interface_info: 20 | serial: "{{ serial }}" 21 | register: result 22 | 23 | - name: Show Device Management Information 24 | ansible.builtin.debug: 25 | var: result 26 | -------------------------------------------------------------------------------- /selector.yaml: -------------------------------------------------------------------------------- 1 | agent01: 2 | selector: 3 | agent: network 4 | environment: lab 5 | policies: 6 | network_discovery: 7 | path: policies/network-discovery-policy.yaml 8 | enabled: true 9 | 10 | agent02: 11 | selector: 12 | agent: device 13 | environment: lab 14 | policies: 15 | device_discovery: 16 | path: policies/device-discovery-policy.yaml 17 | enabled: true 18 | 19 | agent03: 20 | selector: 21 | agent: example-worker 22 | environment: demo 23 | policies: 24 | example_worker: 25 | path: policies/worker-discovery-policy.yaml 26 | enabled: true 27 | 28 | agent04: 29 | selector: 30 | agent: mist-worker 31 | environment: lab 32 | policies: 33 | mist_worker: 34 | path: policies/mist-discovery-policy.yaml 35 | enabled: true -------------------------------------------------------------------------------- /autocon2-workshop/slurpit/sync_to_netbox.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Enable flags to exit on errors, unset variables, and pipeline failures 4 | set -euo pipefail 5 | 6 | # Check if required environment variables are set 7 | if [[ -z "${MY_EXTERNAL_IP:-}" || -z "${SLURPIT_PORT:-}" ]]; then 8 | echo "Error: Environment variables MY_EXTERNAL_IP and SLURPIT_PORT must be set." 9 | exit 1 10 | fi 11 | 12 | # Construct the URLs using the environment variables 13 | URL_SYNC="http://${MY_EXTERNAL_IP}:${SLURPIT_PORT}/run/plugin/sync" 14 | URL_SYNC_QUEUE="http://${MY_EXTERNAL_IP}:${SLURPIT_PORT}/run/plugin/sync_queue" 15 | 16 | # Curl the URLs, with -f to fail on HTTP errors 17 | echo "Navigating to $URL_SYNC..." 18 | curl -fsS "$URL_SYNC" 19 | 20 | sleep 5 21 | 22 | echo "Navigating to $URL_SYNC_QUEUE..." 23 | curl -fsS "$URL_SYNC_QUEUE" 24 | 25 | echo "Both URLs accessed successfully." -------------------------------------------------------------------------------- /autocon3-workshop-guide/sections/Section-6/agent-vault.yaml: -------------------------------------------------------------------------------- 1 | orb: 2 | labels: 3 | ccc_integration: true 4 | config_manager: 5 | active: git 6 | sources: 7 | git: 8 | url: "https://github.com/netboxlabs/autocon3_workshop_config.git" 9 | schedule: "* * * * *" 10 | branch: develop 11 | secrets_manager: 12 | active: vault 13 | sources: 14 | vault: 15 | address: "https://vault.netboxlabs.tech:8200" 16 | namespace: "workshop" 17 | timeout: 60 18 | auth: "token" 19 | auth_args: 20 | token: ${VAULT_TOKEN} 21 | schedule: "*/5 * * * *" 22 | backends: 23 | worker: 24 | common: 25 | diode: 26 | target: grpc://:8080/diode 27 | client_id: ${DIODE_CLIENT_ID} 28 | client_secret: ${DIODE_CLIENT_SECRET} 29 | agent_name: agent-vault -------------------------------------------------------------------------------- /autocon2-workshop/ansible/playbooks/set-hostname.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Set hostname on Nokia SR Linux devices 3 | hosts: sites_denver 4 | gather_facts: true 5 | tasks: 6 | - name: Set the hostname 7 | nokia.srlinux.config: 8 | update: 9 | - path: /system/name 10 | value: 11 | host-name: "{{ inventory_hostname }}" 12 | register: set_response 13 | 14 | - name: Verify the hostname change 15 | nokia.srlinux.get: 16 | paths: 17 | - path: /system/name/host-name 18 | datastore: state 19 | yang_models: srl 20 | register: verify_response 21 | 22 | - name: debug output 23 | debug: 24 | msg: "{{ verify_response }}" 25 | 26 | - name: Display the new hostname 27 | debug: 28 | msg: "Hostname of {{ inventory_hostname }} is now {{ verify_response.result }}" 29 | 30 | -------------------------------------------------------------------------------- /autocon4-workshop/ansible/README.md: -------------------------------------------------------------------------------- 1 | ## Prerequisites 2 | 1. Ensure containerlab is started and netbox is accessible 3 | 2. Devices in NetBox must be named "srl1" and "srl2" 4 | 5 | ## Run Ansible Playbook 6 | 7 | ### Using the Script (Recommended) 8 | 9 | Run the playbook using the provided script: 10 | 11 | ```bash 12 | ./run-ansible-playbook.sh --branch 13 | ``` 14 | 15 | Or without a branch (will prompt for confirmation to run against main branch): 16 | 17 | ```bash 18 | ./run-ansible-playbook.sh 19 | ``` 20 | 21 | ### Manual Command 22 | 23 | Alternatively, run the following command directly, with your API token and branch id created in the previous steps: 24 | 25 | ```bash 26 | ansible-playbook -i ansible/inventory.yaml ansible/deploy-configs.yaml -e "MY_EXTERNAL_IP=${MY_EXTERNAL_IP}" -e "NETBOX_PORT=${NETBOX_PORT}" -e "NETBOX_API_TOKEN=${NETBOX_API_TOKEN}" -e "NETBOX_BRANCH_ID=c9fpfpmj" 27 | ``` 28 | -------------------------------------------------------------------------------- /autocon3-workshop-guide/README.md: -------------------------------------------------------------------------------- 1 | # AutoCon3 Workshop Guide 2 | 3 | A guide for the AutoCon3 workshop focusing on NetBox Discovery and network automation concepts. 4 | 5 | ## Sections 6 | 7 | The workshop is divided into seven sections: 8 | 9 | 1. [Why Operational Drift is Inevitable](sections/Section-1/Section-1.md) 10 | 2. [Introduction to NetBox Labs & NetBox](sections/Section-2/Section-2.md) 11 | 3. [Getting Hands On with NetBox Discovery and Assurance](sections/Section-3/Section-3.md) 12 | 4. [NetBox Discovery Controller Integrations](sections/Section-4/Section-4.md) 13 | 5. [Introducing Git Driven Configuration Management for NetBox Discovery](sections/Section-5/Section-5.md) 14 | 6. [Introducing Secrets Management for NetBox Discovery](sections/Section-6/Section-6.md) 15 | 7. [Building Your Own Controller Integration](sections/Section-7/Section-7.md) 16 | 17 | Each section contains instructional materials and hands-on exercises. -------------------------------------------------------------------------------- /netbox-diode-webinar/examples/python/skeleton.py: -------------------------------------------------------------------------------- 1 | ''' 2 | ensure DIODE_CLIENT_ID and DIODE_CLIENT_SECRET are set before running this 3 | ''' 4 | 5 | from netboxlabs.diode.sdk import DiodeClient 6 | from netboxlabs.diode.sdk.ingester import ( 7 | Entity, 8 | ) 9 | 10 | 11 | def generate_entities() -> list[Entity]: 12 | ''' generate a list of entitles for return to Diode ''' 13 | entities = [] 14 | return entities 15 | 16 | 17 | if __name__ == "__main__": 18 | ''' main function ''' 19 | 20 | entities = generate_entities() 21 | 22 | with DiodeClient( 23 | target="grpc:///diode", 24 | app_name="my-app", 25 | app_version="1", 26 | 27 | ) as client: 28 | try: 29 | response = client.ingest(entities=entities) 30 | print(response) 31 | except Exception as exc: 32 | print(f"\n!! An Exception Happened: {exc}") 33 | -------------------------------------------------------------------------------- /netbox-ansible-webinar/config_templates/cEOSLab.j2: -------------------------------------------------------------------------------- 1 | ! 2 | no aaa root 3 | ! 4 | username admin privilege 15 role network-admin secret sha512 $6$Nfus.CLqubtUkR/5$RMXV7ErzvU2M1UeycFsgIZx5rAQoypSWsfvUXH6u4xM6bT0AkNhpb.MqBhl1AbBj3PI4CUe8w2hC1nM.ZwiRU0 5 | ! 6 | transceiver qsfp default-mode 4x10G 7 | ! 8 | service routing protocols model multi-agent 9 | ! 10 | hostname {{ device.name }} 11 | ! 12 | spanning-tree mode mstp 13 | ! 14 | {%- for vl in device.site.vlans.all() %} 15 | vlan {{vl.vid }} 16 | name {{ vl.name }} 17 | ! 18 | {%- endfor %} 19 | management api http-commands 20 | no shutdown 21 | ! 22 | management api gnmi 23 | transport grpc default 24 | ! 25 | management api netconf 26 | transport ssh default 27 | ! 28 | interface Ethernet1 29 | ! 30 | interface Ethernet2 31 | ! 32 | interface Management0 33 | ip address {{ device.primary_ip.address }} 34 | ! 35 | no ip routing 36 | ! 37 | ip route 0.0.0.0/0 172.21.21.1 38 | ! 39 | end -------------------------------------------------------------------------------- /netbox-discovery-webinar/policies/device-discovery-policy.yaml: -------------------------------------------------------------------------------- 1 | device_discovery: 2 | lab_network: 3 | config: 4 | schedule: "* * * * *" 5 | defaults: 6 | device: 7 | description: "Discovered by NetBox Discovery agent" 8 | tags: 9 | - device-discovery 10 | site: Lab 11 | role: Lab Device 12 | 13 | scope: 14 | - hostname: 172.24.0.101 15 | username: "${SSH_USERNAME}" 16 | password: "${SSH_PASSWORD}" 17 | optional_args: 18 | transport: ssh 19 | - driver: eos 20 | hostname: 172.24.0.102 21 | username: "${SSH_USERNAME}" 22 | password: "${SSH_PASSWORD}" 23 | optional_args: 24 | transport: ssh 25 | - driver: eos 26 | hostname: 172.24.0.103 27 | username: "${SSH_USERNAME}" 28 | password: "${SSH_PASSWORD}" 29 | optional_args: 30 | transport: ssh -------------------------------------------------------------------------------- /autocon2-workshop/6_start_netpicker.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -euo pipefail 3 | 4 | # Check if all required environment variables are set 5 | REQUIRED_VARS=("MY_EXTERNAL_IP" "NETPICKER_PORT" "NETPICKER_API_PORT") 6 | 7 | for var in "${REQUIRED_VARS[@]}"; do 8 | if [ -z "${!var:-}" ]; then 9 | echo "Error: Required environment variable '$var' is not set." 10 | exit 0 11 | fi 12 | done 13 | 14 | echo 15 | echo "--- Starting Netpicker ---" 16 | echo 17 | 18 | pushd netpicker 19 | docker compose up -d 20 | popd 21 | 22 | echo 23 | echo "--- Configuring Policies, Rules and Vault ---" 24 | echo 25 | 26 | pushd workshop_setup 27 | python3 -m venv venv 28 | source venv/bin/activate 29 | pip install -r requirements.txt 30 | 31 | python netpicker/setup.py 32 | deactivate 33 | rm -fr venv/ 34 | popd 35 | 36 | echo "you can get to netpicker on http://${MY_EXTERNAL_IP}:${NETPICKER_PORT}" 37 | echo "username: admin@admin.com" 38 | echo "password: 12345678" 39 | -------------------------------------------------------------------------------- /netbox-discovery-webinar/worker-example/.gitignore: -------------------------------------------------------------------------------- 1 | # Byte-compiled / optimized / DLL files 2 | __pycache__/ 3 | *.py[cod] 4 | *$py.class 5 | 6 | # C extensions 7 | *.so 8 | 9 | # Distribution / packaging 10 | .Python 11 | build/ 12 | develop-eggs/ 13 | dist/ 14 | downloads/ 15 | eggs/ 16 | .eggs/ 17 | lib/ 18 | lib64/ 19 | parts/ 20 | sdist/ 21 | var/ 22 | wheels/ 23 | *.egg-info/ 24 | .installed.cfg 25 | *.egg 26 | 27 | # PyInstaller 28 | *.manifest 29 | *.spec 30 | 31 | # Installer logs 32 | pip-log.txt 33 | pip-delete-this-directory.txt 34 | 35 | # Unit test / coverage reports 36 | htmlcov/ 37 | .tox/ 38 | .coverage 39 | .coverage.* 40 | .cache 41 | nosetests.xml 42 | coverage.xml 43 | *.cover 44 | .hypothesis/ 45 | .pytest_cache/ 46 | 47 | # Environments 48 | .env 49 | .venv 50 | env/ 51 | venv/ 52 | ENV/ 53 | env.bak/ 54 | venv.bak/ 55 | 56 | # IDE specific files 57 | .idea/ 58 | .vscode/ 59 | *.swp 60 | *.swo 61 | 62 | # macOS specific 63 | .DS_Store -------------------------------------------------------------------------------- /netbox-ansible-webinar/backup_configs.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Backup Device Configurations 3 | hosts: sites_container_lab 4 | gather_facts: false 5 | connection: network_cli 6 | 7 | vars: 8 | backup_root: ./backups 9 | 10 | tasks: 11 | - name: 1 - Run 'show running-config' on remote devices 12 | eos_command: 13 | commands: "show running-config" 14 | register: running_config 15 | 16 | - name: 2 - Ensure backup folder is created 17 | file: 18 | path: "{{ backup_root }}" 19 | state: directory 20 | run_once: yes 21 | 22 | - name: 3 - Ensure device folder is created 23 | file: 24 | path: "{{ backup_root }}/{{ inventory_hostname }}" 25 | state: directory 26 | 27 | - name: 4 - Write the configuration to the backup file 28 | copy: 29 | content: "{{ running_config.stdout[0] }}" 30 | dest: "{{ backup_root }}/{{ inventory_hostname }}/{{ inventory_hostname }}_running.conf" -------------------------------------------------------------------------------- /autocon4-workshop/config-templates/prometheus/docker-compose.yaml: -------------------------------------------------------------------------------- 1 | services: 2 | prometheus: 3 | image: prom/prometheus:latest 4 | container_name: prometheus 5 | command: 6 | - '--config.file=/etc/prometheus/prometheus.yaml' 7 | - '--storage.tsdb.path=/prometheus' 8 | - '--web.console.libraries=/usr/share/prometheus/console_libraries' 9 | - '--web.console.templates=/usr/share/prometheus/consoles' 10 | - '--web.enable-remote-write-receiver' 11 | - '--query.lookback-delta=30s' 12 | volumes: 13 | - ./prometheus.yaml:/etc/prometheus/prometheus.yaml:ro 14 | - ./alerts:/etc/prometheus/alerts 15 | - prometheus-data:/prometheus 16 | ports: 17 | - "9090:9090" 18 | restart: unless-stopped 19 | healthcheck: 20 | test: ["CMD-SHELL", "promtool check healthy || exit 1"] 21 | interval: 30s 22 | timeout: 10s 23 | retries: 3 24 | start_period: 40s 25 | volumes: 26 | prometheus-data: 27 | -------------------------------------------------------------------------------- /autocon-workshop/README.md: -------------------------------------------------------------------------------- 1 | # NetBox Config Pusher for AutoCon Workshop 2 | 3 | ## Requirements 4 | 5 | - docker 6 | - docker-compose 7 | 8 | ## Configuration 9 | 10 | - NetBox Cloud credentials go in `docker-compose.yml` 11 | - The rest can stay the same if using the preconfigured workshop clab lab 12 | - `networks` must contain the same `docker network` that is used for the clab lab. This is hard coded to work in the workshop, but if you're curious you can inspect using 'docker network ls` 13 | 14 | ## Usage 15 | 16 | Normal usage: `docker-compose up` 17 | If you've made changes to the code: `docker-compose up --build` 18 | 19 | ## Behaviour 20 | 21 | - Pulls device information (Name, IP, Platform) from NetBox for the device names specified on the command line ("fiber" and "plane") by default 22 | - Generates the configurations for the devices using NetBox's `/render-config/` endpoint 23 | - Connects to the devices 24 | - Pushes the generated configs 25 | - Pulls the config and reports any differences -------------------------------------------------------------------------------- /netbox-event-driven-ansible/playbooks/configure_login_banner.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Configure Login Banner on network devices using NetBox Config Context data 3 | connection: network_cli 4 | hosts: sites_melbourne 5 | gather_facts: no 6 | 7 | tasks: 8 | - name: Extract Login Banner from NetBox inventory config_context 9 | set_fact: 10 | login_banner: "{{ hostvars[inventory_hostname].config_context[0].login_banner[0] | default([]) }}" 11 | 12 | - name: Apply Login Banner configuration to Arista EOS devices 13 | when: ansible_network_os == 'arista.eos.eos' 14 | arista.eos.eos_banner: 15 | banner: login 16 | text: | 17 | "{{ login_banner }}" 18 | state: present 19 | 20 | - name: Retrieve running configuration 21 | arista.eos.eos_command: 22 | commands: ["show running-config"] 23 | register: banner_config 24 | 25 | - name: Display Login Banner configuration 26 | debug: 27 | var: banner_config.stdout_lines -------------------------------------------------------------------------------- /netbox-ansible-collection-quick-start/lookup_site_and_device_data.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Lookup NetBox Site and Device Data 3 | hosts: localhost 4 | gather_facts: no 5 | 6 | vars: 7 | netbox_url: "{{ lookup('ansible.builtin.env', 'NETBOX_API') }}" 8 | netbox_token: "{{ lookup('ansible.builtin.env', 'NETBOX_TOKEN') }}" 9 | 10 | tasks: 11 | 12 | - name: "Query NetBox for all sites" 13 | set_fact: 14 | sites: "{{ query('netbox.netbox.nb_lookup', 'sites', api_endpoint=netbox_url, token=netbox_token) }}" 15 | 16 | - name: "Print the list of sites" 17 | debug: 18 | msg: "{{ sites | json_query('[*].value.name') }}" 19 | 20 | - name: "Query NetBox for devices at the Cisco DevNet Site" 21 | set_fact: 22 | devices: "{{ query('netbox.netbox.nb_lookup', 'devices', api_filter='site=cisco-devnet', api_endpoint=netbox_url, token=netbox_token) }}" 23 | 24 | - name: "Print a list of devices at Cisco DevNet Site" 25 | debug: 26 | msg: "{{ devices | json_query('[*].value.name') }}" 27 | -------------------------------------------------------------------------------- /autocon4-workshop/2_start_diode.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | set -euo pipefail 3 | 4 | # Detect OS (macOS vs Linux) 5 | OS_TYPE=$(uname) 6 | 7 | # Ensure required environment variables are set 8 | REQUIRED_VARS=("MY_EXTERNAL_IP" "NETBOX_PORT") 9 | 10 | for var in "${REQUIRED_VARS[@]}"; do 11 | if [ -z "${!var:-}" ]; then 12 | echo "Error: Required environment variable '$var' is not set." 13 | exit 1 14 | fi 15 | done 16 | 17 | mkdir -p diode 18 | pushd diode 19 | 20 | echo 21 | echo "--- Downloading and preparing quickstart script ---" 22 | echo 23 | 24 | curl -sSfLo quickstart.sh https://raw.githubusercontent.com/netboxlabs/diode/release/diode-server/docker/scripts/quickstart.sh 25 | chmod +x quickstart.sh 26 | 27 | echo 28 | echo "--- Running quickstart script pointing at NetBox at http://${MY_EXTERNAL_IP}:${NETBOX_PORT} ---" 29 | echo 30 | 31 | ./quickstart.sh "http://${MY_EXTERNAL_IP}:${NETBOX_PORT}" 32 | 33 | echo 34 | echo "--- Bringing up Diode ---" 35 | echo 36 | 37 | docker compose up -d 38 | 39 | # End 40 | popd -------------------------------------------------------------------------------- /autocon2-workshop/2_start_slurpit.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -euo pipefail 3 | 4 | # pushd to Slurpit directory 5 | pushd slurpit 6 | 7 | # Check if all required environment variables are set 8 | REQUIRED_VARS=("MY_EXTERNAL_IP" "SLURPIT_PORT" "WORKSHOP_SUBNET" "NETBOX_PORT") 9 | 10 | for var in "${REQUIRED_VARS[@]}"; do 11 | if [ -z "${!var:-}" ]; then 12 | echo "Error: Required environment variable '$var' is not set." 13 | exit 0 14 | fi 15 | done 16 | 17 | echo 18 | echo "--- Starting Slurpit ---" 19 | echo 20 | 21 | docker compose up -d 22 | 23 | # Return to the original directory 24 | popd 25 | 26 | echo 27 | echo "--- Configuring Finder and NetBox Plugin ---" 28 | echo 29 | 30 | pushd workshop_setup 31 | python3 -m venv venv 32 | source venv/bin/activate 33 | pip install -r requirements.txt 34 | 35 | python slurpit/setup.py 36 | deactivate 37 | rm -fr venv/ 38 | popd 39 | 40 | echo "You should be able to login to slurpit here: http://${MY_EXTERNAL_IP}:${SLURPIT_PORT}" 41 | echo "username admin@admin.com" 42 | echo "password 12345678" 43 | -------------------------------------------------------------------------------- /autocon4-workshop/network/workshop.clab.yaml: -------------------------------------------------------------------------------- 1 | name: workshop 2 | 3 | mgmt: 4 | network: autocon4-workshop 5 | ipv4-subnet: 172.24.0.0/24 6 | 7 | topology: 8 | nodes: 9 | srl1: 10 | kind: nokia_srlinux 11 | image: ghcr.io/nokia/srlinux:24.7.2 12 | mgmt-ipv4: 172.24.0.101 13 | 14 | srl2: 15 | kind: nokia_srlinux 16 | image: ghcr.io/nokia/srlinux:24.7.2 17 | mgmt-ipv4: 172.24.0.102 18 | 19 | orb-agent: 20 | kind: linux 21 | image: netboxlabs/orb-agent:develop 22 | mgmt-ipv4: 172.24.0.100 23 | binds: 24 | - orb-agent:/opt/orb:ro 25 | entrypoint: /bin/sh 26 | cmd: /opt/orb/startup.sh 27 | 28 | web-server: 29 | kind: linux 30 | image: nginx:alpine 31 | network-mode: none 32 | exec: 33 | - ip addr add 192.168.2.2/30 dev eth1 34 | - ip route add default via 192.168.2.1 35 | 36 | links: 37 | - endpoints: ["srl1:e1-1", "srl2:e1-1"] 38 | - endpoints: ["srl1:e1-2", "orb-agent:eth1"] 39 | - endpoints: ["srl2:e1-2", "web-server:eth1"] -------------------------------------------------------------------------------- /autocon2-workshop/deploy_changes.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -euo pipefail 3 | 4 | # Check if all required environment variables are set 5 | REQUIRED_VARS=("MY_EXTERNAL_IP" "NETBOX_PORT") 6 | 7 | for var in "${REQUIRED_VARS[@]}"; do 8 | if [ -z "${!var:-}" ]; then 9 | echo "Error: Required environment variable '$var' is not set." 10 | exit 0 11 | fi 12 | done 13 | 14 | echo 15 | echo "--- Configuring environment ---" 16 | echo 17 | 18 | pushd ansible 19 | python3 -m venv venv 20 | source venv/bin/activate 21 | pip install -r requirements.txt 22 | ansible-galaxy install -r roles/requirements.yml 23 | ansible-galaxy collection install git+https://github.com/nokia/srlinux-ansible-collection.git 24 | 25 | # Insert the correct NetBox server 26 | sed -i "s/MY_EXTERNAL_IP/$MY_EXTERNAL_IP/g; s/NETBOX_PORT/$NETBOX_PORT/g" inventory/netbox.yml 27 | 28 | echo 29 | echo "--- Deploying changes to the network ---" 30 | echo 31 | 32 | ansible-playbook playbooks/set-ntp.yml 33 | 34 | echo 35 | echo "--- Cleaning up ---" 36 | echo 37 | 38 | #deactivate 39 | #rm -fr venv/ 40 | #popd -------------------------------------------------------------------------------- /autocon3-workshop-guide/sections/Section-2/Section-2.md: -------------------------------------------------------------------------------- 1 | # Introduction to NetBox Labs & NetBox 2 | 3 | This section provides an introduction to NetBox Labs and the NetBox platform. It covers the basics of NetBox and its capabilities, serving as a foundation for the workshop despite its automation focus. 4 | 5 | ## Instructions 6 | 7 | Sit back and relax. We will introduce NetBox Labs and NetBox, and give you a guided tour of a NetBox Cloud instance with example data. 8 | 9 | ### Log in to the User Interface of your NetBox Instance 10 | 11 | Now is a good time to check that you can access your NetBox instance, by logging into the Web UI. The details are: 12 | 13 | - **URL:** http://$INFRA_IP:8000/netbox 14 | - **Credentials:** admin / admin 15 | 16 | > [!TIP] 17 | > 18 | > You can find your the value of your `INFRA_IP` environment variable by entering the command `env | grep INFRA_IP` in your terminal. 19 | 20 | **Note** your NetBox instance is empty as you will be populating the database with discovered data for devices, interfaces, IP addresses etc during the rest of the workshop. -------------------------------------------------------------------------------- /netbox-ansible-cisco-cc/show_ip_int_brief.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Get Device Configurations From Cisco Catalyst Center 3 | hosts: sw1 4 | gather_facts: no 5 | vars: 6 | username: "devnetuser" 7 | password: "Cisco123!" 8 | 9 | tasks: 10 | - name: Set Custom Fields as Facts for Cisco Catalyst Center host and Device UUID 11 | set_fact: 12 | cisco_catalyst_center: "{{ hostvars[inventory_hostname].custom_fields['cisco_catalyst_center'] }}" 13 | ccc_device_id: "{{ hostvars[inventory_hostname].custom_fields['ccc_device_id'] }}" 14 | 15 | - name: Run 'show ip interface brief' Command 16 | cisco.dnac.command_runner_run_command: 17 | dnac_host: "{{ cisco_catalyst_center }}" 18 | dnac_username: "{{ username }}" 19 | dnac_password: "{{ password }}" 20 | dnac_verify: False 21 | deviceUuids: 22 | - "{{ ccc_device_id }}" 23 | commands: 24 | - "show ip interface brief" 25 | register: command_output 26 | 27 | - name: Display Command Output 28 | debug: 29 | var: command_output 30 | -------------------------------------------------------------------------------- /netbox-discovery-webinar/worker-example/README.md: -------------------------------------------------------------------------------- 1 | # Worker Example 2 | 3 | A sample implementation for NetBox Labs worker that demonstrates creating device entities. 4 | 5 | ## Requirements 6 | 7 | - Python 3.x 8 | - If running as part of NetBox Labs: netboxlabs.diode.sdk, worker packages 9 | 10 | ## Running Standalone 11 | 12 | This project can be run as a standalone script for testing and development: 13 | 14 | ```bash 15 | # Run with default device name (automatically generated) 16 | python3 worker_example/runner.py 17 | 18 | # Run with a custom device name 19 | python3 worker_example/runner.py --device-name my-custom-device 20 | ``` 21 | 22 | ## Features 23 | 24 | - Creates device entities with configurable properties 25 | - Implements required Backend interface 26 | - Parameter validation 27 | - Mock implementations for standalone mode 28 | 29 | ## Project Structure 30 | 31 | - `worker_example/runner.py`: Main implementation file 32 | 33 | ## Customization 34 | 35 | You can modify the required fields and default values in the `run` method to adapt the worker to your specific requirements. -------------------------------------------------------------------------------- /netbox-pyats-webinar/initial_device_configs.md: -------------------------------------------------------------------------------- 1 | # Initial Lab Device Configs 2 | 3 | Initial configuration applied to the lab devices in addition to the basic config applied by Containerlab. This configures the interface connecting the devices, plus a loopback interface, then adds a simple OSPF configuration. 4 | 5 | ## CSR1 6 | ``` 7 | conf t 8 | int gigabitEthernet 2 9 | ip address 192.168.1.1 255.255.255.252 10 | description Connection to CSR2 11 | no shut 12 | int lo0 13 | ip address 1.1.1.1 255.255.255.255 14 | lldp run 15 | router ospf 1 16 | router-id 1.1.1.1 17 | log-adjacency-changes 18 | network 192.168.1.1 0.0.0.3 area 0 19 | network 1.1.1.1 0.0.0.0 area 0 20 | exit 21 | exit 22 | wr 23 | ``` 24 | 25 | ## CSR2 26 | ``` 27 | conf t 28 | int gigabitEthernet 2 29 | ip address 192.168.1.2 255.255.255.252 30 | description Connection to CSR1 31 | no shut 32 | int lo0 33 | ip address 2.2.2.2 255.255.255.255 34 | lldp run 35 | router ospf 1 36 | router-id 2.2.2.2 37 | log-adjacency-changes 38 | network 192.168.1.0 0.0.0.3 area 0 39 | network 2.2.2.2 0.0.0.0 area 0 40 | exit 41 | exit 42 | wr 43 | ``` -------------------------------------------------------------------------------- /nornir-netbox-webinar/requirements.txt: -------------------------------------------------------------------------------- 1 | bcrypt==4.0.1 2 | certifi==2024.7.4 3 | cffi==1.16.0 4 | charset-normalizer==3.3.0 5 | colorama==0.4.6 6 | cryptography==44.0.1 7 | future==0.18.3 8 | idna==3.7 9 | Jinja2==3.1.5 10 | junos-eznc==2.6.8 11 | lxml==4.9.3 12 | markdown-it-py==3.0.0 13 | MarkupSafe==2.1.3 14 | mdurl==0.1.2 15 | mypy-extensions==1.0.0 16 | napalm==4.1.0 17 | ncclient==0.6.13 18 | netaddr==0.9.0 19 | netmiko==4.1.2 20 | netutils==1.6.0 21 | nornir==3.4.1 22 | nornir-napalm==0.4.0 23 | nornir-netbox==0.3.0 24 | nornir-netmiko==1.0.0 25 | nornir-utils==0.2.0 26 | ntc_templates==4.0.0 27 | paramiko==3.4.0 28 | pycparser==2.21 29 | pyeapi==1.0.2 30 | Pygments==2.16.1 31 | PyNaCl==1.5.0 32 | pyparsing==3.1.1 33 | pyserial==3.5 34 | python-dotenv==1.0.0 35 | PyYAML==6.0.1 36 | requests==2.32.0 37 | rich==13.6.0 38 | ruamel.yaml==0.17.35 39 | ruamel.yaml.clib==0.2.8 40 | scp==0.14.5 41 | six==1.16.0 42 | tabulate==0.9.0 43 | tenacity==8.2.3 44 | textfsm==1.1.2 45 | transitions==0.9.0 46 | ttp==0.9.5 47 | ttp-templates==0.3.5 48 | typing_extensions==4.8.0 49 | urllib3==2.2.2 50 | yamlordereddictloader==0.4.2 51 | -------------------------------------------------------------------------------- /nornir-netbox-webinar/README.md: -------------------------------------------------------------------------------- 1 | # nornir-netbox 2 | 3 | Code for the **Getting Started with Nornir and NetBox for Network Automation Webinar** hosted by NetBox Labs in October 2023. The talk showed how to get started on your Network Automation journey with Nornir and NetBox and featured the nornir_netbox inventory plugin for Nornir. 4 | 5 | [![nornir netbox webinar](https://img.youtube.com/vi/9kwfFgSwLNQ/0.jpg)](https://www.youtube.com/watch?v=9kwfFgSwLNQ) 6 | 7 | ## Getting Started 8 | 9 | 1. Clone Git repo and change into `nornir-netbox-webinar` directory 10 | ``` 11 | git clone https://github.com/netboxlabs/netbox-learning.git 12 | cd netbox-learning/nornir-netbox-webinar 13 | ``` 14 | 2. Create and activate Python 3 virtual environment 15 | ``` 16 | python3 -m venv ./venv 17 | source venv/bin/activate 18 | ``` 19 | 3. Install required Python packages 20 | ``` 21 | pip install -r requirements.txt 22 | ``` 23 | 4. Set environment variables for the NetBox API token and URL 24 | ``` 25 | export NB_URL= (note - must include http:// or https://) 26 | export NB_TOKEN= 27 | ``` 28 | -------------------------------------------------------------------------------- /nornir-netbox-webinar/backup_device_configs.py: -------------------------------------------------------------------------------- 1 | #!./venv/bin/python 2 | 3 | # Import required libraries 4 | 5 | from nornir import InitNornir 6 | from nornir_napalm .plugins.tasks import napalm_get 7 | from nornir_utils.plugins.functions import print_result 8 | from nornir_utils.plugins.tasks.files import write_file 9 | from datetime import date 10 | import pathlib 11 | 12 | # Define a function to back up the device configuration and write then to a file 13 | 14 | def backup_device_configs(task): 15 | backup_directory = "backups" 16 | pathlib.Path(backup_directory).mkdir(exist_ok=True) 17 | r = task.run(task=napalm_get, getters=["config"]) 18 | task.run( 19 | task=write_file, 20 | content=r.result["config"]["running"], 21 | filename=f"" + str(backup_directory) + "/" + str(task.host.name) + str(date.today()) + ".cfg", 22 | ) 23 | 24 | # Initialize Nornir with config file 25 | 26 | nr = InitNornir(config_file="config.yaml") 27 | 28 | # Display the results 29 | 30 | result = nr.run( 31 | name="Backing up device configurations", task=backup_device_configs 32 | ) 33 | 34 | print_result(result) 35 | -------------------------------------------------------------------------------- /autocon4-workshop/network/orb-agent/startup.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # Source environment variables 4 | set -a # automatically export all variables 5 | . /opt/orb/.env 6 | set +a 7 | 8 | # Install napalm-srl 9 | pip install napalm-srl==1.0.5 --break-system-packages -q 10 | 11 | # Install iproute2 for network configuration 12 | apt-get update -qq && apt-get install -y -qq iproute2 > /dev/null 2>&1 13 | 14 | # Wait for eth1 interface to be available (containerlab attaches it after container starts) 15 | echo "Waiting for eth1 interface..." 16 | for i in $(seq 1 30); do 17 | if ip link show eth1 > /dev/null 2>&1; then 18 | echo "eth1 interface found" 19 | break 20 | fi 21 | sleep 1 22 | done 23 | 24 | # Configure data plane interface 25 | ip addr add 192.168.1.2/30 dev eth1 2>/dev/null || true 26 | ip link set eth1 up 27 | 28 | # Add route to web server network via srl1 29 | ip route add 192.168.2.0/30 via 192.168.1.1 2>/dev/null || true 30 | 31 | echo "Network configuration complete" 32 | ip addr show eth1 33 | ip route 34 | 35 | # Start orb-agent with config file 36 | exec /usr/local/bin/orb-agent run --config /opt/orb/agent.yaml -------------------------------------------------------------------------------- /autocon4-workshop/config-templates/orb-agent/startup.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # Source environment variables 4 | set -a # automatically export all variables 5 | . /opt/orb/.env 6 | set +a 7 | 8 | # Install napalm-srl 9 | pip install napalm-srl==1.0.5 --break-system-packages -q 10 | 11 | # Install iproute2 for network configuration 12 | apt-get update -qq && apt-get install -y -qq iproute2 > /dev/null 2>&1 13 | 14 | # Wait for eth1 interface to be available (containerlab attaches it after container starts) 15 | echo "Waiting for eth1 interface..." 16 | for i in $(seq 1 30); do 17 | if ip link show eth1 > /dev/null 2>&1; then 18 | echo "eth1 interface found" 19 | break 20 | fi 21 | sleep 1 22 | done 23 | 24 | # Configure data plane interface 25 | ip addr add 192.168.1.2/30 dev eth1 2>/dev/null || true 26 | ip link set eth1 up 27 | 28 | # Add route to web server network via srl1 29 | ip route add 192.168.2.0/30 via 192.168.1.1 2>/dev/null || true 30 | 31 | echo "Network configuration complete" 32 | ip addr show eth1 33 | ip route 34 | 35 | # Start orb-agent with config file 36 | exec /usr/local/bin/orb-agent run --config /opt/orb/agent.yaml -------------------------------------------------------------------------------- /autocon2-workshop/docs/3_Source_Of_Truth_NetBox.md: -------------------------------------------------------------------------------- 1 | # Section 3 - NetBox - Our Network Source of Truth 2 | 3 | ## Video Guide (Click to launch :rocket:) 4 | [![NetBox - Our Network Source of Truth](images/videos/NetBox-SoT.png)](https://www.youtube.com/watch?v=Onz8_xDiMfM) 5 | 6 | ___ 7 | 8 | A Network Source of Truth like [NetBox](https://netboxlabs.com/) is the bedrock of any network automation stategy. NetBox acts as your living documentation and captures the Low Level Design of your network, but initially our NetBox is empty (apart from a some pre-configured objects, which you can ignore for now.) 9 | 10 | Please refer to the video above for this section. 11 | 12 | > [!TIP] 13 | > **NetBox URL**: `./0_set_envvars.sh | grep -i netbox` 14 | > **username** admin 15 | > **password** admin 16 | 17 | > [!TIP] 18 | > 19 | > If you're interested in learning more about NetBox check out the [NetBox Zero to Hero course](https://netboxlabs.com/zero-to-hero/) 20 | > It's packed with useful information and instructional videos to give you a deeper understanding of NetBox's capabilities 21 | 22 | ___ 23 | 24 | Next Section - [**Discovery and Reconciliation - Slurpit**](./4_Discovery_Reconciliation_Slurpit.md) 25 | -------------------------------------------------------------------------------- /autocon2-workshop/workshop_setup/icinga/check_nokia_ping.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Icinga plugin to ping a specified target 3 | # Usage: ./ping_plugin.sh -H admin@host --target 4 | # Function to show usage 5 | usage() { 6 | echo "Usage: $0 -H admin@host --target " 7 | exit 3 # Unknown status 8 | } 9 | # Default exit codes for Icinga plugins 10 | OK=0 11 | WARNING=1 12 | CRITICAL=2 13 | UNKNOWN=3 14 | # Parse arguments 15 | while [[ "$#" -gt 0 ]]; do 16 | case $1 in 17 | -H) HOST="$2"; shift ;; 18 | --target) TARGET="$2"; shift ;; 19 | *) usage ;; 20 | esac 21 | shift 22 | done 23 | # Check if HOST and TARGET were provided 24 | if [[ -z "$HOST" || -z "$TARGET" ]]; then 25 | echo "UNKNOWN: Required arguments -H and --target are missing." 26 | usage 27 | fi 28 | 29 | SSHPASS="NokiaSrl1!" 30 | # Perform ping and check the result 31 | sshpass -p $SSHPASS ssh -o StrictHostKeyChecking=no admin@$HOST ping -c 2 -W 2 "$TARGET" > /dev/null 2>&1 32 | PING_STATUS=$? 33 | if [[ $PING_STATUS -eq 0 ]]; then 34 | echo "OK: Ping to $TARGET from $HOST is successful." 35 | exit $OK 36 | else 37 | echo "CRITICAL: Ping to $TARGET from $HOST failed." 38 | exit $CRITICAL 39 | fi 40 | -------------------------------------------------------------------------------- /netbox-ansible-collection-quick-start/roles/create_prefixes/vars/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | prefixes: 3 | 4 | - parent: 192.168.0.0/22 5 | status: reserved 6 | description: Data 7 | prefix_length: 25 8 | site: AUBRI01 9 | tenant: Consulting 10 | vlan: DATA 11 | 12 | - parent: 192.168.0.0/22 13 | status: reserved 14 | description: Voice 15 | prefix_length: 25 16 | site: AUBRI01 17 | tenant: Consulting 18 | vlan: VOICE 19 | 20 | - parent: 192.168.0.0/22 21 | status: reserved 22 | description: Branch Wifi 23 | prefix_length: 25 24 | site: AUBRI01 25 | tenant: Consulting 26 | vlan: B_WIFI 27 | 28 | - parent: 192.168.0.0/22 29 | status: reserved 30 | description: Guest Wifi 31 | prefix_length: 25 32 | site: AUBRI01 33 | tenant: Consulting 34 | vlan: G_WIFI 35 | 36 | - parent: 192.168.0.0/22 37 | status: reserved 38 | description: Network Management 39 | prefix_length: 26 40 | site: AUBRI01 41 | tenant: Consulting 42 | vlan: NETMAN 43 | 44 | - parent: 192.168.0.0/22 45 | status: reserved 46 | description: P2P RTR-SW 47 | prefix_length: 30 48 | site: AUBRI01 49 | tenant: Consulting 50 | vlan: P2P -------------------------------------------------------------------------------- /vxlan-workflows/README.md: -------------------------------------------------------------------------------- 1 | # VXLAN Configuration Fetcher 2 | 3 | This tool fetches and flattens VXLAN configuration data from a NetBox instance for a specific device using Custom Objects. 4 | 5 | ## Setup 6 | 7 | 1. **Create a virtual environment:** 8 | 9 | ```bash 10 | python3 -m venv venv 11 | ``` 12 | 13 | 2. **Activate the virtual environment:** 14 | 15 | ```bash 16 | source venv/bin/activate 17 | ``` 18 | 19 | 3. **Install the required dependencies:** 20 | 21 | ```bash 22 | pip install -r requirements.txt 23 | ``` 24 | 25 | ## Usage 26 | 27 | 1. **Set the required environment variables:** 28 | 29 | ```bash 30 | export NETBOX_URL="" 31 | export NETBOX_TOKEN="" 32 | ``` 33 | Replace `` and `` with your actual NetBox URL and API token. The URL should be the base URL of your NetBox instance (e.g., `http://netbox.example.com/`). 34 | 35 | 2. **Run the script:** 36 | 37 | ```bash 38 | python cli.py 39 | ``` 40 | Replace `` with the name of the device you want to query. 41 | 42 | **Example:** 43 | ```bash 44 | python cli.py example_vtep_leaf 45 | ``` -------------------------------------------------------------------------------- /autocon4-workshop/create_orb_env_file.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | set -euo pipefail 3 | 4 | ENV_FILE="./network/orb-agent/.env" 5 | 6 | # Check if all required environment variables are set 7 | REQUIRED_VARS=("MY_EXTERNAL_IP" "DIODE_CLIENT_ID" "DIODE_CLIENT_SECRET") 8 | 9 | for var in "${REQUIRED_VARS[@]}"; do 10 | if [ -z "${!var:-}" ]; then 11 | echo "Error: Required environment variable '$var' is not set." 12 | exit 1 13 | fi 14 | done 15 | 16 | # Generate variables needed by orb-agent 17 | DIODE_TARGET="grpc://${MY_EXTERNAL_IP}:8080/diode" 18 | GIT_TARGET="http://${MY_EXTERNAL_IP}:3000/admin/orb-policies" 19 | PROMETHEUS_TARGET="http://${MY_EXTERNAL_IP}:9090/api/v1/write" 20 | 21 | # Ensure directory exists 22 | mkdir -p "$(dirname ${ENV_FILE})" 23 | 24 | # Write variables to the environment file 25 | cat < "$ENV_FILE" 26 | DIODE_TARGET=${DIODE_TARGET} 27 | DIODE_CLIENT_ID=${DIODE_CLIENT_ID} 28 | DIODE_CLIENT_SECRET=${DIODE_CLIENT_SECRET} 29 | GIT_TARGET=${GIT_TARGET} 30 | PROMETHEUS_TARGET=${PROMETHEUS_TARGET} 31 | EOF 32 | 33 | # Debug information to communicate values being used 34 | echo 35 | echo "--- Orb Agent ENV file created ---" 36 | echo ${ENV_FILE} 37 | cat $ENV_FILE 38 | echo "----------------------------------" 39 | echo -------------------------------------------------------------------------------- /autocon2-workshop/0_set_envvars.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Attempt to fetch the external IPv4 address 4 | EXTERNAL_IP=$(curl -4 -s ifconfig.me) # Use -4 to ensure IPv4 is returned 5 | 6 | # Check if the IP was retrieved successfully 7 | if [ -z "$EXTERNAL_IP" ]; then 8 | echo "Error: Unable to determine external IPv4 address." 9 | exit 1 10 | fi 11 | 12 | export MY_EXTERNAL_IP=$EXTERNAL_IP 13 | 14 | # Set service ports 15 | export SLURPIT_PORT="8000" 16 | export NETBOX_PORT="8001" 17 | export ICINGA_PORT="8002" 18 | export NETPICKER_PORT="8003" 19 | export NETPICKER_API_PORT="8004" 20 | export WORKSHOP_SUBNET="172.24.0.0/24" 21 | 22 | 23 | # Debug information to communicate values being used 24 | echo 25 | echo "--- Environment Variables Set ---" 26 | echo "External IP: $MY_EXTERNAL_IP" 27 | echo "Slurpit will be deployed at: http://$MY_EXTERNAL_IP:$SLURPIT_PORT" 28 | echo "NetBox will be deployed at: http://$MY_EXTERNAL_IP:$NETBOX_PORT" 29 | echo "Icinga will be deployed at: http://$MY_EXTERNAL_IP:$ICINGA_PORT" 30 | echo "NetPicker Frontend will be deployed at: http://$MY_EXTERNAL_IP:$NETPICKER_PORT" 31 | echo "NetPicker API will be deployed at: $MY_EXTERNAL_IP:$NETPICKER_API_PORT" 32 | echo "Workshop Docker network: $WORKSHOP_SUBNET" 33 | echo "-----------------------------------" -------------------------------------------------------------------------------- /netbox-pyats-webinar/generate_testbed_file.py: -------------------------------------------------------------------------------- 1 | # filename: generate_testbed_file.py 2 | 3 | # Description: This script generates a testbed file based on the Netbox data 4 | # using the pyATS framework. It uses the Netbox class from the 5 | # pyats.contrib.creators.netbox module to create the testbed file. 6 | 7 | # Import the necessary libraries 8 | from pyats.contrib.creators.netbox import Netbox 9 | import yaml 10 | import os 11 | 12 | # Define Netbox URL, user token, and default credentials 13 | netbox_url = os.getenv('NETBOX_URL') 14 | user_token = os.getenv('NETBOX_USER_TOKEN') 15 | def_user = '%ENV{DEF_PYATS_USER}' 16 | def_pass = '%ENV{DEF_PYATS_PASS}' 17 | url_filter = 'site=pyats-webinar' 18 | # url_filter = 'site_id=68' 19 | # url_filter = 'site=pyats-webinar&os=ios-xe' 20 | # url_filter = 'platform=ios-xe' 21 | 22 | # Create testbed object and build data structure 23 | nb_testbed = Netbox( 24 | netbox_url=netbox_url, 25 | user_token=user_token, 26 | def_user=def_user, 27 | def_pass=def_pass, 28 | url_filter=url_filter, 29 | ssl_verify=False, 30 | topology=True 31 | ) 32 | 33 | # Generate testbed file 34 | tb = nb_testbed._generate() 35 | tb_yaml = yaml.dump(tb) 36 | with open("testbed.yaml", "w") as f: 37 | f.write(tb_yaml) -------------------------------------------------------------------------------- /netbox-event-driven-architectures/agents/reachability_alerter/README.md: -------------------------------------------------------------------------------- 1 | # Reachability Alerter Agent 📢 2 | 3 | By default the Reachability Agent waits for messages to appear on the `$SUBSCRIBE_SUBJECT` subject and then if a device is reported as being unreachable the agent publishes a message to Slack. 4 | 5 | ### Configuration 6 | 7 | The agent is configured on start up by the `.env` file in the agent's directory. We assume that you have already created a Slack app. 8 | 9 | ``` 10 | cat agents/reachability_alerter/example.env 11 | NATS_SERVER="127.0.0.1:4222" # NATs server to connect to 12 | SUBSCRIBE_SUBJECT="network.devices.reachable" # NATs subject to subscribe to. The agent runs when a message is receieved 13 | SLACK_TOKEN="YOUR SLACK TOKEN" # Slack App Token 14 | SLACK_USERNAME="YOUR SLACK BOT USERNAME" # Slack username to publish as 15 | SLACK_CHANNEL="YOUR SLACK CHANNEL" # Slack channel to publish to 16 | ``` 17 | 18 | ### Start the agent 19 | 20 | ``` 21 | python agents/reachability_alerter/reachability_alerter.py 22 | Loaded environment for reachability_alerter.py 23 | NATs Server: 127.0.0.1:4222 24 | Writing ping alerts to Slack channel: event-driven-webinar with username: Slack Alert Bot 25 | Subscribed to network.devices.reachable 26 | ``` -------------------------------------------------------------------------------- /autocon2-workshop/slurpit/docker-compose.override.yml: -------------------------------------------------------------------------------- 1 | # It's better to overwrite compose changes in this file so that the original will be overwriten when you pull the updates from the git project 2 | # To use the override file, remove -EXAMPLE from the filename and it becomes automatically active when you run up.sh or up.bat 3 | services: 4 | slurpit-warehouse: 5 | environment: 6 | TZ: Europe/Amsterdam 7 | WAREHOUSE_CALLBACK_SCANNER_URL: http://slurpit-portal/callback/scanner 8 | WAREHOUSE_CALLBACK_SCANNER_TOKEN: 9 | WAREHOUSE_CALLBACK_SCRAPER_URL: http://slurpit-portal/callback/scraper 10 | WAREHOUSE_CALLBACK_SCRAPER_TOKEN: 11 | 12 | slurpit-scraper: 13 | environment: 14 | TZ: Europe/Amsterdam 15 | SCRAPER_TIMEOUT: 20 16 | SCRAPER_POOLSIZE: 8 17 | SCRAPER_WAREHOUSE_URL: http://slurpit-warehouse 18 | 19 | slurpit-scanner: 20 | environment: 21 | TZ: Europe/Amsterdam 22 | SCANNER_POOLSIZE: 8 23 | SCANNER_TIMEOUT: 10 24 | SCANNER_WAREHOUSE_URL: http://slurpit-warehouse 25 | 26 | slurpit-portal: 27 | environment: 28 | TZ: Europe/Amsterdam 29 | PORTAL_BASE_URL: "http://${MY_EXTERNAL_IP}:${SLURPIT_PORT}/" 30 | PORTAL_WAREHOUSE_URL: http://slurpit-warehouse 31 | ports: 32 | - "${SLURPIT_PORT}:80" -------------------------------------------------------------------------------- /netbox-ansible-webinar/roles/COMPARE_STATES/tasks/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: 1 - Create temp file for actual configuration 3 | ansible.builtin.copy: 4 | src: "{{ actual_conf_dir }}/{{ inventory_hostname }}_running.conf" 5 | dest: "/tmp/{{ inventory_hostname }}_temp.conf" 6 | remote_src: yes 7 | register: actual_temp_file 8 | delegate_to: localhost 9 | 10 | - name: 2 - Remove lines matching the exclusion pattern from temp actual configuration 11 | ansible.builtin.lineinfile: 12 | path: "{{ actual_temp_file.dest }}" 13 | regexp: "{{ exclusion_pattern }}" 14 | state: absent 15 | delegate_to: localhost 16 | 17 | - name: 3 - Diff compare temp actual configuration file with intended configuration file 18 | command: "diff /tmp/{{ inventory_hostname }}_temp.conf {{ intended_conf_dir }}/{{ inventory_hostname }}_intended.conf" 19 | register: diff_output 20 | ignore_errors: yes 21 | changed_when: false 22 | delegate_to: localhost 23 | 24 | - name: 4 - Show delta of intended state vs actual State 25 | debug: 26 | msg: "{{ diff_output.stdout_lines }}" 27 | when: diff_output.stdout != "" 28 | delegate_to: localhost 29 | 30 | - name: 5 - Cleanup temp actual configuration file 31 | ansible.builtin.file: 32 | path: "{{ actual_temp_file.dest }}" 33 | state: absent 34 | delegate_to: localhost -------------------------------------------------------------------------------- /autocon3-workshop-guide/sections/Section-7/code/step-2/lab-integration/pyproject.toml: -------------------------------------------------------------------------------- 1 | [project] 2 | name = "lab-integration" 3 | version = "1.0.0" # Overwritten during the build process 4 | description = "Worker to import data from a custom integration" 5 | readme = "README.md" 6 | requires-python = ">=3.10" 7 | license = { text = "Apache-2.0" } 8 | authors = [ 9 | {name = "YOUR NAME", email = "YOUR@EMAIL.COM" } 10 | ] 11 | maintainers = [ 12 | {name = "YOUR NAME", email = "YOUR@EMAIL.COM" } 13 | ] 14 | classifiers = [ 15 | "Development Status :: 3 - Alpha", 16 | "Intended Audience :: Developers", 17 | "Topic :: Software Development :: Build Tools", 18 | "License :: OSI Approved :: Apache Software License", 19 | "Programming Language :: Python :: 3", 20 | "Programming Language :: Python :: 3 :: Only", 21 | 'Programming Language :: Python :: 3.10', 22 | 'Programming Language :: Python :: 3.11', 23 | 'Programming Language :: Python :: 3.12', 24 | ] 25 | 26 | dependencies = [ 27 | "netboxlabs-orb-worker~=1.0", 28 | ] 29 | 30 | 31 | [project.urls] 32 | "Homepage" = "" 33 | 34 | [tool.setuptools] 35 | packages = [ 36 | "lab_integration", 37 | ] 38 | package-data = {"lab_integration" = ["**/*"]} 39 | 40 | [build-system] 41 | requires = ["setuptools>=43.0.0", "wheel"] 42 | build-backend = "setuptools.build_meta" -------------------------------------------------------------------------------- /netbox-discovery-quickstart/2_start_diode.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | set -euo pipefail 3 | 4 | # Detect OS (macOS vs Linux) 5 | OS_TYPE=$(uname) 6 | 7 | # Ensure required environment variables are set 8 | REQUIRED_VARS=("MY_EXTERNAL_IP" "NETBOX_PORT") 9 | 10 | for var in "${REQUIRED_VARS[@]}"; do 11 | if [ -z "${!var:-}" ]; then 12 | echo "Error: Required environment variable '$var' is not set." 13 | exit 1 14 | fi 15 | done 16 | 17 | mkdir -p diode 18 | pushd diode 19 | 20 | echo 21 | echo "--- Downloading and preparing quickstart script ---" 22 | echo 23 | 24 | curl -sSfLo quickstart.sh https://raw.githubusercontent.com/netboxlabs/diode/release/diode-server/docker/scripts/quickstart.sh 25 | chmod +x quickstart.sh 26 | 27 | echo 28 | echo "--- Running quickstart script pointing at NetBox at http://${MY_EXTERNAL_IP}:${NETBOX_PORT} ---" 29 | echo 30 | 31 | ./quickstart.sh "http://${MY_EXTERNAL_IP}:${NETBOX_PORT}" 32 | 33 | echo 34 | echo "--- Bringing up Diode ---" 35 | echo 36 | 37 | docker compose up -d 38 | 39 | echo 40 | echo "--- Setting up netbox-to-diode client secret ---" 41 | echo 42 | 43 | echo "To set up NetBox integration, run this command:" 44 | echo "export NETBOX_TO_DIODE_CLIENT_SECRET=\$(jq -r '.[] | select(.client_id == \"netbox-to-diode\") | .client_secret' ./diode/oauth2/client/client-credentials.json)" 45 | 46 | # End 47 | popd -------------------------------------------------------------------------------- /autocon3-workshop-guide/sections/Section-7/code/step-1/lab-integration/pyproject.toml: -------------------------------------------------------------------------------- 1 | [project] 2 | name = "lab-integration" 3 | version = "1.0.0" # Overwritten during the build process 4 | description = "Worker to import data from a custom integration" 5 | readme = "README.md" 6 | requires-python = ">=3.10" 7 | license = { text = "Apache-2.0" } 8 | authors = [ 9 | {name = "", email = "" } 10 | ] 11 | maintainers = [ 12 | {name = "", email = "" } 13 | ] 14 | 15 | classifiers = [ 16 | "Development Status :: 3 - Alpha", 17 | "Intended Audience :: Developers", 18 | "Topic :: Software Development :: Build Tools", 19 | "License :: OSI Approved :: Apache Software License", 20 | "Programming Language :: Python :: 3", 21 | "Programming Language :: Python :: 3 :: Only", 22 | 'Programming Language :: Python :: 3.10', 23 | 'Programming Language :: Python :: 3.11', 24 | 'Programming Language :: Python :: 3.12', 25 | ] 26 | 27 | dependencies = [ 28 | "netboxlabs-orb-worker~=1.0", 29 | ] 30 | 31 | 32 | [project.urls] 33 | "Homepage" = "" 34 | 35 | [tool.setuptools] 36 | packages = [ 37 | "lab_integration", 38 | ] 39 | package-data = {"lab_integration" = ["**/*"]} 40 | 41 | [build-system] 42 | requires = ["setuptools>=43.0.0", "wheel"] 43 | build-backend = "setuptools.build_meta" -------------------------------------------------------------------------------- /autocon3-workshop-guide/sections/Section-7/code/step-3/lab-integration/pyproject.toml: -------------------------------------------------------------------------------- 1 | [project] 2 | name = "lab-integration" 3 | version = "1.0.0" # Overwritten during the build process 4 | description = "Worker to import data from a custom integration" 5 | readme = "README.md" 6 | requires-python = ">=3.10" 7 | license = { text = "Apache-2.0" } 8 | authors = [ 9 | {name = "YOUR NAME", email = "YOUR@EMAIL.COM" } 10 | ] 11 | maintainers = [ 12 | {name = "YOUR NAME", email = "YOUR@EMAIL.COM" } 13 | ] 14 | 15 | classifiers = [ 16 | "Development Status :: 3 - Alpha", 17 | "Intended Audience :: Developers", 18 | "Topic :: Software Development :: Build Tools", 19 | "License :: OSI Approved :: Apache Software License", 20 | "Programming Language :: Python :: 3", 21 | "Programming Language :: Python :: 3 :: Only", 22 | 'Programming Language :: Python :: 3.10', 23 | 'Programming Language :: Python :: 3.11', 24 | 'Programming Language :: Python :: 3.12', 25 | ] 26 | 27 | dependencies = [ 28 | "netboxlabs-orb-worker~=1.0", 29 | ] 30 | 31 | 32 | [project.urls] 33 | "Homepage" = "" 34 | 35 | [tool.setuptools] 36 | packages = [ 37 | "lab_integration", 38 | ] 39 | package-data = {"lab_integration" = ["**/*"]} 40 | 41 | [build-system] 42 | requires = ["setuptools>=43.0.0", "wheel"] 43 | build-backend = "setuptools.build_meta" -------------------------------------------------------------------------------- /netbox-ansible-webinar/roles/INTENDED_STATE/tasks/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: 1 - Get device details from NetBox 3 | uri: 4 | url: "{{ netbox_url }}api/dcim/devices/?name={{ inventory_hostname }}" 5 | method: GET 6 | return_content: yes 7 | headers: 8 | accept: "application/json" 9 | Authorization: "Token {{ netbox_token }}" 10 | register: device 11 | 12 | - name: 2- Get intended state from NetBox based on device ID from play 1 13 | uri: 14 | url: "{{ netbox_url }}api/dcim/devices/{{ device.json.results.0['id'] }}/render-config/" 15 | method: POST 16 | return_content: yes 17 | headers: 18 | accept: "application/json" 19 | Authorization: "Token {{ netbox_token }}" 20 | register: intended_config 21 | 22 | - name: 3 - Ensure folder for intended configs exists 23 | file: 24 | path: "{{ intended_configs_root }}" 25 | state: directory 26 | run_once: yes 27 | 28 | - name: 4 - Ensure folder for each device's intended config exists 29 | file: 30 | path: "{{ intended_configs_root }}/{{ inventory_hostname }}" 31 | state: directory 32 | 33 | - name: 5 - Copy intened config for each device to folder 34 | copy: 35 | content: "{{ intended_config.json.content }}" 36 | dest: "{{ intended_configs_root }}/{{ inventory_hostname }}/{{ inventory_hostname }}_intended.conf" -------------------------------------------------------------------------------- /netbox-diode-webinar/examples/python/sample-orb-worker/lab-integration/pyproject.toml: -------------------------------------------------------------------------------- 1 | [project] 2 | name = "lab-integration" 3 | version = "1.0.0" # Overwritten during the build process 4 | description = "Worker to import data from a custom integration" 5 | readme = "README.md" 6 | requires-python = ">=3.10" 7 | license = { text = "Apache-2.0" } 8 | authors = [ 9 | {name = "YOUR NAME", email = "YOUR@EMAIL.COM" } 10 | ] 11 | maintainers = [ 12 | {name = "YOUR NAME", email = "YOUR@EMAIL.COM" } 13 | ] 14 | 15 | classifiers = [ 16 | "Development Status :: 3 - Alpha", 17 | "Intended Audience :: Developers", 18 | "Topic :: Software Development :: Build Tools", 19 | "License :: OSI Approved :: Apache Software License", 20 | "Programming Language :: Python :: 3", 21 | "Programming Language :: Python :: 3 :: Only", 22 | 'Programming Language :: Python :: 3.10', 23 | 'Programming Language :: Python :: 3.11', 24 | 'Programming Language :: Python :: 3.12', 25 | ] 26 | 27 | dependencies = [ 28 | "netboxlabs-orb-worker~=1.0", 29 | ] 30 | 31 | 32 | [project.urls] 33 | "Homepage" = "" 34 | 35 | [tool.setuptools] 36 | packages = [ 37 | "lab_integration", 38 | ] 39 | package-data = {"lab_integration" = ["**/*"]} 40 | 41 | [build-system] 42 | requires = ["setuptools>=43.0.0", "wheel"] 43 | build-backend = "setuptools.build_meta" -------------------------------------------------------------------------------- /netbox-event-driven-architectures/agents/config_backuper/README.md: -------------------------------------------------------------------------------- 1 | # Config Backuper Agent 💾 2 | 3 | By default the Config Backuper Agent waits for messages to appear on the `$SUBSCRIBE_SUBJECT` subject and then commits the contents to GitHub at `github.com/$GITHUB_ORG/$GITHUB_REPO/$HOSTNAME/running_config`. 4 | 5 | ### Configuration 6 | 7 | The agent is configured on start up by the `.env` file in the agent's directory. We assume that you have already created a Slack app. 8 | 9 | ``` 10 | cat agents/config_backuper/example.env 11 | NATS_SERVER="127.0.0.1:4222" # NATs server to connect to 12 | SUBSCRIBE_SUBJECT="network.devices.running_config" # NATs subject to subscribe to. The agent runs when a message is receieved 13 | GITHUB_TOKEN="YOUR GITHUB TOKEN" # GitHub API token 14 | GITHUB_ORG="YOUR GITHUB ORG" # GitHub Organization that running configs will be committed to 15 | GITHUB_REPO="YOUR GITHUB REPO" # GitHub Repo that running configs will be committed to 16 | ``` 17 | 18 | ### Start the agent 19 | 20 | ``` 21 | python agents/config_backuper/config_backuper.py 22 | Loaded environment for config_backuper.py 23 | NATs Server: 127.0.0.1:4222 24 | Writing device configs to: mrmrcoleman/device_config_backups 25 | Subscribed to network.devices.running_config 26 | ``` -------------------------------------------------------------------------------- /netbox-event-driven-ansible/playbooks/configure_ntp.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Configure NTP on network devices using NetBox inventory config_context 3 | connection: network_cli 4 | hosts: sites_melbourne 5 | gather_facts: no 6 | 7 | tasks: 8 | - name: Extract NTP servers from NetBox inventory config_context 9 | set_fact: 10 | ntp_servers: "{{ hostvars[inventory_hostname].config_context[0].ntp_servers | default([]) }}" 11 | 12 | - name: Render NTP configuration using Jinja2 template 13 | template: 14 | src: templates/ntp_config.j2 15 | dest: /tmp/ntp_config_{{ inventory_hostname }}.yml 16 | 17 | - name: Apply NTP configuration to Arista EOS devices 18 | when: ansible_network_os == 'arista.eos.eos' 19 | arista.eos.eos_ntp_global: 20 | config: "{{ lookup('file', '/tmp/ntp_config_{{ inventory_hostname }}.yml') | from_yaml }}" 21 | state: replaced 22 | 23 | - name: Retrieve running configuration NTP section 24 | arista.eos.eos_command: 25 | commands: ["show running-config | section ntp"] 26 | register: ntp_config 27 | 28 | - name: Display NTP configuration 29 | debug: 30 | var: ntp_config.stdout_lines 31 | 32 | - name: Remove temporary NTP configuration files 33 | file: 34 | path: "/tmp/ntp_config_{{ inventory_hostname }}.yml" 35 | state: absent -------------------------------------------------------------------------------- /autocon4-workshop/run_ansible.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | set -euo pipefail 3 | 4 | # Default branch to empty string 5 | BRANCH_ID="" 6 | 7 | # Parse command line arguments 8 | while [[ $# -gt 0 ]]; do 9 | case $1 in 10 | --branch) 11 | BRANCH_ID="$2" 12 | shift 2 13 | ;; 14 | *) 15 | echo "Unknown option: $1" 16 | echo "Usage: $0 [--branch BRANCH_SCHEMA_ID]" 17 | exit 1 18 | ;; 19 | esac 20 | done 21 | 22 | # If branch is not defined, ask for confirmation 23 | if [ -z "$BRANCH_ID" ]; then 24 | echo "Warning: No branch specified. This will run against the main branch." 25 | read -p "Do you want to continue? (yes/no): " -r 26 | if [[ ! $REPLY =~ ^[Yy][Ee][Ss]$ ]]; then 27 | echo "Aborted." 28 | exit 1 29 | fi 30 | fi 31 | 32 | # Check if required environment variables are set 33 | REQUIRED_VARS=("MY_EXTERNAL_IP" "NETBOX_PORT" "NETBOX_TOKEN") 34 | 35 | for var in "${REQUIRED_VARS[@]}"; do 36 | if [ -z "${!var:-}" ]; then 37 | echo "Error: Required environment variable '$var' is not set." 38 | exit 1 39 | fi 40 | done 41 | 42 | # Run the ansible playbook 43 | ansible-playbook \ 44 | -i ansible/inventory.yaml \ 45 | ansible/deploy-configs.yaml \ 46 | -e "MY_EXTERNAL_IP=${MY_EXTERNAL_IP}" \ 47 | -e "NETBOX_PORT=${NETBOX_PORT}" \ 48 | -e "NETBOX_API_TOKEN=${NETBOX_TOKEN}" \ 49 | -e "NETBOX_BRANCH_ID=${BRANCH_ID}" 50 | -------------------------------------------------------------------------------- /netbox-diode-webinar/examples/go/diode-webinar.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "context" 5 | "log" 6 | 7 | "github.com/netboxlabs/diode-sdk-go/diode" 8 | ) 9 | 10 | func main() { 11 | client, err := diode.NewClient( 12 | "grpc:///diode", 13 | "example-app", 14 | "0.1.0", 15 | diode.WithClientID("YOUR_CLIENT_ID"), 16 | diode.WithClientSecret("YOUR_CLIENT_SECRET"), 17 | ) 18 | if err != nil { 19 | log.Fatal(err) 20 | } 21 | 22 | // Create a device 23 | deviceEntity := &diode.Device{ 24 | Name: diode.String("PDU 05"), 25 | DeviceType: &diode.DeviceType{ 26 | Model: diode.String("AP7955"), 27 | Manufacturer: &diode.Manufacturer{ 28 | Name: diode.String("APC"), 29 | }, 30 | }, 31 | Platform: &diode.Platform{ 32 | Name: diode.String("APCOS"), 33 | Manufacturer: &diode.Manufacturer{ 34 | Name: diode.String("APC"), 35 | }, 36 | }, 37 | Site: &diode.Site{ 38 | Name: diode.String("Sunderland"), 39 | }, 40 | Role: &diode.DeviceRole{ 41 | Name: diode.String("Rack PDU"), 42 | }, 43 | Status: diode.String("active"), 44 | } 45 | 46 | entities := []diode.Entity{ 47 | deviceEntity, 48 | } 49 | 50 | resp, err := client.Ingest(context.Background(), entities) 51 | if err != nil { 52 | log.Fatal(err) 53 | } 54 | if resp != nil && resp.Errors != nil { 55 | log.Printf("Errors: %v\n", resp.Errors) 56 | } else { 57 | log.Printf("Success\n") 58 | } 59 | 60 | } 61 | -------------------------------------------------------------------------------- /autocon4-workshop/6_start_prometheus.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | set -euo pipefail 3 | 4 | # Check if all required environment variables are set 5 | REQUIRED_VARS=("MY_EXTERNAL_IP") 6 | 7 | for var in "${REQUIRED_VARS[@]}"; do 8 | if [ -z "${!var:-}" ]; then 9 | echo "Error: Required environment variable '$var' is not set." 10 | exit 1 11 | fi 12 | done 13 | 14 | # You can override this if you use the legacy 'docker-compose' binary: 15 | DOCKER_COMPOSE="${DOCKER_COMPOSE:-docker compose}" 16 | 17 | # Fresh start directory 18 | mkdir -p prometheus/alerts 19 | pushd prometheus 20 | 21 | echo "Copying config files from config-templates/prometheus/" 22 | cp ../config-templates/prometheus/docker-compose.yaml . 23 | cp ../config-templates/prometheus/prometheus.yaml . 24 | cp ../config-templates/prometheus/alerts/httpcheck.yaml alerts/ 25 | 26 | echo 27 | echo "--- Ensuring data dirs exist ---" 28 | echo 29 | 30 | rm -rf prometheus-data 31 | mkdir -p prometheus-data 32 | 33 | echo 34 | echo "--- Starting Prometheus (detached) ---" 35 | echo 36 | 37 | $DOCKER_COMPOSE up -d 38 | 39 | echo 40 | echo "--- Waiting for container health=healthy ---" 41 | echo 42 | 43 | # Wait for health to be "healthy" 44 | until [ "$( 45 | docker inspect -f '{{.State.Health.Status}}' prometheus 2>/dev/null || echo "starting" 46 | )" = "healthy" ]; do 47 | sleep 1 48 | done 49 | 50 | popd 51 | echo 52 | echo "✅ Done. Prometheus is ready at: http://${MY_EXTERNAL_IP}:9090" 53 | echo -------------------------------------------------------------------------------- /netbox-event-driven-architectures/agents/ping_devices/README.md: -------------------------------------------------------------------------------- 1 | # Ping Devices Agent 🏓 2 | 3 | By default the Ping Agent waits for messages to appear on the `$SUBSCRIBE_SUBJECT` subject and then pulls all devices from NetBox that are in the `Active` state and have a `mgmt-ipv4` address. The agent then uses `ping` to check if the devices are reachable and publishes the results to the `$PUBLISH_SUBJECT` subject on the message bus. 4 | 5 | ### Configuration 6 | 7 | The agent is configured on start up by the `.env` file in the agent's directory. 8 | 9 | ``` 10 | cat agents/ping_devices/example.env 11 | NATS_SERVER="127.0.0.1:4222" # NATs server to connect to 12 | PUBLISH_SUBJECT="network.devices.reachable" # NATs subject to publish ping results to 13 | SUBSCRIBE_SUBJECT="network.actions.ping_devices" # NATs subject to subscribe to. The agent runs when a message is receieved 14 | NETBOX_URL="https://yournetbox.instance.com/" # NetBox instance to pull device inventory from 15 | NETBOX_TOKEN="YOUR NETBOX TOKEN" # NetBox API token. Must have at least `read` permission on `dcim/device` 16 | ``` 17 | 18 | ### Start the agent 19 | 20 | ``` 21 | python agents/ping_devices/ping_devices.py 22 | Loaded environment for ping_devices.py 23 | NATs Server: 127.0.0.1:4222 24 | Publishing to: network.devices.reachable 25 | Pulling inventory from NetBox: https://sxtc8225.cloud.netboxapp.com/ 26 | Subscribed to network.actions.ping_devices 27 | ``` -------------------------------------------------------------------------------- /netbox-discovery-quickstart/4_start_network.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -euo pipefail 3 | 4 | # Check if all required environment variables are set 5 | REQUIRED_VARS=("DOCKER_NETWORK" "DOCKER_SUBNET") 6 | 7 | # Create the docker network if it doesn't already exist 8 | if ! docker network inspect "$DOCKER_NETWORK" &>/dev/null; then 9 | echo "Creating Docker network: $DOCKER_NETWORK with subnet: $DOCKER_SUBNET" 10 | docker network create \ 11 | --driver=bridge \ 12 | --subnet="$DOCKER_SUBNET" \ 13 | "$DOCKER_NETWORK" 14 | else 15 | echo "Docker network '$DOCKER_NETWORK' already exists." 16 | fi 17 | 18 | # Check if directory parameter is passed 19 | if [ $# -eq 0 ]; then 20 | echo "Usage: $0 /.clab.yml" 21 | exit 1 22 | fi 23 | 24 | CLAB_FILE="$1" 25 | 26 | # Check if the specified clab file exists 27 | if [ ! -f "$CLAB_FILE" ]; then 28 | echo "Error: File '$CLAB_FILE' does not exist." 29 | exit 1 30 | fi 31 | 32 | # Destroy all existing containerlab labs 33 | echo 34 | echo "--- Destroying all existing labs ---" 35 | echo 36 | 37 | set +e # Temporarily disable exit on error 38 | sudo clab destroy --all --cleanup 39 | DESTROY_EXIT_CODE=$? 40 | set -e # Re-enable exit on error 41 | 42 | if [ $DESTROY_EXIT_CODE -ne 0 ]; then 43 | echo "Warning: No existing labs were destroyed or an error occurred." 44 | fi 45 | 46 | # Starting network 47 | echo 48 | echo "--- Starting network from '$CLAB_FILE' ---" 49 | echo 50 | 51 | sudo clab deploy --topo "$CLAB_FILE" "${@:2}" 52 | -------------------------------------------------------------------------------- /autocon4-workshop/config-templates/prometheus/alerts/httpcheck.yaml: -------------------------------------------------------------------------------- 1 | groups: 2 | - name: httpcheck_alerts 3 | interval: 15s 4 | rules: 5 | # Alert when HTTP check doesn't return 2xx 6 | - alert: WebServer_NotReachable 7 | expr: httpcheck_status{http_url="http://192.168.2.2", http_status_class="2xx"} == 0 8 | labels: 9 | severity: critical 10 | team: workshop 11 | annotations: 12 | summary: "HTTP check failed for {{ $labels.http_url }}" 13 | description: "HTTP check for {{ $labels.http_url }} is not responding with 2xx status." 14 | 15 | # Alert when HTTP check has errors 16 | - alert: WebServer_HttpCheckError 17 | expr: httpcheck_error{http_url="http://192.168.2.2"} == 1 18 | labels: 19 | severity: critical 20 | team: workshop 21 | annotations: 22 | summary: "HTTP check error for {{ $labels.http_url }}" 23 | description: "HTTP check for {{ $labels.http_url }} returned error message: {{ $labels.error_message }}." 24 | 25 | # Alert when no metrics received 26 | - alert: HttpCheck_NoMetricsReceived 27 | expr: | 28 | absent(httpcheck_status) == 1 29 | or 30 | absent(httpcheck_duration_milliseconds) == 1 31 | labels: 32 | severity: critical 33 | team: workshop 34 | annotations: 35 | summary: "HTTP check metrics missing" 36 | description: "Critical: no httpcheck metrics have been received." -------------------------------------------------------------------------------- /autocon3-workshop-guide/sections/Section-3/scripts/2_start_network.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -euo pipefail 3 | 4 | # Check if all required environment variables are set 5 | REQUIRED_VARS=("DOCKER_NETWORK" "DOCKER_SUBNET") 6 | 7 | # Create the docker network if it doesn't already exist 8 | if ! docker network inspect "$DOCKER_NETWORK" &>/dev/null; then 9 | echo "Creating Docker network: $DOCKER_NETWORK with subnet: $DOCKER_SUBNET" 10 | docker network create \ 11 | --driver=bridge \ 12 | --subnet="$DOCKER_SUBNET" \ 13 | "$DOCKER_NETWORK" 14 | else 15 | echo "Docker network '$DOCKER_NETWORK' already exists." 16 | fi 17 | 18 | # Check if directory parameter is passed 19 | if [ $# -eq 0 ]; then 20 | echo "Usage: $0 " 21 | exit 1 22 | fi 23 | 24 | CLAB_FILE="$1" 25 | 26 | # Check if the specified clab file exists 27 | if [ ! -f "$CLAB_FILE" ]; then 28 | echo "Error: File '$CLAB_FILE' does not exist." 29 | exit 1 30 | fi 31 | 32 | # Destroy all existing containerlab labs 33 | echo 34 | echo "--- Destroying all existing labs (errors here are ok) ---" 35 | echo 36 | 37 | set +e # Temporarily disable exit on error 38 | sudo clab destroy --all --cleanup 39 | DESTROY_EXIT_CODE=$? 40 | set -e # Re-enable exit on error 41 | 42 | if [ $DESTROY_EXIT_CODE -ne 0 ]; then 43 | echo "Warning: No existing labs were destroyed or an error occurred." 44 | fi 45 | 46 | # Starting network 47 | echo 48 | echo "--- Starting network from '$CLAB_FILE' ---" 49 | echo 50 | 51 | sudo clab deploy --topo "$CLAB_FILE" "${@:2}" -------------------------------------------------------------------------------- /netbox-diode-webinar/examples/python/1_direct.py: -------------------------------------------------------------------------------- 1 | ''' 2 | ensure DIODE_CLIENT_ID and DIODE_CLIENT_SECRET are set before running this 3 | ''' 4 | 5 | from netboxlabs.diode.sdk import DiodeClient 6 | from netboxlabs.diode.sdk.ingester import ( 7 | Device, 8 | DeviceRole, 9 | DeviceType, 10 | Site, 11 | Entity, 12 | CustomFieldValue, 13 | ) 14 | 15 | 16 | def generate_entities() -> list[Entity]: 17 | ''' generate a list of entitles for return to Diode ''' 18 | entities = [] 19 | 20 | device = Device( 21 | name="PDU 1", 22 | device_type=DeviceType( 23 | manufacturer="APC", 24 | model="7951" 25 | ), 26 | role=DeviceRole( 27 | name="Rack PDU" 28 | ), 29 | site=Site( 30 | name="Sunderland" 31 | ), 32 | custom_fields={ 33 | 'software_version': CustomFieldValue( 34 | text="1.1" 35 | ) 36 | } 37 | ) 38 | 39 | entities.append(Entity(device=device)) 40 | 41 | return entities 42 | 43 | 44 | if __name__ == "__main__": 45 | ''' main function ''' 46 | 47 | entities = generate_entities() 48 | 49 | with DiodeClient( 50 | target="grpc:///diode", 51 | app_name="my-app", 52 | app_version="1", 53 | 54 | ) as client: 55 | try: 56 | response = client.ingest(entities=entities) 57 | print(response) 58 | except Exception as exc: 59 | print(f"\n!! An Exception Happened: {exc}") 60 | -------------------------------------------------------------------------------- /autocon2-workshop/ansible/playbooks/set-ntp.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Configure NTP servers on Nokia SR Linux devices 3 | hosts: sites_denver 4 | gather_facts: false 5 | tasks: 6 | - name: Check and retrieve NTP servers from site custom fields 7 | set_fact: 8 | ntp_servers: "{{ hostvars[inventory_hostname].sites[0].custom_fields.ntp_servers.split(',') | map('trim') | list }}" 9 | when: 10 | - hostvars[inventory_hostname].sites is defined 11 | - hostvars[inventory_hostname].sites[0].custom_fields.ntp_servers is defined 12 | - hostvars[inventory_hostname].sites[0].custom_fields.ntp_servers | trim != '' 13 | 14 | - name: Debug message when no NTP servers are defined 15 | debug: 16 | msg: "No NTP servers defined for the site of {{ inventory_hostname }}. Skipping..." 17 | when: ntp_servers is not defined 18 | 19 | - name: Construct the NTP configuration data 20 | set_fact: 21 | ntp_config: 22 | network-instance: default 23 | admin-state: enable 24 | server: "{{ ntp_servers | map('trim') | list | map('regex_replace', '^(.*)$', '{\"address\":\"\\1\"}') | map('from_json') | list }}" 25 | when: ntp_servers is defined 26 | 27 | - name: Debug message when no NTP servers are defined 28 | debug: 29 | msg: "ntp_config: {{ ntp_config }}" 30 | 31 | - name: Enable NTP and configure servers 32 | nokia.srlinux.config: 33 | update: 34 | - path: /system/ntp 35 | value: "{{ ntp_config }}" 36 | when: ntp_servers is defined -------------------------------------------------------------------------------- /netbox-event-driven-architectures/agents/discover_network/README.md: -------------------------------------------------------------------------------- 1 | # Discover Network Agent 🔍 2 | 3 | By default the Discover Network Agent waits for messages to appear on the `$SUBSCRIBE_SUBJECT` subject and then uses `nmap` to discover devices in the `$SUBNET_CIDR` specified subnet, ignoring IPs in `$IGNORE_IPS` and publishes the devices it finds to the `$PUBLISH_SUBJECT` subject on the message bus. 4 | 5 | ### Configuration 6 | 7 | The agent is configured on start up by the `.env` file in the agent's directory 8 | 9 | ``` 10 | cat agents/discover_network/example.env 11 | NATS_SERVER="127.0.0.1:4222" # NATs server to connect to 12 | PUBLISH_SUBJECT="network.devices" # NATs subject to publish discovered devices to 13 | SUBSCRIBE_SUBJECT="network.actions.discover_network" # NATs subject to subscribe to. The agent runs when a message is receieved. 14 | SUBNET_CIDR="172.20.20.0/24" # Which subnet to scan for devices. 172.20.20.0/24 is the ContainerLab default 15 | IGNORE_IPS="172.20.20.1" # Specify multiple comma separated IPs to ignore. 172.20.20.1 is the default ContainerLab gateway (Docker bridge), so we ignore it 16 | ``` 17 | 18 | ### Start the agent 19 | 20 | ``` 21 | python agents/discover_network/discover_network.py 22 | Loaded environment for discover_network.py 23 | NATs Server: 127.0.0.1:4222 24 | Publishing to subject: network.devices 25 | Monitoring subnet: 172.20.20.0/24 26 | Ignoring IPs: ['172.20.20.1'] 27 | Subscribed to network.actions.discover_network 28 | ``` -------------------------------------------------------------------------------- /autocon2-workshop/3_start_network.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -euo pipefail 3 | 4 | # Check if directory parameter is passed 5 | if [ $# -eq 0 ]; then 6 | echo "Usage: $0 " 7 | exit 1 8 | fi 9 | 10 | NETWORK_DIR="$1" 11 | 12 | # Check if the specified directory exists 13 | if [ ! -d "$NETWORK_DIR" ]; then 14 | echo "Error: Directory '$NETWORK_DIR' does not exist." 15 | exit 1 16 | fi 17 | 18 | TOPOLOGY_FILENAME="autocon2.clab.yml" 19 | TOPOLOGY_FILE_PATH="$NETWORK_DIR/$TOPOLOGY_FILENAME" 20 | 21 | # Check if the topology file exists in the specified directory 22 | if [ ! -f "$TOPOLOGY_FILE_PATH" ]; then 23 | echo "Error: Topology file '$TOPOLOGY_FILENAME' not found in '$NETWORK_DIR'." 24 | exit 1 25 | fi 26 | 27 | # Prompt user for confirmation 28 | #echo 29 | #read -p "This will destroy all existing containerlab labs. Are you sure? (y/n): " confirm 30 | #if [[ "$confirm" != "y" ]]; then 31 | # echo "Aborting." 32 | # exit 0 33 | #fi 34 | 35 | # Destroy all existing containerlab labs 36 | echo 37 | echo "--- Destroying all existing labs ---" 38 | echo 39 | 40 | set +e # Temporarily disable exit on error 41 | sudo clab destroy --all --cleanup 42 | DESTROY_EXIT_CODE=$? 43 | set -e # Re-enable exit on error 44 | 45 | if [ $DESTROY_EXIT_CODE -ne 0 ]; then 46 | echo "Warning: No existing labs were destroyed or an error occurred." 47 | fi 48 | 49 | # Starting network 50 | echo 51 | echo "--- Starting network from '$NETWORK_DIR' ---" 52 | echo 53 | 54 | pushd "$NETWORK_DIR" > /dev/null 55 | sudo clab deploy --topo "$TOPOLOGY_FILENAME" "${@:2}" 56 | popd > /dev/null -------------------------------------------------------------------------------- /netbox-event-driven-architectures/agents/device_alerter/README.md: -------------------------------------------------------------------------------- 1 | # Device Alerter Agent 📢 2 | 3 | By default the Reachability Agent waits for messages to appear on the `$SUBSCRIBE_SUBJECT` subject and then the device reported in the message is not present in the NetBox inventory, the agent publishes a message to Slack. 4 | 5 | ### Configuration 6 | 7 | The agent is configured on start up by the `.env` file in the agent's directory. We assume that you have already created a Slack app. 8 | 9 | ``` 10 | cat agents/device_alerter/example.env 11 | NATS_SERVER="127.0.0.1:4222" # NATs server to connect to 12 | SUBSCRIBE_SUBJECT="network.devices" # NATs subject to subscribe to. The agent runs when a message is receieved 13 | SLACK_TOKEN="YOUR SLACK BOT" # Slack App Token 14 | SLACK_USERNAME="YOUR SLACK BOT USERNAME" # Slack username to publish as 15 | SLACK_CHANNEL="YOUR SLACK CHANNEL" # Slack channel to publish to 16 | NETBOX_URL="https://yournetbox.instance.com/" # NetBox instance to pull device inventory from 17 | NETBOX_TOKEN="YOUR NETBOX TOKEN" # NetBox API token. Must have at least `read` permission on `dcim/device` 18 | ``` 19 | 20 | ### Start the agent 21 | 22 | ``` 23 | python agents/device_alerter/device_alerter.py 24 | Loaded environment for device_alerter.py 25 | NATs Server: 127.0.0.1:4222 26 | Reading inventory from NetBox: https://sxtc8225.cloud.netboxapp.com/ 27 | Writing device alerts to Slack channel: event-driven-webinar with username: Slack Alert Bot 28 | Subscribed to network.devices 29 | ``` -------------------------------------------------------------------------------- /custom-objects-quickstart/1_set_envvars.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | ENV_FILE="environment" 4 | 5 | # Check if the environment file exists 6 | if [ -f "$ENV_FILE" ]; then 7 | echo "Environment file found. Using existing variables." 8 | else 9 | echo "Environment file not found. Generating new variables." 10 | 11 | if [[ -z "${MY_EXTERNAL_IP}" ]]; then 12 | # Attempt to fetch the external IPv4 address 13 | EXTERNAL_IP=$(curl -4 -s ifconfig.me) # Use -4 to ensure IPv4 is returned 14 | # Check if the IP was retrieved successfully 15 | if [ -z "$EXTERNAL_IP" ]; then 16 | echo "Error: Unable to determine external IPv4 address." 17 | exit 1 18 | fi 19 | else 20 | EXTERNAL_IP=${MY_EXTERNAL_IP} 21 | fi 22 | 23 | # Generate new variables 24 | MY_EXTERNAL_IP=$EXTERNAL_IP 25 | NETBOX_PORT="8000" 26 | NETBOX_TOKEN="1234567890" 27 | 28 | # Write variables to the environment file 29 | cat < "$ENV_FILE" 30 | MY_EXTERNAL_IP=$MY_EXTERNAL_IP 31 | NETBOX_PORT=$NETBOX_PORT 32 | NETBOX_TOKEN=$NETBOX_TOKEN 33 | EOF 34 | fi 35 | 36 | # Export variables from the environment file 37 | while IFS='=' read -r key value; do 38 | export "$key=$value" 39 | done < "$ENV_FILE" 40 | 41 | # Debug information to communicate values being used 42 | echo 43 | echo "--- Environment Variables Set ---" 44 | echo "External IP: $MY_EXTERNAL_IP" 45 | echo "NetBox will be deployed at: http://$MY_EXTERNAL_IP:$NETBOX_PORT" 46 | echo "NetBox username: admin" 47 | echo "NetBox password: admin" 48 | echo "NetBox token: $NETBOX_TOKEN" 49 | echo "-----------------------------------" 50 | -------------------------------------------------------------------------------- /CLUS-2024-CISCOU-2039/get_device_details.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Get Device Details From Cisco Catalyst Center 3 | hosts: device_roles_distribution, device_roles_access 4 | gather_facts: no 5 | vars: 6 | username: "devnetuser" 7 | password: "Cisco123!" 8 | 9 | tasks: 10 | - name: Set Custom Fields as Facts for Cisco Catalyst Center host and Device UUID 11 | set_fact: 12 | cisco_catalyst_center: "{{ hostvars[inventory_hostname].custom_fields['cisco_catalyst_center'] }}" 13 | ccc_device_id: "{{ hostvars[inventory_hostname].custom_fields['ccc_device_id'] }}" 14 | 15 | - name: Get Auth Token 16 | uri: 17 | url: "https://{{ cisco_catalyst_center }}/dna/system/api/v1/auth/token" 18 | method: POST 19 | return_content: yes 20 | validate_certs: no 21 | headers: 22 | Content-Type: "application/json" 23 | Authorization: "Basic {{ ('%s:%s' | format(username, password)) | b64encode }}" 24 | body_format: json 25 | register: login_response 26 | delegate_to: localhost 27 | 28 | - name: Get Device Details 29 | uri: 30 | url: "https://{{ cisco_catalyst_center }}/dna/intent/api/v1/network-device/{{ ccc_device_id }}" 31 | method: GET 32 | return_content: yes 33 | validate_certs: no 34 | headers: 35 | Content-Type: "application/json" 36 | x-auth-token: "{{ login_response.json['Token'] }}" 37 | register: device_details 38 | delegate_to: localhost 39 | 40 | - name: Print Device Details 41 | debug: 42 | var: device_details.json 43 | delegate_to: localhost -------------------------------------------------------------------------------- /netbox-ansible-cisco-cc/get_device_details.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Get Device Details From Cisco Catalyst Center 3 | hosts: device_roles_distribution, device_roles_access 4 | gather_facts: no 5 | vars: 6 | username: "devnetuser" 7 | password: "Cisco123!" 8 | 9 | tasks: 10 | - name: Set Custom Fields as Facts for Cisco Catalyst Center host and Device UUID 11 | set_fact: 12 | cisco_catalyst_center: "{{ hostvars[inventory_hostname].custom_fields['cisco_catalyst_center'] }}" 13 | ccc_device_id: "{{ hostvars[inventory_hostname].custom_fields['ccc_device_id'] }}" 14 | 15 | - name: Get Auth Token 16 | uri: 17 | url: "https://{{ cisco_catalyst_center }}/dna/system/api/v1/auth/token" 18 | method: POST 19 | return_content: yes 20 | validate_certs: no 21 | headers: 22 | Content-Type: "application/json" 23 | Authorization: "Basic {{ ('%s:%s' | format(username, password)) | b64encode }}" 24 | body_format: json 25 | register: login_response 26 | delegate_to: localhost 27 | 28 | - name: Get Device Details 29 | uri: 30 | url: "https://{{ cisco_catalyst_center }}/dna/intent/api/v1/network-device/{{ ccc_device_id }}" 31 | method: GET 32 | return_content: yes 33 | validate_certs: no 34 | headers: 35 | Content-Type: "application/json" 36 | x-auth-token: "{{ login_response.json['Token'] }}" 37 | register: device_details 38 | delegate_to: localhost 39 | 40 | - name: Print Device Details 41 | debug: 42 | var: device_details.json 43 | delegate_to: localhost -------------------------------------------------------------------------------- /CLUS-2024-CISCOU-2039/get_device_config.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Get Device Configurations From Cisco Catalyst Center 3 | hosts: device_roles_distribution, device_roles_access 4 | gather_facts: no 5 | vars: 6 | username: "devnetuser" 7 | password: "Cisco123!" 8 | 9 | tasks: 10 | - name: Set Custom Fields as Facts for Cisco Catalyst Center host and Device UUID 11 | set_fact: 12 | cisco_catalyst_center: "{{ hostvars[inventory_hostname].custom_fields['cisco_catalyst_center'] }}" 13 | ccc_device_id: "{{ hostvars[inventory_hostname].custom_fields['ccc_device_id'] }}" 14 | 15 | - name: Get Auth Token 16 | uri: 17 | url: "https://{{ cisco_catalyst_center }}/dna/system/api/v1/auth/token" 18 | method: POST 19 | return_content: yes 20 | validate_certs: no 21 | headers: 22 | Content-Type: "application/json" 23 | Authorization: "Basic {{ ('%s:%s' | format(username, password)) | b64encode }}" 24 | body_format: json 25 | register: login_response 26 | delegate_to: localhost 27 | 28 | - name: Get Device Config 29 | uri: 30 | url: "https://{{ cisco_catalyst_center }}/dna/intent/api/v1/network-device/{{ ccc_device_id }}/config" 31 | method: GET 32 | return_content: yes 33 | validate_certs: no 34 | headers: 35 | Content-Type: "application/json" 36 | x-auth-token: "{{ login_response.json['Token'] }}" 37 | register: device_config 38 | delegate_to: localhost 39 | 40 | - name: Print Device Config 41 | debug: 42 | var: device_config.json 43 | delegate_to: localhost -------------------------------------------------------------------------------- /netbox-ansible-cisco-cc/get_device_config.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Get Device Configurations From Cisco Catalyst Center 3 | hosts: device_roles_distribution, device_roles_access 4 | gather_facts: no 5 | vars: 6 | username: "devnetuser" 7 | password: "Cisco123!" 8 | 9 | tasks: 10 | - name: Set Custom Fields as Facts for Cisco Catalyst Center host and Device UUID 11 | set_fact: 12 | cisco_catalyst_center: "{{ hostvars[inventory_hostname].custom_fields['cisco_catalyst_center'] }}" 13 | ccc_device_id: "{{ hostvars[inventory_hostname].custom_fields['ccc_device_id'] }}" 14 | 15 | - name: Get Auth Token 16 | uri: 17 | url: "https://{{ cisco_catalyst_center }}/dna/system/api/v1/auth/token" 18 | method: POST 19 | return_content: yes 20 | validate_certs: no 21 | headers: 22 | Content-Type: "application/json" 23 | Authorization: "Basic {{ ('%s:%s' | format(username, password)) | b64encode }}" 24 | body_format: json 25 | register: login_response 26 | delegate_to: localhost 27 | 28 | - name: Get Device Config 29 | uri: 30 | url: "https://{{ cisco_catalyst_center }}/dna/intent/api/v1/network-device/{{ ccc_device_id }}/config" 31 | method: GET 32 | return_content: yes 33 | validate_certs: no 34 | headers: 35 | Content-Type: "application/json" 36 | x-auth-token: "{{ login_response.json['Token'] }}" 37 | register: device_config 38 | delegate_to: localhost 39 | 40 | - name: Print Device Config 41 | debug: 42 | var: device_config.json 43 | delegate_to: localhost -------------------------------------------------------------------------------- /netbox-pyats-webinar/ospf_neighbor_table.py: -------------------------------------------------------------------------------- 1 | # filename: ospf_neighbor_table.py 2 | 3 | # Description: Script to get and print OSPF Neighbor Table for a given device. 4 | # Import the necessary libraries 5 | from genie.testbed import load 6 | from prettytable import PrettyTable 7 | 8 | # Function to get and print OSPF Neighbor Table for a given device 9 | def get_ospf_neighbor_table(device_name: str, testbed_file: str = 'testbed.yaml') -> None: 10 | """ 11 | Function to get and print OSPF Neighbor Table for a given device. 12 | :param device_name: Name of the device 13 | :param testbed_file: Path to the testbed file 14 | :return: None 15 | """ 16 | # Load the testbed 17 | testbed = load(testbed_file) 18 | 19 | # Get the device 20 | device = testbed.devices[device_name] 21 | 22 | # Connect to the device 23 | device.connect() 24 | 25 | # Parse the 'show ip ospf neighbor' command 26 | data = device.parse('show ip ospf neighbor') 27 | 28 | # Define the table 29 | table = PrettyTable() 30 | table.field_names = ["Interface", "Neighbor", "Address", "State"] 31 | 32 | # Iterate over the interfaces and neighbors 33 | for interface, details in data['interfaces'].items(): 34 | for neighbor, neighbor_details in details['neighbors'].items(): 35 | # Add a row to the table 36 | table.add_row([interface, neighbor, neighbor_details['address'], neighbor_details['state']]) 37 | 38 | # Print the table for the device 39 | print(f"OSPF Neighbor Table for {device.name}") 40 | print(table) 41 | 42 | # Call the function with the device name 43 | get_ospf_neighbor_table('CSR1') -------------------------------------------------------------------------------- /autocon2-workshop/network/1_the_hard_way/srl1.cfg: -------------------------------------------------------------------------------- 1 | # Configure interface to other router 2 | set / interface ethernet-1/1 admin-state enable 3 | set / interface ethernet-1/1 subinterface 0 4 | set / interface ethernet-1/1 subinterface 0 ipv4 5 | set / interface ethernet-1/1 subinterface 0 ipv4 admin-state enable 6 | set / interface ethernet-1/1 subinterface 0 ipv4 address 192.168.0.1/30 7 | 8 | # Add interfaces to the default network-instance 9 | set / network-instance default 10 | set / network-instance default interface ethernet-1/1.0 11 | 12 | # SNMPv3 Configuration with Privacy 13 | set /system snmp network-instance mgmt admin-state enable 14 | 15 | ## Create Access Group 16 | set /system snmp access-group ag1 17 | set /system snmp access-group ag1 admin-state enable 18 | set /system snmp access-group ag1 security-level auth-priv 19 | 20 | ## Create Security Entry and User 21 | set /system snmp access-group ag1 security-entry se1 22 | set /system snmp access-group ag1 security-entry se1 user snmpuser 23 | 24 | ## Authentication Settings 25 | set /system snmp access-group ag1 security-entry se1 user snmpuser authentication protocol hmac-sha1-96 26 | set /system snmp access-group ag1 security-entry se1 user snmpuser authentication password snmppassword 27 | 28 | ## Privacy Settings 29 | set /system snmp access-group ag1 security-entry se1 user snmpuser privacy protocol cfb128-aes-128 30 | set /system snmp access-group ag1 security-entry se1 user snmpuser privacy password snmpprivpassword 31 | 32 | # Enable LLDP 33 | set / system lldp admin-state enable 34 | 35 | # Set correct hostname 36 | set / system name host-name clab-autocon2-srl1 -------------------------------------------------------------------------------- /autocon2-workshop/network/1_the_hard_way/srl2.cfg: -------------------------------------------------------------------------------- 1 | # Configure interface to other router 2 | set / interface ethernet-1/1 admin-state enable 3 | set / interface ethernet-1/1 subinterface 0 4 | set / interface ethernet-1/1 subinterface 0 ipv4 5 | set / interface ethernet-1/1 subinterface 0 ipv4 admin-state enable 6 | set / interface ethernet-1/1 subinterface 0 ipv4 address 192.168.0.2/30 7 | 8 | # Add interfaces to the default network-instance 9 | set / network-instance default 10 | set / network-instance default interface ethernet-1/1.0 11 | 12 | # SNMPv3 Configuration with Privacy 13 | set /system snmp network-instance mgmt admin-state enable 14 | 15 | ## Create Access Group 16 | set /system snmp access-group ag1 17 | set /system snmp access-group ag1 admin-state enable 18 | set /system snmp access-group ag1 security-level auth-priv 19 | 20 | ## Create Security Entry and User 21 | set /system snmp access-group ag1 security-entry se1 22 | set /system snmp access-group ag1 security-entry se1 user snmpuser 23 | 24 | ## Authentication Settings 25 | set /system snmp access-group ag1 security-entry se1 user snmpuser authentication protocol hmac-sha1-96 26 | set /system snmp access-group ag1 security-entry se1 user snmpuser authentication password snmppassword 27 | 28 | ## Privacy Settings 29 | set /system snmp access-group ag1 security-entry se1 user snmpuser privacy protocol cfb128-aes-128 30 | set /system snmp access-group ag1 security-entry se1 user snmpuser privacy password snmpprivpassword 31 | 32 | # Enable LLDP 33 | set / system lldp admin-state enable 34 | 35 | # Set correct hostname 36 | set / system name host-name clab-autocon2-srl2 -------------------------------------------------------------------------------- /netbox-discovery-quickstart/1_set_envvars.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | ENV_FILE="environment" 4 | 5 | # Check if the environment file exists 6 | if [ -f "$ENV_FILE" ]; then 7 | echo "Environment file found. Using existing variables." 8 | else 9 | echo "Environment file not found. Generating new variables." 10 | 11 | if [[ -z "${MY_EXTERNAL_IP}" ]]; then 12 | # Attempt to fetch the external IPv4 address 13 | EXTERNAL_IP=$(curl -4 -s ifconfig.me) # Use -4 to ensure IPv4 is returned 14 | # Check if the IP was retrieved successfully 15 | if [ -z "$EXTERNAL_IP" ]; then 16 | echo "Error: Unable to determine external IPv4 address." 17 | exit 1 18 | fi 19 | else 20 | EXTERNAL_IP=${MY_EXTERNAL_IP} 21 | fi 22 | 23 | # Generate new variables 24 | MY_EXTERNAL_IP=$EXTERNAL_IP 25 | NETBOX_PORT="8000" 26 | DOCKER_SUBNET="172.24.0.0/24" 27 | DOCKER_NETWORK="discovery-quickstart" 28 | 29 | # Write variables to the environment file 30 | cat < "$ENV_FILE" 31 | MY_EXTERNAL_IP=$MY_EXTERNAL_IP 32 | NETBOX_PORT=$NETBOX_PORT 33 | DOCKER_SUBNET=$DOCKER_SUBNET 34 | DOCKER_NETWORK=$DOCKER_NETWORK 35 | EOF 36 | fi 37 | 38 | # Export variables from the environment file 39 | while IFS='=' read -r key value; do 40 | export "$key=$value" 41 | done < "$ENV_FILE" 42 | 43 | # Debug information to communicate values being used 44 | echo 45 | echo "--- Environment Variables Set ---" 46 | echo "External IP: $MY_EXTERNAL_IP" 47 | echo "NetBox will be deployed at: http://$MY_EXTERNAL_IP:$NETBOX_PORT" 48 | echo "Docker subnet: $DOCKER_SUBNET" 49 | echo "Docker network: $DOCKER_NETWORK" 50 | echo "-----------------------------------" 51 | -------------------------------------------------------------------------------- /autocon2-workshop/network/6.1_assurance/srl1.cfg: -------------------------------------------------------------------------------- 1 | # Configure interface to other router 2 | set / interface ethernet-1/1 admin-state enable 3 | set / interface ethernet-1/1 subinterface 0 4 | set / interface ethernet-1/1 subinterface 0 ipv4 5 | set / interface ethernet-1/1 subinterface 0 ipv4 admin-state enable 6 | set / interface ethernet-1/1 subinterface 0 ipv4 address 192.168.0.0/31 7 | 8 | # Add interfaces to the default network-instance 9 | set / network-instance default 10 | set / network-instance default interface ethernet-1/1.0 11 | 12 | # SNMPv3 Configuration with Privacy 13 | set /system snmp network-instance mgmt admin-state enable 14 | 15 | ## Create Access Group 16 | set /system snmp access-group ag1 17 | set /system snmp access-group ag1 admin-state enable 18 | set /system snmp access-group ag1 security-level auth-priv 19 | 20 | ## Create Security Entry and User 21 | set /system snmp access-group ag1 security-entry se1 22 | set /system snmp access-group ag1 security-entry se1 user snmpuser 23 | 24 | ## Authentication Settings 25 | set /system snmp access-group ag1 security-entry se1 user snmpuser authentication protocol hmac-sha1-96 26 | set /system snmp access-group ag1 security-entry se1 user snmpuser authentication password snmppassword 27 | 28 | ## Privacy Settings 29 | set /system snmp access-group ag1 security-entry se1 user snmpuser privacy protocol cfb128-aes-128 30 | set /system snmp access-group ag1 security-entry se1 user snmpuser privacy password snmpprivpassword 31 | 32 | # Enable LLDP 33 | set / system lldp admin-state enable 34 | 35 | # Set correct hostname 36 | set / system name host-name clab-autocon2-srlOOPS -------------------------------------------------------------------------------- /autocon2-workshop/network/6.1_assurance/srl2.cfg: -------------------------------------------------------------------------------- 1 | # Configure interface to other router 2 | set / interface ethernet-1/1 admin-state enable 3 | set / interface ethernet-1/1 subinterface 0 4 | set / interface ethernet-1/1 subinterface 0 ipv4 5 | set / interface ethernet-1/1 subinterface 0 ipv4 admin-state enable 6 | set / interface ethernet-1/1 subinterface 0 ipv4 address 192.168.0.1/31 7 | 8 | # Add interfaces to the default network-instance 9 | set / network-instance default 10 | set / network-instance default interface ethernet-1/1.0 11 | 12 | # SNMPv3 Configuration with Privacy 13 | set /system snmp network-instance mgmt admin-state enable 14 | 15 | ## Create Access Group 16 | set /system snmp access-group ag1 17 | set /system snmp access-group ag1 admin-state enable 18 | set /system snmp access-group ag1 security-level auth-priv 19 | 20 | ## Create Security Entry and User 21 | set /system snmp access-group ag1 security-entry se1 22 | set /system snmp access-group ag1 security-entry se1 user snmpuser 23 | 24 | ## Authentication Settings 25 | set /system snmp access-group ag1 security-entry se1 user snmpuser authentication protocol hmac-sha1-96 26 | set /system snmp access-group ag1 security-entry se1 user snmpuser authentication password snmppassword 27 | 28 | ## Privacy Settings 29 | set /system snmp access-group ag1 security-entry se1 user snmpuser privacy protocol cfb128-aes-128 30 | set /system snmp access-group ag1 security-entry se1 user snmpuser privacy password snmpprivpassword 31 | 32 | # Enable LLDP 33 | set / system lldp admin-state enable 34 | 35 | # Set correct hostname 36 | set / system name host-name clab-autocon2-srlNOOOOO -------------------------------------------------------------------------------- /netbox-diode-webinar/examples/go/go.sum: -------------------------------------------------------------------------------- 1 | github.com/envoyproxy/protoc-gen-validate v1.0.4 h1:gVPz/FMfvh57HdSJQyvBtF00j8JU4zdyUgIUNhlgg0A= 2 | github.com/envoyproxy/protoc-gen-validate v1.0.4/go.mod h1:qys6tmnRsYrQqIhm2bvKZH4Blx/1gTIZ2UKVY1M+Yew= 3 | github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= 4 | github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= 5 | github.com/netboxlabs/diode-sdk-go v1.1.0 h1:+W2VwTFoofgG8CZcwQ1x0EcmDo9yFbyPwAH4gaKbswc= 6 | github.com/netboxlabs/diode-sdk-go v1.1.0/go.mod h1:UNUmF3TJrvPVUutjKqMPpcRPm29myBjgc5c3CjHduis= 7 | golang.org/x/net v0.38.0 h1:vRMAPTMaeGqVhG5QyLJHqNDwecKTomGeqbnfZyKlBI8= 8 | golang.org/x/net v0.38.0/go.mod h1:ivrbrMbzFq5J41QOQh0siUuly180yBYtLp+CKbEaFx8= 9 | golang.org/x/sys v0.31.0 h1:ioabZlmFYtWhL+TRYpcnNlLwhyxaM9kWTDEmfnprqik= 10 | golang.org/x/sys v0.31.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k= 11 | golang.org/x/text v0.23.0 h1:D71I7dUrlY+VX0gQShAThNGHFxZ13dGLBHQLVl1mJlY= 12 | golang.org/x/text v0.23.0/go.mod h1:/BLNzu4aZCJ1+kcD0DNRotWKage4q2rGVAg4o22unh4= 13 | google.golang.org/genproto/googleapis/rpc v0.0.0-20240227224415-6ceb2ff114de h1:cZGRis4/ot9uVm639a+rHCUaG0JJHEsdyzSQTMX+suY= 14 | google.golang.org/genproto/googleapis/rpc v0.0.0-20240227224415-6ceb2ff114de/go.mod h1:H4O17MA/PE9BsGx3w+a+W2VOLLD1Qf7oJneAoU6WktY= 15 | google.golang.org/grpc v1.63.2 h1:MUeiw1B2maTVZthpU5xvASfTh3LDbxHd6IJ6QQVU+xM= 16 | google.golang.org/grpc v1.63.2/go.mod h1:WAX/8DgncnokcFUldAxq7GeB5DXHDbMF+lLvDomNkRA= 17 | google.golang.org/protobuf v1.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGmI= 18 | google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= 19 | -------------------------------------------------------------------------------- /autocon3-workshop-guide/sections/Section-3/scripts/3_start_network_discovery.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -euo pipefail 3 | 4 | # Check if all required environment variables are set 5 | REQUIRED_VARS=("INFRA_IP" "DOCKER_SUBNET" "DOCKER_NETWORK" "DIODE_PORT" "DIODE_CLIENT_SECRET" "DIODE_CLIENT_ID") 6 | 7 | for var in "${REQUIRED_VARS[@]}"; do 8 | if [ -z "${!var:-}" ]; then 9 | echo "Error: Required environment variable '$var' is not set." 10 | exit 0 11 | fi 12 | done 13 | 14 | WORKING_DIR="network_discovery" 15 | 16 | # Remove config directory if it exists 17 | sudo rm -fr ${WORKING_DIR} 18 | 19 | # Recreate it and pushd in 20 | mkdir ${WORKING_DIR} 21 | pushd ${WORKING_DIR} 22 | 23 | echo 24 | echo "--- Writing agent config ---" 25 | echo 26 | 27 | cat < agent.yaml 28 | orb: 29 | config_manager: 30 | active: local 31 | backends: 32 | network_discovery: 33 | common: 34 | diode: 35 | target: grpc://${INFRA_IP}:${DIODE_PORT}/diode 36 | client_id: ${DIODE_CLIENT_ID} 37 | client_secret: ${DIODE_CLIENT_SECRET} 38 | agent_name: network-discovery 39 | policies: 40 | network_discovery: 41 | policy_1: 42 | config: 43 | timeout: 5 44 | scope: 45 | targets: [${DOCKER_SUBNET}] 46 | EOF 47 | 48 | cat agent.yaml 49 | 50 | echo 51 | echo "--- Start the agent ---" 52 | echo 53 | 54 | docker run -v $(pwd):/opt/orb/ \ 55 | -e DIODE_CLIENT_SECRET=${DIODE_CLIENT_SECRET} \ 56 | --network ${DOCKER_NETWORK} \ 57 | mrmrcoleman/orb-agent:with_ccc run -c /opt/orb/agent.yaml 58 | 59 | # End 60 | popd 61 | 62 | echo "Now go and check out NetBox Assurance: http://${INFRA_IP}:${NETBOX_PORT}/netbox/" -------------------------------------------------------------------------------- /autocon2-workshop/network/4.1_discovery_reconciliation/srl1.cfg: -------------------------------------------------------------------------------- 1 | # Configure interface to other router 2 | set / interface ethernet-1/1 admin-state enable 3 | set / interface ethernet-1/1 subinterface 0 4 | set / interface ethernet-1/1 subinterface 0 ipv4 5 | set / interface ethernet-1/1 subinterface 0 ipv4 admin-state enable 6 | set / interface ethernet-1/1 subinterface 0 ipv4 address 192.168.0.0/31 7 | 8 | # Add interfaces to the default network-instance 9 | set / network-instance default 10 | set / network-instance default interface ethernet-1/1.0 11 | 12 | # SNMPv3 Configuration with Privacy 13 | set /system snmp network-instance mgmt admin-state enable 14 | 15 | ## Create Access Group 16 | set /system snmp access-group ag1 17 | set /system snmp access-group ag1 admin-state enable 18 | set /system snmp access-group ag1 security-level auth-priv 19 | 20 | ## Create Security Entry and User 21 | set /system snmp access-group ag1 security-entry se1 22 | set /system snmp access-group ag1 security-entry se1 user snmpuser 23 | 24 | ## Authentication Settings 25 | set /system snmp access-group ag1 security-entry se1 user snmpuser authentication protocol hmac-sha1-96 26 | set /system snmp access-group ag1 security-entry se1 user snmpuser authentication password snmppassword 27 | 28 | ## Privacy Settings 29 | set /system snmp access-group ag1 security-entry se1 user snmpuser privacy protocol cfb128-aes-128 30 | set /system snmp access-group ag1 security-entry se1 user snmpuser privacy password snmpprivpassword 31 | 32 | # Enable LLDP 33 | set / system lldp admin-state enable 34 | 35 | # Set correct hostname 36 | set / system name host-name clab-autocon2-srl1 -------------------------------------------------------------------------------- /autocon2-workshop/network/4.1_discovery_reconciliation/srl2.cfg: -------------------------------------------------------------------------------- 1 | # Configure interface to other router 2 | set / interface ethernet-1/1 admin-state enable 3 | set / interface ethernet-1/1 subinterface 0 4 | set / interface ethernet-1/1 subinterface 0 ipv4 5 | set / interface ethernet-1/1 subinterface 0 ipv4 admin-state enable 6 | set / interface ethernet-1/1 subinterface 0 ipv4 address 192.168.0.1/31 7 | 8 | # Add interfaces to the default network-instance 9 | set / network-instance default 10 | set / network-instance default interface ethernet-1/1.0 11 | 12 | # SNMPv3 Configuration with Privacy 13 | set /system snmp network-instance mgmt admin-state enable 14 | 15 | ## Create Access Group 16 | set /system snmp access-group ag1 17 | set /system snmp access-group ag1 admin-state enable 18 | set /system snmp access-group ag1 security-level auth-priv 19 | 20 | ## Create Security Entry and User 21 | set /system snmp access-group ag1 security-entry se1 22 | set /system snmp access-group ag1 security-entry se1 user snmpuser 23 | 24 | ## Authentication Settings 25 | set /system snmp access-group ag1 security-entry se1 user snmpuser authentication protocol hmac-sha1-96 26 | set /system snmp access-group ag1 security-entry se1 user snmpuser authentication password snmppassword 27 | 28 | ## Privacy Settings 29 | set /system snmp access-group ag1 security-entry se1 user snmpuser privacy protocol cfb128-aes-128 30 | set /system snmp access-group ag1 security-entry se1 user snmpuser privacy password snmpprivpassword 31 | 32 | # Enable LLDP 33 | set / system lldp admin-state enable 34 | 35 | # Set correct hostname 36 | set / system name host-name clab-autocon2-srl2 -------------------------------------------------------------------------------- /autocon2-workshop/network/4.2_discovery_reconciliation/srl1.cfg: -------------------------------------------------------------------------------- 1 | # Configure interface to other router 2 | set / interface ethernet-1/1 admin-state disable 3 | set / interface ethernet-1/1 subinterface 0 4 | set / interface ethernet-1/1 subinterface 0 ipv4 5 | set / interface ethernet-1/1 subinterface 0 ipv4 admin-state disable 6 | set / interface ethernet-1/1 subinterface 0 ipv4 address 192.168.0.0/31 7 | 8 | # Add interfaces to the default network-instance 9 | set / network-instance default 10 | set / network-instance default interface ethernet-1/1.0 11 | 12 | # SNMPv3 Configuration with Privacy 13 | set /system snmp network-instance mgmt admin-state enable 14 | 15 | ## Create Access Group 16 | set /system snmp access-group ag1 17 | set /system snmp access-group ag1 admin-state enable 18 | set /system snmp access-group ag1 security-level auth-priv 19 | 20 | ## Create Security Entry and User 21 | set /system snmp access-group ag1 security-entry se1 22 | set /system snmp access-group ag1 security-entry se1 user snmpuser 23 | 24 | ## Authentication Settings 25 | set /system snmp access-group ag1 security-entry se1 user snmpuser authentication protocol hmac-sha1-96 26 | set /system snmp access-group ag1 security-entry se1 user snmpuser authentication password snmppassword 27 | 28 | ## Privacy Settings 29 | set /system snmp access-group ag1 security-entry se1 user snmpuser privacy protocol cfb128-aes-128 30 | set /system snmp access-group ag1 security-entry se1 user snmpuser privacy password snmpprivpassword 31 | 32 | # Enable LLDP 33 | set / system lldp admin-state enable 34 | 35 | # Set correct hostname 36 | set / system name host-name clab-autocon2-srl1 -------------------------------------------------------------------------------- /autocon2-workshop/network/4.2_discovery_reconciliation/srl2.cfg: -------------------------------------------------------------------------------- 1 | # Configure interface to other router 2 | set / interface ethernet-1/1 admin-state enable 3 | set / interface ethernet-1/1 subinterface 0 4 | set / interface ethernet-1/1 subinterface 0 ipv4 5 | set / interface ethernet-1/1 subinterface 0 ipv4 admin-state enable 6 | set / interface ethernet-1/1 subinterface 0 ipv4 address 192.168.0.1/31 7 | 8 | # Add interfaces to the default network-instance 9 | set / network-instance default 10 | set / network-instance default interface ethernet-1/1.0 11 | 12 | # SNMPv3 Configuration with Privacy 13 | set /system snmp network-instance mgmt admin-state enable 14 | 15 | ## Create Access Group 16 | set /system snmp access-group ag1 17 | set /system snmp access-group ag1 admin-state enable 18 | set /system snmp access-group ag1 security-level auth-priv 19 | 20 | ## Create Security Entry and User 21 | set /system snmp access-group ag1 security-entry se1 22 | set /system snmp access-group ag1 security-entry se1 user snmpuser 23 | 24 | ## Authentication Settings 25 | set /system snmp access-group ag1 security-entry se1 user snmpuser authentication protocol hmac-sha1-96 26 | set /system snmp access-group ag1 security-entry se1 user snmpuser authentication password snmppassword 27 | 28 | ## Privacy Settings 29 | set /system snmp access-group ag1 security-entry se1 user snmpuser privacy protocol cfb128-aes-128 30 | set /system snmp access-group ag1 security-entry se1 user snmpuser privacy password snmpprivpassword 31 | 32 | # Enable LLDP 33 | set / system lldp admin-state enable 34 | 35 | # Set correct hostname 36 | set / system name host-name clab-autocon2-srl2 -------------------------------------------------------------------------------- /autocon2-workshop/network/7_automated_network_changes/srl1.cfg: -------------------------------------------------------------------------------- 1 | # Configure interface to other router 2 | set / interface ethernet-1/1 admin-state enable 3 | set / interface ethernet-1/1 subinterface 0 4 | set / interface ethernet-1/1 subinterface 0 ipv4 5 | set / interface ethernet-1/1 subinterface 0 ipv4 admin-state enable 6 | set / interface ethernet-1/1 subinterface 0 ipv4 address 192.168.0.0/31 7 | 8 | # Add interfaces to the default network-instance 9 | set / network-instance default 10 | set / network-instance default interface ethernet-1/1.0 11 | 12 | # SNMPv3 Configuration with Privacy 13 | set /system snmp network-instance mgmt admin-state enable 14 | 15 | ## Create Access Group 16 | set /system snmp access-group ag1 17 | set /system snmp access-group ag1 admin-state enable 18 | set /system snmp access-group ag1 security-level auth-priv 19 | 20 | ## Create Security Entry and User 21 | set /system snmp access-group ag1 security-entry se1 22 | set /system snmp access-group ag1 security-entry se1 user snmpuser 23 | 24 | ## Authentication Settings 25 | set /system snmp access-group ag1 security-entry se1 user snmpuser authentication protocol hmac-sha1-96 26 | set /system snmp access-group ag1 security-entry se1 user snmpuser authentication password snmppassword 27 | 28 | ## Privacy Settings 29 | set /system snmp access-group ag1 security-entry se1 user snmpuser privacy protocol cfb128-aes-128 30 | set /system snmp access-group ag1 security-entry se1 user snmpuser privacy password snmpprivpassword 31 | 32 | # Enable LLDP 33 | set / system lldp admin-state enable 34 | 35 | # Set correct hostname 36 | set / system name host-name clab-autocon2-srl1 -------------------------------------------------------------------------------- /autocon2-workshop/network/7_automated_network_changes/srl2.cfg: -------------------------------------------------------------------------------- 1 | # Configure interface to other router 2 | set / interface ethernet-1/1 admin-state enable 3 | set / interface ethernet-1/1 subinterface 0 4 | set / interface ethernet-1/1 subinterface 0 ipv4 5 | set / interface ethernet-1/1 subinterface 0 ipv4 admin-state enable 6 | set / interface ethernet-1/1 subinterface 0 ipv4 address 192.168.0.1/31 7 | 8 | # Add interfaces to the default network-instance 9 | set / network-instance default 10 | set / network-instance default interface ethernet-1/1.0 11 | 12 | # SNMPv3 Configuration with Privacy 13 | set /system snmp network-instance mgmt admin-state enable 14 | 15 | ## Create Access Group 16 | set /system snmp access-group ag1 17 | set /system snmp access-group ag1 admin-state enable 18 | set /system snmp access-group ag1 security-level auth-priv 19 | 20 | ## Create Security Entry and User 21 | set /system snmp access-group ag1 security-entry se1 22 | set /system snmp access-group ag1 security-entry se1 user snmpuser 23 | 24 | ## Authentication Settings 25 | set /system snmp access-group ag1 security-entry se1 user snmpuser authentication protocol hmac-sha1-96 26 | set /system snmp access-group ag1 security-entry se1 user snmpuser authentication password snmppassword 27 | 28 | ## Privacy Settings 29 | set /system snmp access-group ag1 security-entry se1 user snmpuser privacy protocol cfb128-aes-128 30 | set /system snmp access-group ag1 security-entry se1 user snmpuser privacy password snmpprivpassword 31 | 32 | # Enable LLDP 33 | set / system lldp admin-state enable 34 | 35 | # Set correct hostname 36 | set / system name host-name clab-autocon2-srl2 -------------------------------------------------------------------------------- /netbox-discovery-quickstart/5_start_network_discovery.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -euo pipefail 3 | 4 | # Check if all required environment variables are set 5 | REQUIRED_VARS=("MY_EXTERNAL_IP" "DOCKER_SUBNET" "DOCKER_NETWORK" "NETBOX_PORT" "DIODE_CLIENT_ID" "DIODE_CLIENT_SECRET") 6 | 7 | for var in "${REQUIRED_VARS[@]}"; do 8 | if [ -z "${!var:-}" ]; then 9 | echo "Error: Required environment variable '$var' is not set." 10 | exit 0 11 | fi 12 | done 13 | 14 | WORKING_DIR="network_discovery" 15 | 16 | # Remove config directory if it exists 17 | sudo rm -fr ${WORKING_DIR} 18 | 19 | # Recreate it and pushd in 20 | mkdir ${WORKING_DIR} 21 | pushd ${WORKING_DIR} 22 | 23 | echo 24 | echo "--- Writing agent config ---" 25 | echo 26 | 27 | cat < agent.yaml 28 | orb: 29 | config_manager: 30 | active: local 31 | backends: 32 | network_discovery: 33 | common: 34 | diode: 35 | target: grpc://${MY_EXTERNAL_IP}:8080/diode 36 | client_id: ${DIODE_CLIENT_ID} 37 | client_secret: ${DIODE_CLIENT_SECRET} 38 | agent_name: agent1 39 | policies: 40 | network_discovery: 41 | loopback_policy: 42 | config: 43 | scope: 44 | targets: 45 | - ${DOCKER_SUBNET} 46 | EOF 47 | 48 | cat agent.yaml 49 | 50 | echo 51 | echo "--- Start the agent ---" 52 | echo 53 | 54 | docker run -v $(pwd):/opt/orb/ \ 55 | -e DIODE_CLIENT_ID=${DIODE_CLIENT_ID} \ 56 | -e DIODE_CLIENT_SECRET=${DIODE_CLIENT_SECRET} \ 57 | --network ${DOCKER_NETWORK} \ 58 | netboxlabs/orb-agent:latest run -c /opt/orb/agent.yaml 59 | 60 | # End 61 | popd 62 | 63 | echo "Now go and check the discovered IPs in NetBox: http://${MY_EXTERNAL_IP}:${NETBOX_PORT}/ipam/ip-addresses/" -------------------------------------------------------------------------------- /.github/workflows/build_readme.yaml: -------------------------------------------------------------------------------- 1 | name: Learning - template generator 2 | 3 | on: 4 | # Allow us to fire it manually 5 | workflow_dispatch: 6 | # Allow us to regenerate the templates when the develop branch is updated 7 | # Daily at 3am 8 | schedule: 9 | # 7 minutes past the hour 10 | - cron: '* 3 * * *' 11 | push: 12 | branches: 13 | - 'develop' 14 | paths: 15 | - '.learning-meta/**' 16 | # Regenerate the templates when a new release is published 17 | release: 18 | types: [published] 19 | 20 | concurrency: 21 | group: ${{ github.workflow }} 22 | cancel-in-progress: false 23 | 24 | jobs: 25 | generate_templates: 26 | permissions: 27 | contents: write 28 | pull-requests: read 29 | runs-on: ubuntu-latest 30 | steps: 31 | - uses: actions/checkout@v4 32 | with: 33 | ref: develop 34 | token: ${{ secrets.ORB_CI_GH_TOKEN }} 35 | - name: Setup Python 36 | uses: actions/setup-python@v5 37 | with: 38 | python-version: 3.11 39 | cache: 'pip' 40 | cache-dependency-path: '.learning-meta/requirements.txt' 41 | - name: Install dependencies 42 | run: | 43 | python -m pip install --upgrade pip 44 | pip install -r .learning-meta/requirements.txt 45 | - name: Generate from templates 46 | run: | 47 | python .learning-meta/regenerate.py 48 | env: 49 | GITHUB_TOKEN: ${{ secrets.ORB_CI_GH_TOKEN }} 50 | - name: Commit changes 51 | uses: stefanzweifel/git-auto-commit-action@v5 52 | with: 53 | branch: develop 54 | commit_message: Regen on ${{ github.event_name }} 55 | file_pattern: '*.md *.yaml *.yml' 56 | -------------------------------------------------------------------------------- /netbox-devops-onug-fall/roles/deploy_vlans/tasks/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: 1 - Get Devices From Site 3 | uri: 4 | url: "{{ netbox_url }}api/dcim/devices/?name={{ inventory_hostname }}" 5 | method: GET 6 | return_content: yes 7 | headers: 8 | accept: "application/json" 9 | Authorization: "Token {{ netbox_token }}" 10 | register: device 11 | 12 | - name: 2 - Get Site Details 13 | uri: 14 | url: "{{ netbox_url }}api/dcim/sites/?name={{ device.json.results[0]['site']['name'] }}" 15 | method: GET 16 | return_content: yes 17 | headers: 18 | accept: "application/json" 19 | Authorization: "Token {{ netbox_token }}" 20 | register: site 21 | 22 | - name: 3 - Get List of VLANs for Site {{ device.json.results[0]['site']['name'] }} 23 | uri: 24 | url: "{{ netbox_url }}api/ipam/vlans/?site_id={{ site.json.results[0]['id'] }}" 25 | method: GET 26 | return_content: yes 27 | headers: 28 | accept: "application/json" 29 | Authorization: "Token {{ netbox_token }}" 30 | register: vlans 31 | 32 | # Uncomment for debugging the JSON Data registered by a play 33 | # Change the var value to whatever you need eg. var: vlans.json.results 34 | #- name: Display Json Data 35 | # ansible.builtin.debug: 36 | # var: vlans.json.results 37 | 38 | # Uncomment to display the Ansible Host Vars for a host 39 | # - name: Display all variables/facts known for a host 40 | # ansible.builtin.debug: 41 | # var: hostvars[inventory_hostname] 42 | 43 | - name: Configure VLANs on Arista Switches 44 | arista.eos.eos_vlans: 45 | config: 46 | - name: "{{ item.name }}" 47 | vlan_id: "{{ item.vid }}" 48 | with_items: "{{ vlans.json.results }}" 49 | -------------------------------------------------------------------------------- /netbox-discovery-webinar/README.md: -------------------------------------------------------------------------------- 1 | # NetBox Discovery Agent Policies 2 | 3 | This repository contains example policies for the NetBox Discovery Agent, which is part of the NetBox Discovery solution. These examples accompany the webinar: [Accurate Network Inventory, Automated — A NetBox Discovery Deep Dive](https://netboxlabs.com/events/webinar-accurate-network-inventory-automated-netbox-discovery-deep-dive/). 4 | 5 | ## About NetBox Discovery 6 | 7 | NetBox Discovery is built to simplify and automate the collection of network and device data, ensuring that your source of truth stays aligned with the real world. With features like Git-based configuration and extensible integrations, it's designed to help you maintain accurate network inventory in dynamic environments. 8 | 9 | ## Documentation 10 | 11 | For detailed documentation about the NetBox Discovery Agent, please refer to the [official Orb Agent documentation](https://github.com/netboxlabs/orb-agent). 12 | 13 | ## Getting Started 14 | 15 | ### Prerequisites 16 | 17 | - Docker 18 | - NetBox Discovery Agent (orb-agent) 19 | - Required environment variables (DIODE_API_KEY, SSH_USERNAME, SSH_PASSWORD) 20 | 21 | ### Example Commands 22 | 23 | The repository includes example commands for running different types of discovery agents. See [example-commands.md](example-commands.md) for detailed instructions on running: 24 | 25 | - Network Discovery Agent 26 | - Device Discovery Agent 27 | - Custom Worker Discovery Agent 28 | 29 | ## Policy Examples 30 | 31 | This repository contains example policies for various discovery scenarios. Each policy is designed to demonstrate different aspects of NetBox Discovery's capabilities. 32 | 33 | ## Contributing 34 | 35 | Feel free to submit issues and enhancement requests! 36 | -------------------------------------------------------------------------------- /autocon4-workshop/1_set_envvars.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | ENV_FILE="environment" 4 | 5 | # Check if the environment file exists 6 | if [ -f "$ENV_FILE" ]; then 7 | echo "Environment file found. Using existing variables." 8 | else 9 | echo "Environment file not found. Generating new variables." 10 | 11 | if [[ -z "${MY_EXTERNAL_IP}" ]]; then 12 | # Attempt to fetch the external IPv4 address 13 | EXTERNAL_IP=$(curl -4 -s ifconfig.me) # Use -4 to ensure IPv4 is returned 14 | # Check if the IP was retrieved successfully 15 | if [ -z "$EXTERNAL_IP" ]; then 16 | echo "Error: Unable to determine external IPv4 address." 17 | exit 1 18 | fi 19 | else 20 | EXTERNAL_IP=${MY_EXTERNAL_IP} 21 | fi 22 | 23 | # Generate new variables 24 | MY_EXTERNAL_IP=$EXTERNAL_IP 25 | NETBOX_PORT="8000" 26 | DOCKER_SUBNET="172.24.0.0/24" 27 | DOCKER_NETWORK="autocon4-workshop" 28 | NETBOX_TOKEN="1234567890" 29 | 30 | # Write variables to the environment file 31 | cat < "$ENV_FILE" 32 | MY_EXTERNAL_IP=$MY_EXTERNAL_IP 33 | NETBOX_PORT=$NETBOX_PORT 34 | DOCKER_SUBNET=$DOCKER_SUBNET 35 | DOCKER_NETWORK=$DOCKER_NETWORK 36 | NETBOX_TOKEN=$NETBOX_TOKEN 37 | EOF 38 | fi 39 | 40 | # Export variables from the environment file 41 | while IFS='=' read -r key value; do 42 | export "$key=$value" 43 | done < "$ENV_FILE" 44 | 45 | # Debug information to communicate values being used 46 | echo 47 | echo "--- Environment Variables Set ---" 48 | echo "External IP: $MY_EXTERNAL_IP" 49 | echo "NetBox will be deployed at: http://$MY_EXTERNAL_IP:$NETBOX_PORT" 50 | echo "Docker subnet: $DOCKER_SUBNET" 51 | echo "Docker network: $DOCKER_NETWORK" 52 | echo "NetBox token: $NETBOX_TOKEN" 53 | echo "-----------------------------------" --------------------------------------------------------------------------------