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

Various improvements #10

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
Open

Various improvements #10

wants to merge 10 commits into from

Conversation

jplitza
Copy link

@jplitza jplitza commented Nov 13, 2019

In particular, we don't need to parse the local AS from the config anymore with current bird versions.

@mikenowak
Copy link
Owner

Hi @jplitza, thanks for the PR.

Few things though,

  1. your systemd unit would run the agent as root, I am not a big fan of that - see the README for an example of recommended unit file.
  2. Just like you say Local AS is only available on recent versions of bird (I am not even sure when it was introduced - can you specify?), and this change isn't backwards compatible.

@jplitza
Copy link
Author

jplitza commented Dec 12, 2019

Ah yes, I only found the unit in the README after writing my own. Will check.

The output was added in commit 0b1e1e1, which is first contained in version 2.0.5.

When I wrote the patch for bird, I did it precisely because bird-snmp-agent was unable to parse the local AS from my config. Maybe my later improvements of the config parsing code would make this work, but I don't currently have the time to check, sorry.

@interduo
Copy link

interduo commented Sep 15, 2022

@mikenowak are You planning to merge that PR?

The second thing - at the current state of master I've got an error:

python3 bird_bgp.py 
bird-bgp-agent AgentX starting
NET-SNMP version 5.9 AgentX subagent connected
Failed to parse MIB file /


/usr/local/bird-snmp-agent# snmptranslate -m BGP4-MIB 1
iso

on Debian 11

and also error in journal:

wrz 15 15:39:26 rtx-bgp python3[703290]: Exception ignored on calling ctypes callback function: <function _handler_wrapper at 0x7f3f712>
wrz 15 15:39:26 rtx-bgp python3[703290]: Traceback (most recent call last):
wrz 15 15:39:26 rtx-bgp python3[703290]:   File "/usr/local/bird-snmp-agent/adv_agentx.py", line 464, in _handler_wrapper
wrz 15 15:39:26 rtx-bgp python3[703290]:     AXObject.GlobalsRun('OnUpdate')
wrz 15 15:39:26 rtx-bgp python3[703290]:   File "/usr/local/bird-snmp-agent/adv_agentx.py", line 713, in GlobalsRun
wrz 15 15:39:26 rtx-bgp python3[703290]:     self.Globals[name](self, self.AXData)
wrz 15 15:39:26 rtx-bgp python3[703290]:   File "/usr/local/bird-snmp-agent/bird_bgp.py", line 92, in <lambda>
wrz 15 15:39:26 rtx-bgp python3[703290]:     "OnUpdate": lambda ax, axd: OnUpdate(ax, axd, bird.getBGPState())
wrz 15 15:39:26 rtx-bgp python3[703290]:   File "/usr/local/bird-snmp-agent/birdagent.py", line 188, in getBGPState
wrz 15 15:39:26 rtx-bgp python3[703290]:     for line in BirdAgent.combinedConfigLines(self.cfgfile):
wrz 15 15:39:26 rtx-bgp python3[703290]:   File "/usr/local/bird-snmp-agent/birdagent.py", line 163, in combinedConfigLines
wrz 15 15:39:26 rtx-bgp python3[703290]:     sys.exit(1)
wrz 15 15:39:26 rtx-bgp python3[703290]: SystemExit: 1

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 this pull request may close these issues.

3 participants