Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/smejdil/zabbix-ansible
First steps with Ansible and Zabbix
https://github.com/smejdil/zabbix-ansible
ansible-playbook zabbix zabbix-ansible
Last synced: 7 days ago
JSON representation
First steps with Ansible and Zabbix
- Host: GitHub
- URL: https://github.com/smejdil/zabbix-ansible
- Owner: smejdil
- License: gpl-3.0
- Created: 2021-03-22T13:17:05.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2024-01-10T15:45:52.000Z (10 months ago)
- Last Synced: 2024-01-10T18:01:17.118Z (10 months ago)
- Topics: ansible-playbook, zabbix, zabbix-ansible
- Homepage: https://open-tech.cz
- Size: 273 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## zabbix-ansible
First steps with Ansible and Zabbix collections on FreeBSD 12.2, OpenBSD 6.8, Ubuntu 20.04, CentOS Stream
### Packages FreeBSD
- Package - py37-pip-20.2.3 Tool for installing and managing Python packages
- Package - py37-ansible-2.9.7 Radically simple IT automation### Packages OpenBSD
- Package - py3-pip-20.3.4 tool for installing Python packages
- Package - ansible-2.9.19 ssh based config management framework### Packages Ubuntu
- Package - python-pip 20.0.2-5ubuntu1.1
- Package - ansible 2.9.6+dfsg-1### Packages CentOS
- Package - python3-pip 9.0.3-19.el8
- Package - ansible 2.9.18-2.el8### How it works
Ansible use collections https://galaxy.ansible.com/community/zabbix and by
Zabbix API create Host's and Host's Group in Zabbix monitoring system.- Python package - zabbix-api 0.5.4
### Install FreeBSD
```console
cd /usr/ports/devel/py-pip && make install clean
cd /usr/ports/sysutils/ansible && make install cleanpip install zabbix-api
```### Install OpenBSD
```console
export FLAVOR=python3
cd /usr/ports/devel/py-pip && make install clean
cd /usr/ports/sysutils/ansible && make install cleanpip3.8 install zabbix-api
```### Install Ubuntu
```console
apt install python3-pip
apt install ansiblepip3 install zabbix-api
```### Install CentOS
```console
dnf install ansiblepip3 install zabbix-api
```### Install ansible collection zabbix
```console
ansible-galaxy collection install -r requirements.yml
Process install dependency map
Starting collection install process
Installing 'community.zabbix:1.3.0' to '/root/.ansible/collections/ansible_collections/community/zabbix'
```### Run playbook
```console
export ZABBIX_USER=zabbix_admin_user
export ZABBIX_PASSWORD=*******************ansible-playbook setup_zabbix_server.yml
PLAY [Using Zabbix collection] **********************************************************************************************************************************************************TASK [Gathering Facts] ******************************************************************************************************************************************************************
ok: [localhost]TASK [include_tasks] ********************************************************************************************************************************************************************
included: /root/work/zabbix-ansible/tasks/zabbix-add-host-group.yml for localhostTASK [Create host groups] ***************************************************************************************************************************************************************
changed: [localhost]TASK [include_tasks] ********************************************************************************************************************************************************************
included: /root/work/zabbix-ansible/tasks/zabbix-add-host-freebsd.yml for localhostTASK [Create a FreeBSD host or update] **************************************************************************************************************************************************
changed: [localhost]TASK [include_tasks] ********************************************************************************************************************************************************************
included: /root/work/zabbix-ansible/tasks/zabbix-add-host-seznam.yml for localhostTASK [Create a Seznam host or update] ***************************************************************************************************************************************************
changed: [localhost]TASK [include_tasks] ********************************************************************************************************************************************************************
included: /root/work/zabbix-ansible/tasks/zabbix-add-host-smejdil.yml for localhostTASK [Create a SmEjDiL host or update] **************************************************************************************************************************************************
changed: [localhost]TASK [include_tasks] ********************************************************************************************************************************************************************
included: /root/work/zabbix-ansible/tasks/zabbix-add-screen.yml for localhostTASK [Create screen Public/WWW-servers or update the existing screen items] *************************************************************************************************************
changed: [localhost]TASK [include_tasks] ********************************************************************************************************************************************************************
included: /root/work/zabbix-ansible/tasks/zabbix-add-template.yml for localhostTASK [Import Zabbix Training from XML] **************************************************************************************************************************************************
changed: [localhost]TASK [include_tasks] ********************************************************************************************************************************************************************
included: /root/work/zabbix-ansible/tasks/zabbix-add-user.yml for localhostTASK [create a new zabbix user.] ********************************************************************************************************************************************************
changed: [localhost]PLAY RECAP ******************************************************************************************************************************************************************************
localhost : ok=15 changed=7 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0
```### Images
![Zabbix Host detail](./images/Zabbix-Host-Detail.png)
### Example
```console
ansible-playbook -i inventory/cert-hosts.ini playbook/zabbix-add-web-certificate.yml
```### To do
- Import Media
- Create other Zabbix objects