VMWARE SDK install broke WMI perl plugin

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
mcockram
Posts: 23
Joined: Tue May 04, 2021 7:44 am

Re: VMWARE SDK install broke WMI perl plugin

Post by mcockram »

Now I am getting the below error

LANG=C LC_ALL=C /usr/bin/mrtg /etc/mrtg/mrtg.cfg --lock-file /var/lib/mrtg/mrtg.lock --confcache-file /var/lib/mrtg/mrtg.ok --user=nagios --grou...

Subroutine SNMP_Session::pack_sockaddr_in6 redefined at /usr/share/perl5/vendor_perl/Exporter.pm line 66.
at /usr/bin/../lib64/mrtg2/SNMP_Session.pm line 149.
Subroutine SNMP_Session::unpack_sockaddr_in6 redefined at /usr/share/perl5/vendor_perl/Exporter.pm line 66.
at /usr/bin/../lib64/mrtg2/SNMP_Session.pm line 149.
Subroutine SNMPv1_Session::pack_sockaddr_in6 redefined at /usr/share/perl5/vendor_perl/Exporter.pm line 66.
at /usr/bin/../lib64/mrtg2/SNMP_Session.pm line 604.
Subroutine SNMPv1_Session::unpack_sockaddr_in6 redefined at /usr/share/perl5/vendor_perl/Exporter.pm line 66.
at /usr/bin/../lib64/mrtg2/SNMP_Session.pm line 604.
2022-03-02 12:35:01: WARNING: SNMP V3 libraries not found, SNMP V3 disabled.
mcockram
Posts: 23
Joined: Tue May 04, 2021 7:44 am

Re: VMWARE SDK install broke WMI perl plugin

Post by mcockram »

[root cron.d]# find /usr/local/share/perl5 -type d -exec chmod 0755 {} \;
[root cron.d]# LANG=C LC_ALL=C /usr/bin/mrtg /etc/mrtg/mrtg.cfg --lock-file /var/lib/mrtg/mrtg.lock --confcache-file /var/lib/mrtg/mrtg.ok --user=nagios --group=nagios
Subroutine SNMP_Session::pack_sockaddr_in6 redefined at /usr/share/perl5/vendor_perl/Exporter.pm line 66.
at /usr/bin/../lib64/mrtg2/SNMP_Session.pm line 149.
Subroutine SNMP_Session::unpack_sockaddr_in6 redefined at /usr/share/perl5/vendor_perl/Exporter.pm line 66.
at /usr/bin/../lib64/mrtg2/SNMP_Session.pm line 149.
Subroutine SNMPv1_Session::pack_sockaddr_in6 redefined at /usr/share/perl5/vendor_perl/Exporter.pm line 66.
at /usr/bin/../lib64/mrtg2/SNMP_Session.pm line 604.
Subroutine SNMPv1_Session::unpack_sockaddr_in6 redefined at /usr/share/perl5/vendor_perl/Exporter.pm line 66.
at /usr/bin/../lib64/mrtg2/SNMP_Session.pm line 604.
2022-03-02 12:42:49: WARNING: SNMP V3 libraries not found, SNMP V3 disabled.
mcockram
Posts: 23
Joined: Tue May 04, 2021 7:44 am

Re: VMWARE SDK install broke WMI perl plugin

Post by mcockram »

I found this link https://support.nagios.com/kb/print-526.html

Do we change the lines in Red? They don't exactly match the above referenced doc. If so, what do we change them too?

[root@nagios_test ~]# cat /usr/lib64/mrtg2/SNMP_Session.pm | grep pack_sockaddr_in6
Socket6->import(qw(pack_sockaddr_in6 inet_pton getaddrinfo unpack_sockaddr_in6));
$ipv6_addr_len = length(pack_sockaddr_in6(161, inet_pton(AF_INET6(), "::1")));
($port,$addrunpack) = unpack_sockaddr_in6 ($addr);
Socket6->import(qw(pack_sockaddr_in6 inet_pton getaddrinfo unpack_sockaddr_in6));
($p1,$a1) = unpack_sockaddr_in6 ($sa1);
($p2,$a2) = unpack_sockaddr_in6 ($sa2);
($port,$iaddr) = unpack_sockaddr_in6($remote_addr);
($port,$iaddr) = unpack_sockaddr_in6($remote_addr);
gsmith
Posts: 1253
Joined: Tue Mar 02, 2021 11:15 am

Re: VMWARE SDK install broke WMI perl plugin

Post by gsmith »

Hi,

ssax had to step away for a few days.

My plan is to replicate your system.

What version of RHEL 8 are you using?

Code: Select all

cat /etc/os-release
uname -a
hostnamectl
What version of Nagios XI do you have installed? You can see it in the lower left corner of the home page.

What version of perl is installed?

Code: Select all

perl -v
Please send me a System Profile so I can take a look.

1. Login to the Nagios XI GUI using a web browser.
2. Click the "Admin" > "System Profile" Menu
3. Click the "Download Profile" button
4. Save the profile.zip file and share the file in a private message and then reply to this post to bring it up in the queue.

If that doesn't work then:
1. rm -rf /usr/local/nagiosxi/var/components/profile*
2. /usr/local/nagiosxi/scripts/components/getprofile.sh SUPPORT
3. Then send me the resulting /usr/local/nagiosxi/var/components/profile.zip​ file.

Thanks
mcockram
Posts: 23
Joined: Tue May 04, 2021 7:44 am

Re: VMWARE SDK install broke WMI perl plugin

Post by mcockram »

Thank you for the response. I received the below response from a nagios support ticket which seems to work, but we are still receiving the snmp error.

Try this, edit the /usr/lib/mrtg2/SNMP_Session.pm file and change line 149 and 604 to

Socket6->import(qw(inet_pton getaddrinfo inet_ntop));


Code: Select all

$ perl -e "use Net_SNMP_util;"
Can't locate Net_SNMP_util.pm in @INC (you may need to install the Net_SNMP_util module) (@INC contains: /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5) at -e line 1.
BEGIN failed--compilation aborted at -e line 1.
[root]# dnf search perl | grep -i snmp
Last metadata expiration check: 1:33:21 ago on Fri 04 Mar 2022 08:52:38 AM EST.
net-snmp-perl.x86_64 : The perl NET-SNMP module and the mib2c tool
perl-SNMP_Session.noarch : SNMP support for Perl 5
perl-Net-SNMP.noarch : Object oriented interface to SNMP
snmptt.noarch : An SNMP trap handler written in Perl
[root]# dnf install net-snmp-perl
Updating Subscription Management repositories.
8 prod                                                                                                                   52 kB/s | 2.1 kB     00:00    
Red Hat Enterprise Linux 8 for x86_64 - BaseOS (RPMs)                                                                    62 kB/s | 2.4 kB     00:00    
Red Hat Enterprise Linux 8 for x86_64 - AppStream (RPMs)                                                                 74 kB/s | 2.8 kB     00:00    
Red Hat CodeReady Linux Builder for RHEL 8 x86_64 (RPMs)                                                                 67 kB/s | 2.8 kB     00:00    
Package net-snmp-perl-1:5.8-22.el8.x86_64 is already installed.
Dependencies resolved.
Nothing to do.
Complete!
[root]# dnf install perl-Net-SNMP
Updating Subscription Management repositories.
8 prod                                                                                                                   32 kB/s | 2.1 kB     00:00    
Red Hat Enterprise Linux 8 for x86_64 - BaseOS (RPMs)                                                                    24 kB/s | 2.4 kB     00:00    
Red Hat Enterprise Linux 8 for x86_64 - AppStream (RPMs)                                                                 64 kB/s | 2.8 kB     00:00    
Red Hat CodeReady Linux Builder for RHEL 8 x86_64 (RPMs)                                                                 55 kB/s | 2.8 kB     00:00    
Package perl-Net-SNMP-6.0.1-25.el8.1.noarch is already installed.
Dependencies resolved.
Nothing to do.
Complete!
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

Re: VMWARE SDK install broke WMI perl plugin

Post by tgriep »

That perl module comes with the MRTG package so MRTG will have to be reinstalled.

Make sure you backup the /etc/mrtg/mrtg.cfg file in case it is needed.

Run the following as root to reinstall MRTG.

Code: Select all

cd /tmp
rm -rf nagiosxi xi*.tar.gz
wget https://assets.nagios.com/downloads/nagiosxi/5/xi-5.8.7.tar.gz
tar xzf xi-5.8.7.tar.gz
cd /tmp/nagiosxi/subcomponents/mrtg/
./install
MRTG comes with it own Net_SNMP_util module so the follow command will not work as the module needs to be imported first which MRTG does.
perl -e "use Net_SNMP_util;"
Thank you.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked