Uses zabbix api to generate external-facing host information dashboards served over nginx
- Python 96%
- HTML 4%
| .gitignore | ||
| 404.html | ||
| env.example | ||
| generate_hostpage.py | ||
| hostdata_refresh | ||
| README.md | ||
| zabbix.conf | ||
zabbix-host-dashboards
Installation
1. Install the script
sudo cp generate_hostpage.py /usr/local/bin/generate_hostpage.py
sudo chmod 755 /usr/local/bin/generate_hostpage.py
2. Add your API token — edit the script and replace REPLACE_WITH_YOUR_TOKEN with the token from Zabbix.
3. Set up the web root and 404 page
sudo mkdir -p /var/www/hostdata
sudo cp 404.html /var/www/hostdata/404.html
4. Install nginx config
sudo cp hostdata.conf /etc/nginx/conf.d/hostdata.conf
sudo nginx -t && sudo systemctl reload nginx
OR
sudo cp hostdata.conf /etc/nginx/sites-available/hostdata.conf
sudo ln -s /etc/nginx/sites-available/hostdata.conf /etc/nginx/sites-enabled/hostdata.conf
sudo nginx -t && sudo systemctl reload nginx
5. Install cron
sudo cp hostdata_refresh /etc/cron.d/hostdata_refresh
sudo chmod 644 /etc/cron.d/hostdata_refresh
6. Test run manually first
sudo python3 /usr/local/bin/generate_hostpage.py
Should print all your hosts and generate pages under /var/www/hostdata/. Then hit http://monitor01-sj2.quantumscape.com/hostdata/bindplane-gw-sj1 and see if it renders.