This repo contains ansible playbooks to install and configure zabbix agent on host servers and a python script to add the new host to the zabbix server using zabbix API.
Currently set for Zabbix 6.4, this can be changed by updating urls in the ansible playbook. Ansible playbooks can be run for Debian and Red Hat based systems.
- Ansible installed on your control machine.
- Python and necessary dependencies listed in
ServerScript/requirements.txt
.
-
Clone the repository:
git clone https://github.com/memo1918/zabbix-agent-ansible-automation.git cd zabbix-agent-ansible-automation
-
Install Python dependencies:
pip install -r ServerScript/requirements.txt
-
Update the inventory file with your hosts and update sv_ip with the Zabbix server ips in host_conf_zabbix.yaml.
-
Run the Ansible playbooks as needed:
ansible-playbook install_zabbix_allSys.yaml -K ansible-playbook host_conf_zabbix.yaml -K ansible-playbook conf_docker_permission.yaml -K
-
Update configIps.txt with server ip and host names and ips.
-
Update the python script to add Zabbix AUTH token or user and password.
-
Execute the Python script to manage Zabbix hosts:
python ServerScript/zabbixPythonReq.py
This project is licensed under the MIT License. See the LICENSE file for details.