Skip to content

Ansible playbooks and Python script to quickly set up Zabbix agents and add them to your Zabbix server.

License

Notifications You must be signed in to change notification settings

memo1918/zabbix-agent-ansible-automation

Repository files navigation

Zabbix Agent2 Ansible Automation

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.

Prerequisites

  • Ansible installed on your control machine.
  • Python and necessary dependencies listed in ServerScript/requirements.txt.

Installation

  1. Clone the repository:

    git clone https://github.com/memo1918/zabbix-agent-ansible-automation.git
    cd zabbix-agent-ansible-automation
  2. Install Python dependencies:

    pip install -r ServerScript/requirements.txt

Usage

  1. Update the inventory file with your hosts and update sv_ip with the Zabbix server ips in host_conf_zabbix.yaml.

  2. 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 
  3. Update configIps.txt with server ip and host names and ips.

  4. Update the python script to add Zabbix AUTH token or user and password.

  5. Execute the Python script to manage Zabbix hosts:

    python ServerScript/zabbixPythonReq.py

License

This project is licensed under the MIT License. See the LICENSE file for details.

Acknowledgements


About

Ansible playbooks and Python script to quickly set up Zabbix agents and add them to your Zabbix server.

Topics

Resources

License

Stars

Watchers

Forks

Languages