Bug #11926 added the ability for koha to collect usage statistics. Problem is, to set them up you have to both change the system preferences and jump on the server to add the cron script to your crontab. I think the server-side bit should be done at install time thus allwoing simple on/off switching via the staff client configurable sysprefs. To do this, we need to add the a line to: for packages: /kohaclone/debian/koha-common.cron.monthly and perhaps add something to get the file installed as it's new (our first monthly cronjob for packages :) ) for other installs, there's a cron template in /kohaclone/misc/cronjobs/crontab.example
I have another idea to ease HEA : add a test in mainpage. If the user has admin rights, ask him about HEA, and/or send the data. That would almost not slow Koha, and no more need for the cronjob !
Paul, the problem is that we want to get data regularly (every month). We don't want to ask every month (need a test to know when to ask) manual action, don't you think?
(In reply to Jonathan Druart from comment #2) > Paul, the problem is that we want to get data regularly (every month). > We don't want to ask every month (need a test to know when to ask) manual > action, don't you think? sorry, i've been unclear: * on mainpage.pl : * if the sysprefs are not set, display a clear block to say the library must choose * if the syspref are set => did we submit more than one month ago ? No=> submit I agree that, for a library without any admin login regularly, the data will not be submitted regularly. But this situation is an uncommon one I think.
I think these are really two different things. The addition of the cronjobs to both the crontab.example file and almost more importantly the package templates file would simply mean enabling HEA for reporting statistics would be a simpler task (and make it in reach of 'just a librarian', i.e. clientside only user). Adding a prompt routine to remind said admin level users to enable the statistics is a seperate piece.. which so long as it was too obtrusive I would probably support. I'de personally prefer it simply warns say three days after an upgrade to a version supporting HEA, and has the options of enabling HEA, (disabling the warning permanently), Remind me later (suggesting a popup would appear again in another three days), or just disable the popup forever. Perhaps submit another bug for the above proposal?
Created attachment 41024 [details] [review] Bug 13585 : Add a cronjob which send UsageStats monthly.
Comment on attachment 41024 [details] [review] Bug 13585 : Add a cronjob which send UsageStats monthly. Review of attachment 41024 [details] [review]: ----------------------------------------------------------------- ::: debian/koha-common.cron.monthly @@ +15,5 @@ > +# You should have received a copy of the GNU General Public License > +# along with this program. If not, see <http://www.gnu.org/licenses/>. > + > + > +koha-foreach --enabled /usr/share/koha/bin/cronjobs/share_usage_with_koha_community.pl The problem is that the share_usage_with_koha_community.pl considers it's an error to launch it if the pref is not enabled. There is a warning message and an exit 1 in this case. I suppose it's not what we want, the admin will receive an email every month.
Created attachment 42176 [details] [review] [SIGNED OFF] Bug 13585: Add a cronjob which send UsageStats monthly. This patch introduces entries for monthly running the share_usage_with_koha_community.pl script to the packages and also the crontab.example file for manual installs use. Edit: I fixed the Copyright line Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 6 needs an answer.
Regarding the admin getting an email monthly - I think that might be alright, and here is why: we want to encourage people to contribute their stats. They might install a new version, and not realise that this is a feature they now have. It might take an independent Koha admin several months to "get around" to enabling the sysprefs for "reasons" - in that case the reminder might be nice. An experienced admin will say "that's running a cron, I bet I can remove it from the jobs and this message will go away" which also seems reasonable to me. Instructions on what to do might be nice in the error message, but I don't think the fact that it generates output with the syspref off, in itself, is reason to deny this patch. A followup that makes the falure output more informative (maybe) would be good. I see this as very much like the message you get when EnhancedMessagingPreferences is off. As an admin you go "ah right, yeah that's off and I mean it to be" or, if you mean for it to be on "ah right, yeah, I want that on actually!" and you go take care of it. Liz
(In reply to Jonathan Druart from comment #6) > Comment on attachment 41024 [details] [review] [review] > Bug 13585 : Add a cronjob which send UsageStats monthly. > > Review of attachment 41024 [details] [review] [review]: > ----------------------------------------------------------------- > > ::: debian/koha-common.cron.monthly > @@ +15,5 @@ > > +# You should have received a copy of the GNU General Public License > > +# along with this program. If not, see <http://www.gnu.org/licenses/>. > > + > > + > > +koha-foreach --enabled /usr/share/koha/bin/cronjobs/share_usage_with_koha_community.pl > > The problem is that the share_usage_with_koha_community.pl considers it's an > error to launch it if the pref is not enabled. > There is a warning message and an exit 1 in this case. I agree with all of you actually: - Having a cronjob error email might not be that useful. - A new bug should be filled. In that case I would propose a --quiet switch and could provide the patch. - We should at least show a message on the about page about this. And encourage people to check that page regularly on update.
Created attachment 42375 [details] [review] Bug 13585: Add a cronjob which send UsageStats monthly. This patch introduces entries for monthly running the share_usage_with_koha_community.pl script to the packages and also the crontab.example file for manual installs use. Edit: I fixed the Copyright line Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Patch pushed to master. Thanks Julian!
Patch included in 3.22.00