Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ping_ plugin still use ping6 #1256

Closed
solsticedhiver opened this issue Dec 9, 2019 · 9 comments
Closed

ping_ plugin still use ping6 #1256

solsticedhiver opened this issue Dec 9, 2019 · 9 comments

Comments

@solsticedhiver
Copy link

solsticedhiver commented Dec 9, 2019

ping6 is not available on archlinux (has it ever been ?)

so the /usr/lib/munin/plugins/ping_ plugin of munin-node fails when using ipv6 like in /etc/munin/plugins/ping6_2606:4700:4700::1111

# munin-run "ping6_2606:4700:4700::1111"
/etc/munin/plugins/ping6_2606:4700:4700::1111: line 94: ping6: command not found

the fix is simple and it needs a one character patch:

--- /usr/lib/munin/plugins/ping_ 2019-12-07 20:04:17.263575467 +0100
+++ /usr/lib/munin/plugins/ping_ 2019-12-07 19:56:01.635908455 +0100
@@ -59,7 +59,7 @@

case $0 in
*ping6_*)
- PING=ping6
+ PING=ping
file_host=${0##*/ping6_}
V=IPv6
;;
@je3kmz
Copy link

je3kmz commented Dec 10, 2019

The commands are different between the BSD system and Linux.

--- ./plugins/node.d/ping_.in.orig      2019-10-17 23:49:12.000000000 +0000
+++ ./plugins/node.d/ping_.in   2019-12-10 02:58:21.897377000 +0000
@@ -57,14 +57,14 @@ Foundation, Inc., 51 Franklin Street, Fi
 # shellcheck disable=SC1090
 . "$MUNIN_LIBDIR/plugins/plugin.sh"

+PING=ping
 case $0 in
     *ping6_*)
-        PING=ping6
+       PING=`( uname -a | grep -q 'BSD' ) && echo ping6`
         file_host=${0##*/ping6_}
         V=IPv6
         ;;
     *ping_*)
-        PING=ping
         file_host=${0##*/ping_}
         V=IPv4
         ;;

@solsticedhiver
Copy link
Author

Ok.

But the command is empty on anything else than BSD. May be:

PING="ping`( echo BSD | grep -q 'BSD' ) && echo 6`"

@je3kmz
Copy link

je3kmz commented Dec 11, 2019

You've found it well.

PING="ping`( uname -a | grep -q 'BSD' ) && echo 6`"

@solsticedhiver
Copy link
Author

Moreover, if ever you are loosing internet connectivity (or the link to the machine you ping), and that ping never returns nor timeout, munin-node waits indefinitly (or some amount of time) that will block the other script run on the node.

Yesterday, I lost internet, but ping never returned and was waiting, waiting... alll the other munin plugins of the node did not run because of the stalled ping_ plugin. for hours.

so I added -W 60 to the ping option. This should definitvly be a default.

Moreover, I think this is a bug of munin-node. Each plugin should be run inside a command similar to timeout(1), and the plugin should be killed if it times out after some predefined time.

@sumpfralle
Copy link
Collaborator

Yesterday, I lost internet, but ping never returned and was waiting, waiting... alll the other munin plugins of the node did not run because of the stalled ping_ plugin. for hours.

This should not happen. Every plugin is executed in (see do_with_timeout in Munin::Common::Timeout). A quick test on my host indeed kills the hanging plugin (I just added a long sleep to it) and returns in time.

Please open a separate issue and describe your specific environment, if you are able to reproduce a hanging plugin.

@solsticedhiver
Copy link
Author

It was a guess. Because it happenned at the same time I lost internet connectivity.

I am not sure I can reproduce that. It happenned only once, and it stopped as soon as internet connectivity was there again. I did not had time to investigate

@shtrom
Copy link
Contributor

shtrom commented Apr 18, 2020

You could use ping_2606:4700:4700::1111 as the symlink. If using a DNS name, you could add env.ping_args -6 to the config to force IPv6 resolution (the only remaining issue would be the title of the graph, showing IPv4).

@solsticedhiver
Copy link
Author

This seems to have been fixed in 2.0.61. However there is a new bug ! #1325

@sumpfralle
Copy link
Collaborator

Correct, this specific problem should be fixed now, but the which approach does not seem to be as platform-independent, as I thought.

Let's close this specific issue for now and track the issue with which in #1325.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

5 participants