«

»

Oct 28

MRTG error through CRON :: “Subroutine SNMP_Session::pack_sockaddr_in6 redefined”

The Multi Router Traffic Grapher (MRTG) is a tool to monitor the traffic load on network-links. MRTG generates HTML pages containing GIF images which provide a LIVE visual representation of this traffic.

This package is standard tools for CentOS. Same counts for Perl, SNMP etc. Whenever we wish to add an additional repository for server maintenance, e.g, the Atomic Rocket Turtle repo, then you might run into some problems these days.

The rocket turtle has released an update for Perl-IO-Socket-INET6, which is used in MRTG. This might bring some problems like following:

————————————————

Subroutine SNMPv1_Session::AF_INET6 redefined at /usr/lib/perl5/5.8.8/Exporter.pm line 65.
at /usr/bin/../lib64/mrtg2/SNMP_Session.pm line 594
Subroutine main::AF_INET6 redefined at /usr/lib/perl5/5.8.8/Exporter.pm line 65.
at /usr/bin/mrtg line 97

————————————————


For the fix, go through the following

1) Edit the binary file of MRTG, get it from #which mrtg

#vi /usr/bin/mrtg

Then replace import Socket6;

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

2) Edit the file /usr/lib/mrtg2/SNMP_Session.pm . If the server is 64 bit then edit /usr/lib64/mrtg2/SNMP_Session.pm

Replace two instances of entry Socket6->import(qw(pack_sockaddr_in6 inet_pton getaddrinfo)); or import Socket6;

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

You are done 🙂

6 comments

Skip to comment form

  1. Alan Simplicio

    Thanks man, was already going crazy!

    1. penguinbliss

      I’m glad this post has helped you 🙂

  2. MaReK

    Thx for your tutorial 🙂

    1. penguinbliss

      You are most welcome: )

  3. Greg

    Thanks – its been driving me crazy for ages!

    1. penguinbliss

      😀 it’s fixed now right

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>