All Apps and Add-ons

Cisco Nexus 9k Add-on: collect.py ERROR: __init__() got an unexpected keyword argument ‘context’

lqiao2
Path Finder

Hi,

I installed and configured Cisco Nexus 9k Add-on.

However, I got an error like this:

Nexus Error: Not able to Execute command through NXAPI: init() got an unexpected keyword argument ‘context’, DEVICE IP: xxxx.xxx.xx.xxx. COMMAND: show version

Has anyone experienced this? If so, can you please share the resolution?

One possible reason that I can think of is that this add-on issues NX-API call with https while on the switch' side, it is http, right? Can this add-on provides the option to choose whether http or https? Changing the code in collect.py is not very nice.

Thanks in advance.

0 Karma
1 Solution

lqiao2
Path Finder

I answered this question by myself. While debugging the Python scripts of this add-on, I found out that there is a protocol mismatch between "collect.py" and "utils/nxapi_utils.py". In the "collect.py", the URL is with HTTPS. But the "nxapi_utils.py" uses "RespFetcher", which is coded HTTP. So if you align these two scripts, it should work. I switched to HTTP in "collect.py" and I can see data is coming to Splunk. HTTPS doesn't work for me at the moment as it is not yet configured on the switch side. Hope it helps.

View solution in original post

0 Karma

lqiao2
Path Finder

I answered this question by myself. While debugging the Python scripts of this add-on, I found out that there is a protocol mismatch between "collect.py" and "utils/nxapi_utils.py". In the "collect.py", the URL is with HTTPS. But the "nxapi_utils.py" uses "RespFetcher", which is coded HTTP. So if you align these two scripts, it should work. I switched to HTTP in "collect.py" and I can see data is coming to Splunk. HTTPS doesn't work for me at the moment as it is not yet configured on the switch side. Hope it helps.

0 Karma

mstjohn_splunk
Splunk Employee
Splunk Employee

@Iqiao2

Glad you figured this out! Would you mind approving your answer so that others know it's the correct solution? Thanks.

0 Karma
Get Updates on the Splunk Community!

Updated Team Landing Page in Splunk Observability

We’re making some changes to the team landing page in Splunk Observability, based on your feedback. The ...

New! Splunk Observability Search Enhancements for Splunk APM Services/Traces and ...

Regardless of where you are in Splunk Observability, you can search for relevant APM targets including service ...

Webinar Recap | Revolutionizing IT Operations: The Transformative Power of AI and ML ...

The Transformative Power of AI and ML in Enhancing Observability   In the realm of IT operations, the ...