Bash scripts executed periodically to send alerts to a mattermost channel.
See https://docs.mattermost.com/developers/integrate/reference/bot-accounts to learn about bot accounts for mattermost
The scripts are shared with no guarantee. They must be edited to include your mattermost server address and channel ID where the message are posted. The following must be edited further to include specificities of your server:
disk_usage_report/disk_alert.sh→ changeSOMEFILTERdisk_usage_report/disk_usage.sh→ changecd /mnt/the_location_i_want_to_checkomero_stats_csv/usage_per_group_per_month_omerodir.sh→ Edit AGs.txt to list the groups you want to get a report for.
Connect to PostgreSQL as an administrator, create the login, and grant it access
to the omero database. Replace the password with a strong one:
CREATE ROLE report_user LOGIN PASSWORD 'replace-with-a-strong-password';
GRANT CONNECT ON DATABASE omero TO report_user;
\connect omero
GRANT USAGE ON SCHEMA public TO report_user;
GRANT SELECT ON ALL TABLES IN SCHEMA public TO report_user;
REVOKE SELECT ON TABLE public.password FROM report_user;Warning
Changing the crontab entries requires changes in the period queried by the corresponding script
The crontab entries I use are in crontab