[ZBX-17192] SNMP traps in RHEL8/CentOS 8 - missing & removed "net-snmp-perl" package Created: 2020 Jan 17  Updated: 2024 May 16  Resolved: 2021 Jul 01

Status: Closed
Project: ZABBIX BUGS AND ISSUES
Component/s: Documentation (D), Packages (C)
Affects Version/s: 4.0.16, 4.4.4
Fix Version/s: 5.4 (plan)

Type: Incident report Priority: Blocker
Reporter: Oleksii Zagorskyi Assignee: Jurijs Klopovskis
Resolution: Won't fix Votes: 26
Labels: rhel8, snmptraps
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: PNG File image-2020-08-10-14-58-12-099.png    
Issue Links:
Causes
causes ZBXNEXT-5703 Receive SNMP traps by Zabbix Server/P... Open
Duplicate
Sub-task
Sprint: Sprint 70 (Nov 2020), Sprint 71 (Dec 2020), Sprint 72 (Jan 2021), Sprint 73 (Feb 2021), Sprint 74 (Mar 2021), Sprint 75 (Apr 2021), Sprint 76 (May 2021), Sprint 77 (Jun 2021), Sprint 78 (Jul 2021)

 Description   

Additionally to a ZBX-17081 (libssh2), we have one more trouble with RHEL8.

Package "net-snmp-perl" has been removed as of RH8/CentOS8: https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/8/html-single/considerations_in_adopting_rhel_8/index#removed-packages_changes-to-packages

The package is needed to collection of SNMP traps. Mentioned for example in this tutorial: https://blog.zabbix.com/snmp-traps-in-zabbix/

 

There is some unofficial replacement: https://centos.pkgs.org/8/okey-x86_64/net-snmp-perl-5.8-7.el8.2.x86_64.rpm.html 

I tried to manually download and install the RPM file, but it failed because of dependencies, which I could not resolve quickly and easily.

 

FUI: If configure /etc/snmp/snmptrapd.conf by adding zabbix perl trap handler and restart the daemon, it will start successfully, but in syslog you will get these messages:

Dec  8 13:59:37 centos8 systemd[1]: Starting Simple Network Management Protocol (SNMP) Trap Daemon.... 
Dec  8 13:59:37 centos8 snmptrapd[3585]: Can't open perl script "/usr/share/snmp/snmp_perl_trapd.pl": No such file or directory 
Dec  8 13:59:37 centos8 snmptrapd[3585]: embedded perl support failed to initialize (perl_parse(/usr/share/snmp/snmp_perl_trapd.pl) returned 2) 
Dec  8 13:59:37 centos8 snmptrapd[3585]: NET-SNMP version 5.8 
Dec  8 13:59:37 centos8 systemd[1]: Started Simple Network Management Protocol (SNMP) Trap Daemon.. 

Don't be confused by /usr/share/snmp/snmp_perl_trapd.pl path. This is attempt of initialization of perl engine, as we added own handler.

Solution should be found and documented.



 Comments   
Comment by Hexdump [ 2020 Apr 16 ]

Did you tried to install the package with cpan ?

# cpan i Net::SNMP

I do not have access to my centos8 before monday.

Comment by Jurijs Klopovskis [ 2020 Apr 21 ]

If you choose to use 3rd party repo.okay.com.mx, then do not install net-snmp-perl package directly. Do as follows.

rpm -Uvh http://repo.okay.com.mx/centos/8/x86_64/release/okay-release-1-3.el8.noarch.rpm
dnf clean all
dnf install net-snmp-perl

Tested on a clean centos-8 system.

In my opinion the best solution is to go with https://support.zabbix.com/browse/ZBXNEXT-5703.

Comment by patrik uytterhoeven [ 2020 Aug 04 ]

is there no official fix for this yet ? i cant imagine Zabbix SIA not having 1 customer under support with RHEL 8 and having SNMP Traps ?? ALSO LTS better tested ..... the way i see it Zabbix 5 is broken atm and not production ready unless you are willing to stay on RHEL 7

Comment by Adam Leggo [ 2020 Aug 04 ]

You can find the package in the centos 8 AppStream packages.

http://mirror.centos.org/centos/8-stream/AppStream/x86_64/os/Packages/

http://mirror.centos.org/centos/8-stream/AppStream/x86_64/os/Packages/net-snmp-perl-5.8-15.el8.x86_64.rpm

Comment by patrik uytterhoeven [ 2020 Aug 04 ]

ok good to see that it was added

is the Zabbix perl script working bc this was not the case with the okey package ?

Comment by patrik uytterhoeven [ 2020 Oct 27 ]

it seems to be in epel these days

Comment by Dimitri Bellini [ 2020 Oct 27 ]

I came here yesterday because i reach the same situation... no net-snmp-perl but i have solved because is coming on EPEL

Since 2 years ago we start to prefer the "perl-way" because on RHEL 6/7/8.x the SNMPTT package is not provided and we need to compile it... but on Zabbix documentation is still suggested it as high performance solution. 

If SNMPTT is the best solution could be possible to have an official Zabbix RPM for RHEL/Centos from Zabbix?

Thanks so much

 

Comment by Brian van Baekel [ 2020 Oct 27 ]

@Dimitri Bellini: That's exactly why we've created our own handler(s), a lot of customers do not allow things from EPEL.

https://blog.zabbix.com/parsing-snmp-traps-with-python-or-bash-a-net-snmp-perl-alternative/11577/

Not the most elegant integration, but it works....

 

Comment by Dimitri Bellini [ 2020 Oct 27 ]

Hi Brian, thanks so much! I never saw the blog posted, very useful information and workaround!

Thanks so much

Comment by patrik uytterhoeven [ 2020 Oct 29 ]

Hey Dimitri or anyone else 

was wondering wat the impact if on the speed of the script moving away from perl to bash or python 

also is it working out of the box ?

Comment by Dimitri Bellini [ 2020 Oct 29 ]

Hi Patrik,

i never tested the python/bash solution at the moment.. I would like but i'm in lack of time

I have you made some test?

Comment by patrik uytterhoeven [ 2020 Oct 29 ]

ah ok thought you had tested it 

i just found out btw that for the perl-Net-SNMP package to intall

you need to enalble the PowerTools first

 

dnf config-manager --set-enabled PowerTools

 

Comment by Dimitri Bellini [ 2020 Oct 29 ]

@Patrik ok thanks for the tip!

Comment by Brian van Baekel [ 2020 Oct 30 ]

I'm a huge fan of the python integration (well, made it myself, would be crazy if i said it was sh*t).

Tested the python integration with 4-5 concurrent for loops (without any delays built in) pushing in traps to be parsed; flawless.

 

The bash integration works, but not tested to see how far performance stretches...

Comment by Jurijs Klopovskis [ 2020 Dec 02 ]

Apparently net-snmp-perl has been added in RHEL 8.3, according to https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/8/html-single/considerations_in_adopting_rhel_8/index#new-packages-added-in-RHEL-8-minor-releases_changes-to-packages

Comment by Edgar Akhmetshin [ 2020 Dec 08 ]

https://www.mail-archive.com/[email protected]/msg11827.html

$ cat /etc/centos-release
CentOS Linux release 8.3.2011
$ sudo dnf -y install centos-release-stream
$ sudo dnf makecache
$ sudo dnf -y install net-snmp net-snmp-perl perl-Net-SNMP
Comment by Sub2.13 [ 2020 Dec 14 ]

Be careful with the suggested solution "centos-release-stream". Your distribution will be moved from CentOS to CentOS Stream. It's a major change. In a production environnement, you should thing about it twice .
Following "centos-release-stream" installation, you will have to update your distribution in order to use CentOS stream packages. This is a huge side effect from my point-of-view:

# dnf install centos-release-stream
Last metadata expiration check: 0:40:04 ago on Mon 14 Dec 2020 11:20:49 AM CET.
Dependencies resolved.
==================================================================================================================================================
 Package                                    Architecture                Version                                 Repository                   Size
==================================================================================================================================================
Installing:
 centos-release-stream                      x86_64                      8.1-1.1911.0.7.el8                      extras                       11 k

Transaction Summary
==================================================================================================================================================
Install  1 Package

Total download size: 11 k
Installed size: 6.6 k
Is this ok [y/N]: y
Downloading Packages:
centos-release-stream-8.1-1.1911.0.7.el8.x86_64.rpm                                                                18 kB/s |  11 kB     00:00
--------------------------------------------------------------------------------------------------------------------------------------------------
Total                                                                                                              12 kB/s |  11 kB     00:00
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
  Preparing        :                                                                                                                          1/1
  Installing       : centos-release-stream-8.1-1.1911.0.7.el8.x86_64                                                                          1/1
  Verifying        : centos-release-stream-8.1-1.1911.0.7.el8.x86_64                                                                          1/1

Installed:
  centos-release-stream-8.1-1.1911.0.7.el8.x86_64

Complete!
# more /etc/centos-release
CentOS Linux release 8.3.2011
# dnf update
Last metadata expiration check: 0:04:10 ago on Mon 14 Dec 2020 12:02:06 PM CET.
Dependencies resolved.
==================================================================================================================================================
 Package                                         Architecture    Version                                          Repository                 Size
==================================================================================================================================================
Installing:
 centos-stream-release                           noarch          8.4-1.el8                                        Stream-BaseOS              21 k
     replacing  centos-linux-release.noarch 8.3-1.2011.el8
     replacing  centos-release-stream.x86_64 8.1-1.1911.0.7.el8

...

About Okay repo solution, I've tried it as well. If you use the net-snmp-perl package from this repo, you will have several dependencies conflicts afterward because the version is available on this repo is too old to respect dependencies with others packages from official repo.
Consequence, it has to downgrade several packages:

dnf install net-snmp-perl
Extra OKay Packages for Enterprise Linux - x86_64                                                                                                                    8.1 kB/s | 2.9 kB     00:00
Dependencies resolved.
=====================================================================================================================================================================================================
 Package                                               Architecture                             Version                                            Repository                                   Size
=====================================================================================================================================================================================================
Installing:
 net-snmp-perl                                         x86_64                                   1:5.8-12.el8.1                                     okay                                        355 k
Installing dependencies:
 perl-JSON                                             noarch                                   2.97.001-2.el8                                     appstream                                    96 k
 perl-Mail-Sender                                      noarch                                   1:0.903-7.el8                                      epel                                         56 k
Downgrading:
 net-snmp                                              x86_64                                   1:5.8-12.el8.1                                     okay                                        352 k
 net-snmp-agent-libs                                   x86_64                                   1:5.8-12.el8.1                                     okay                                        750 k
 net-snmp-libs                                         x86_64                                   1:5.8-12.el8.1                                     okay                                        821 k
 net-snmp-utils                                        x86_64                                   1:5.8-12.el8.1                                     okay                                        238 k
Transaction Summary
=====================================================================================================================================================================================================
Install    3 Packages
Downgrade  4 Packages

Consequence, you have several dependency issues afterward:

# dnf update
Last metadata expiration check: 0:03:22 ago on Mon 14 Dec 2020 11:31:10 AM CET.
Error:
 Problem 1: libnghttp2-1.33.0-3.el8_2.1.i686 has inferior architecture
  - cannot install both libnghttp2-1.39.2-1.el8.x86_64 and libnghttp2-1.33.0-3.el8_2.1.x86_64
  - cannot install the best update candidate for package libnghttp2-1.33.0-3.el8_2.1.i686
  - cannot install the best update candidate for package libnghttp2-1.33.0-3.el8_2.1.x86_64
 Problem 2: package net-snmp-perl-1:5.8-12.el8.1.x86_64 requires net-snmp-agent-libs(x86-64) = 1:5.8-12.el8.1, but none of the providers can be in
  - cannot install both net-snmp-agent-libs-1:5.8-17.el8.x86_64 and net-snmp-agent-libs-1:5.8-12.el8.1.x86_64
  - cannot install both net-snmp-agent-libs-1:5.8-12.el8.1.x86_64 and net-snmp-agent-libs-1:5.8-17.el8.x86_64
  - cannot install the best update candidate for package net-snmp-perl-1:5.8-12.el8.1.x86_64
  - cannot install the best update candidate for package net-snmp-agent-libs-1:5.8-12.el8.1.x86_64
 Problem 3: problem with installed package net-snmp-perl-1:5.8-12.el8.1.x86_64
  - package net-snmp-perl-1:5.8-12.el8.1.x86_64 requires net-snmp-libs(x86-64) = 1:5.8-12.el8.1, but none of the providers can be installed
  - cannot install both net-snmp-libs-1:5.8-17.el8.x86_64 and net-snmp-libs-1:5.8-12.el8.1.x86_64
  - cannot install both net-snmp-libs-1:5.8-12.el8.1.x86_64 and net-snmp-libs-1:5.8-17.el8.x86_64
  - cannot install the best update candidate for package net-snmp-libs-1:5.8-12.el8.1.x86_64
(try to add '--allowerasing' to command line to replace conflicting packages or '--skip-broken' to skip uninstallable packages or '--nobest' to us

Again, you should to measure the consequence of this installation.

From my point-of-view, there is no acceptable solution in a production environnement

Any help will be welcomed.

Comment by Edgar Akhmetshin [ 2021 Jun 30 ]

Package is available in RHEL8.3/Oracle Linux 8.3/VxLinux/AlmaLinux/RockyLinux and above.

'Classic' CentOS 8 support ends in 2021: https://wiki.centos.org/About/Product.

Problem is not actual for upstream systems:

[edgar@ kraken]$ sudo dnf info net-snmp-perl
Updating Subscription Management repositories.
Last metadata expiration check: 0:55:19 ago on Thu 01 Jul 2021 06:37:49 AM UTC.
Available Packages
Name         : net-snmp-perl
Epoch        : 1
Version      : 5.8
Release      : 20.el8
Architecture : x86_64
Size         : 358 k
Source       : net-snmp-5.8-20.el8.src.rpm
Repository   : rhel-8-for-x86_64-appstream-rpms
Summary      : The perl NET-SNMP module and the mib2c tool
URL          : http://net-snmp.sourceforge.net/
License      : BSD
Description  : The net-snmp-perl package contains the perl files to use SNMP from within
             : Perl.
             : 
             : Install the net-snmp-perl package, if you want to use mib2c or SNMP
             : with perl.
[edgar@ kraken]$ head -n 5 /etc/os-release 
NAME="Red Hat Enterprise Linux"
VERSION="8.4 (Ootpa)"
ID="rhel"
ID_LIKE="fedora"
VERSION_ID="8.4"
[edgar@ kraken]$ sudo subscription-manager repos --list-enabled
+----------------------------------------------------------+
    Available Repositories in /etc/yum.repos.d/redhat.repo
+----------------------------------------------------------+
Repo ID:   ansible-2.9-for-rhel-8-x86_64-rpms
Repo Name: Red Hat Ansible Engine 2.9 for RHEL 8 x86_64 (RPMs)
Repo URL:  https://cdn.redhat.com/content/dist/layered/rhel8/x86_64/ansible/2.9/os
Enabled:   1

Repo ID:   codeready-builder-for-rhel-8-x86_64-rpms
Repo Name: Red Hat CodeReady Linux Builder for RHEL 8 x86_64 (RPMs)
Repo URL:  https://cdn.redhat.com/content/dist/rhel8/$releasever/x86_64/codeready-builder/os
Enabled:   1

Repo ID:   rhel-8-for-x86_64-baseos-rpms
Repo Name: Red Hat Enterprise Linux 8 for x86_64 - BaseOS (RPMs)
Repo URL:  https://cdn.redhat.com/content/dist/rhel8/$releasever/x86_64/baseos/os
Enabled:   1

Repo ID:   rhel-8-for-x86_64-appstream-rpms
Repo Name: Red Hat Enterprise Linux 8 for x86_64 - AppStream (RPMs)
Repo URL:  https://cdn.redhat.com/content/dist/rhel8/$releasever/x86_64/appstream/os
Enabled:   1

CentOS 8.0-8.2 can use Python or Bash handlers, like described here:
https://blog.zabbix.com/parsing-snmp-traps-with-python-or-bash-a-net-snmp-perl-alternative/11577/

Comment by Jurijs Klopovskis [ 2021 Jul 01 ]

I'm closing the issue as WON'T FIX, due to the death of CentOS 8.
Reopen if you object or have something to add.

Generated at Mon May 19 06:39:24 EEST 2025 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.