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

Failed to parse MIB file / #8

Open
nagarjung opened this issue May 17, 2021 · 4 comments
Open

Failed to parse MIB file / #8

nagarjung opened this issue May 17, 2021 · 4 comments

Comments

@nagarjung
Copy link

Hi,

I am trying to setup the snmp agent to monitor the bird bgp.
I have followed the instructions in the README file from [https://github.com/mikenowak/bird-snmp-agent]

As I am new to bird daemon, I assume few instruction in the readme file as below:

  1. Setting the environment variables in the setting section is done in /etc/bird/envvars.
  2. I have put the systemd unit section into /etc/init.d/bird. (Is this location correct) ? But /etc/init.d/bird file does not recognise
    the sections [Unit], [service], [install].

So I have the copied the contents at the end of /etc/init.d/bird as :

Description="BIRD SNMP Agent"
After=snmp.service

PermissionsStartOnly=true
User=snmp
Group=snmp
WorkingDirectory=/usr/local/bird-snmp-agent
ExecStart=/usr/bin/env python3 /usr/local/bird-snmp-agent/bird_bgp.py
ExecReload=/bin/kill -s HUP $MAINPID
ExecStop=/bin/kill -s TERM $MAINPID
PrivateTmp=true

WantedBy=multi-user.target

Finally I run bird daemon using the below command:

root@ubuntu:xxxxxxx# /etc/init.d/bird start

  • Starting BIRD Internet Routing Daemon (IPv4) bird
    ...done.
    bird-bgp-agent AgentX starting
    NET-SNMP version 5.7.2 AgentX subagent connected
    Failed to parse MIB file /

Looks like it is unable to parse the MIB file. I have placed my MIB file in /usr/share/snmp/mibs.
I have also place the MIB File /var/lib/mibs/ietf/BGP4-MIB ( as required by bird-bop-agent).

Result of snmpwalk:
root@ubuntu:/home/nagarjun# snmpget -v 2c -c public 172.20.10.2 1.3.6.1.2.1.15.1
iso.3.6.1.2.1.15.1 = No Such Object available on this agent at this OID

Any help is appreciated. Also do you have clear document/instructions to set the bird-bgp-agent.

Thanks
Nagarjun

@yswery-reconz
Copy link

@nagarjung Did you get this solved?

@peterbaumert
Copy link

having same issue :(

@peterbaumert
Copy link

peterbaumert commented Oct 30, 2021

@nagarjung @yswery-reconz

add to adv_agentx.py

import locale under last import

def b(s):
    """ Encodes Unicode strings to byte strings, if necessary. """
    return s if isinstance(s, bytes) else s.encode(locale.getpreferredencoding())

after def ReadTOID for example

and last change axl.read_mib(mib) to axl.read_mib(b(mib))

@yswery-reconz
Copy link

@peterbaumert Nice, many thanks! looks like its no longer erroring and continuing to work all nice

WolffyTheReal pushed a commit to WolffyTheReal/bird-snmp-agent that referenced this issue Dec 13, 2021
with locale Fix from carosio#8
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

No branches or pull requests

3 participants