Closed rydy closed 1 year ago
I thought XE only supported NETCONF RFC 5277 subscription. They later moved to using the ietf-event-notifications.yang module. Performing netconf subscriptions in yangsuite, in order to keep the session open, choose the device and "Open in new window" or "Open in new tab". In the device window you can manually "Start Session" and perform actions (including RFC 5277 streams). The session will stay open until you click on "End Session". Once the session is open, you can send subscribe messages using the ietf-event-notifications module from the NETCONF page.
The NETCONF configuration is as follows:
Device Variant : (Default - RFC-compliant device)
NETCONF port : 830
Address:172.19.3.183
Username:root
Password:••••••••
Timeout:30
I chose the device and click "Open Device Window", There is no "Start Session "button on this page. I tried to click "Open in new window", There is "Start Session" button on this new window. I manually clicked "Start Session" and run log as follows:
Waiting for Data...
Sending:
<nc:hello xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0">...</nc:hello>
]]>]]>
Received message from host
initialized: session-id=9 | server_capabilities=<dict_keyiterator object at 0x7f59afff2ef0>
NETCONF CONNECTED 172.19.3.183:830
No session found. Creating a new temporary session
Sending:
<nc:hello xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0">...</nc:hello>
]]>]]>
Received message from host
initialized: session-id=10 | server_capabilities=<dict_keyiterator object at 0x7f59b0077a40>
NETCONF CONNECTED 172.19.3.183:830
Ending temporary session
Requesting 'CloseSession'
Sending:
#184
<nc:rpc xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="urn:uuid:232653ad-e99a-45e1-b6cb-0e4ca5e7f943">
<nc:close-session/>
</nc:rpc>
##
Received message from host
NETCONF DISCONNECT 172.19.3.183:830
No session found. Creating a new temporary session
Sending:
<nc:hello xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0">...</nc:hello>
]]>]]>
Received message from host
initialized: session-id=11 | server_capabilities=<dict_keyiterator object at 0x7f59b008d400>
NETCONF CONNECTED 172.19.3.183:830
Ending temporary session
Requesting 'CloseSession'
Sending:
#184
<nc:rpc xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="urn:uuid:958eab9e-77bd-4d42-ab8f-026075219708">
<nc:close-session/>
</nc:rpc>
##
Received message from host
NETCONF DISCONNECT 172.19.3.183:830
No session found. Creating a new temporary session
Sending:
<nc:hello xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0">...</nc:hello>
]]>]]>
Received message from host
initialized: session-id=12 | server_capabilities=<dict_keyiterator object at 0x7f59b0098ea0>
NETCONF CONNECTED 172.19.3.183:830
Ending temporary session
Requesting 'CloseSession'
Sending:
#184
<nc:rpc xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="urn:uuid:4dee16e8-cb19-4352-8789-20100648165e">
<nc:close-session/>
</nc:rpc>
##
Received message from host
NETCONF DISCONNECT 172.19.3.183:830
I did not click "End Session" during this period, but "close-session" was still sent automatically. Why is this?
I then proceed to action "subscribe", which also automatically sends "close-session" without me clicking "End Session", Is there a problem with my operation?
No session found. Creating a new temporary session
Sending:
<nc:hello xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0">...</nc:hello>
]]>]]>
Received message from host
initialized: session-id=13 | server_capabilities=<dict_keyiterator object at 0x7f59b007f040>
NETCONF CONNECTED 172.19.3.183:830
NETCONF SEND rpc
Requesting 'Dispatch'
Sending:
#297
<nc:rpc xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="urn:uuid:9262a1c1-9d36-4be0-881a-426ae0fca18a"><create-subscription xmlns="urn:ietf:params:xml:ns:netconf:notification:1.0">
<stream>NETCONF</stream>
</create-subscription>
</nc:rpc>
##
Received message from host
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="urn:uuid:9262a1c1-9d36-4be0-881a-426ae0fca18a">
<ok/>
</rpc-reply>
NETCONF rpc COMPLETE
Requesting 'CloseSession'
Sending:
#184
<nc:rpc xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="urn:uuid:99bded6d-33fc-4bc6-8506-f397dc4c81f3">
<nc:close-session/>
</nc:rpc>
##
Received message from host
NETCONF DISCONNECT 172.19.3.183:830
Cleaning up these old issues.
First, I see in your last comment that "Device Variant : (Default - RFC-compliant device)" and that setting is only for Nexus (IOS-NX) platforms and they do not support RFC-5277 type of streaming. Cisco IOS-XE and IOS_XR only support "NETCONF" streams for RFC-5277 type streaming. Second, the "Start Session" shows up in my new tab.
I tried my Cisco IOS-NX testbed and it returned no RFC-5277 streams as expected. My Cisco IOS-XE and IOS_XR testbeds only returned NETCONF as an RFC-5277 stream choice. All 3 devices do not close the session after I click on "Start Session".
What device are you trying this on? Does not appear to be a Cisco device.
Please re-open this issue if you need to.
Hi,
I refer to NETCONF RFC 5277 Notification Streams to run the notification test . The current master branch will automatically send 'close-session' after sending 'create-subscription', which makes me unable to receive relevant notifications. How to cancel the automatic sending of 'close-session'?
log.txt:
Best regards, Thanks