pimvanpelt / vpp-snmp-agent

SNMP Agentx for VPP interface statistics
BSD 2-Clause "Simplified" License
23 stars 11 forks source link

VppApiDynamicMethodHolder error with VPP 23.06 #9

Closed fornacis-202 closed 1 year ago

fornacis-202 commented 1 year ago

I receive the following error when running vpp-snmp-agent with vpp 23.06:

/// --- Logging error --- Traceback (most recent call last): File "/home/fornacis/Desktop/vpp-snmp-agent/vppapi.py", line 129, in get_lcp lcp_list = self.vpp.api.lcp_itf_pair_get() AttributeError: 'VppApiDynamicMethodHolder' object has no attribute 'lcp_itf_pair_get' ///

when I remove the call for get_lcp() from vpp-snmp-agent.py (line 111), the other parts work without error.

pimvanpelt commented 1 year ago

The vpp-snmp-agent is expecting to see Linux CP enabled in VPP (in startup.conf):

plugins {
  plugin default { disable }
  plugin linux_nl_plugin.so { enable }
  plugin linux_cp_plugin.so { enable }
}

Otherwise, I remember I used to have a flag --no-lcp, but one possible fix is to wrap the call of lcp_itf_pair_get() in a try: statement, catch the exception as AttributeError, log a debug statement "expecting Linux CP to be enabled", possibly pointing to this github issue, and then moving on.

Would you be willing to send a PR for that ?

fornacis-202 commented 1 year ago

Thanks for your help. it is now working properly.