opnsense-speedtest icon indicating copy to clipboard operation
opnsense-speedtest copied to clipboard

Cron job results don't appear in the Reporting logs

Open Couto opened this issue 3 years ago • 9 comments

I've set up a hourly job to run speedtest (reduced to every 30 minutes for debugging). I can see in the logs that the cron job is being triggered as shown in the second picture.

However, the results of the cronjob are not appearing the Reporting page (in the third picture those are manual runs)

Am I missing something? I admit that I'm a bit newbie with OPNSense, so I can't find the logs detailing what's happening in the cron triggered runs... Any help here would be appreciated, and I can provide more information if you ask.

Screenshot 2021-11-26 at 09 40 07 Screenshot 2021-11-26 at 09 39 44 Screenshot 2021-11-26 at 09 41 12

Couto avatar Nov 26 '21 09:11 Couto

this looks like some odd permissions issue; can you check the permissions on .csv file where results are stored?

mihakralj avatar Nov 26 '21 23:11 mihakralj

thanks for the quick response, here's the result

couto@sun /usr/local/opnsense/scripts/OPNsense/speedtest]$ ls -la
total 28
drwxr-xr-x   2 root  wheel   512 Nov 24 18:22 .
drwxr-xr-x  10 root  wheel   512 Nov 24 18:20 ..
-rwxr-xr-x   1 root  wheel  1640 Apr  4  2021 install_speedtest.sh
-rwxr-xr-x   1 root  wheel  9344 Apr  4  2021 opn_speedtest.py
-rw-r-----   1 root  wheel  1326 Nov 26 09:12 speedtest.csv
[couto@sun /usr/local/opnsense/scripts/OPNsense/speedtest]$

I changed the permissions to chmod 0755 and it seems to be working now, if you have a more restricted permission that still allows it to work, please feel free to suggest. Thanks for the tip! 👍

Couto avatar Nov 27 '21 08:11 Couto

Sorry, I have something to add.

So, the next cron job after fixing the file permissions ran perfectly. However the following ones no longer appear on the report page again. The csv file still has the 0755 permission. Im getting the feeling that it's something a bit deeper than simple file permissions.

Couto avatar Nov 27 '21 16:11 Couto

Exactly the same issue here... Does anyone have a suggestion?

scottini avatar Jan 23 '22 11:01 scottini

@scottini Unfortunately not, I haven't found a solution yet. This bug is annoying enough to make this plugin lose its best feature 😢

Couto avatar Jan 28 '22 19:01 Couto

@Couto, please try to modify your scheduled execution time from something else than 0 or 30 (start and middle of every hour). I've scheduled it to start every hour at 15', and it works on 4 installations. Let me know!

scottini avatar Jan 30 '22 14:01 scottini

@scottini thanks for the tip, that indeed solved the problem. Which is such a weird workaround!

Couto avatar Jan 31 '22 11:01 Couto

@Couto yes, definitely... But with this indication maybe @mihakralj can find an elegant solution! ;)

scottini avatar Jan 31 '22 11:01 scottini

I cannot reproduce... Also, we moved maintenance and further development of this plugin to https://github.com/mimugmail/opn-repo Here is a direct link to Speedtest plugin in mimugmail's repo: https://github.com/mimugmail/opn-repo/tree/main/net-mgmt/speedtest-community

mihakralj avatar Jan 31 '22 14:01 mihakralj