munin-monitoring / contrib

Contributed stuff for munin (plugins, tools, etc...)

Home Page:http://munin-monitoring.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

reading conf fails with A: and AAAA: on ping plugin

doublehp opened this issue · comments

https://github.com/munin-monitoring/contrib/blob/master/plugins/ping/ping

# which host
/usr/bin/host
# which ping6
/bin/ping6
# which ping
/bin/ping


env.hosts 1.1.1.1,one.one.one.one, 4:ipv41.google.com,4:ipv42.google.com, 6:ipv43.google.com # space after comma
=>
fetch ping_4.2.2.2
_ipv42_google_com.value U
_.value 0.039913
one_one_one_one.value 0.038617
.


env.hosts 1.1.1.1,one.one.one.one, 4:ipv41.google.com,4:ipv42.google.com ,6:ipv43.google.com # space before comma
=>
fetch ping_4.2.2.2
_ipv42_google_com_.value U
ipv43_google_com.value U
_.value 0.045448
one_one_one_one.value 0.052665
.


env.hosts 1.1.1.1,one.one.one.one, 4:ipv41.google.com,4:ipv42.google.com   ,6:ipv43.google.com # TAB before comma
=>
fetch ping_4.2.2.2
_ipv42_google_com_.value U
ipv43_google_com.value U
_.value 0.040032
one_one_one_one.value 0.039707
.


env.hosts 1.1.1.1,one.one.one.one       ,A:ipv41.google.com ,AAAA:ipv42.google.com  ,6:ipv43.google.com
=>
fetch ping_4.2.2.2
ipv43_google_com.value U
_.value 0.098703
one_one_one_one_.value 0.070317
.


env.hosts 1.1.1.1,one.one.one.one       ,A:ipv41.google.com ,AAAA:ipv42.google.com  ,4:ipv43.google.com     ,6:ipv44.google.com
=>
fetch ping_4.2.2.2
# munin node at opi-69-maison-compteur-electric.doublehp.org
ipv44_google_com.value U
_ipv43_google_com_.value U
_.value 0.039374
one_one_one_one_.value 0.038355
. 

1: space or TAB is not supported after the coma, only BEFORE (spacing is required to align vertically hosts with names in conf)

2: A: and AAAA: never produce output on fetch.

3: 4: was an intuitive thing to me, but it also fails, so I have no way to force v4 resolution for sure for hosts that resolve on both stacks. one.one.one.one for example can be resolved on both stacks:

$ ping -c1 -4 one.one.one.one
PING  (1.1.1.1) 56(84) bytes of data.
64 bytes from one.one.one.one (1.1.1.1): icmp_seq=1 ttl=55 time=49.1 ms
$ ping -c1 -6 one.one.one.one
PING one.one.one.one(one.one.one.one (2606:4700:4700::1001)) 56 data bytes
64 bytes from one.one.one.one (2606:4700:4700::1001): icmp_seq=1 ttl=59 time=50.1 ms 

so I have no way to force v4

I don't speak Perl, and don't understand how resolution works, or the difference of using AAAA: or 6: .

creating a plugin called ping_packetloss with corresponding conf section

[ping_packetloss]
env.hosts ipv4.google.com ,ipv6.google.com
env.names g4 ,g6
env.fork yes

produces ... no new graph in the network section.

EDIT: I had a corrupted cache; things got fixed by flushing /var/lib/munin