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

Add Timeout of 5m to zbx-speedtest.sh #12

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

elekgeek
Copy link

@elekgeek elekgeek commented Jun 25, 2020

This change is originally proposed by someone else @garbled1 but it was on the wrong file but still I believe this change should be applied to all scripts, nevertheless to speed things up, I just proposed the same exact change to avoid forcing people looking up why this script hangs and no longer works.

This change is originally proposed by someone else, but it was on the wrong file, nevertheless to speed things up, I just proposed it to avoid forcing people looking up why this script hangs and no longer works.
@elekgeek elekgeek changed the title Update zbx-speedtest.sh Add Timeout of 5m to zbx-speedtest.sh Jun 25, 2020
Copy link
Owner

@pschmitt pschmitt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your work on this.

As stated in my review of the original PR:

  • please don't use full paths to binaries
  • run generate-debian-files.sh and commit the updated Debian/ubuntu script
  • the timeout should be user-configurable. I'm fine with a default of 5m but there's gotta people who will need to adjust that.
  • also, the readme needs be adjusted accordingly

@elekgeek
Copy link
Author

elekgeek commented Jun 25, 2020

sure, let me read your script and see how I will do that correctly concerning the timeout. I assume also zabbix template has to be changed as well, am I correct?

@pschmitt
Copy link
Owner

Yeah probably, ideally the timeout would be a macro à la {#SPEEDTEST_TIMEOUT}. I forgot about that part.

@pschmitt
Copy link
Owner

Quick note: I just checked on a vanilla install of OpenWRT 19.03 -> timeout isn't installed by default.
This needs to be mentioned in the dependencies section of the README.

Sorry for dumping all these change requests on you like this, I'm really not trying to be a dick. Thanks for your interest in this particular piece of software and your work on this PR 🙏

@elekgeek
Copy link
Author

I noticed that timeout 5m doesn't solve the hanging issue, I checked when I arrived home ps aux | grep zbx-speedtest.sh has been running for the last 2 hours.

I should find the actual reason behind this failure first.

@elekgeek
Copy link
Author

elekgeek commented Jun 27, 2020

  1. I found that the user should be zabbix rather than zabbix-agent in zabbix-speedtest.service.

  2. I don't believe that adding {$SPEEDTEST_TIMEOUT} is necessary to zabbix template template_speedtest.xml and zbx-speedtest.sh. I ran time speedtest --accept-license --accept-gdpr -f json for 50Mbps line 10 times, the average was 26.5 seconds, so having timeout 1m in zbx-speedtest.sh is more than enough to avoid speedtest troubles. Add to it is that the real value that matters is OnCalendar=*:0/x in zabbix-speedtest.timer, this value should never be less than 2 minutes, the same value of 2 minutes limitation applies to {$UPDATE_INTERVAL} that is mentioned in pt. 3, and this has to be reflected in README.

  3. The more important thing was I added {$UPDATE_INTERVAL} macro to zabbix template, and replaced 5m value for Update interval with {$UPDATE_INTERVAL} so it is only once place where you have to change update interval for all items based on the value of OnCalender in the zabbix-speedtest.timer

If you agree on these changes let me know so I create complete pull request for all related files.

@pschmitt
Copy link
Owner

pschmitt commented Jul 2, 2020

  1. I found that the user should be zabbix rather than zabbix-agent in zabbix-speedtest.service.

This is distro-specific. To really make this work everywhere I guess I'll have to implement an install.sh script. Anyway: this is out of scope for this PR.

  1. The real value that matters is OnCalendar=*:0/x

You are correct. This is definitely the better approach.

I ran time speedtest --accept-license --accept-gdpr -f json for 50Mbps line 10 times, the average was 26.5 seconds, so having timeout 1m in zbx-speedtest.sh is more than enough to avoid speedtest troubles

Not everybody has a 50Mb line... I won't merge a timeout of 1m. That's just too low IMHO.

  1. The more important thing was I added {$UPDATE_INTERVAL} macro to zabbix template, and replaced 5m value for Update interval with {$UPDATE_INTERVAL} so it is only once place where you have to change update interval for all items based on the value of OnCalender in the zabbix-speedtest.timer

👍

@elekgeek
Copy link
Author

elekgeek commented Jul 2, 2020

I am new to this pull request thing to be honest, and it's making me more nervous when I say this is the first time I do a pull request :) anyway, just let me know what you need from me, and I will try to do the best I can.

@elekgeek
Copy link
Author

elekgeek commented Jul 2, 2020

man I re-read this discussion, this discussion should never be in a pull request :)

@pschmitt
Copy link
Owner

pschmitt commented Jul 2, 2020

No harm done. Not all of it was off-topic ;)

@pschmitt
Copy link
Owner

@elekgeek you still on this? or should I discard this PR?

@elekgeek
Copy link
Author

elekgeek commented Nov 21, 2020 via email

@pschmitt
Copy link
Owner

Untitled

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

Successfully merging this pull request may close these issues.

2 participants