Debian Codegraph @

ansible_collections/community/zabbix/README.md

raw
1 # Zabbix collection for Ansible
2
3 Plugins:
4
5 ![plugins](https://github.com/ansible-collections/community.zabbix/workflows/plugins-integration/badge.svg) ![repo-sanity](https://github.com/ansible-collections/community.zabbix/workflows/repo-sanity/badge.svg)
6
7 Roles:
8
9 ![Zabbix Agent](https://github.com/ansible-collections/community.zabbix/workflows/community.zabbix.zabbix_agent/badge.svg) ![Zabbix Server](https://github.com/ansible-collections/community.zabbix/workflows/community.zabbix.zabbix_server/badge.svg) ![Zabbix Proxy](https://github.com/ansible-collections/community.zabbix/workflows/community.zabbix.zabbix_proxy/badge.svg) ![Zabbix Web](https://github.com/ansible-collections/community.zabbix/workflows/community.zabbix.zabbix_web/badge.svg) ![Zabbix Javagateway](https://github.com/ansible-collections/community.zabbix/workflows/community.zabbix.zabbix_javagateway/badge.svg)
10
11 **Table of Contents**
12
13 - [Zabbix collection for Ansible](#zabbix-collection-for-ansible)
14 * [Introduction](#introduction)
15 * [Communication](#communication)
16 * [Included content](#included-content)
17 * [Installation](#installation)
18 + [Requirements](#requirements)
19 + [Installing the Collection from Ansible Galaxy](#installing-the-collection-from-ansible-galaxy)
20 * [Usage](#usage)
21 * [Supported Zabbix versions](#supported-zabbix-versions)
22 * [Collection life cycle and support](#collection-life-cycle-and-support)
23 * [Contributing](#contributing)
24 * [License](#license)
25
26 ## Introduction
27
28 This repo hosts the `community.zabbix` Ansible Collection.
29
30 The collection includes a variety of Ansible content to help automate the management of resources in Zabbix.
31
32 ## Communication
33
34 * Join the Ansible forum:
35 * [Get Help](https://forum.ansible.com/c/help/6): get help or help others.
36 * [Posts tagged with 'zabbix'](https://forum.ansible.com/tag/zabbix): subscribe to participate in collection-related conversations.
37 * [Social Spaces](https://forum.ansible.com/c/chat/4): gather and interact with fellow enthusiasts.
38 * [News & Announcements](https://forum.ansible.com/c/news/5): track project-wide announcements including social events.
39
40 * The Ansible [Bullhorn newsletter](https://docs.ansible.com/projects/ansible/devel/community/communication.html#the-bullhorn): used to announce releases and important changes.
41
42 For more information about communication, see the [Ansible communication guide](https://docs.ansible.com/projects/ansible/devel/community/communication.html).
43
44 ## Included content
45
46 Click on the name of a plugin or module to view that content's documentation:
47
48 - **Inventory Sources**:
49 - [zabbix](scripts/inventory/zabbix.py) - Zabbix Inventory Script
50 - [zabbix_inventory](https://docs.ansible.com/projects/ansible/latest/collections/community/zabbix/zabbix_inventory_inventory.html) - Zabbix Ansible Inventory Plugin
51 - **Modules**:
52 - [zabbix_action](https://docs.ansible.com/projects/ansible/latest/collections/community/zabbix/zabbix_action_module.html)
53 - [zabbix_authentication](https://docs.ansible.com/projects/ansible/latest/collections/community/zabbix/zabbix_authentication_module.html)
54 - [zabbix_autoregister](https://docs.ansible.com/projects/ansible/latest/collections/community/zabbix/zabbix_autoregister_module.html)
55 - [zabbix_discovery_rule](https://docs.ansible.com/projects/ansible/latest/collections/community/zabbix/zabbix_discovery_rule_module.html)
56 - [zabbix_globalmacro](https://docs.ansible.com/projects/ansible/latest/collections/community/zabbix/zabbix_globalmacro_module.html)
57 - [zabbix_group_info](https://docs.ansible.com/projects/ansible/latest/collections/community/zabbix/zabbix_group_info_module.html)
58 - [zabbix_group_events_info](https://docs.ansible.com/projects/ansible/latest/collections/community/zabbix/zabbix_group_events_info_module.html)
59 - [zabbix_group](https://docs.ansible.com/projects/ansible/latest/collections/community/zabbix/zabbix_group_module.html)
60 - [zabbix_host_events_info](https://docs.ansible.com/projects/ansible/latest/collections/community/zabbix/zabbix_host_events_info_module.html)
61 - [zabbix_host_info](https://docs.ansible.com/projects/ansible/latest/collections/community/zabbix/zabbix_host_info_module.html)
62 - [zabbix_host](https://docs.ansible.com/projects/ansible/latest/collections/community/zabbix/zabbix_host_module.html)
63 - [zabbix_hostmacro](https://docs.ansible.com/projects/ansible/latest/collections/community/zabbix/zabbix_hostmacro_module.html)
64 - [zabbix_housekeeping](https://docs.ansible.com/projects/ansible/latest/collections/community/zabbix/zabbix_housekeeping_module.html)
65 - [zabbix_maintenance](https://docs.ansible.com/projects/ansible/latest/collections/community/zabbix/zabbix_maintenance_module.html)
66 - [zabbix_map](https://docs.ansible.com/projects/ansible/latest/collections/community/zabbix/zabbix_map_module.html)
67 - [zabbix_mediatype](https://docs.ansible.com/projects/ansible/latest/collections/community/zabbix/zabbix_mediatype_module.html)
68 - [zabbix_proxy_info](https://docs.ansible.com/projects/ansible/latest/collections/community/zabbix/zabbix_proxy_info_module.html)
69 - [zabbix_proxy](https://docs.ansible.com/projects/ansible/latest/collections/community/zabbix/zabbix_proxy_module.html)
70 - [zabbix_screen](https://docs.ansible.com/ansible/latest/collections/community/zabbix/zabbix_screen_module.html)
71 - [zabbix_script](https://docs.ansible.com/projects/ansible/latest/collections/community/zabbix/zabbix_script_module.html)
72 - [zabbix_service](https://docs.ansible.com/projects/ansible/latest/collections/community/zabbix/zabbix_service_module.html)
73 - [zabbix_template_info](https://docs.ansible.com/projects/ansible/latest/collections/community/zabbix/zabbix_template_info_module.html)
74 - [zabbix_template](https://docs.ansible.com/projects/ansible/latest/collections/community/zabbix/zabbix_template_module.html)
75 - [zabbix_user_info](https://docs.ansible.com/projects/ansible/latest/collections/community/zabbix/zabbix_user_info_module.html)
76 - [zabbix_user](https://docs.ansible.com/projects/ansible/latest/collections/community/zabbix/zabbix_user_module.html)
77 - [zabbix_usergroup](https://docs.ansible.com/projects/ansible/latest/collections/community/zabbix/zabbix_usergroup_module.html)
78 - [zabbix_valuemap](https://docs.ansible.com/projects/ansible/latest/collections/community/zabbix/zabbix_valuemap_module.html)
79 - **Roles**:
80 - [zabbix_agent](docs/ZABBIX_AGENT_ROLE.md)
81 - [zabbix_javagateway](docs/ZABBIX_JAVAGATEWAY_ROLE.md)
82 - [zabbix_proxy](docs/ZABBIX_PROXY_ROLE.md)
83 - [zabbix_server](docs/ZABBIX_SERVER_ROLE.md)
84 - [zabbix_web](docs/ZABBIX_WEB_ROLE.md)
85
86 ## Installation
87
88 ### Requirements
89
90 Some of the components in this collection requires additional dependencies. Review components you are interested in by visiting links present in the [Included content](#included-content) section.
91
92 While the various roles and modules may work with earlier versions of Python and Ansible, they are only tested and maintained against Ansible Core >= 2.16 and python >= 3.9
93
94 #### External Collections
95
96 Additional collections may be required when running the various roles.
97
98 * `ansible.posix`: Required if using SELinux portion of any roles
99 * `ansible.general`: Required if using SELinux portion of any roles
100 * `ansible.netcommon`: Required when using the agent role
101 * `community.mysql`: Required for the proxy or server roles if using MySQL
102 * `community.postgresql`: Required for the proxy or server roles if using PostgreSQL
103 * `community.windows`: Required for the agent role if installing on Windows
104
105
106 ```bash
107 ansible-galaxy collection install ansible.posix
108 ansible-galaxy collection install community.general
109 ansible-galaxy collection install ansible.netcommon
110 ```
111 ### Installing the Collection from Ansible Galaxy
112
113 Before using the Zabbix collection, you need to install it with the Ansible Galaxy CLI:
114
115 ```bash
116 ansible-galaxy collection install community.zabbix
117 ```
118
119 You can also include it in a `requirements.yml` file along with other required collections and install them via `ansible-galaxy collection install -r requirements.yml`, using the format:
120
121 ```yaml
122 ---
123 collections:
124 - name: community.zabbix
125 version: 4.2.0
126 - name: ansible.posix
127 version: 1.3.0
128 - name: community.general
129 version: 3.7.0
130 ```
131
132 ## Usage
133
134 *Please note that these are not working examples. For documentation on how to use content included in this collection, refer to the links in the [Included content](#included-content) section.*
135
136 To use a module or role from this collection, reference them with their Fully Qualified Collection Namespace (FQCN) like so:
137
138 ```yaml
139 ---
140 - name: Using Zabbix collection to install Zabbix Agent
141 hosts: localhost
142 roles:
143 - role: community.zabbix.zabbix_agent
144 zabbix_agent_server: zabbix.example.com
145 ...
146
147 - name: If Zabbix WebUI runs on non-default (zabbix) path, e.g. http://<FQDN>/zabbixeu
148 ansible.builtin.set_fact:
149 ansible_zabbix_url_path: 'zabbixeu'
150
151 - name: Using Zabbix collection to manage Zabbix Server's elements with username/password
152 hosts: zabbix.example.com
153 vars:
154 ansible_network_os: community.zabbix.zabbix
155 ansible_connection: httpapi
156 ansible_httpapi_port: 80
157 ansible_httpapi_use_ssl: false # Set to true for HTTPS
158 ansible_httpapi_validate_certs: false # For HTTPS et to true to validate server's certificate
159 ansible_user: Admin
160 ansible_httpapi_pass: zabbix
161 tasks:
162 - name: Ensure host is monitored by Zabbix
163 community.zabbix.zabbix_host:
164 ...
165
166 - name: Using Zabbix collection to manage Zabbix Server's elements with authentication key
167 hosts: zabbix.example.net
168 vars:
169 ansible_network_os: community.zabbix.zabbix
170 ansible_connection: httpapi
171 ansible_httpapi_port: 80
172 ansible_httpapi_use_ssl: false # Set to true for HTTPS
173 ansible_httpapi_validate_certs: false # For HTTPS set to true to validate server's certificate
174 ansible_zabbix_auth_key: 8ec0d52432c15c91fcafe9888500cf9a607f44091ab554dbee860f6b44fac895
175 tasks:
176 - name: Ensure host is monitored by Zabbix
177 community.zabbix.zabbix_host:
178 ...
179 ```
180
181 Or you include collection name `community.zabbix` in the playbook's `collections` element, like this:
182
183 ```yaml
184 ---
185 - name: Using Zabbix collection
186 hosts: localhost
187 collections:
188 - community.zabbix
189
190 roles:
191 - role: zabbix_agent
192 zabbix_agent_server: zabbix.example.com
193 ...
194
195 - name: Using Zabbix collection to manage Zabbix Server's elements with username/password
196 hosts: zabbix.example.com
197 vars:
198 ansible_network_os: community.zabbix.zabbix
199 ansible_connection: httpapi
200 ansible_httpapi_port: 80
201 ansible_httpapi_use_ssl: false # Set to true for HTTPS
202 ansible_httpapi_validate_certs: false # For HTTPS et to true to validate server's certificate
203 ansible_user: Admin
204 ansible_httpapi_pass: zabbix
205 tasks:
206 - name: Ensure host is monitored by Zabbix
207 zabbix.zabbix_host:
208 ...
209
210 - name: Using Zabbix collection to manage Zabbix Server's elements with authentication key
211 hosts: zabbix.example.net
212 vars:
213 ansible_network_os: community.zabbix.zabbix
214 ansible_connection: httpapi
215 ansible_httpapi_port: 80
216 ansible_httpapi_use_ssl: false # Set to true for HTTPS
217 ansible_httpapi_validate_certs: false # For HTTPS et to true to validate server's certificate
218 ansible_zabbix_auth_key: 8ec0d52432c15c91fcafe9888500cf9a607f44091ab554dbee860f6b44fac895
219 tasks:
220 - name: Ensure host is monitored by Zabbix
221 community.zabbix.zabbix_host:
222 ...
223 ```
224
225 If Basic Authentication is required to access Zabbix server add following variables:
226 ```
227 zabbix_api_http_user: "user"
228 zabbix_api_http_password: "password"
229 ```
230
231 ## Supported Zabbix versions
232
233 Main priority is to support Zabbix releases which have official full support from Zabbix LLC. Please checkout the versions at [Zabbix Life Cycle & Release Policy](https://www.zabbix.com/life_cycle_and_release_policy) page.
234
235 Support for Zabbix LTS versions will be dropped with Major releases of the collection and mostly affect modules. Each role is following its unique support matrix. You should always consult documentation of roles in *docs/* directory.
236
237 If you find any inconsistencies with the version of Zabbix you are using, feel free to open a pull request or an issue and we will try to address it as soon as possible. In case of pull requests, please make sure that your changes will not break any existing functionality for currently supported Zabbix releases.
238
239 ## Collection life cycle and support
240
241 See [RELEASE](docs/RELEASE.md) document for more information regarding life cycle and support for the collection.
242
243 ## Contributing
244
245 See [CONTRIBUTING](CONTRIBUTING.md) for more information about how to contribute to this repository.
246
247 Please also feel free to stop by our [Gitter community](https://gitter.im/community-zabbix/community).
248
249 ## License
250
251 GNU General Public License v3.0 or later
252
253 See [LICENSE](LICENSE) to see the full text.