NOTE: as of CentOS 8.3 the following is NOT required; net-snmp-perl is now in AppStream
Ok, so a bit of a necropost here, but since this forum thread comes up high on the list when you search for 'netdisco CentOS 8' I thought I'd reply here.
So, first off, the package "net-snmp-perl" is NOT the same as "perl-Net-SNMP" and this will trip you up trying to get netdisco to build.
The package 'net-snmp-perl' is not built by default in CentOS 8 anymore, and is not in any of the standard repositories. There is a third-party repository with the package, called the 'OKay' repository, but, in my case, I decided to rebuild net-snmp-perl from sources; I've been looking for a good reason to try out building from git.centos.org, and this is a reasonably good test case. I'm not going to muddy things up with lots of comments; this flow should be pretty self-explanatory.
Here's the process:
First, as root, enable EPEL, then:
Code: Select all
dnf config-manager --set-enabled PowerTools
dnf group install "Development Tools"
dnf install rpmdevtools rpmlint perl-Expect mariadb-devel perl-core perl-DBD-Pg openssl-devel postgresql-server postgresql-contrib automake
Installing of 'mysql-devel' will NOT work for building net-snmp-perl; you'll get an error related to my_bool.
As a normal user (since I'm installing netdisco, I'm using that user; I'm also an rsync junkie, so I use rsync here instead of ln -s or cp -a....) EDIT: also note that the previously posted "~/net-snmp-perl" won't actually work correctly; using `pwd` is better:
Code: Select all
cd
git clone https://git.centos.org/centos-git-common.git
git clone https://git.centos.org/rpms/net-snmp.git
mkdir ~/bin
#Local ~/bin is typically in $PATH
rsync -avHAX centos-git-common/ ~/bin
cd net-snmp
#We need to checkout the 'c8' branch. There are other branches!
git checkout c8
get_sources.sh
rpmbuild --define "%_topdir `pwd`" --define '%netsnmp_check 0' -ba SPECS/net-snmp.spec
As root again (or of course using sudo is fine):
Code: Select all
cd /home/netdisco/net-snmp/RPMS/x86_64
yum install net-snmp-5.8*.rpm net-snmp-perl-5.8*.rpm net-snmp-devel-5.8*.rpm net-snmp-libs-5.8*.rpm net-snmp-agent-libs-5.8*.rpm
Your build of netdisco should then Just Work. And, yes, I know I'm mixing yum and dnf willy-nilly.....and after this process you'll need to exclude net-snmp* from yum updates and you'll need to keep track of those yourself. You might be able to automate that, use createrepo and friends, and have your own local repository.... all of which are left as an exercise for the reader. Thanks go out to multiple people on the centos mailing list and elsewhere for pieces of this recipe.....
Enjoy!
EDITED 2020-12-16 to make a bit more clear which bin directory is being referenced.