Monitor the Community Network with Zabbix - aucoop/hahatay-community-network GitHub Wiki
Zabbix installation using docker
Run the docker-compose that suits you better: https://github.com/zabbix/zabbix-docker.git. In our case, running the ubuntu-mysql version.
Video reference:
Add hosts to Zabbix
Add OpenWrt Network Devices
Monitoring OpenWrt devices and Linux Servers and apply discovery rules, so zabbix discovers network equipment automatically:
Video reference:
Steps:
- Go to Monitoring -> Hosts -> Create host and complete the details. As host, we can choose IP or DNS (we use both for convenience). The Host groups router was created previously in order to have all the routers together. Add Agent in Interfaces.
- Then execute the following command:
sed -i -E "s/^Server=127.0.0.1/Server=192.168.10.0\/24/" /etc/zabbix_agentd.conf
- Finally, restart the server with:
/etc/init.d/zabbix_agentd restart
Add an Antenna to the Server
To add an Antenna to the server, we do the same but we add an SNMP instead of an Agent in Interfaces.
Add Servers that host Docker containers
Requisites:
- Install
zabbix-agent2
(Download page) - Download
zabbix_get
in the zabbix repository withapt install zabbix_get
Video Reference:
TL;DR:
- Add
Server
conf in/etc/zabbix/zabbix_agent2.conf
- Check logs in
tail -f /var/log/zabbix/zabbix_agent2.log
- Add the
zabbix
user to the docker group withgpasswd -a zabbix docker
- Test that docker information can be accessed through the Docker API with:
zabbix_get -s 192.168.10.4 -k docker.info
Synchronize Notifications with Telegram
Vide refernece:
Steps
- We create a Xat with FatherBot.
- We enable Telegram:
- Go to Alerts -> Media Types -> Telegram and fill the parameters To and Token of your Xat.
- Then, click Enable next to Telegram.
- Add media to Admin:
- Go to Users -> Users -> Admin -> Media -> Add and fill in Send to with your Xat.
- Add actions:
- Go to Alerts -> Actions -> Trigger Actions -> Report problems to Zabbix administrators -> Operations.
- Add Operations and add Recovery Operations.
Upgrades to Telegram Notifications
Modify the message Template
We have a default message but we can modify it and adjust it to our necessities by going to Alerts -> Media Types -> Telegram -> Message Tempaltes and edit the Problem and Problem recovery templates. We also can remove the messages we do not want.