#network device-discovery

1 messages · Page 1 of 1 (latest)

knotty gyro
#

I am trying to collect metrics from "network device-discovery show". But when using private cli "/api/private/network/device-discovery", I get "API not Found". Also from the API doc, I see in Models, there is device_discovery_data but don't know how to use it.
BTW, we have zapi template collecting network device-discovery.

Thanks!

tough glade
#

hi @knotty gyro your URI is missing cli. This works for me
curl -s -k -u $user:$pass 'https://10.193.48.154/api/private/cli/network/device-discovery'
{
"records": [
{
"node": "umeng-aff300-02",
"protocol": "cdp",
"port": "e0a",
"discovered_device": "umeng-aff300-01",
"interface": "e0a"
},
{
"node": "umeng-aff300-02",
"protocol": "cdp",
"port": "e0b",
"discovered_device": "umeng-aff300-01",
"interface": "e0b"
}
]
}

knotty gyro
#

OMG, I can't believe it. I was so close 😀

tough glade
#

yep, I only noticed it because i've done the same many times 😄

rustic spear
#

A /cli close !

knotty gyro
#

so here is my template

query:            api/private/cli/network/device-discovery
object:           net_device_discovery
counters:
  - ^^node
  - ^^port
  - ^protocol
  - ^discovered_device
  - ^discovered_device_platform       => platform
  - ^discovered_device_version        => version
  - ^discovered_device_interface      => interface

export_options:
  instance_keys:
    - node
    - port
  instance_labels:
    - protocol
    - discovered_device
    - platform
    - version
    - interface```
I get labels node,port,protocol, and discovered_device, but not platform,version, and interface. What's wrong with my template?