10-20-2023 07:33 AM
Helo Team:
I have a simple question.
In NSO-3.x, I was able to use the curl to get daemon status:
curl -X GET -u user:passwd http://127.0.0.1:8080/api/operational/ncs-state/daemon-status
However, in NSO-6.1, I cannot use the same curl command. Can anyone help?
THX
sm000x
Solved! Go to Solution.
10-23-2023 05:12 AM
The "authentication failed" message is not coming from NSO. A quick web search for the error message you get indicates a proxy issue.
10-23-2023 05:31 AM
10-25-2023 07:07 AM
10-25-2023 07:10 AM
Hi, Jesus:
I am confirmed this issue is Proxy issue. But the tool surely is a useful tool.
Thank you so much for providing such a wonderful tool.
THX
sm000x
10-20-2023 08:15 AM - edited 10-22-2023 11:20 PM
EDIT: Updating answer. Replaced version by daemon-status. By mistake added version instead of the status of the daemon.
In my case I used this path:
/restconf/data/tailf-ncs-monitoring:ncs-state/daemon-status
See the full example here, it might be userful https://developer.cisco.com/codeexchange/github/repo/jillesca/nso_hello_world_restconf/
And you can actually try on the Cisco Cloud IDE environment. the NSO used in on 5.x but I believe it will work with 6.1.
Still you can get the version doing:
show ncs-state daemon-status | display restconf
And add the 'data' path between restconf and tailf-ncs...
10-23-2023 05:35 AM
10-21-2023 07:00 AM - edited 10-21-2023 07:03 AM
The old REST API was removed some time ago in favor of the IETF RFC8040-based RESTCONF API. So with NSO 6.1 try something like:
curl -X GET -u admin:admin http://localhost:8080/restconf/data/tailf-ncs-monitoring:ncs-state/tailf-ncs-monitoring2:daemon-status -H "Accept: application/yang-data+json"
{
"tailf-ncs-monitoring2:daemon-status": "started"
}
10-21-2023 10:02 AM
10-21-2023 12:02 PM
If you add an admin user to the NSO local authentication, also make sure /ncs-config/aaa/local-authentication/enabled is set to true in your ncs.conf.
10-22-2023 07:11 AM
10-23-2023 05:12 AM
The "authentication failed" message is not coming from NSO. A quick web search for the error message you get indicates a proxy issue.
10-23-2023 05:31 AM
10-25-2023 07:07 AM
10-23-2023 05:26 AM
Hi sm000x,
We recently launched the NSO playground, where you can play with NSO in your web browser. Here you can experiment getting the deamon status using curl. We have two variants, local and system install. Since I see you are working with PAM, the system install version can help more.
The playground has a fresh system install so, to get deamon status via curl with admin:admin you need to:
curl -X GET -u admin:admin http://localhost:8080/restconf/data/tailf-ncs-monitoring:ncs-state/daemon-status -H "Accept: application/yang-data+json"
Here are the instructions with more details: https://github.com/CiscoDevNet/NSO-Playground-System-Install/tree/main/webui it has steps to do the changes manually or via cli.
And here you can find a direct access to the playground: https://developer.cisco.com/codeexchange/devenv/CiscoDevNet/NSO-Playground-System-Install
Hopefully this can help you to pin point the issue.
Feel free to do any changes, you can reset the environment any time to start again. if you have issues loading the page the first time, just refresh it. Also, get familiar with the solution here: https://github.com/CiscoDevNet/NSO-Playground-System-Install
Snippet of point 4:
aaa authentication users user admin
uid 65534
gid 65534
password admin
ssh_keydir /var/ncs/homes/admin/.ssh
homedir /var/ncs/homes/admin
!
nacm write-default permit
nacm groups group admin
user-name [ admin ]
!
nacm rule-list admin
group [ admin ]
rule any-access
action permit
!
cmdrule any-command
action permit
!
!
nacm rule-list any-group
group [ * ]
rule tailf-aaa-user
module-name tailf-aaa
path /user[name='$USER']
access-operations create,read,update,delete
action permit
!
rule tailf-webui-user
module-name tailf-webui
path /webui/data-stores/user-profile[username='$USER']
access-operations create,read,update,delete
action permit
!
rule tailf-aaa-authentication
module-name tailf-aaa
path /aaa/authentication/users/user[name='$USER']
access-operations read,update
action permit
!
!
10-23-2023 05:38 AM
10-25-2023 07:10 AM
Hi, Jesus:
I am confirmed this issue is Proxy issue. But the tool surely is a useful tool.
Thank you so much for providing such a wonderful tool.
THX
sm000x
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