cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1032
Views
0
Helpful
3
Replies

Using live-status command and also send quit on xr router

schallagalla
Level 1
Level 1

Hi All,

 

I need to get utilization from router, for which i  am using live-status command as below. I need to send quit to come out of terminal as below. How can i send 'quit'  When i send request from NSO.

 

ncs > request devices device xr live-status exec any args "monitor interface HundredGigE 0/0/0/1"

It is hanging as i need to send quit to close the terminal.

 

RP/0/RP0/CPU0:xr#monitor interface HundredGigE 0/0/0/1

xr Monitor Time: 00:00:02 SysUptime: 5837:06:10


HundredGigE0/0/0/1 is up, line protocol is up
Encapsulation ARPA

Traffic Stats:(2 second rates) Delta
Input Packets: 26167943773 800687
Input pps: 330325
Input Bytes: 24338207260608 744180100
Input Kbps (rate): 2456007 ( 2%)
Output Packets: 1002362250 84
Output pps: 47
Output Bytes: 184972156916 7982
Output Kbps (rate): 40 ( 0%)

Errors Stats:
Input Total: 83 0
Input CRC: 55 0
Input Frame: 0 0
Input Overrun: 0 0
Output Total: 0 0
Output Underrun: 0 0

Quit='q', Freeze='f', Thaw='t', Clear='c', Interface='i', Next='n', Prev='p'

Brief='b', Detail='d', Protocol(IPv4/IPv6)='r'

 

 

Thanks,

3 Replies 3

yfherzog
Cisco Employee
Cisco Employee

I don't have a definite answer on the top of my head (someone else might have), and it may require a bit of trial and, but the first thing to look at is the README file inside the NED directory.

Search for section "Execute native device command", and specifically mentions of 'prompts'.

 

Might be something like:

 

request devices device xr live-status exec any args "monitor interface HundredGigE 0/0/0/1 | prompts q"

 

edit:

 

I saw now you have another quite similar post on which you mentioned that you already tried this.

As mentioned, someone else might have the answer, but in the meantime, the NED README is the way to go.

Thanks yfherzog.

 

From the NED trace, Below is the ouput when i tried to send the below command(sending multiple commands as per README).  

As per my understanding, it is trying to reset write timeout and  executing the command again. Do i need to change any device setting of timeouts. Or is there any other way to get operational data from device.

 

ncs #devices device xr live-status exec any "monitor interface HundredGigE 0/0/0/1 ;  q"

 

-- BEGIN COMMAND # "monitor interface HundredGigE 0/0/0/1 ; q"
-- SENDING_CMD : "monitor interface HundredGigE 0/0/0/1"
monitor interface HundredGigE 0/0/0/1

*** input 12-Feb-2020::15:48:14.360 user: admin/4312 thandle 529831 hostname nso-02 device xr ***
monitor interface HundredGigE 0/0/0/1

*** output 12-Feb-2020::15:48:14.360 user: admin/4312 thandle 529831 hostname nso-02 device xr  ***
-- timeout reset to 20000 ms
<< 12-Feb-2020::15:48:14.360 user: admin/4312 thandle 529831 hostname nso-02 device xr SET_TIMEOUT
-- Waiting for command reply (write-timeout 20000)

*** input 12-Feb-2020::15:48:16.577 user: admin/4312 thandle 529831 hostname nso-02 device xr ***

Wed Feb 12 16:01:12.883 Asia/Dubai
xr Monitor Time: 00:01:42 SysUptime: 5860:44:16


HundredGigE0/0/0/1 is up, line protocol is up
Encapsulation ARPA

Traffic Stats:(2 second rates) Delta
Input Packets: 27607097856 116
Input pps: 54
Input Bytes: 25672028599607 10008
Input Kbps (rate): 40 ( 0%)
Output Packets: 1006273184 89
Output pps: 92
Output Bytes: 185392884627 8255
Output Kbps (rate): 438 ( 0%)

Errors Stats:
Input Total: 83 0
Input CRC: 55 0
Input Frame: 0 0
Input Overrun: 0 0
Output Total: 0 0
Output Underrun: 0 0

Quit='q', Freeze='f', Thaw='t', Clear='c', Interface='i',
Next='n', Prev='p'

Brief='b', Detail='d', Protocol(IPv4/IPv6)='r'

 

 

 

 

I don't think you need to change the timeout.

I think the command is timing out as it doesn't get the prompt it expects to find.

 

You're sending the first command, and then you never get the prompt back, so you never get to the second command ('q').

I think using prompts is still the way to go rather than multiple commands.

I suspect the problem here might be for the way this command behaves to the prompts, as the output refreshes every couple of seconds.

 

I still think that '| prompts q' is the way to go, but it might be failing because of the command behavior.

If you get to a point that the NED trace shows reasonable behavior (i.e. q is provided at the right moment) but you're not getting a result, then it might be a good idea to open a support case.

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the NSO Developer community: