person Tia Zanella
calendar_add_on Created March 17, 2026
update Updated March 29, 2026
Share
download Download MD

OSIRIS JSON Producer for Cisco

The OSIRIS JSON Cisco producer connects to Cisco infrastructure platforms (APIC, NX-OS, IOS-XE) and generates OSIRIS JSON snapshots of your network topology, devices, interfaces, and connections.

Install the core dispatcher and the Cisco producer:

go install go.osirisjson.org/producers/cmd/osirisjson-producer@latest
go install go.osirisjson.org/producers/cmd/osirisjson-producer-cisco@latest

The core dispatcher lets you run osirisjson-producer cisco .... Without it, invoke the vendor binary directly as osirisjson-producer-cisco ....

Make sure $GOPATH/bin (or $HOME/go/bin) is in your PATH. See the getting started page for more install options.

Supported platforms

ACI / APIC

available

Application Policy Infrastructure Controller

Transport: REST API

NX-OS

available

Nexus data center switches

Transport: NX-API CLI

IOS-XE

available

Enterprise routers and switches

Transport: NETCONF/YANG over SSH

CLI usage

The Cisco producer uses a dispatcher-style CLI with sub-producers:

osirisjson-producer cisco <subcommand> [flags]

Single mode

Connect to one device and output an OSIRIS JSON document to stdout:

# ACI fabric snapshot via APIC
osirisjson-producer cisco apic -h 10.0.0.1 -u admin -p secret

# NX-OS device snapshot
osirisjson-producer cisco nxos -h switch01.example.com -u admin -p secret

# IOS-XE device snapshot
osirisjson-producer cisco iosxe -h router01.example.com -u admin --insecure

If -p / --password is omitted, the CLI prompts interactively.

Batch mode

Collect from multiple devices listed in a CSV file. Output is organized as a hierarchical directory structure: DC/Floor/Room/Zone/Hostname.json.

osirisjson-producer cisco apic -s datacenter.csv -o ./output -u admin -p secret

Generate a CSV template to get started:

osirisjson-producer cisco template --generate apic

The CSV template uses these columns:

ColumnRequiredDescription
dcDatacenter name (used for output folder hierarchy)
floorFloor identifier
roomRoom identifier
zoneZone or pod identifier
hostnameyesDevice label used as output filename
typeyesProducer type: apic, nxos, iosxe
ipyesIP address or FQDN of the target device
portOverride port (default: producer-specific)
ownerself (default), isp, or colo - operator metadata only
notesFree-text notes (ignored by producer)

Credentials are provided via -u/-p flags and apply to all targets in the batch.

Flags reference

Single mode flags

FlagShortDescription
--host-hTarget host (IP or FQDN, optionally with :port)
--username-uUsername for authentication
--password-pPassword (omit for interactive prompt)
--port-POverride port (default: producer-specific)
--detailDetail level: minimal (default) or detailed
--insecureSkip TLS certificate verification
--safe-failure-modeSecret handling: fail-closed (default), log-and-redact, off

Batch mode flags

FlagShortDescription
--source-sCSV file with targets
--output-oOutput directory (hierarchical: DC/Floor/Room/Zone/Hostname.json)
--username-uDefault username for all targets
--password-pDefault password for all targets

Global flags

FlagDescription
--version / -vDisplay version and exit
--helpDisplay help and exit

What each platform collects

ACI / APIC

The APIC producer queries the following MO classes via the REST API:

Minimal mode:

MO ClassDescription
fabricNodeFabric nodes (controllers, spines, leafs)
topSystemSystem attributes (uptime, state, fabric MAC, control plane MTU)
firmwareRunningRunning firmware versions
fvTenantTenant definitions
fvCtxVRF contexts
fvBDBridge domains
fvSubnetSubnets
fvAEPgApplication endpoint groups
l3extOutL3 external connectivity
faultInstActive fault instances

Detailed mode adds:

MO ClassDescription
fvCEpClient endpoints (MAC, VLAN encap, leaf attachment)

NX-OS

The NX-OS producer sends NX-API CLI commands in batched requests:

Minimal mode:

CommandDescription
show versionDevice model, serial number, OS version, uptime
show inventoryHardware inventory (modules, power supplies, fans)
show interface briefInterface names, states, speeds, VLANs
show vlan briefVLAN IDs, names, and member interfaces
show vrf all detailVRF definitions and member interfaces
show lldp neighbors detailLLDP neighbor discovery
show vpc briefvPC domain, peer status, keepalive
show port-channel summaryPort-channel configurations

Detailed mode adds:

CommandDescription
show interfaceFull interface stats (MTU, bandwidth, duplex, counters)
show system resourcesCPU idle %, memory usage, load averages
show environmentPower supplies, fan status, temperatures

IOS-XE

The IOS-XE producer uses NETCONF/YANG RPCs over SSH (default port 830):

Minimal mode:

YANG ModelDescription
Cisco-IOS-XE-nativeDevice version and hostname
ietf-interfacesInterface details
Cisco-IOS-XE-device-hardware-operHardware inventory
Cisco-IOS-XE-cdp-operCDP neighbor discovery
Cisco-IOS-XE-native (vrf)VRF definitions

Detailed mode adds:

YANG ModelDescription
Cisco-IOS-XE-bgp-operBGP neighbor details
Cisco-IOS-XE-ospf-operOSPF process and neighbor state
Cisco-IOS-XE-process-cpu-operCPU utilization
Cisco-IOS-XE-memory-operMemory statistics

OSIRIS JSON output structure

All three producers emit the same OSIRIS JSON envelope:

{
  "schema": "https://osirisjson.org/schemas/osiris-v0.0.1.json",
  "metadata": {
    "generator": {
      "name": "osirisjson-producer-cisco-<platform>",
      "version": "0.1.0"
    },
    "scope": {
      "providers": ["cisco"]
    }
  },
  "topology": {
    "resources": [ ... ],
    "connections": [ ... ],
    "groups": [ ... ]
  }
}

Resource types by platform

IOS-XE:

  • network.router - Primary device
  • network.interface - Physical and logical interfaces
  • network.interface.lag - Port-channel / LAG interfaces

NX-OS:

  • network.switch / network.switch.spine / network.switch.leaf - Device (role-classified)
  • network.interface - Physical and logical interfaces
  • network.interface.lag - Port-channels

APIC:

  • network.controller - APIC controllers
  • network.switch.spine / network.switch.leaf - Fabric switches
  • network.domain.bridge - Bridge domains
  • network.subnet - Subnets
  • network.l3out - L3 external networks
  • network.endpoint - Client endpoints (detailed mode only)

Group types by platform

IOS-XE: logical.vrf

NX-OS: logical.vrf, network.vlan, network.vpc

APIC: logical.tenant, logical.vrf, logical.epg

Connection discovery

  • IOS-XE discovers neighbors via CDP (Cisco Discovery Protocol)
  • NX-OS discovers neighbors via LLDP (Link Layer Discovery Protocol)
  • APIC uses containment hierarchy (tenants -> BDs -> subnets -> EPGs) rather than point-to-point links

Remote devices discovered via CDP/LLDP are added as stub resources with status: unknown.

Examples

IOS-XE - single device, minimal mode

osirisjson-producer cisco iosxe -h 10.99.0.1 -u admin -p secret

Output (trimmed):

{
  "schema": "https://osirisjson.org/schemas/osiris-v0.0.1.json",
  "metadata": {
    "generator": {
      "name": "osirisjson-producer-cisco-iosxe",
      "version": "0.1.0"
    },
    "scope": {
      "providers": ["cisco"]
    }
  },
  "topology": {
    "resources": [
      {
        "id": "cisco-iosxe-LAB-RTR01",
        "type": "network.router",
        "name": "LAB-RTR01",
        "status": "active",
        "provider": {
          "name": "cisco",
          "type": "ISR4451-X/K9",
          "version": "16.9"
        },
        "extensions": {
          "osiris.cisco": {
            "inventory": [
              { "name": "Chassis", "description": "ISR4451-X/K9", "serial": "FDO12345678" }
            ]
          }
        }
      },
      {
        "id": "cisco-iosxe-LAB-RTR01-GigabitEthernet0/0/0",
        "type": "network.interface",
        "name": "GigabitEthernet0/0/0",
        "status": "active",
        "properties": {
          "speed": "1000000000",
          "description": "WAN uplink"
        }
      }
    ],
    "connections": [
      {
        "source": "cisco-iosxe-LAB-RTR01-GigabitEthernet0/0/0",
        "target": "cisco-iosxe-stub-REMOTE-SW01-GigabitEthernet1/0/1",
        "type": "network.link",
        "status": "active"
      }
    ],
    "groups": [
      {
        "id": "cisco-iosxe-LAB-RTR01-vrf-CORP",
        "type": "logical.vrf",
        "name": "CORP",
        "members": [
          "cisco-iosxe-LAB-RTR01-GigabitEthernet0/0/0",
          "cisco-iosxe-LAB-RTR01-Loopback0"
        ]
      }
    ]
  }
}

NX-OS - single device, detailed mode

osirisjson-producer cisco nxos -h switch01.lab -u admin -p secret --detail detailed

Output (trimmed):

{
  "schema": "https://osirisjson.org/schemas/osiris-v0.0.1.json",
  "metadata": {
    "generator": {
      "name": "osirisjson-producer-cisco-nxos",
      "version": "0.1.0"
    },
    "scope": {
      "providers": ["cisco"]
    }
  },
  "topology": {
    "resources": [
      {
        "id": "cisco-nxos-LAB-SW01",
        "type": "network.switch",
        "name": "LAB-SW01",
        "status": "active",
        "provider": {
          "name": "cisco",
          "type": "Nexus9000 C9508",
          "version": "10.3(4a)"
        },
        "extensions": {
          "osiris.cisco": {
            "bios_version": "08.40",
            "kernel_uptime": "15d 3h 22m 10s",
            "cpu_idle": 85.5,
            "load_avg_1min": 1.23,
            "memory_used": 8192,
            "memory_free": 24576,
            "power_supplies": [
              { "id": "1", "model": "NXA-PAC-1100W", "watts": 350, "status": "ok" }
            ],
            "fans": [
              { "name": "Fan1", "status": "ok" }
            ],
            "temperatures": [
              { "sensor": "SUP slot 1", "celsius": 35.5 }
            ]
          }
        }
      },
      {
        "id": "cisco-nxos-LAB-SW01-Ethernet1/1",
        "type": "network.interface",
        "name": "Ethernet1/1",
        "status": "active",
        "properties": {
          "speed": "10000000000",
          "description": "Server-facing"
        }
      }
    ],
    "connections": [
      {
        "source": "cisco-nxos-LAB-SW01-Ethernet1/1",
        "target": "cisco-nxos-stub-REMOTE-SW01-Ethernet1/49",
        "type": "network.link",
        "status": "active"
      }
    ],
    "groups": [
      {
        "id": "cisco-nxos-LAB-SW01-vlan-100",
        "type": "network.vlan",
        "name": "PROD",
        "members": ["cisco-nxos-LAB-SW01-Ethernet1/1"]
      },
      {
        "id": "cisco-nxos-LAB-SW01-vpc-10",
        "type": "network.vpc",
        "name": "vPC domain 10",
        "extensions": {
          "osiris.cisco": {
            "role": "primary",
            "peer_status": "peer-ok",
            "keepalive_status": "peer-alive"
          }
        }
      }
    ]
  }
}

APIC - ACI fabric snapshot

osirisjson-producer cisco apic -h 10.0.0.1 -u admin -p secret --detail detailed

Output (trimmed):

{
  "schema": "https://osirisjson.org/schemas/osiris-v0.0.1.json",
  "metadata": {
    "generator": {
      "name": "osirisjson-producer-cisco-apic",
      "version": "0.1.0"
    },
    "scope": {
      "providers": ["cisco"]
    }
  },
  "topology": {
    "resources": [
      {
        "id": "cisco-apic-apic1",
        "type": "network.controller",
        "name": "apic1",
        "status": "active",
        "provider": {
          "name": "cisco",
          "type": "APIC-SERVER-M3",
          "version": "6.0(2h)",
          "site": "pod-1"
        }
      },
      {
        "id": "cisco-apic-spine1",
        "type": "network.switch.spine",
        "name": "spine1",
        "status": "active",
        "provider": {
          "name": "cisco",
          "type": "N9K-C9336C-FX2",
          "version": "n9000-16.0(2h)",
          "site": "pod-1"
        },
        "extensions": {
          "osiris.cisco": {
            "fabric_mac": "AA:BB:CC:DD:EE:01",
            "control_plane_mtu": 9000,
            "faults": [
              { "code": "F1527", "severity": "warning", "description": "storage full" }
            ]
          }
        }
      },
      {
        "id": "cisco-apic-bd-bd_App",
        "type": "network.domain.bridge",
        "name": "bd_App",
        "status": "active"
      },
      {
        "id": "cisco-apic-subnet-10.0.0.1/24",
        "type": "network.subnet",
        "name": "10.0.0.1/24",
        "status": "active"
      },
      {
        "id": "cisco-apic-ep-AA:BB:CC:DD:EE:FF",
        "type": "network.endpoint",
        "name": "AA:BB:CC:DD:EE:FF",
        "status": "active",
        "properties": {
          "encap": "vlan-100",
          "leaf": "leaf1",
          "interface": "eth1/1"
        }
      }
    ],
    "groups": [
      {
        "id": "cisco-apic-tenant-tn_Example",
        "type": "logical.tenant",
        "name": "tn_Example",
        "children": [
          "cisco-apic-vrf-tn_Example-vrf_Main",
          "cisco-apic-epg-tn_Example-epg_WEB"
        ]
      },
      {
        "id": "cisco-apic-vrf-tn_Example-vrf_Main",
        "type": "logical.vrf",
        "name": "vrf_Main"
      },
      {
        "id": "cisco-apic-epg-tn_Example-epg_WEB",
        "type": "logical.epg",
        "name": "epg_WEB",
        "members": ["cisco-apic-ep-AA:BB:CC:DD:EE:FF"]
      }
    ]
  }
}

Batch mode - multi-device collection

Create a CSV inventory file:

dc,floor,room,zone,hostname,type,ip,port,owner,notes
AMS-01,F3,R301,POD-A,apic-01,apic,10.10.1.1,,self,Primary controller
AMS-01,F3,R301,POD-A,nx-spine-01,nxos,10.10.1.10,,self,Spine switch
AMS-01,F3,R302,POD-B,xe-router-01,iosxe,172.16.0.1,,isp,PE router

Run the batch:

osirisjson-producer cisco apic -s inventory.csv -o ./output -u admin -p secret

The resulting output directory:

output/
  AMS-01/
    F3/
      R301/
        POD-A/
          apic-01.json
          nx-spine-01.json
      R302/
        POD-B/
          xe-router-01.json
edit_note

Help improve this page

Found an issue or want to contribute? Open an issue.