This is a cache of https://support.nagios.com/kb/article/nagios-xi-mrtg-reports-snmp_session-errors-526.html. It is a snapshot of the page at 2025-05-14T00:08:59.070+0000.
Nagios <strong>xi</strong> - MRTG Reports SNMP_Session Errors
Home » Categories » Products » Nagios xi » Troubleshooting » Common Problems

Nagios xi - MRTG Reports SNMP_Session Errors

Problem Description

When running MRTG at the command line:

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

 

You receive errors similar to this:

Subroutine SNMP_Session::pack_sockaddr_in6 redefined at /usr/local/share/perl5/Exporter.pm line 66.
at /usr/bin/../lib/mrtg2/SNMP_Session.pm line 149.
Subroutine SNMP_Session::unpack_sockaddr_in6 redefined at /usr/local/share/perl5/Exporter.pm line 66.
at /usr/bin/../lib/mrtg2/SNMP_Session.pm line 149.
Subroutine SNMPv1_Session::pack_sockaddr_in6 redefined at /usr/local/share/perl5/Exporter.pm line 66.
at /usr/bin/../lib/mrtg2/SNMP_Session.pm line 604.
Subroutine SNMPv1_Session::unpack_sockaddr_in6 redefined at /usr/local/share/perl5/Exporter.pm line 66.
at /usr/bin/../lib/mrtg2/SNMP_Session.pm line 604.

 

This KB article explains how to fix these errors.

 

 

Resolution

The following step will make changes to the SNMP_Session.pm files. There are several copies of these files so first we must find them:

find /usr/ -name SNMP_Session.pm | grep mrtg

 

Which should output something like:

/usr/lib64/mrtg2/SNMP_Session.pm
/usr/lib/mrtg2/SNMP_Session.pm

 

Edit the first file:

vi /usr/lib64/mrtg2/SNMP_Session.pm

This opens the vi text editor.

Type /pack_sockaddr_in6 on the keyboard and press enter

This will take you to the section we want to edit.

Confirm that the line that looks like this:

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

Press i on the keyboard to go into insert mode.

Change the line so it looks like this:

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

Press Escape on the keyboard to exit insert mode.

There may be multiple lines in the file that contain pack_sockaddr_in6, repeat the above steps to find any other lines and update them.

Type :wq and then press Enter (this will save the file and exit vi).

 

Repeat the above steps for all the SNMP_Session.pm files you found with the first command.

 

After completing these steps run MRTG again to ensure the errors are no longer produced.

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

 

If you no longer receive the errors the problem has been resolved.

 

 

Final Thoughts

For any support related questions please visit the Nagios Support Forums at:

http://support.nagios.com/forum/



Special Offer For Knowledgebase Visitors! Get a huge discount on Nagios Log Server by clicking below.

Get 60% Off Nagios Log Server!

Did you know? Nagios provides complete monitoring of: Windows, Linux, UNIX, Servers, Websites, SNMP, DHCP, DNS, Email, Storage, Files, Apache, IIS, EC2, and more!

0 (0)
Article Rating (No Votes)
Rate this article
  • Icon PDFExport to PDF
  • Icon MS-WordExport to MS Word
Attachments Attachments
There are no attachments for this article.
Related Articles RSS Feed
Nagios xi - Notification Problems
Viewed 31267 times since Tue, Jan 27, 2015
Nagios xi - How To Test Check Commands From The Command-line
Viewed 49114 times since Tue, Jan 26, 2016
Nagios xi - Configuration Applies, No Changes Take Place
Viewed 8683 times since Tue, Jan 27, 2015
Nagios xi - Resetting The nagiosadmin Password
Viewed 46825 times since Mon, Jan 25, 2016
Nagios xi - How To Delete A Data Source From An RRD File
Viewed 14149 times since Wed, Apr 27, 2016
Nagios xi - Debugging Bandwidth Performance Graphs
Viewed 15982 times since Tue, Jan 27, 2015
Nagios xi - Bandwidth Graphs Showing 0Mb/s in Non-English Systems
Viewed 7511 times since Fri, Dec 19, 2014
Nagios xi - Apply Configuration Fails - Backend login to the Core Configuration failed
Viewed 25768 times since Tue, Aug 2, 2016
Pages Not Displaying Correctly
Viewed 8590 times since Mon, Jan 25, 2016
Nagios xi - How To Use CA Certificates With check_ldaps Plugin
Viewed 12609 times since Tue, Jul 26, 2016