How to build FRR with snmp supported ?
Hi all, I'm working on FRR, and I want bgpd and zebra to support snmp like this ( http://docs.frrouting.org/en/latest/snmp.html). As I want to handle peer down/up events. So I use this script to build : .ONESHELL: SHELL = /bin/bash .SHELLFLAGS += -e MAIN_TARGET = $(FRR) DERIVED_TARGET = $(FRR_PYTHONTOOLS) $(FRR_DBG) $(addprefix $(DEST)/, $(MAIN_TARGET)): $(DEST)/% : # Build the package pushd ./frr tools/tarsource.sh -V -e '-sonic' dpkg-buildpackage -rfakeroot -b -us -uc -Ppkg.frr.nortrlib -j$(SONIC_CONFIG_MAKE_JOBS) popd mv $(DERIVED_TARGET) $* $(DEST)/ $(addprefix $(DEST)/, $(DERIVED_TARGET)): $(DEST)/% : $(DEST)/$(MAIN_TARGET) In build log, I found there are zebra_snmp.so, and I found in this folder
$ find -name zebra_snmp.so ./frr/zebra/.libs/zebra_snmp.so ./frr/debian/frr-snmp/usr/lib/x86_64-linux-gnu/frr/modules/zebra_snmp.so ./frr/debian/tmp/usr/lib/x86_64-linux-gnu/frr/modules/zebra_snmp.so
But at last, in deb package, this is no zebra_snmp.so and other snmp.so in modules folder, and actually there is no modules folder. So how to build with these modules and snmp support like that URL? Will this be work? 1. Add '-Ppkg.frr.snmp' in 'dpkg-buildpackage' step? Or 2. Use some old version? Thank you~ ---- Simon Jones
SNMP support is in a separate debian package called "frr-snmp". It is installed *additionally* to the "frr" package. -David On Thu, Aug 01, 2019 at 03:31:11PM +0800, Simon Jones wrote:
Hi all,
I'm working on FRR, and I want bgpd and zebra to support snmp like this ( http://docs.frrouting.org/en/latest/snmp.html). As I want to handle peer down/up events.
So I use this script to build : .ONESHELL: SHELL = /bin/bash .SHELLFLAGS += -e
MAIN_TARGET = $(FRR) DERIVED_TARGET = $(FRR_PYTHONTOOLS) $(FRR_DBG)
$(addprefix $(DEST)/, $(MAIN_TARGET)): $(DEST)/% : # Build the package pushd ./frr tools/tarsource.sh -V -e '-sonic' dpkg-buildpackage -rfakeroot -b -us -uc -Ppkg.frr.nortrlib -j$(SONIC_CONFIG_MAKE_JOBS) popd mv $(DERIVED_TARGET) $* $(DEST)/
$(addprefix $(DEST)/, $(DERIVED_TARGET)): $(DEST)/% : $(DEST)/$(MAIN_TARGET)
In build log, I found there are zebra_snmp.so, and I found in this folder
$ find -name zebra_snmp.so ./frr/zebra/.libs/zebra_snmp.so ./frr/debian/frr-snmp/usr/lib/x86_64-linux-gnu/frr/modules/zebra_snmp.so ./frr/debian/tmp/usr/lib/x86_64-linux-gnu/frr/modules/zebra_snmp.so
But at last, in deb package, this is no zebra_snmp.so and other snmp.so in modules folder, and actually there is no modules folder.
So how to build with these modules and snmp support like that URL?
Will this be work? 1. Add '-Ppkg.frr.snmp' in 'dpkg-buildpackage' step? Or 2. Use some old version?
Thank you~
---- Simon Jones
_______________________________________________ dev mailing list dev@lists.frrouting.org https://lists.frrouting.org/listinfo/dev
Thank you ! BUT I still have these questions, I don't know if I'm wrong: 1. In this doc (http://docs.frrouting.org/en/latest/snmp.html), I think SNMP related code in FRR is - snmp codes of each module, like zebra or bgpd, which is located in .../modules/zebra_snmp.so. And these codes is load while zebra or bgpd start up? These codes response for report snmp events in zebra or bgpd modules by protocol to agentX? - AgentX, which is used to receive these snmp events and call snmp traps 2. So I want to start zebra with zebra_snmp.so. But I got errors which tell me there is no zebra_snmp.so. So I check build process, then I have questions in the email above. 3. Is there some docs about how to build, package, install and use frr-snmp? As this(http://docs.frrouting.org/en/latest/snmp.html) is not very clear. - http://docs.frrouting.org/en/latest/snmp.html tell me SNMP support compile is just use `--enable-snmp`. But as I said above, there is zebra_snmp.so in compile log, but no zebra_snmp.so in packages I installed. - http://docs.frrouting.org/en/latest/snmp.html tell me SNMP support could be started by `--module <module:snmp>`, but when I start, report error log that 'there is no zebra_snmp.so in .../modules/' 4. So could someone tell me clear steps on: - How to installed *additionally* to the "frr" package. - How to start SNMP support in system. Thank you~ ---- Simon Jones David Lamparter <equinox@diac24.net> 于2019年8月1日周四 下午3:36写道:
SNMP support is in a separate debian package called "frr-snmp". It is installed *additionally* to the "frr" package.
-David
On Thu, Aug 01, 2019 at 03:31:11PM +0800, Simon Jones wrote:
Hi all,
I'm working on FRR, and I want bgpd and zebra to support snmp like this ( http://docs.frrouting.org/en/latest/snmp.html). As I want to handle peer down/up events.
So I use this script to build : .ONESHELL: SHELL = /bin/bash .SHELLFLAGS += -e
MAIN_TARGET = $(FRR) DERIVED_TARGET = $(FRR_PYTHONTOOLS) $(FRR_DBG)
$(addprefix $(DEST)/, $(MAIN_TARGET)): $(DEST)/% : # Build the package pushd ./frr tools/tarsource.sh -V -e '-sonic' dpkg-buildpackage -rfakeroot -b -us -uc -Ppkg.frr.nortrlib -j$(SONIC_CONFIG_MAKE_JOBS) popd mv $(DERIVED_TARGET) $* $(DEST)/
$(addprefix $(DEST)/, $(DERIVED_TARGET)): $(DEST)/% : $(DEST)/$(MAIN_TARGET)
In build log, I found there are zebra_snmp.so, and I found in this folder
$ find -name zebra_snmp.so ./frr/zebra/.libs/zebra_snmp.so
./frr/debian/frr-snmp/usr/lib/x86_64-linux-gnu/frr/modules/zebra_snmp.so
./frr/debian/tmp/usr/lib/x86_64-linux-gnu/frr/modules/zebra_snmp.so
But at last, in deb package, this is no zebra_snmp.so and other snmp.so in modules folder, and actually there is no modules folder.
So how to build with these modules and snmp support like that URL?
Will this be work? 1. Add '-Ppkg.frr.snmp' in 'dpkg-buildpackage' step? Or 2. Use some old version?
Thank you~
---- Simon Jones
_______________________________________________ dev mailing list dev@lists.frrouting.org https://lists.frrouting.org/listinfo/dev
On Thu, Aug 01, 2019 at 03:56:40PM +0800, Simon Jones wrote:
1. In this doc (http://docs.frrouting.org/en/latest/snmp.html), I think SNMP related code in FRR is - snmp codes of each module, like zebra or bgpd, which is located in .../modules/zebra_snmp.so. And these codes is load while zebra or bgpd start up? These codes response for report snmp events in zebra or bgpd modules by protocol to agentX? - AgentX, which is used to receive these snmp events and call snmp traps
I'm having some trouble understanding your questions, but the modules are installed to /usr/lib/*/frr/modules/*_snmp.so and loaded at startup with the "-M snmp" option.
2. So I want to start zebra with zebra_snmp.so. But I got errors which tell me there is no zebra_snmp.so. So I check build process, then I have questions in the email above.
Then the frr-snmp package is not installed. There is no problem with the build process. Unless you modify the Debian package - or the package build didn't complete successfully - SNMP support is enabled for Debian packages.
3. Is there some docs about how to build, package, install and use frr-snmp? As this(http://docs.frrouting.org/en/latest/snmp.html) is not very clear. - http://docs.frrouting.org/en/latest/snmp.html tell me SNMP support compile is just use `--enable-snmp`. But as I said above, there is zebra_snmp.so in compile log, but no zebra_snmp.so in packages I installed. - http://docs.frrouting.org/en/latest/snmp.html tell me SNMP support could be started by `--module <module:snmp>`, but when I start, report error log that 'there is no zebra_snmp.so in .../modules/'
There is nothing to change to enable SNMP support in Debian packages. You just need to install the frr-snmp package and add the "-M snmp" / "--module snmp" (same option) to your config.
4. So could someone tell me clear steps on: - How to installed *additionally* to the "frr" package.
apt-get install frr-snmp or dpkg -i frr-snmp_*.deb
- How to start SNMP support in system.
You seem to have that in place already since you're getting the "zebra_snmp.so not found" error. -David
Oh,maybe I did not introduce clearly, I'm working on sonic-frr( https://github.com/Azure/sonic-frr), what I want to do is: 1. sonic-frr build FRR deb package into a docker image, but this image has no SNMP support, so I have to add SNMP support, so I ask questions above. 2. How sonic-frr build is - use this script to build FRR deb package, is this script build SNMP codes(/usr/lib/*/frr/modules/*_snmp.so)? I think it is. .ONESHELL: SHELL = /bin/bash .SHELLFLAGS += -e MAIN_TARGET = $(FRR) DERIVED_TARGET = $(FRR_PYTHONTOOLS) $(FRR_DBG) $(addprefix $(DEST)/, $(MAIN_TARGET)): $(DEST)/% : # Build the package pushd ./frr tools/tarsource.sh -V -e '-sonic' dpkg-buildpackage -rfakeroot -b -us -uc -Ppkg.frr.nortrlib -j$(SONIC_CONFIG_MAKE_JOBS) popd mv $(DERIVED_TARGET) $* $(DEST)/ $(addprefix $(DEST)/, $(DERIVED_TARGET)): $(DEST)/% : $(DEST)/$(MAIN_TARGET) - use this script to build sonic-frr docker image, is this script install SNMP codes into docker image? I think it's NOT, so I want to know how to package SNMP codes into docker image, which is how to install SNMP codes into deb package. Is it to add '-Ppkg.frr.snmp' ? # FRRouting (frr) package FRR_VERSION = 7.0.1 FRR_SUBVERSION = 0 export FRR_VERSION FRR_SUBVERSION FRR = frr_$(FRR_VERSION)-sonic-$(FRR_SUBVERSION)_amd64.deb $(FRR)_DEPENDS += $(LIBSNMP_DEV) $(LIBYANG_DEV) $(FRR)_RDEPENDS += $(LIBYANG) $(FRR)_SRC_PATH = $(SRC_PATH)/sonic-frr SONIC_MAKE_DEBS += $(FRR) SONIC_STRETCH_DEBS += $(FRR) FRR_PYTHONTOOLS = frr-pythontools_$(FRR_VERSION)-sonic-$(FRR_SUBVERSION) _all.deb $(eval $(call add_derived_package,$(FRR),$(FRR_PYTHONTOOLS))) FRR_DBG = frr-dbgsym_$(FRR_VERSION)-sonic-$(FRR_SUBVERSION)_amd64.deb $(eval $(call add_derived_package,$(FRR),$(FRR_DBG))) export FRR FRR_PYTHONTOOLS FRR_DBG - use docker command to install this image Thanks ~ ---- Simon Jones David Lamparter <equinox@diac24.net> 于2019年8月1日周四 下午5:05写道:
On Thu, Aug 01, 2019 at 03:56:40PM +0800, Simon Jones wrote:
1. In this doc (http://docs.frrouting.org/en/latest/snmp.html), I think SNMP related code in FRR is - snmp codes of each module, like zebra or bgpd, which is located in .../modules/zebra_snmp.so. And these codes is load while zebra or bgpd start up? These codes response for report snmp events in zebra or bgpd modules by protocol to agentX? - AgentX, which is used to receive these snmp events and call snmp traps
I'm having some trouble understanding your questions, but the modules are installed to /usr/lib/*/frr/modules/*_snmp.so and loaded at startup with the "-M snmp" option.
2. So I want to start zebra with zebra_snmp.so. But I got errors which tell me there is no zebra_snmp.so. So I check build process, then I have questions in the email above.
Then the frr-snmp package is not installed. There is no problem with the build process. Unless you modify the Debian package - or the package build didn't complete successfully - SNMP support is enabled for Debian packages.
3. Is there some docs about how to build, package, install and use frr-snmp? As this(http://docs.frrouting.org/en/latest/snmp.html) is not very clear. - http://docs.frrouting.org/en/latest/snmp.html tell me SNMP support compile is just use `--enable-snmp`. But as I said above, there is zebra_snmp.so in compile log, but no zebra_snmp.so in packages I installed. - http://docs.frrouting.org/en/latest/snmp.html tell me SNMP support could be started by `--module <module:snmp>`, but when I start, report error log that 'there is no zebra_snmp.so in .../modules/'
There is nothing to change to enable SNMP support in Debian packages. You just need to install the frr-snmp package and add the "-M snmp" / "--module snmp" (same option) to your config.
4. So could someone tell me clear steps on: - How to installed *additionally* to the "frr" package.
apt-get install frr-snmp or dpkg -i frr-snmp_*.deb
- How to start SNMP support in system.
You seem to have that in place already since you're getting the "zebra_snmp.so not found" error.
-David
On Thu, Aug 01, 2019 at 08:32:05PM +0800, Simon Jones wrote:
Oh,maybe I did not introduce clearly, I'm working on sonic-frr( https://github.com/Azure/sonic-frr),
I don't see any changes in the Debian packaging there.
dpkg-buildpackage -rfakeroot -b -us -uc -Ppkg.frr.nortrlib -j$(SONIC_CONFIG_MAKE_JOBS)
This command will build the "frr-snmp" package along with "frr", "frr-doc" and "frr-pythontools".
- use this script to build sonic-frr docker image, is this script install SNMP codes into docker image? I think it's NOT, so I want to know how to package SNMP codes into docker image, which is how to install SNMP codes into deb package.
You're taking a wrong turn at the "into deb package" part. The SNMP modules are in the "frr-snmp" package. All you need to do is to make sure the "frr-snmp" package is included in your Docker image, like the "frr" package already is. There's something in your Docker image build that already lists the FRR package to be included into the image. You need to add frr-snmp there. Unfortunately I can't really help you with that as understanding the Sonic Docker image build process would take up more of my time than I can afford. Sorry.
Is it to add '-Ppkg.frr.snmp' ?
No. That option does not exist. It is always enabled. -David
dpkg-buildpackage -rfakeroot -b -us -uc -Ppkg.frr.nortrlib -j$(SONIC_CONFIG_MAKE_JOBS)
This command will build the "frr-snmp" package along with "frr", "frr-doc" and "frr-pythontools".
Thank you, but my question is: if frr-snmp has been build, is it NOT packaged into deb package? If it is, which command is to package frr-snmp into deb package? If it is not, why FRR running from this docker image has NO /usr/lib/*/frr/modules/*_snmp.so ? And could not start zebra with '-M snmp' ? ---- Simon Jones David Lamparter <equinox@diac24.net> 于2019年8月1日周四 下午9:06写道:
On Thu, Aug 01, 2019 at 08:32:05PM +0800, Simon Jones wrote:
Oh,maybe I did not introduce clearly, I'm working on sonic-frr( https://github.com/Azure/sonic-frr),
I don't see any changes in the Debian packaging there.
dpkg-buildpackage -rfakeroot -b -us -uc -Ppkg.frr.nortrlib -j$(SONIC_CONFIG_MAKE_JOBS)
This command will build the "frr-snmp" package along with "frr", "frr-doc" and "frr-pythontools".
- use this script to build sonic-frr docker image, is this script install SNMP codes into docker image? I think it's NOT, so I want to know how to package SNMP codes into docker image, which is how to install SNMP codes into deb package.
You're taking a wrong turn at the "into deb package" part.
The SNMP modules are in the "frr-snmp" package. All you need to do is to make sure the "frr-snmp" package is included in your Docker image, like the "frr" package already is.
There's something in your Docker image build that already lists the FRR package to be included into the image. You need to add frr-snmp there. Unfortunately I can't really help you with that as understanding the Sonic Docker image build process would take up more of my time than I can afford. Sorry.
Is it to add '-Ppkg.frr.snmp' ?
No. That option does not exist. It is always enabled.
-David
For licensing reasons, the snmp support for FRR is always built as a separate package. So it will never be part of the main FRR package. Instead, when you run `dpkg-buildpackage` an additional `frr-snmp` package will be produced. To debug your problem, as pointed out by David, first check whether the `frr-snmp` package is built by your call to `dpkg-buildpackage` and then check your Dockerfile to see if it actually installs the `frr-snmp` package. All Best, Chris On Fri, Aug 2, 2019, 04:46 Simon Jones <batmanustc@gmail.com> wrote:
dpkg-buildpackage -rfakeroot -b -us -uc -Ppkg.frr.nortrlib
-j$(SONIC_CONFIG_MAKE_JOBS) This command will build the "frr-snmp" package along with "frr", "frr-doc" and "frr-pythontools".
Thank you, but my question is: if frr-snmp has been build, is it NOT packaged into deb package? If it is, which command is to package frr-snmp into deb package? If it is not, why FRR running from this docker image has NO /usr/lib/*/frr/modules/*_snmp.so ? And could not start zebra with '-M snmp' ?
---- Simon Jones
David Lamparter <equinox@diac24.net> 于2019年8月1日周四 下午9:06写道:
On Thu, Aug 01, 2019 at 08:32:05PM +0800, Simon Jones wrote:
Oh,maybe I did not introduce clearly, I'm working on sonic-frr( https://github.com/Azure/sonic-frr),
I don't see any changes in the Debian packaging there.
dpkg-buildpackage -rfakeroot -b -us -uc -Ppkg.frr.nortrlib -j$(SONIC_CONFIG_MAKE_JOBS)
This command will build the "frr-snmp" package along with "frr", "frr-doc" and "frr-pythontools".
- use this script to build sonic-frr docker image, is this script install SNMP codes into docker image? I think it's NOT, so I want to
know
how to package SNMP codes into docker image, which is how to install SNMP codes into deb package.
You're taking a wrong turn at the "into deb package" part.
The SNMP modules are in the "frr-snmp" package. All you need to do is to make sure the "frr-snmp" package is included in your Docker image, like the "frr" package already is.
There's something in your Docker image build that already lists the FRR package to be included into the image. You need to add frr-snmp there. Unfortunately I can't really help you with that as understanding the Sonic Docker image build process would take up more of my time than I can afford. Sorry.
Is it to add '-Ppkg.frr.snmp' ?
No. That option does not exist. It is always enabled.
-David
_______________________________________________ dev mailing list dev@lists.frrouting.org https://lists.frrouting.org/listinfo/dev
participants (3)
-
Christian Franke -
David Lamparter -
Simon Jones