04-27-2022 12:30 PM
Hi,
We have a need to determine if a particular interface is down (not admin-down, but operationally) with NSO.
It seems trivial to detect admin-state like this, but oddly, oper-status isn't available.
The goal would to use this state in a service template and make logic decisions based on it.
thanks
R
show devices device mydevice live-status interfaces-state interface TenGigE0/0/0/0 admin-status admin-status up
show devices device mydevice live-status interfaces-state interface TenGigE0/0/0/0 oper-status % No entries found.
Solved! Go to Solution.
04-28-2022 10:18 AM - edited 04-28-2022 10:31 AM
If nothing else works, and if the NED is CLI perhaps do exec
admin@ncs(config)# devices device rtr live-status cisco-ios-xr-stats:exec any "command you want"
The output would have to be parsed though as it will be a string I think.
This two threads do it in python:
04-28-2022 10:53 AM
Slight modification to the above, gives us:
admin@nso-lab(config)# devices device mydevice live-status exec any "show interface TenGigE 0/0/0/0" | include line TenGigE0/0/0/0 is up, line protocol is up
We'll check out the python posts, much appreciated.
04-29-2022 07:57 AM
It looks like there might be a mismatch between the device output and what the NED expects. In /cisco-iosxr-cli-7.39/src/gili/if:interfaces-state_interface.gili you see that the NED expects "Line protocol is" with an uppercase L, while the output of the device is "line protocol is" with a lowercase l. You can try to correct it and recompile the NED.
04-30-2022 12:36 AM
Awesome! Yes, please go ahead and open a TAC case
04-28-2022 09:57 AM
Hello ,
Which NED are you using ?
can you provide NSO , Ned version ?
Can you execute this command and post the output that you get .
show devices device mydevice live-status interfaces-state interface TenGigE0/0/0/0
04-28-2022 10:16 AM
Thanks for the reply,
Running NSO 5.6.5 with cisco-iosxr-cli-7.38 NED
Result of command above:
live-status interfaces-state interface TenGigE0/0/0/0 admin-status up phys-address d4:6a:35:f4:44:00 speed 10000000000 statistics in-octets 35334763881 statistics in-unicast-pkts 7046572 statistics in-broadcast-pkts 2 statistics in-multicast-pkts 4058647 statistics in-discards 0 statistics in-errors 1 statistics in-unknown-protos 0 statistics out-octets 35249134129 statistics out-unicast-pkts 6023956 statistics out-broadcast-pkts 3 statistics out-multicast-pkts 4050900 statistics out-discards 0 statistics out-errors 0 ipv4 forwarding true ipv4 mtu 9180 IP NETMASK ORIGIN ---------------------------------------- 1.2.3.4 255.255.255.252 - ipv6 forwarding true ipv6 mtu 9180
04-28-2022 10:18 AM - edited 04-28-2022 10:31 AM
If nothing else works, and if the NED is CLI perhaps do exec
admin@ncs(config)# devices device rtr live-status cisco-ios-xr-stats:exec any "command you want"
The output would have to be parsed though as it will be a string I think.
This two threads do it in python:
04-28-2022 10:53 AM
Slight modification to the above, gives us:
admin@nso-lab(config)# devices device mydevice live-status exec any "show interface TenGigE 0/0/0/0" | include line TenGigE0/0/0/0 is up, line protocol is up
We'll check out the python posts, much appreciated.
04-29-2022 07:57 AM
It looks like there might be a mismatch between the device output and what the NED expects. In /cisco-iosxr-cli-7.39/src/gili/if:interfaces-state_interface.gili you see that the NED expects "Line protocol is" with an uppercase L, while the output of the device is "line protocol is" with a lowercase l. You can try to correct it and recompile the NED.
04-29-2022 10:14 AM
Thank you, we will give it a go and see what happens.
04-29-2022 12:06 PM
@hazad - You nailed it, that was exactly the issue. Should I open a TAC case and provide this info, or another approach?
thanks
R
04-30-2022 12:36 AM
Awesome! Yes, please go ahead and open a TAC case
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide