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

net-snmp: refactor Makefile for optional variant with openssl and logging #25444

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

Conversation

Chris1189
Copy link

@Chris1189 Chris1189 commented Nov 25, 2024

Maintainer: @stintel
Compile tested: x86_64, Openwrt 24.10
Run tested: x86_64, Openwrt 24.10

Description:
Openssl is needed to implement encryption and authentification for SNMPv3.
As discussed in PR #25178 , I added a variant for net-snmp that compiles libnetsnmp
with libopenssl (for SNMPv3). The default compilation is with the former variant.

The features for SNMPv3 are added to snmpd.init file and the possibility
to log messages to syslog or a log file..

@Chris1189 Chris1189 marked this pull request as draft November 25, 2024 10:23
@Chris1189 Chris1189 force-pushed the pr/net-snmp branch 2 times, most recently from 063324f to 91c1e21 Compare November 25, 2024 10:45
@Chris1189 Chris1189 marked this pull request as ready for review November 25, 2024 10:46
@Chris1189 Chris1189 marked this pull request as draft November 25, 2024 11:02
@Chris1189 Chris1189 marked this pull request as ready for review November 28, 2024 07:51
@Chris1189 Chris1189 force-pushed the pr/net-snmp branch 2 times, most recently from 8bda243 to 9be48e9 Compare November 28, 2024 08:15
@Chris1189
Copy link
Author

@stintel : I updated the Makefile in a way that it is possible to compile snmp with or without openssl.
It also works for my purposes. Please review it when possible. Thank you!

@Chris1189 Chris1189 force-pushed the pr/net-snmp branch 4 times, most recently from d921a24 to da99ac5 Compare December 2, 2024 14:19
@Chris1189
Copy link
Author

Chris1189 commented Dec 3, 2024

@stintel : Did you find time to look into the changes?
(One check failed because i updated the comment to change to Openwrt 24.10)

@stintel
Copy link
Member

stintel commented Dec 3, 2024

@stintel : Did you find time to look into the changes?

Sorry, a bit busy with life. Might be a while. Without reviewing the code the following question comes to mind: can the user still do opkg install libnetsnmp?

@Chris1189
Copy link
Author

Chris1189 commented Dec 3, 2024

I understand that and I didn't have in mind to pressure you.
I checked and saw that it was not possible.
So i added PROVIDES:=libnetsnmpto both variants and now it is possible

@Chris1189
Copy link
Author

Hello @stintel ,
I think you might still be busy. May I ask you if you could suggest a different maintainer, who may see into the PR?
Only to get things going.

Copy link
Member

@stintel stintel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also please add example sections in net/net-snmp/files/snmpd.conf for both SNMPv3 and logging.

net/net-snmp/Makefile Outdated Show resolved Hide resolved
net/net-snmp/Makefile Outdated Show resolved Hide resolved
net/net-snmp/Makefile Outdated Show resolved Hide resolved
net/net-snmp/Makefile Outdated Show resolved Hide resolved
net/net-snmp/Makefile Show resolved Hide resolved
@stintel
Copy link
Member

stintel commented Feb 14, 2025

Build test on qoriq shows a bunch of conflicts. I ran make oldconfig and said yes to the -ssl variants. You should probably remove the old variants (libnetsnmp, snmp-utils, snmpd) and only keep the -ssl and -nossl variants. Have both variants provide the old package name. And make sure you cannot enable both the -ssl and -nossl variants at the same time.

Collected errors:
 * check_data_file_clashes: Package libnetsnmp-ssl wants to install file /home/stijn/Development/OpenWrt/openwrt/build_dir/target-powerpc64_e5500_musl/root-qoriq/usr/lib/libnetsnmp.so.40
        But that file is already provided by package  * libnetsnmp
 * check_data_file_clashes: Package libnetsnmp-ssl wants to install file /home/stijn/Development/OpenWrt/openwrt/build_dir/target-powerpc64_e5500_musl/root-qoriq/usr/lib/libnetsnmp.so.40.2.1
        But that file is already provided by package  * libnetsnmp
 * check_data_file_clashes: Package libnetsnmp-ssl wants to install file /home/stijn/Development/OpenWrt/openwrt/build_dir/target-powerpc64_e5500_musl/root-qoriq/usr/lib/libnetsnmpagent.so.40
        But that file is already provided by package  * libnetsnmp
 * check_data_file_clashes: Package libnetsnmp-ssl wants to install file /home/stijn/Development/OpenWrt/openwrt/build_dir/target-powerpc64_e5500_musl/root-qoriq/usr/lib/libnetsnmpagent.so.40.2.1
        But that file is already provided by package  * libnetsnmp
 * check_data_file_clashes: Package libnetsnmp-ssl wants to install file /home/stijn/Development/OpenWrt/openwrt/build_dir/target-powerpc64_e5500_musl/root-qoriq/usr/lib/libnetsnmphelpers.so.40
        But that file is already provided by package  * libnetsnmp
 * check_data_file_clashes: Package libnetsnmp-ssl wants to install file /home/stijn/Development/OpenWrt/openwrt/build_dir/target-powerpc64_e5500_musl/root-qoriq/usr/lib/libnetsnmphelpers.so.40.2.1
        But that file is already provided by package  * libnetsnmp
 * check_data_file_clashes: Package libnetsnmp-ssl wants to install file /home/stijn/Development/OpenWrt/openwrt/build_dir/target-powerpc64_e5500_musl/root-qoriq/usr/lib/libnetsnmpmibs.so.40
        But that file is already provided by package  * libnetsnmp
 * check_data_file_clashes: Package libnetsnmp-ssl wants to install file /home/stijn/Development/OpenWrt/openwrt/build_dir/target-powerpc64_e5500_musl/root-qoriq/usr/lib/libnetsnmpmibs.so.40.2.1
        But that file is already provided by package  * libnetsnmp
 * opkg_install_cmd: Cannot install package libnetsnmp-ssl.
 * check_data_file_clashes: Package libnetsnmp-ssl wants to install file /home/stijn/Development/OpenWrt/openwrt/build_dir/target-powerpc64_e5500_musl/root-qoriq/usr/lib/libnetsnmp.so.40
        But that file is already provided by package  * libnetsnmp
 * check_data_file_clashes: Package libnetsnmp-ssl wants to install file /home/stijn/Development/OpenWrt/openwrt/build_dir/target-powerpc64_e5500_musl/root-qoriq/usr/lib/libnetsnmp.so.40.2.1
        But that file is already provided by package  * libnetsnmp
 * check_data_file_clashes: Package libnetsnmp-ssl wants to install file /home/stijn/Development/OpenWrt/openwrt/build_dir/target-powerpc64_e5500_musl/root-qoriq/usr/lib/libnetsnmpagent.so.40
        But that file is already provided by package  * libnetsnmp
 * check_data_file_clashes: Package libnetsnmp-ssl wants to install file /home/stijn/Development/OpenWrt/openwrt/build_dir/target-powerpc64_e5500_musl/root-qoriq/usr/lib/libnetsnmpagent.so.40.2.1
        But that file is already provided by package  * libnetsnmp
 * check_data_file_clashes: Package libnetsnmp-ssl wants to install file /home/stijn/Development/OpenWrt/openwrt/build_dir/target-powerpc64_e5500_musl/root-qoriq/usr/lib/libnetsnmphelpers.so.40
        But that file is already provided by package  * libnetsnmp
 * check_data_file_clashes: Package libnetsnmp-ssl wants to install file /home/stijn/Development/OpenWrt/openwrt/build_dir/target-powerpc64_e5500_musl/root-qoriq/usr/lib/libnetsnmphelpers.so.40.2.1
        But that file is already provided by package  * libnetsnmp
 * check_data_file_clashes: Package libnetsnmp-ssl wants to install file /home/stijn/Development/OpenWrt/openwrt/build_dir/target-powerpc64_e5500_musl/root-qoriq/usr/lib/libnetsnmpmibs.so.40
        But that file is already provided by package  * libnetsnmp
 * check_data_file_clashes: Package libnetsnmp-ssl wants to install file /home/stijn/Development/OpenWrt/openwrt/build_dir/target-powerpc64_e5500_musl/root-qoriq/usr/lib/libnetsnmpmibs.so.40.2.1
        But that file is already provided by package  * libnetsnmp
 * opkg_install_cmd: Cannot install package snmp-utils-ssl.
 * check_data_file_clashes: Package libnetsnmp-ssl wants to install file /home/stijn/Development/OpenWrt/openwrt/build_dir/target-powerpc64_e5500_musl/root-qoriq/usr/lib/libnetsnmp.so.40
        But that file is already provided by package  * libnetsnmp
 * check_data_file_clashes: Package libnetsnmp-ssl wants to install file /home/stijn/Development/OpenWrt/openwrt/build_dir/target-powerpc64_e5500_musl/root-qoriq/usr/lib/libnetsnmp.so.40.2.1
        But that file is already provided by package  * libnetsnmp
 * check_data_file_clashes: Package libnetsnmp-ssl wants to install file /home/stijn/Development/OpenWrt/openwrt/build_dir/target-powerpc64_e5500_musl/root-qoriq/usr/lib/libnetsnmpagent.so.40
        But that file is already provided by package  * libnetsnmp
 * check_data_file_clashes: Package libnetsnmp-ssl wants to install file /home/stijn/Development/OpenWrt/openwrt/build_dir/target-powerpc64_e5500_musl/root-qoriq/usr/lib/libnetsnmpagent.so.40.2.1
        But that file is already provided by package  * libnetsnmp
 * check_data_file_clashes: Package libnetsnmp-ssl wants to install file /home/stijn/Development/OpenWrt/openwrt/build_dir/target-powerpc64_e5500_musl/root-qoriq/usr/lib/libnetsnmphelpers.so.40
        But that file is already provided by package  * libnetsnmp
 * check_data_file_clashes: Package libnetsnmp-ssl wants to install file /home/stijn/Development/OpenWrt/openwrt/build_dir/target-powerpc64_e5500_musl/root-qoriq/usr/lib/libnetsnmphelpers.so.40.2.1
        But that file is already provided by package  * libnetsnmp
 * check_data_file_clashes: Package libnetsnmp-ssl wants to install file /home/stijn/Development/OpenWrt/openwrt/build_dir/target-powerpc64_e5500_musl/root-qoriq/usr/lib/libnetsnmpmibs.so.40
        But that file is already provided by package  * libnetsnmp
 * check_data_file_clashes: Package libnetsnmp-ssl wants to install file /home/stijn/Development/OpenWrt/openwrt/build_dir/target-powerpc64_e5500_musl/root-qoriq/usr/lib/libnetsnmpmibs.so.40.2.1
        But that file is already provided by package  * libnetsnmp
 * opkg_install_cmd: Cannot install package snmpd-ssl.
 * check_data_file_clashes: Package libnetsnmp-ssl wants to install file /home/stijn/Development/OpenWrt/openwrt/build_dir/target-powerpc64_e5500_musl/root-qoriq/usr/lib/libnetsnmp.so.40
        But that file is already provided by package  * libnetsnmp
 * check_data_file_clashes: Package libnetsnmp-ssl wants to install file /home/stijn/Development/OpenWrt/openwrt/build_dir/target-powerpc64_e5500_musl/root-qoriq/usr/lib/libnetsnmp.so.40.2.1
        But that file is already provided by package  * libnetsnmp
 * check_data_file_clashes: Package libnetsnmp-ssl wants to install file /home/stijn/Development/OpenWrt/openwrt/build_dir/target-powerpc64_e5500_musl/root-qoriq/usr/lib/libnetsnmpagent.so.40
        But that file is already provided by package  * libnetsnmp
 * check_data_file_clashes: Package libnetsnmp-ssl wants to install file /home/stijn/Development/OpenWrt/openwrt/build_dir/target-powerpc64_e5500_musl/root-qoriq/usr/lib/libnetsnmpagent.so.40.2.1
        But that file is already provided by package  * libnetsnmp
 * check_data_file_clashes: Package libnetsnmp-ssl wants to install file /home/stijn/Development/OpenWrt/openwrt/build_dir/target-powerpc64_e5500_musl/root-qoriq/usr/lib/libnetsnmphelpers.so.40
        But that file is already provided by package  * libnetsnmp
 * check_data_file_clashes: Package libnetsnmp-ssl wants to install file /home/stijn/Development/OpenWrt/openwrt/build_dir/target-powerpc64_e5500_musl/root-qoriq/usr/lib/libnetsnmphelpers.so.40.2.1
        But that file is already provided by package  * libnetsnmp
 * check_data_file_clashes: Package libnetsnmp-ssl wants to install file /home/stijn/Development/OpenWrt/openwrt/build_dir/target-powerpc64_e5500_musl/root-qoriq/usr/lib/libnetsnmpmibs.so.40
        But that file is already provided by package  * libnetsnmp
 * check_data_file_clashes: Package libnetsnmp-ssl wants to install file /home/stijn/Development/OpenWrt/openwrt/build_dir/target-powerpc64_e5500_musl/root-qoriq/usr/lib/libnetsnmpmibs.so.40.2.1
        But that file is already provided by package  * libnetsnmp
 * opkg_install_cmd: Cannot install package snmptrapd-ssl.
 * check_data_file_clashes: Package libnetsnmp-ssl wants to install file /home/stijn/Development/OpenWrt/openwrt/build_dir/target-powerpc64_e5500_musl/root-qoriq/usr/lib/libnetsnmp.so.40
        But that file is already provided by package  * libnetsnmp
 * check_data_file_clashes: Package libnetsnmp-ssl wants to install file /home/stijn/Development/OpenWrt/openwrt/build_dir/target-powerpc64_e5500_musl/root-qoriq/usr/lib/libnetsnmp.so.40.2.1
        But that file is already provided by package  * libnetsnmp
 * check_data_file_clashes: Package libnetsnmp-ssl wants to install file /home/stijn/Development/OpenWrt/openwrt/build_dir/target-powerpc64_e5500_musl/root-qoriq/usr/lib/libnetsnmpagent.so.40
        But that file is already provided by package  * libnetsnmp
 * check_data_file_clashes: Package libnetsnmp-ssl wants to install file /home/stijn/Development/OpenWrt/openwrt/build_dir/target-powerpc64_e5500_musl/root-qoriq/usr/lib/libnetsnmpagent.so.40.2.1
        But that file is already provided by package  * libnetsnmp
 * check_data_file_clashes: Package libnetsnmp-ssl wants to install file /home/stijn/Development/OpenWrt/openwrt/build_dir/target-powerpc64_e5500_musl/root-qoriq/usr/lib/libnetsnmphelpers.so.40
        But that file is already provided by package  * libnetsnmp
 * check_data_file_clashes: Package libnetsnmp-ssl wants to install file /home/stijn/Development/OpenWrt/openwrt/build_dir/target-powerpc64_e5500_musl/root-qoriq/usr/lib/libnetsnmphelpers.so.40.2.1
        But that file is already provided by package  * libnetsnmp
 * check_data_file_clashes: Package libnetsnmp-ssl wants to install file /home/stijn/Development/OpenWrt/openwrt/build_dir/target-powerpc64_e5500_musl/root-qoriq/usr/lib/libnetsnmpmibs.so.40
        But that file is already provided by package  * libnetsnmp
 * check_data_file_clashes: Package libnetsnmp-ssl wants to install file /home/stijn/Development/OpenWrt/openwrt/build_dir/target-powerpc64_e5500_musl/root-qoriq/usr/lib/libnetsnmpmibs.so.40.2.1
        But that file is already provided by package  * libnetsnmp
 * opkg_install_cmd: Cannot install package libnetsnmp-ssl.
 * check_data_file_clashes: Package libnetsnmp-ssl wants to install file /home/stijn/Development/OpenWrt/openwrt/build_dir/target-powerpc64_e5500_musl/root-qoriq/usr/lib/libnetsnmp.so.40
        But that file is already provided by package  * libnetsnmp
 * check_data_file_clashes: Package libnetsnmp-ssl wants to install file /home/stijn/Development/OpenWrt/openwrt/build_dir/target-powerpc64_e5500_musl/root-qoriq/usr/lib/libnetsnmp.so.40.2.1
        But that file is already provided by package  * libnetsnmp
 * check_data_file_clashes: Package libnetsnmp-ssl wants to install file /home/stijn/Development/OpenWrt/openwrt/build_dir/target-powerpc64_e5500_musl/root-qoriq/usr/lib/libnetsnmpagent.so.40
        But that file is already provided by package  * libnetsnmp
 * check_data_file_clashes: Package libnetsnmp-ssl wants to install file /home/stijn/Development/OpenWrt/openwrt/build_dir/target-powerpc64_e5500_musl/root-qoriq/usr/lib/libnetsnmpagent.so.40.2.1
        But that file is already provided by package  * libnetsnmp
 * check_data_file_clashes: Package libnetsnmp-ssl wants to install file /home/stijn/Development/OpenWrt/openwrt/build_dir/target-powerpc64_e5500_musl/root-qoriq/usr/lib/libnetsnmphelpers.so.40
        But that file is already provided by package  * libnetsnmp
 * check_data_file_clashes: Package libnetsnmp-ssl wants to install file /home/stijn/Development/OpenWrt/openwrt/build_dir/target-powerpc64_e5500_musl/root-qoriq/usr/lib/libnetsnmphelpers.so.40.2.1
        But that file is already provided by package  * libnetsnmp
 * check_data_file_clashes: Package libnetsnmp-ssl wants to install file /home/stijn/Development/OpenWrt/openwrt/build_dir/target-powerpc64_e5500_musl/root-qoriq/usr/lib/libnetsnmpmibs.so.40
        But that file is already provided by package  * libnetsnmp
 * check_data_file_clashes: Package libnetsnmp-ssl wants to install file /home/stijn/Development/OpenWrt/openwrt/build_dir/target-powerpc64_e5500_musl/root-qoriq/usr/lib/libnetsnmpmibs.so.40.2.1
        But that file is already provided by package  * libnetsnmp
 * opkg_install_cmd: Cannot install package libnetsnmp-ssl.
 * check_data_file_clashes: Package libnetsnmp-ssl wants to install file /home/stijn/Development/OpenWrt/openwrt/build_dir/target-powerpc64_e5500_musl/root-qoriq/usr/lib/libnetsnmp.so.40
        But that file is already provided by package  * libnetsnmp
 * check_data_file_clashes: Package libnetsnmp-ssl wants to install file /home/stijn/Development/OpenWrt/openwrt/build_dir/target-powerpc64_e5500_musl/root-qoriq/usr/lib/libnetsnmp.so.40.2.1
        But that file is already provided by package  * libnetsnmp
 * check_data_file_clashes: Package libnetsnmp-ssl wants to install file /home/stijn/Development/OpenWrt/openwrt/build_dir/target-powerpc64_e5500_musl/root-qoriq/usr/lib/libnetsnmpagent.so.40
        But that file is already provided by package  * libnetsnmp
 * check_data_file_clashes: Package libnetsnmp-ssl wants to install file /home/stijn/Development/OpenWrt/openwrt/build_dir/target-powerpc64_e5500_musl/root-qoriq/usr/lib/libnetsnmpagent.so.40.2.1
        But that file is already provided by package  * libnetsnmp
 * check_data_file_clashes: Package libnetsnmp-ssl wants to install file /home/stijn/Development/OpenWrt/openwrt/build_dir/target-powerpc64_e5500_musl/root-qoriq/usr/lib/libnetsnmphelpers.so.40
        But that file is already provided by package  * libnetsnmp
 * check_data_file_clashes: Package libnetsnmp-ssl wants to install file /home/stijn/Development/OpenWrt/openwrt/build_dir/target-powerpc64_e5500_musl/root-qoriq/usr/lib/libnetsnmphelpers.so.40.2.1
        But that file is already provided by package  * libnetsnmp
 * check_data_file_clashes: Package libnetsnmp-ssl wants to install file /home/stijn/Development/OpenWrt/openwrt/build_dir/target-powerpc64_e5500_musl/root-qoriq/usr/lib/libnetsnmpmibs.so.40
        But that file is already provided by package  * libnetsnmp
 * check_data_file_clashes: Package libnetsnmp-ssl wants to install file /home/stijn/Development/OpenWrt/openwrt/build_dir/target-powerpc64_e5500_musl/root-qoriq/usr/lib/libnetsnmpmibs.so.40.2.1
        But that file is already provided by package  * libnetsnmp

@Chris1189
Copy link
Author

Chris1189 commented Feb 17, 2025

Thank you for your review!
I resolved your requested changes and now it should be only possible to build one package of the two.
The old packages are now virtually provided by them.

EDIT: Also added v3 and logging options to snmpd.conf.

@Chris1189 Chris1189 force-pushed the pr/net-snmp branch 4 times, most recently from 5a0aaa5 to 6561ab5 Compare February 17, 2025 07:50
This commit integrates the option
to add openssl to net-snmp.
This way SNMP V3 can be modified

Signed-off-by: Christian Korber <[email protected]>
Christian Korber added 2 commits February 17, 2025 08:51
This commit implements SNMPv3 functionality
to snmpd.init.
In particular it adds function snmpd_snmpdv3_add,
which sets the needed options in /var/run/snmpd.conf.
Additionally a possibility to download mib file
is also added.

Signed-off-by: Christian Korber <[email protected]>
This commit adds logging to syslog and to a logfile.

Signed-off-by: Christian Korber <[email protected]>
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.

2 participants