mimugmail / opn-repo

OPNsense repo by mimugmail
Other
358 stars 27 forks source link

Speedtest not running via cron #216

Open GioPan04 opened 5 months ago

GioPan04 commented 5 months ago

Hi, I setup a cron job via the web gui to run a speedtest every hour, but reading the logs it looks like it doesn't ever run. The cron service is up and running and other cron jobs seems running fine. What the problem could be?

Here is the configuration of the cron job: image

I tried to find some logs from cron or from the tool, but I didn't find anything relevant.

Qhilm commented 5 months ago

Same issue here.

Although I noticed I also get this error when trying to run manually: "speedtest server id XXXX not recognized". But it sometimes work, sometimes not, it's strange.

The list of available servers also changes each time I reload the page...

mimugmail commented 5 months ago

@mihakralj any idea?

GioPan04 commented 5 months ago

Although I noticed I also get this error when trying to run manually: "speedtest server id XXXX not recognized". But it sometimes work, sometimes not, it's strange.

I never encountered this issue, but I can see that some servers differs every time, so it could be totally possible that you are having this problem.

Qhilm commented 5 months ago

It suddenly started working yesterday for me, I have no explanation. I think I changed the cron schedule from daily to hourly, that's it.

I still get the "speedtest server id XXXX not recognized" error with multiple servers, when I trigger it manually.

mihakralj commented 5 months ago

list of speedtest servers is pulled straight out from speedtest CLI. Which one do you use - the Python one or Ookla binary? My suspicion is that the Python version of Speedtest is becoming more and more obsolete.

gitthangbaby commented 2 months ago

Speedtest forgot server id after a year of permanent use..offered me locations from some different country. So ran both "speedtest" and "speedtest-cli" manually, and none of the IDs i used are recognized: list1 list2 after a day, it loaded servers from the correct city, with new IDs, so i took whatever was there speedtest-cli --list update: forgot that there's a secret switch "Socket" when help menu is pressed. Then the IDs work.

paragm commented 3 days ago

try changing the file permissions on the csv file as follows

cd /usr/local/opnsense/scripts/OPNsense/speedtest/ ; chmod 755 speedtest.csv OR try chmod 666 speedtest.csv

and now trying the cronjob or watch the System > Log files > Backend for succesful or failure of cronjob

if the job runs successfully

look at Reports > Speedtest --> Enable showlogs

you should see your speedtest results based on cronjob schedule

PS: i was able to fix this with the 666 as the perms on the csv file