based on the original script here's a version for Postgres + Zabbix 4 and a -month -week- yesterday switch...