Closed ghost closed 3 years ago
Do you have speedtest-cli installed?
What's the output when you are running the speedtest.sh
script?
Yes, I do. I've installed it yesterday.
The output is:
/etc/zabbix/bin/speedtest.sh: 10: exec: {lock_fd}: not found
On 10 May 2017 at 06:49, Philipp Schmitt notifications@github.com wrote:
Do you have speedtest-cli https://github.com/sivel/speedtest-cli installed? What's the output when you are running the speedtest.sh script?
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/pschmitt/zabbix-speedtest/issues/1#issuecomment-300380645, or mute the thread https://github.com/notifications/unsubscribe-auth/AZT8RxRy2vwiGkXvM9YaH-7QWqAHcmDRks5r4U_tgaJpZM4NVMtl .
Was getting the same error. Turns out that I had tested the speedtest.sh as root. It created the /tmp/speedtest.lock file so root was the owner. After that, the zabbix user has no permission to overwrite the file.
Solution: Delete /tmp/speedtest.* and then try it running as the zabbix user.
Does this solve this for you, @andrenobre88?
You might be getting an error like:
/etc/zabbix/bin/speedtest.sh: line 10: lock_fd: Permission denied
or even the one like @andrenobre88 mentioned above.
This happens when the zabbix
user invokes the lock
(within bash
command) command against the /tmp/speedtest.log
and /tmp/speedtest.lock
files.
A quick fix for this is to enable a SELinux permissive policy for the zabbix agent (zabbix_agent_t) type to run anything:
$ sudo semanage permissive -a zabbix_agent_t
Note: This will now mean that the zabbix agent will be able to do a lot of potentially unintended things. If you're OK with this then you can leave it like that. I would however recommend that you look at the SELinux audit log, work out the specific access requirements and generate a least permissions policy module that restricts the zabbix
user to the /tmp/speedtest.*
files.
Also: to disable the SELinux permissive policy for the zabbix agent (zabbix_agent_t) type run the following:
$ sudo semanage permissive -d zabbix_agent_t
@pschmitt : Great work on this tool by the way. I pulled a version that had an installer included and it might be useful to have an SELinux check in there to either automate the inclusion of the policy or prompt the user to do the above. What do you think?
What installer? In my opinion these SELinux instructions should be part of the README. Would you mind submitting a PR?
My bad, I wrote an installer some time back. So much coding... I'll update the README and do the PR.
When I run the script, I get a message "A speedtest is already running" Data is not written /tmp/speedtest.* Make them both executable: chmod +x /etc/zabbix_agentd.conf.d/bin/speedtest what file should I make? Copy the speedtest binary (bin/speedtest-linux-arm-static) what to do with this file?
Received value [] is not suitable for value type [Numeric (float)]