Open jonmcd11 opened 2 years ago
I have to say that the most likely cause of this is some issue with the plugin.
I've played with your plugin-fragment and tested if speedtest is locale sensitive. The plugin-fragment is simple enough. Speedtest is not locale sensitive so it appears it will never print the speed as "99,9" but rather always as "99.0" which is what munin needs.
The only way for the part of the plugin-fragment you've given us (which is not the whole plugin, it does not handle config) is if the /tmp/speedtest.out
file is empty or unreadable. So I have to ask: Did the file exist and was it readable at the time the log with the error message was written?
Also, please have a look at the munin-node log for the times when munin-update said there were errors in the plugin output.
EDIT: oops, I'm sorry. Somehow I only registered the 6 last lines of the plugin, and not in fact the whole plugin which you had provided. It's still simple enough that I think the only way it can fail is if the /tmp/speedtest.out
file does not exist when it's executed.
The /tmp/speedtest.out file has content and is being updated via the cron job as expected. I get it the whole set up is sparse
I previously had a problem with the file not being readable, returning other errors. I changed the systemd configuration for munin to set PrivateTmp
to false
so the file is readable. I figured this out with the --ignore-systemd-properties
flag on the munin-run
command.
What I can't figure out or find any reference for is why a plugin update that works when running munin-update in debug mode from the command line as user munin will not work under munin-update running normally under munin-cron.
Hi, please have a look in the munin-node log (on the node where the plugin is executed) for the times munin-update fails.
munin-update log:
2022/11/30 15:10:01 [INFO]: Starting munin-update
2022/11/30 15:10:01 [INFO] starting work in 4081 for pihole/192.168.1.2:4949.
2022/11/30 15:10:01 [INFO] starting work in 4080 for localhost.localdomain/127.0 .0.1:4949.
2022/11/30 15:10:01 [INFO] node localhost.localdomain advertised itself as zbucket instead.
2022/11/30 15:10:06 [WARNING] 2 lines had errors while 0 lines were correct (100.00%) in data from 'fetch speedtest' on localhost.localdomain/127.0.0.1:4949
2022/11/30 15:10:07 [INFO]: Munin-update finished for node pihole;pihole (6.00 sec)
2022/11/30 15:10:17 [INFO]: Munin-update finished for node localdomain;localhost.localdomain (15.40 sec)
2022/11/30 15:10:17 [INFO] Reaping Munin::Master::UpdateWorker<pihole;pihole>. Exit value/signal: 0/0
2022/11/30 15:10:17 [INFO] Reaping Munin::Master::UpdateWorker<localdomain;localhost.localdomain>. Exit value/signal: 0/0
2022/11/30 15:10:17 [INFO]: Munin-update finished (15.61 sec)
2022/11/30 15:15:01 [INFO]: Starting munin-update
2022/11/30 15:15:01 [INFO] starting work in 5294 for pihole/192.168.1.2:4949.
2022/11/30 15:15:01 [INFO] starting work in 5295 for localhost.localdomain/127.0.0.1:4949.
2022/11/30 15:15:01 [INFO] node localhost.localdomain advertised itself as zbucket instead.
2022/11/30 15:15:05 [WARNING] 2 lines had errors while 0 lines were correct (100.00%) in data from 'fetch speedtest' on localhost.localdomain/127.0.0.1:4949
2022/11/30 15:15:07 [INFO]: Munin-update finished for node pihole;pihole (5.92 sec)
2022/11/30 15:15:14 [INFO]: Munin-update finished for node localdomain;localhost.localdomain (13.17 sec)
2022/11/30 15:15:14 [INFO] Reaping Munin::Master::UpdateWorker<pihole;pihole>. Exit value/signal: 0/0
2022/11/30 15:15:14 [INFO] Reaping Munin::Master::UpdateWorker<localdomain;localhost.localdomain>. Exit value/signal: 0/0
2022/11/30 15:15:14 [INFO]: Munin-update finished (13.37 sec)
munin-node.log from same time period:
Resolved [*]:4949 to [::]:4949, IPv6
Not including resolved host [0.0.0.0] IPv4 because it will be handled by [::] IPv6
Binding to TCP port 4949 on host :: with IPv6
Setting gid to "0 0"
2022/11/30-15:05:13 [2645] sd_notify: looking for NOTIFY_SOCKET environment variable
2022/11/30-15:05:13 [2645] sd_notify: preparing connection to '/run/systemd/notify'
2022/11/30-15:05:13 [2645] sd_notify: connected to socket '/run/systemd/notify'
2022/11/30-15:05:13 [2645] sd_notify: sending READY signal to '/run/systemd/notify'
2022/11/30-15:10:01 CONNECT TCP Peer: "[::ffff:127.0.0.1]:37148" Local: "[::ffff:127.0.0.1]:4949"
2022/11/30-15:15:01 CONNECT TCP Peer: "[::ffff:127.0.0.1]:57236" Local: "[::ffff:127.0.0.1]:4949"
It's been a while. Sorry. There are no error messages on the node.
Can you do 'telnet localhost 4949 | tee mn.log ' and then inside telnet type 'fetch speedtest' and after that 'quit' and post the output captured in mn.log as a file attachment here? (file attachment to be able to see any special characters that might or might not be in the output).
munin-update gets no data from plugin when running from munin-cron, works fine with command line test. master node and node hosting the plugin are the same
munin-update.log:
2022/11/26 14:35:01 [INFO]: Starting munin-update
2022/11/26 14:35:01 [INFO] starting work in 378829 for pihole/192.168.1.2:4949.
2022/11/26 14:35:01 [INFO] starting work in 378828 for localhost.localdomain/127.0.0.1:4949.
2022/11/26 14:35:01 [INFO] node localhost.localdomain advertised itself as zbucket instead.
2022/11/26 14:35:07 [INFO]: Munin-update finished for node pihole;pihole (5.88 sec)
2022/11/26 14:35:15 [WARNING] 2 lines had errors while 0 lines were correct (100.00%) in data from 'fetch speedtest' on localhost.localdomain/127.0.0.1:4949
2022/11/26 14:35:15 [INFO]: Munin-update finished for node localdomain;localhost.localdomain (13.65 sec)
2022/11/26 14:35:15 [INFO] Reaping Munin::Master::UpdateWorker<pihole;pihole>. Exit value/signal: 0/0
2022/11/26 14:35:15 [INFO] Reaping Munin::Master::UpdateWorker<localdomain;localhost.localdomain>. Exit value/signal: 0/0
2022/11/26 14:35:15 [INFO]: Munin-update finished (13.87 sec)
command line run:
munin@zbucket:/home/jon$ /usr/share/munin/munin-update --debug --host localhost.localdomain --service speedtest
2022/11/26 14:44:39 [FETCH from speedtest] down.value 45.09
2022/11/26 14:44:39 [FETCH from speedtest] Storing 45.09 in down
2022/11/26 14:44:39 [FETCH from speedtest] up.value 11.35
2022/11/26 14:44:39 [FETCH from speedtest] Storing 11.35 in up
Plugin speedtest:
The node is running speedtest-cli from a cron job, every 5 minutes:
/usr/local/bin/speedtest-cli --simple > /tmp/speedtest.out
To Reproduce Steps to reproduce the behavior:
/usr/share/munin/munin-update --debug --host localhost.localdomain --service speedtest
Expected behavior no errors for speedtest in munin-update log in either case
Desktop (please complete the following information):