a tons of mails to postmaster for error from mrtg cronjob

MRTG is a very popular open source tool for server statistics. Wether you use it for traffic, CPU load, or whatever.

This package is part of standard tools for CentOS. Same counts for Perl, SNMP, etcetera.
Whenever you decide to use 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:

Depending on how often your CRON job is configured for running web statistics MRTG, you may receive following error:

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

This already is an old bug in MRTG: http://oss.oetiker.ch/mrtg-trac/ticket/45
There are several ways to fix this, like re-installing Perl, roll back your update (if you configured that).
I choose following fix:

Edit: /usr/bin/mrtg

Then find “import Socket6″ (note: without the “;") and replace it with:

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

Also edit: /usr/lib64/mrtg2/SNMP_Session.pm

Then find “import Socket6;"  (note: with the “;")

note: there are 2 instances

replace them both again, like above.

廣告

About alferkwok

Knowledge Base
本篇發表於 Linux。將永久鏈結加入書籤。

發表迴響

在下方填入你的資料或按右方圖示以社群網站登入:

WordPress.com Logo

您的留言將使用 WordPress.com 帳號。 登出 / 變更 )

Twitter picture

您的留言將使用 Twitter 帳號。 登出 / 變更 )

Facebook照片

您的留言將使用 Facebook 帳號。 登出 / 變更 )

Google+ photo

您的留言將使用 Google+ 帳號。 登出 / 變更 )

連結到 %s