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

OSPF neighbor KeyError: 'adjacency' #68

Closed
EsterniTY opened this issue Oct 3, 2023 · 1 comment · Fixed by #85
Closed

OSPF neighbor KeyError: 'adjacency' #68

EsterniTY opened this issue Oct 3, 2023 · 1 comment · Fixed by #85
Milestone

Comments

@EsterniTY
Copy link

When ospf neighbor in 2-way state there is no adjacency field received from router and I have this trace:

Traceback (most recent call last):                                                                                                                                                                                                            
  File "/home/user/git/monitoring-check_routeros/./check_routeros.py", line 7, in <module>
    cli()                                           
  File "/usr/lib/python3/dist-packages/click/core.py", line 829, in __call__      
    return self.main(*args, **kwargs)                                                                                                                                                                                                         
  File "/usr/lib/python3/dist-packages/click/core.py", line 782, in main
    rv = self.invoke(ctx)                           
  File "/usr/lib/python3/dist-packages/click/core.py", line 1259, in invoke       
    return _process_result(sub_ctx.command.invoke(sub_ctx))                                                                                                                                                                                   
  File "/usr/lib/python3/dist-packages/click/core.py", line 1066, in invoke                                            
    return ctx.invoke(self.callback, **ctx.params)                                                                     
  File "/usr/lib/python3/dist-packages/click/core.py", line 610, in invoke                                             
    return callback(*args, **kwargs)
  File "/usr/lib/python3/dist-packages/click/decorators.py", line 21, in new_func                                                                                                                                                             
    return f(get_current_context(), *args, **kwargs)                                                                   
  File "/home/user/git/monitoring-check_routeros/routeros_check/check/routing_ospf_neighbor.py", line 160, in routing_ospf_neighbors                                                                                                        
    check.main(verbose=ctx.obj["verbose"])                                                                             
  File "/home/user/.local/lib/python3.9/site-packages/nagiosplugin/check.py", line 122, in main                                                                                                                                             
    runtime.execute(self, verbose, timeout)
  File "/home/user/.local/lib/python3.9/site-packages/nagiosplugin/runtime.py", line 132, in execute
    self.run(check)
  File "/home/user/.local/lib/python3.9/site-packages/nagiosplugin/runtime.py", line 119, in run
    check()
  File "/home/user/.local/lib/python3.9/site-packages/nagiosplugin/check.py", line 107, in __call__
    self._evaluate_resource(resource)
  File "/home/user/.local/lib/python3.9/site-packages/nagiosplugin/check.py", line 74, in _evaluate_resource
    metrics = resource.probe()
  File "/home/user/git/monitoring-check_routeros/routeros_check/check/routing_ospf_neighbor.py", line 91, in probe
    return self.get_routeros_metric_item(result)
  File "/home/user/git/monitoring-check_routeros/routeros_check/resource.py", line 326, in get_routeros_metric_item
    value = api_result[metric_value_name]
KeyError: 'adjacency'

Here is api_result example:

{'instance': 'default', 'router-id': '<router-id>', 'state': '2-Way', 'state-changes': 5, 'priority': 1, 'ls-retransmits': 0, 'ls-requests': 0, 'db-summaries': 0}
@phibos phibos added this to the 0.10.0 milestone Apr 22, 2024
@phibos
Copy link
Member

phibos commented Jun 11, 2024

The issue has been fixed and will be in the next release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants