IPv6 support?

11 views
Skip to first unread message

Harry

unread,
Jun 8, 2009, 7:57:31 AM6/8/09
to rrdbot
Hi folks!

I would like to poll several IPv6 Nodes with rrdbot, but it seems
there is no support for the protocol (yet?).

When I set up rrdbot.conf variables like this:

in-loop.source: snmp://public@fe80::201:80ff:fe76:e2de/ifInOctets.1

rrdbotd returns:

rrdbotd: couldn't parse host address (ignoring):
fe80::201:80ff:fe76:e2de: Numerical result out of range

After some searching the source, I found the message in "/usr/src/
rrdbot-0.9.4/common/snmp-engine.c" line 960 triggered by a result of
"sock_any_pton". This comes from "/usr/src/rrdbot-0.9.4/common/
sock_any.c" line 50 ff, where I found:

#ifdef HAVE_INET6

Well, the whole sourcecode shows no line containing "#define
HAVE_INET6", neither does the kernel source (oh, by the way, this is a
SuSE Enterprise 10 SP2 machine running linux 2.6.16.60-0.21-default).

The system is IPv6 ready, which I do know for sure. A "ping6 -i eth1
fe80::201:80ff:fe76:e2de" works pretty well.

As a last shot I even tried to insert a "#define HAVE_INET6" into
"common/sock_any.h" but the program doesn't compile anymore:

make all-recursive
make[1]: Entering directory `/usr/src/rrdbot-0.9.4'
Making all in bsnmp
make[2]: Entering directory `/usr/src/rrdbot-0.9.4/bsnmp'
make[2]: Nothing to be done for `all'.
make[2]: Leaving directory `/usr/src/rrdbot-0.9.4/bsnmp'
Making all in common
make[2]: Entering directory `/usr/src/rrdbot-0.9.4/common'
gcc -DHAVE_CONFIG_H -I. -I.. -I../common/ -I../bsnmp/ -I.. -I/usr/
local/include -Wall -pthread -D_POSIX_PTHREAD_SEMANTICS -MT
libcommon_a-sock-any.o -MD -MP -MF .deps/libcommon_a-sock-any.Tpo -c -
o libcommon_a-sock-any.o `test -f 'sock-any.c' || echo './'`sock-any.c
sock-any.c: In function âsock_any_ptonâ:
sock-any.c:97: error: âstruct sockaddr_inâ has no member named
âsin6_addrâ
sock-any.c:202: warning: suggest parentheses around assignment used as
truth value
sock-any.c:214: error: expected â)â before â:â token
sock-any.c:292: error: âoptâ undeclared (first use in this function)
sock-any.c:292: error: (Each undeclared identifier is reported only
once
sock-any.c:292: error: for each function it appears in.)
make[2]: *** [libcommon_a-sock-any.o] Error 1
make[2]: Leaving directory `/usr/src/rrdbot-0.9.4/common'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/usr/src/rrdbot-0.9.4'
make: *** [all] Error 2

It seems to me, there is something prepared for IPv6, but not yes
finished. My C is by far not good enough to investigate any further.

Well, is there any chance, getting rrdbot to work with IPv6?

regards,

Harry

Stef Walter

unread,
Jun 10, 2009, 3:36:40 PM6/10/09
to rrd...@googlegroups.com
Harry wrote:
> I would like to poll several IPv6 Nodes with rrdbot, but it seems
> there is no support for the protocol (yet?).

<snip>

> It seems to me, there is something prepared for IPv6, but not yes
> finished. My C is by far not good enough to investigate any further.
>
> Well, is there any chance, getting rrdbot to work with IPv6?

You're right. There's some code there, but it hasn't been tested. I
played around with it today and got the address parsing to work. But I
think there's a bit more that needs to be done.

In particular there needs to be two sockets opened (one for ipv4, one
for ipv6) for SNMP traffic.

Things are a bit hectic for me right now. I'll try to get to this next
week some time. Please ping me again, if I forget about it.

All the best,

Stef

Stef Walter

unread,
Jul 10, 2009, 12:13:50 AM7/10/09
to Goesta, rrd...@googlegroups.com
Goesta wrote:

> On Jun 10, 9:36 pm, Stef Walter <stef-l...@memberwebs.com> wrote:
>
>> Things are a bit hectic for me right now. I'll try to get to this next
>> week some time. Please ping me again, if I forget about it.
>
> Ping ;-)

Heh, sorry for the late response. Here's a patch with what I have so
far, sorta basic.

The bummer is that "IPv6 support" usually comes with other requirements:

- Fallback to IPv4 (when multiple addresses are supported via DNS).
- Options -4 and -6 to limit use of IPv4 and IPv6 respectively.
- And I'm sure you can think of more ...

I haven't had time to finish those bits, but I'll give it a shot in the
near future.

Stef


rrdbot-ipv6-1.patch

Goesta

unread,
Aug 25, 2009, 6:52:34 AM8/25/09
to rrdbot
Sorry for the delay! Been a bit busy myself lately ...

To cut the long story short: The patch doesn't work (for me, at
least).

I tried it on both Ubuntu 8.04.2 and Ubuntu 9.04 with the same effect
(regardless of IPv4 or IPv6 address use):

[v0.9.4]
rrdbot-get snmp://pub...@10.1.26.72/.1.3.6.1.2.1.1.3.0
SNMPv2-MIB::sysUpTime.0: 7808096

[v0.9.4_patched]
rrdbot-get snmp://pub...@10.1.26.72/.1.3.6.1.2.1.1.3.0
Segmentation fault

----8<---- STRACE OUTPUT ---->8----

root@localhost:~# strace rrdbot-get snmp://pub...@10.1.26.72/.1.3.6.1.2.1.1.3.0
execve("/usr/local/sbin/rrdbot-get", ["rrdbot-get", "snmp://
pub...@10.1.26.72/.1.3.6."...], [/* 17 vars */]) = 0
brk(0) = 0x8080000
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or
directory)
mmap2(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1,
0) = 0xb7f15000
access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or
directory)
open("/etc/ld.so.cache", O_RDONLY) = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=25660, ...}) = 0
mmap2(NULL, 25660, PROT_READ, MAP_PRIVATE, 3, 0) = 0xb7f0e000
close(3) = 0
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or
directory)
open("/usr/lib/librrd.so.2", O_RDONLY) = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\20a
\0\000"..., 512) = 512
fstat64(3, {st_mode=S_IFREG|0644, st_size=284316, ...}) = 0
mmap2(NULL, 292768, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3,
0) = 0xb7ec6000
mmap2(0xb7f08000, 20480, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|
MAP_DENYWRITE, 3, 0x41) = 0xb7f08000
mmap2(0xb7f0d000, 1952, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|
MAP_ANONYMOUS, -1, 0) = 0xb7f0d000
close(3) = 0
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or
directory)
open("/lib/tls/i686/cmov/libpthread.so.0", O_RDONLY) = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\20H
\0\000"..., 512) = 512
fstat64(3, {st_mode=S_IFREG|0755, st_size=112354, ...}) = 0
mmap2(NULL, 94688, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3,
0) = 0xb7eae000
mmap2(0xb7ec2000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|
MAP_DENYWRITE, 3, 0x13) = 0xb7ec2000
mmap2(0xb7ec4000, 4576, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|
MAP_ANONYMOUS, -1, 0) = 0xb7ec4000
close(3) = 0
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or
directory)
open("/lib/tls/i686/cmov/libc.so.6", O_RDONLY) = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\260e\1"...,
512) = 512
fstat64(3, {st_mode=S_IFREG|0755, st_size=1364388, ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1,
0) = 0xb7ead000
mmap2(NULL, 1369712, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE,
3, 0) = 0xb7d5e000
mmap2(0xb7ea7000, 12288, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|
MAP_DENYWRITE, 3, 0x149) = 0xb7ea7000
mmap2(0xb7eaa000, 9840, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|
MAP_ANONYMOUS, -1, 0) = 0xb7eaa000
close(3) = 0
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or
directory)
open("/usr/lib/libfreetype.so.6", O_RDONLY) = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\360i\0"...,
512) = 512
fstat64(3, {st_mode=S_IFREG|0644, st_size=447292, ...}) = 0
mmap2(NULL, 446028, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3,
0) = 0xb7cf1000
mmap2(0xb7d5b000, 12288, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|
MAP_DENYWRITE, 3, 0x6a) = 0xb7d5b000
close(3) = 0
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or
directory)
open("/usr/lib/libpng12.so.0", O_RDONLY) = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\320=\0"...,
512) = 512
fstat64(3, {st_mode=S_IFREG|0644, st_size=141452, ...}) = 0
mmap2(NULL, 140188, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3,
0) = 0xb7cce000
mmap2(0xb7cf0000, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|
MAP_DENYWRITE, 3, 0x22) = 0xb7cf0000
close(3) = 0
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or
directory)
open("/usr/lib/libz.so.1", O_RDONLY) = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\20\31\0"...,
512) = 512
fstat64(3, {st_mode=S_IFREG|0644, st_size=81240, ...}) = 0
mmap2(NULL, 83968, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3,
0) = 0xb7cb9000
mmap2(0xb7ccd000, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|
MAP_DENYWRITE, 3, 0x13) = 0xb7ccd000
close(3) = 0
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or
directory)
open("/usr/lib/libart_lgpl_2.so.2", O_RDONLY) = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\200\'\0"...,
512) = 512
fstat64(3, {st_mode=S_IFREG|0644, st_size=85044, ...}) = 0
mmap2(NULL, 87880, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3,
0) = 0xb7ca3000
mmap2(0xb7cb8000, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|
MAP_DENYWRITE, 3, 0x14) = 0xb7cb8000
close(3) = 0
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or
directory)
open("/lib/tls/i686/cmov/libm.so.6", O_RDONLY) = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0@4\0\000"...,
512) = 512
fstat64(3, {st_mode=S_IFREG|0644, st_size=149328, ...}) = 0
mmap2(NULL, 147584, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3,
0) = 0xb7c7e000
mmap2(0xb7ca1000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|
MAP_DENYWRITE, 3, 0x23) = 0xb7ca1000
close(3) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1,
0) = 0xb7c7d000
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1,
0) = 0xb7c7c000
set_thread_area({entry_number:-1 -> 6, base_addr:0xb7c7c6b0, limit:
1048575, seg_32bit:1, contents:0, read_exec_only:0, limit_in_pages:1,
seg_not_present:0, useable:1}) = 0
mprotect(0xb7ea7000, 4096, PROT_READ) = 0
munmap(0xb7f0e000, 25660) = 0
set_tid_address(0xb7c7c6f8) = 12588
set_robust_list(0xb7c7c700, 0xc) = 0
futex(0xbf867110, 0x81 /* FUTEX_??? */, 1) = 0
rt_sigaction(SIGRTMIN, {0xb7eb22c0, [], SA_SIGINFO}, NULL, 8) = 0
rt_sigaction(SIGRT_1, {0xb7eb2340, [], SA_RESTART|SA_SIGINFO}, NULL,
8) = 0
rt_sigprocmask(SIG_UNBLOCK, [RTMIN RT_1], NULL, 8) = 0
getrlimit(RLIMIT_STACK, {rlim_cur=8192*1024, rlim_max=RLIM_INFINITY})
= 0
uname({sys="Linux", node="localhost", ...}) = 0
brk(0) = 0x8080000
brk(0x80a1000) = 0x80a1000
socket(PF_INET, SOCK_DGRAM, IPPROTO_IP) = 3
bind(3, {sa_family=AF_INET, sin_port=htons(0), sin_addr=inet_addr
("0.0.0.0")}, 16) = 0
--- SIGSEGV (Segmentation fault) @ 0 (0) ---
+++ killed by SIGSEGV +++
Process 12588 detached

----8<---- STRACE OUTPUT ---->8----

Thank you for your effort, I hope my trace helps tracking the bug ...

regards,

Harry

On Jul 10, 6:13 am, Stef Walter <stef-l...@memberwebs.com> wrote:

> Heh, sorry for the late response. Here's a patch with what I have so
> far, sorta basic.
>
> The bummer is that "IPv6 support" usually comes with other requirements:
>
>  - Fallback to IPv4 (when multiple addresses are supported via DNS).
>  - Options -4 and -6 to limit use of IPv4 and IPv6 respectively.
>  - And I'm sure you can think of more ...
>
> I haven't had time to finish those bits, but I'll give it a shot in the
> near future.
>
> Stef
>
>  rrdbot-ipv6-1.patch
> 9KViewDownload
Reply all
Reply to author
Forward
0 new messages