Bug 451783

Summary: mrtg complains of undefined subroutine AF_UNSPEC, doesn't update
Product: [Fedora] Fedora Reporter: J. Randall Owens <jrowens.fedora>
Component: mrtgAssignee: Vitezslav Crhonek <vcrhonek>
Status: CLOSED CURRENTRELEASE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: low Docs Contact:
Priority: low    
Version: 9   
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: 2.16.1-4.fc9 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2008-07-15 12:12:32 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description J. Randall Owens 2008-06-17 11:29:25 UTC
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 15:33:57 UTC
I think I have a fix - let me test it for a while...

Comment 2 Fedora Update System 2008-06-27 08:35:33 UTC
mrtg-2.16.1-4.fc9 has been submitted as an update for Fedora 9

Comment 3 Fedora Update System 2008-06-28 22:15:47 UTC
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 07:38:30 UTC
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 12:12:30 UTC
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.