Bug 451783 - mrtg complains of undefined subroutine AF_UNSPEC, doesn't update
mrtg complains of undefined subroutine AF_UNSPEC, doesn't update
Status: CLOSED CURRENTRELEASE
Product: Fedora
Classification: Fedora
Component: mrtg (Show other bugs)
9
i386 Linux
low Severity low
: ---
: ---
Assigned To: Vitezslav Crhonek
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2008-06-17 07:29 EDT by J. Randall Owens
Modified: 2008-07-15 08:12 EDT (History)
0 users

See Also:
Fixed In Version: 2.16.1-4.fc9
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2008-07-15 08:12:32 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description J. Randall Owens 2008-06-17 07:29:25 EDT
Description of problem:
When crond runs mrtg every 5 minutes, I was getting emails with the
/etc/cron.d/mrtg command line as the subject, of course, and complaining of
"Undefined subroutine &main::AF_UNSPEC called at /usr/bin/mrtg line 2107."  A
little poking around, and examining other old mrtg bugs (especially bug #134241
and bug #438931, which led me to bug #437681) led me to suspect it was my
"EnableIPv6: yes" in /etc/mrtg/mrtg.cfg which contributed to the problem.  So,
for the moment, I've turned off IPv6, which stemmed the deluge of email.  But,
it would be nice to either have IPv6 fully working, or at least disable it and
remove some references to it in docs, annotate others, so people don't expect it
to work.
Unless it does work on some systems but not on others.  Then I'd be scratching
my head a bit.

I found some likely-looking AF_UNSPEC lines grepping through the /usr/lib/perl5/
directory, so I included the version numbers of those here.

Version-Release number of selected component (if applicable):
mrtg-2.16.1-1.fc9.i386
perl-5.10.0-22.fc9.i386
perl-Socket6-0.20-1.fc9.i386
perl-IO-Socket-INET6-2.54-1.fc9.noarch

How reproducible:
Try to run mrtg with IPv6 support.

Steps to Reproduce:
1. Install mrtg and configure it to use IPv6.
2. Check your inbox (if crond & mail are configured correctly).
3. Check the timestamp on files in /var/www/mrtg/.
  
Actual results:
Lots of email, no updated files in /var/www/mrtg/.

Expected results:
No email, fresh graph updates in /var/www/mrtg/.

Additional info:
Oh, and here's the context of line 2107 (it's the one with getaddrinfo &
AF_UNSPEC in it):

} else {
  # Hostname. Look it up
  my @res;
  my ($too,$port,$otheropts) = split(':',$$target{SnmpOpt}, 3);
  $port = 161 unless defined $port;
  @res = getaddrinfo($hostname, $port, AF_UNSPEC(), SOCK_DGRAM());
  if (scalar (@res) < 5) {
    warn "$NOW: WARNING: Skipping host $hostname as it does not resolve to an
IPv4 or IPv6 address\n";
    return 'DEADHOST';
  }
}

Also, I'm sorry to say, I didn't think to check the dates of /var/lib/mrtg/*
before I turned off IPv6.  I'd rather not turn it on, but could if anyone really
thought it'd help.  Given where the error was, I'm pretty sure they would not
have been updated, either.
Comment 1 Vitezslav Crhonek 2008-06-25 11:33:57 EDT
I think I have a fix - let me test it for a while...
Comment 2 Fedora Update System 2008-06-27 04:35:33 EDT
mrtg-2.16.1-4.fc9 has been submitted as an update for Fedora 9
Comment 3 Fedora Update System 2008-06-28 18:15:47 EDT
mrtg-2.16.1-4.fc9 has been pushed to the Fedora 9 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update mrtg'.  You can provide feedback for this update here: http://admin.fedoraproject.org/updates/F9/FEDORA-2008-5806
Comment 4 J. Randall Owens 2008-06-29 03:38:30 EDT
OK, I've been running mrtg-2.16.1-4.fc9 for about 10 minutes now with IPv6
turned back on, and it's still updating, and not sending out any complaining
emails.  Looks good from here!  Thanks.
Comment 5 Fedora Update System 2008-07-15 08:12:30 EDT
mrtg-2.16.1-4.fc9 has been pushed to the Fedora 9 stable repository.  If problems still persist, please make note of it in this bug report.

Note You need to log in before you can comment on or make changes to this bug.