Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SNMP configuration not more working since RouterOS 7.10 #208

Closed
phox142 opened this issue Aug 30, 2023 · 5 comments · Fixed by #218
Closed

SNMP configuration not more working since RouterOS 7.10 #208

phox142 opened this issue Aug 30, 2023 · 5 comments · Fixed by #218
Labels
bug Something isn't working

Comments

@phox142
Copy link
Contributor

phox142 commented Aug 30, 2023

SUMMARY

Since version 7.10 Mikrotik added snmp "engine-id-suffix" setting and set "engine-id" as read-only property;
Therefore the api disallow the parameter "engine-id" in the configuration calls and "api_update" does not work anymore as it always put a "empty" value in the call.
I tried different solutions to adapt the code but I don't find any backward compatible solution as the only solution I found is to remove this field from "_api_data.py"

ISSUE TYPE
  • Bug Report
COMPONENT NAME
  • api_update
  • api_data
ANSIBLE VERSION
ansible [core 2.15.2]
  config file = /etc/ansible/ansible.cfg
  configured module search path = ['/home/***/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python3/dist-packages/ansible
  ansible collection location = /home/***/.ansible/collections:/usr/share/ansible/collections
  executable location = /usr/bin/ansible
  python version = 3.10.12 (main, Jun 11 2023, 05:26:28) [GCC 11.4.0] (/usr/bin/python3)
  jinja version = 3.0.3
  libyaml = True
COLLECTION VERSION
2.9.0
CONFIGURATION
CONFIG_FILE() = /etc/ansible/ansible.cfg
DEFAULT_JINJA2_EXTENSIONS(/etc/ansible/ansible.cfg) = jinja2.ext.do
OS / ENVIRONMENT

Ubuntu 22.04

STEPS TO REPRODUCE
- name: Setup SNMP
  community.routeros.api_modify:
    path: snmp
    handle_entries_content: remove
    data: 
      - enabled: true
        contact: 'contact@test.com'
        location': location
        trap-target': 'x.y.w.z'
        trap-community': 'comm'
        trap-version': 3
        trap-generators': 'interfaces,start-trap,temp-exception'
        trap-interfaces': 'ens01'
        engine-id-suffix: 123456789
EXPECTED RESULTS

Possibility to configure SNMP without error ;)

ACTUAL RESULTS
"Error while modifying: unknown parameter engine-id"
@felixfontein
Copy link
Collaborator

This was about to happen sooner or later... I'll see whether I can add some code to handle that.

@felixfontein
Copy link
Collaborator

I started working on this in #209. Right now it is a very coarse mechanism, you have to provide a complete copy of the API path description. Will refine that next...

@felixfontein felixfontein added the bug Something isn't working label Sep 1, 2023
@felixfontein
Copy link
Collaborator

#212 completes the work.

CC @hansmi - the PRs adjust some of your changes so that new fields and paths are only available on the respective RouterOS versions.

@phox142
Copy link
Contributor Author

phox142 commented Sep 4, 2023

Works perfectly by adding the following lines in the snmp APIData section and removing the definition of ``engine-id``` in the default fields.

versioned_fields=[
   ([('7.10', '<')], 'engine-id', KeyInfo(default='')),
],

I don't have currently access to a previous version of RouterOS. I can't test it right now.

@phox142 phox142 closed this as completed Sep 4, 2023
@phox142 phox142 reopened this Sep 13, 2023
@phox142
Copy link
Contributor Author

phox142 commented Sep 13, 2023

Disregard. Miss click

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants