Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 451783 - mrtg complains of undefined subroutine AF_UNSPEC, doesn't update
Summary: mrtg complains of undefined subroutine AF_UNSPEC, doesn't update
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: mrtg
Version: 9
Hardware: i386
OS: Linux
low
low
Target Milestone: ---
Assignee: Vitezslav Crhonek
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2008-06-17 11:29 UTC by J. Randall Owens
Modified: 2008-07-15 12:12 UTC (History)
0 users

Fixed In Version: 2.16.1-4.fc9
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2008-07-15 12:12:32 UTC


Attachments (Terms of Use)

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.


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