Zabbix module to monitor and maintain multiple local Git repositories from one host.
git-all scans repositories in the parent folder of this project.
Example:
/usr/local/src/
futur-tech-zabbix-git/
repo-a/
repo-b/
Only directories containing .git are processed.
- Clone this repository next to the repositories you want to monitor.
- Run the deployment script:
cd /usr/local/src/futur-tech-zabbix-git
sudo ./deploy-update.sh -b maindeploy-update.sh behavior:
- checks out the target branch (
-b), - fetches updates,
- self-updates and re-executes if needed,
- then runs
./deploy.sh.
deploy.sh installs:
- Zabbix include file:
/etc/zabbix/zabbix_agent2.d/ft-git.conf, or/etc/zabbix/zabbix_agentd.conf.d/ft-git.conf
- sudoers rules in
/etc/sudoers.d/ft-gitfor required commands. - delayed Zabbix agent restart (
systemctl restart zabbix-agent*viaat).
./git-all [option] [branch]Options:
status: fetch all repos first, then print status for each repo.qstatus: status only (no pre-fetch).fetch: fetch all repos, then report which ones need merging.qfetch: quiet fetch only.pull: rungit pullon each repo.merge: rungit merge originwhen updates are available.deploy-update <branch>: run./deploy-update.sh -b <branch>in each clean repo that is behind origin.
Examples:
./git-all qstatus
./git-all fetch
./git-all deploy-update main