cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
508
Views
10
Helpful
1
Replies

Applying live-status command in cisco-iosxr-nc NED

ygorelik
Cisco Employee
Cisco Employee

I am trying to create SNMP trap configuration service on IOS XR device controlled by cisco-iosxr-nc NED. It can be done by building template based on Cisco-IOS-XR-um-snmp-server-cfg YANG model. But I found that although this module is present in capabilities from version 7.0.1 it really supports configuration of snmp-server only from 7.5.1. Therefore before applying a service template I need to check not only device capabilities, but also if it supports some snmp-server configuration. From CLI I can issue a command that gives me perfect answer:

admin@ncs# show devices device iosxr-nc live-status Cisco-IOS-XR-um-snmp-server-cfg:snmp-server community 
COMMUNITY                                                   
STRING     VIEW  RO  RW  SDROWNER  SYSTEMOWNER  IPV4  IPV6  
------------------------------------------------------------
public     -     X   -   -         X            -     -     

or if not supported:

admin@ncs# show devices device xr-33 live-status Cisco-IOS-XR-um-snmp-server-cfg:snmp-server community.   
---------------------------------------------------------------------------------------------^
syntax error: unknown argument

But unfortunately I could not figure out how to implement this show command in Python API. I would really appreciate your help.

Thank you,

Yan

1 Reply 1

hazad
Cisco Employee
Cisco Employee

It is possible to show data as maagic API commands. You can do this by enabling devtools and then piping the show output with "display maagic":

admin@ncs> set devtools true                                   
[ok][2022-10-10 16:43:13]
admin@ncs> show devices device ex0 live-status Cisco-IOS-XR-um-snmp-server-cfg:snmp-server community | display maagic  

Which should give you something like:
root.ncs__devices.device['ex0'].live-status.Cisco-IOS-XR-um-snmp-server-cfg.snmp_server. You might need to change the hyphens to underscores though.