{"id":322473,"date":"2021-05-02T09:00:22","date_gmt":"2021-05-02T09:00:22","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=322473"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=322473","title":{"rendered":"Ansible playbook \u0434\u043b\u044f \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f Windows\/Linux \u0430\u0433\u0435\u043d\u0442\u0430\u043c\u0438 Zabbix"},"content":{"rendered":"\n<div class=\"post__text post__text_v2\" id=\"post-content-body\">\n<p>\u0414\u0430\u043d\u043d\u0430\u044f \u0441\u0442\u0430\u0442\u044c\u044f \u043f\u0440\u043e \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u043f\u0440\u043e\u0441\u0442\u044b\u0445 ansible \u043f\u043b\u0435\u0439\u0431\u0443\u043a\u043e\u0432 \u0434\u043b\u044f \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u0430\u0433\u0435\u043d\u0442\u043e\u0432 \u043d\u0430 \u0445\u043e\u0441\u0442\u044b \u0441 Linux\/Windows \u0438 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u0438 \u0445\u043e\u0441\u0442\u043e\u0432 \u0447\u0435\u0440\u0435\u0437 API Zabbix, \u0432\u043a\u043b\u044e\u0447\u0430\u044f SNMP \u0445\u043e\u0441\u0442\u044b. \u0411\u0443\u0434\u0443\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0433\u043e\u0442\u043e\u0432\u044b\u0435 \u0440\u043e\u043b\u0438 \u0438 \u043c\u043e\u0434\u0443\u043b\u0438 Ansible Galaxy Zabbix.<\/p>\n<p>Zabbix \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u0438\u043b \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0435 \u0440\u043e\u043b\u0438 \u0438 \u043c\u043e\u0434\u0443\u043b\u0438 \u0434\u043b\u044f \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u043c\u043d\u043e\u0433\u0438\u0445 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u0432 Zabbix \u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u043e\u043c Ansible &#8212; \u043f\u043e\u043b\u043d\u044b\u0439 \u0441\u043f\u0438\u0441\u043e\u043a \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438 \u0437\u0434\u0435\u0441\u044c &#8212;<a href=\"https:\/\/galaxy.ansible.com\/community\/zabbix\" rel=\"noopener noreferrer nofollow\"> <u>https:\/\/galaxy.ansible.com\/community\/zabbix<\/u><\/a><\/p>\n<p>\u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043f\u043e\u0433\u043e\u0432\u043e\u0440\u0438\u043c \u0442\u043e\u043b\u044c\u043a\u043e \u043e <strong>zabbix_agent<\/strong> \u0438 <strong>zabbix_host<\/strong>.<\/p>\n<p><em>*\u042d\u0442\u0430 \u0441\u0442\u0430\u0442\u044c\u044f \u043d\u0435 \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0435\u0442 \u0438 \u043d\u0435 \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0443 \u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0443 Ansible, \u044d\u0442\u043e\u0433\u043e \u0432 \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442\u0435 \u043f\u043e\u043b\u043d\u043e.<\/em><\/p>\n<p><strong>zabbix_agent<\/strong>  <\/p>\n<p>\u042d\u0442\u043e \u0440\u043e\u043b\u044c, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0443 \u0430\u0433\u0435\u043d\u0442\u0430 \u043d\u0430 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0435 \u0441\u0438\u0441\u0442\u0435\u043c\u044b:  <\/p>\n<ul>\n<li>\n<p>Red Hat<\/p>\n<\/li>\n<li>\n<p>Fedora<\/p>\n<\/li>\n<li>\n<p>Debian<\/p>\n<\/li>\n<li>\n<p>Ubuntu<\/p>\n<\/li>\n<li>\n<p>opensuse<\/p>\n<\/li>\n<li>\n<p>Windows (Best effort)<\/p>\n<\/li>\n<li>\n<p>macOS<\/p>\n<\/li>\n<\/ul>\n<p>\u0410\u043a\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0439 \u0441\u043f\u0438\u0441\u043e\u043a \u043d\u0430 \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u043c github \u043f\u0440\u043e\u0435\u043a\u0442\u0430 (<a href=\"https:\/\/github.com\/ansible-collections\/community.zabbix\/blob\/main\/docs\/ZABBIX_AGENT_ROLE.md#operating-systems\" rel=\"noopener noreferrer nofollow\"><u>https:\/\/github.com\/ansible-collections\/community.zabbix\/blob\/main\/docs\/ZABBIX_AGENT_ROLE.md#operating-systems<\/u><\/a>)   <\/p>\n<p><strong>zabbix_host<\/strong><\/p>\n<p>\u042d\u0442\u043e \u043c\u043e\u0434\u0443\u043b\u044c \u0434\u043b\u044f \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u044f\/\u0443\u0434\u0430\u043b\u0435\u043d\u0438\u044f\/\u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0445\u043e\u0441\u0442\u043e\u0432 \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0435 zabbix. \u041f\u043e\u043b\u043d\u043e\u0435 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u043c\u043e\u0434\u0443\u043b\u044f \u0442\u0443\u0442 &#8212; <a href=\"https:\/\/docs.ansible.com\/ansible\/2.10\/collections\/community\/zabbix\/zabbix_host_module.html\" rel=\"noopener noreferrer nofollow\">https:\/\/docs.ansible.com\/ansible\/2.10\/collections\/community\/zabbix\/zabbix_host_module.html<\/a><\/p>\n<h3>\u0418\u0442\u0430\u043a \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u043c \u043a \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0435<\/h3>\n<p>\u041f\u0435\u0440\u0432\u044b\u043c \u0448\u0430\u0433\u043e\u043c \u0431\u0443\u0434\u0435\u0442 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u0438 ansible ( \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u0432 ansible \u0432\u0435\u0440\u0441\u0438\u0438 2.9+):<\/p>\n<pre><code>ansible-galaxy collection install community.zabbix<\/code><\/pre>\n<p>\u041f\u043e\u0441\u043b\u0435 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u0438, \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u0444\u0430\u0439\u043b \u0441 \u043f\u043b\u0435\u0439\u0431\u0443\u043a\u043e\u043c. \u0414\u0430\u043d\u043d\u044b\u0439 \u043f\u043b\u0435\u0439\u0431\u0443\u043a \u0434\u0435\u043b\u0430\u0435\u0442 \u0434\u0432\u0435 \u0432\u0435\u0449\u0438 &#8212; \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u0442 \u0440\u043e\u043b\u044c community.zabbix.zabbix_agent \u043d\u0430 \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u044b\u0435 \u0445\u043e\u0441\u0442\u044b \u0438 \u0432\u0442\u043e\u0440\u044b\u043c \u0448\u0430\u0433\u043e\u043c \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u0443\u0435\u0442 \u0445\u043e\u0441\u0442 \u0432 zabbix \u0447\u0435\u0440\u0435\u0437 \u043c\u043e\u0434\u0443\u043b\u044c community.zabbix.zabbix_host. <\/p>\n<p>\u0421\u043e\u0437\u0434\u0430\u0435\u043c \u0444\u0430\u0439\u043b <strong>zabbix-agent-all.yaml<\/strong> \u0441\u043e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u044b\u043c:<\/p>\n<pre><code>- hosts: all    tasks:     - name: Install agent       include_role:         name:  community.zabbix.zabbix_agent # \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u0442 \u0433\u043e\u0442\u043e\u0432\u0443\u044e \u0440\u043e\u043b\u044c \u043d\u0430 \u0445\u043e\u0441\u0442\u0430\u0445       tags:         - install # \u0434\u043b\u044f \u0443\u0434\u043e\u0431\u0441\u0442\u0432\u0430 \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0442\u044d\u0433\u0438     - name: Create a new host or update an existing host's info # \u0437\u0430\u0434\u0430\u0447\u0430 \u0434\u043b\u044f \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u0438 \u0430\u0433\u0435\u043d\u0442\u043e\u0432 \u0432 zabbix \u0441\u0435\u0440\u0432\u0435\u0440\u0435       local_action:         module: community.zabbix.zabbix_host # \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u0433\u043e\u0442\u043e\u0432\u044b\u0439 \u043c\u043e\u0434\u0443\u043b\u044c zabbix_host \u0434\u043b\u044f \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u0438 \u0430\u0433\u0435\u043d\u0442\u043e\u0432         server_url: \"{{ zabbix_url }}\" # \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f \u0438\u0437 \u0438\u043d\u0432\u0435\u043d\u0442\u0430\u0440\u044f - url \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u0434\u043b\u044f \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u0438 API         login_user: \"{{ zabbix_api_user }}\" # \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f \u0438\u0437 \u0438\u043d\u0432\u0435\u043d\u0442\u0430\u0440\u044f - \u0438\u043c\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u043e\u0431\u044b\u0447\u043d\u043e Admin         login_password: \"{{ zabbix_api_pass }}\" # \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f \u0438\u0437 \u0438\u043d\u0432\u0435\u043d\u0442\u0430\u0440\u044f - \u043f\u0430\u0440\u043e\u043b\u044c          host_name: \"{{ item }}\" - # \u0438\u043c\u044f \u0445\u043e\u0441\u0442\u0430 \u0438\u0437 \u0438\u043d\u0432\u0435\u043d\u0442\u0430\u0440\u044f         visible_name: \"{{ hostvars[item].zabbix_visible_name | default(item) }}\" # \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u0434\u0430\u0442\u044c \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0435\u043c\u043e\u0435 \u0438\u043c\u044f \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0445\u043e\u0441\u0442\u0430         description: \"{{   hostvars[item].zabbix_host_description | default('') }} OS: {{  hostvars[item].ansible_distribution | default('') }} {{  hostvars[item].ansible_distribution_version | default('') }}\" # \u0431\u0435\u0440\u0435\u0442 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u0438\u0437 \u0438\u043d\u0432\u0435\u043d\u0442\u0430\u0440\u044f \u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u0438 \u0432\u0435\u0440\u0441\u0438\u044e \u0438\u0437 \u0441\u043b\u0443\u0436\u0435\u0431\u043d\u044b\u0445 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 ansible         host_groups: \"{{ hostvars[item].zabbix_host_groups }}\" # \u0432 \u043a\u0430\u043a\u0443\u044e \u0445\u043e\u0441\u0442 \u0433\u0440\u0443\u043f\u043f\u0443 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0445\u043e\u0441\u0442         link_templates: \"{{ hostvars[item].zabbix_link_templates }}\" # \u043a\u0430\u043a\u0438\u0435 template \u043f\u0440\u0438\u043c\u0435\u043d\u0438\u0442\u044c \u043a \u0445\u043e\u0441\u0442\u0443         status: \"{{  hostvars[item].zabbix_host_status }}\" # \u0441\u0442\u0430\u0442\u0443\u0441 - Enabled \u0438\u043b\u0438 Disabled         state: present # \u0443\u043a\u0430\u0437\u0430\u043d\u0438\u0435 ansible \u0447\u0442\u043e\u0431\u044b \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0445\u043e\u0441\u0442, \u0438\u0437\u043c\u0435\u043d\u0438\u0432 \u043d\u0430 absent \u043c\u043e\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043e\u0431\u0440\u0430\u0442\u043d\u0443\u044e \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044e \u0443\u0434\u0430\u043b\u0435\u043d\u0438\u044f         inventory_mode: disabled # \u043d\u0435 \u0432\u043a\u043b\u044e\u0447\u0430\u0435\u043c inventory mode         interfaces: # \u043c\u043e\u0436\u043d\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u043e\u0432           - type: \"{{ hostvars[item].zabbix_interface_type }}\" # \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f \u0438\u0437 \u0438\u043d\u0432\u0435\u043d\u0442\u0430\u0440\u044f - \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c SNMP, Agent, JMX, IPMI             main: 1              useip: \"{{ hostvars[item].zabbix_interface_use_ip }}\" # \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043f\u043e ip \u0438\u043b\u0438 \u043f\u043e dns             ip: \"{{ hostvars[item].zabbix_interface_ip }}\" # \u0435\u0441\u043b\u0438 \u0432\u044b\u0431\u0440\u0430\u043d\u043e \u043f\u043e ip - \u0431\u0435\u0440\u0435\u0442\u0441\u044f \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f \u0441 ip \u0430\u0434\u0440\u0435\u0441\u043e\u043c             dns: \"{{ item }}\" # \u0435\u0441\u043b\u0438 \u0432\u044b\u0431\u0440\u0430\u043d\u043e useip: 0 \u0442\u043e \u043d\u0443\u0436\u043d\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u044c FQDN \u0445\u043e\u0441\u0442\u0430 \u0432 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u0432 \u0438\u043d\u0432\u0435\u043d\u0442\u0430\u0440\u0435             port: \"{{ hostvars[item].zabbix_interface_port }}\" # \u0443\u043a\u0430\u0437\u0430\u043d\u0438\u0435 \u043f\u043e\u0440\u0442\u0430       loop: \"{{ groups['all'] }}\" # \u0446\u0438\u043a\u043b \u0447\u0442\u043e\u0431\u044b \u043f\u0440\u043e\u0439\u0442\u0438\u0441\u044c \u043f\u043e \u0432\u0441\u0435\u0445 \u0445\u043e\u0441\u0442\u0430\u043c \u0432 \u0438\u043d\u0432\u0435\u043d\u0442\u0430\u0440\u0435       run_once: true # \u0446\u0438\u043a\u043b \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u043e\u0445\u043e\u0434\u0438\u0442\u044c\u0441\u044f \u043f\u043e \u0432\u0441\u0435\u043c \u0445\u043e\u0441\u0442\u0430\u043c, \u0447\u0442\u043e\u0431\u044b \u043e\u043d \u043d\u0435 \u043f\u0440\u043e\u0448\u0451\u043b \u043f\u043e \u0432\u0441\u0435\u043c \u0445\u043e\u0441\u0442\u0430\u043c \u043d\u0430 \u043a\u0430\u0436\u0434\u043e\u043c \u0445\u043e\u0441\u0442\u0435 \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c \u0447\u0442\u043e\u0431\u044b \u0434\u0430\u043d\u043d\u044b\u0439 \u043c\u043e\u0434\u0443\u043b\u044c \u043e\u0442\u0440\u0430\u0431\u043e\u0442\u0430\u043b \u043e\u0434\u0438\u043d \u0440\u0430\u0437       tags:         - add-host #  \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0442\u044d\u0433\u0438 \u0434\u043b\u044f \u0443\u0434\u043e\u0431\u0441\u0442\u0432<\/code><\/pre>\n<p>\u041d\u0430 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0435 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0432\u044b \u0441\u043c\u043e\u0436\u0435\u0442\u0435 \u043d\u0430\u0439\u0442\u0438 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u0434\u0440\u0443\u0433\u0438\u0445 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043a, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u043a zabbix \u0441\u0435\u0440\u0432\u0435\u0440 \u0447\u0435\u0440\u0435\u0437 http, \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u0432\u0435\u0440\u0441\u0438\u044e \u0430\u0433\u0435\u043d\u0442\u0430 \u0438 \u0442.\u0434., \u0432\u0441\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0442\u0443\u0442:<\/p>\n<p><a href=\"https:\/\/github.com\/ansible-collections\/community.zabbix\/blob\/main\/docs\/ZABBIX_AGENT_ROLE.md#role-variables\" rel=\"noopener noreferrer nofollow\"><u>https:\/\/github.com\/ansible-collections\/community.zabbix\/blob\/main\/docs\/ZABBIX_AGENT_ROLE.md#role-variables<\/u><\/a>&nbsp;<\/p>\n<h3>\u0424\u0430\u0439\u043b\u044b \u0438\u043d\u0432\u0435\u043d\u0442\u0430\u0440\u044f<\/h3>\n<p>\u0414\u0430\u043b\u0435\u0435 \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0442\u0440\u0438 \u0444\u0430\u0439\u043b\u0430 linux-inventory, windows-inventory \u0438 snmp-inventory, \u043c\u043e\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043a\u043e\u043d\u0435\u0447\u043d\u043e \u0432 \u043e\u0434\u043d\u043e\u043c \u0444\u0430\u0439\u043b\u0435, \u043d\u043e \u043c\u043d\u0435 \u043f\u043e\u043a\u0430\u0437\u0430\u043b\u043e\u0441\u044c \u0443\u0434\u043e\u0431\u043d\u0435\u0435 \u0440\u0430\u0437\u0434\u0435\u043b\u0438\u0442\u044c \u0430\u0433\u0435\u043d\u0442\u044b \u043f\u043e \u0442\u0438\u043f\u0443.<\/p>\n<p><strong>Linux \u0445\u043e\u0441\u0442\u044b<\/strong><\/p>\n<p>\u0421\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u0444\u0430\u0439\u043b\u0430 linux-inventory:<\/p>\n<pre><code>[all] host1.local #\u0442\u0443\u0442 \u0432\u044b \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0435 \u0432\u0430\u0448\u0438 \u0445\u043e\u0441\u0442\u044b \u043f\u043e FQDN \u0438\u043b\u0438 IP-\u0430\u0434\u0440\u0435\u0441\u0443 host2.local  zabbix_host_description=\u201dThe host2 description\u201d  host3.local zabbix_host_status=disabled # \u043c\u043e\u0436\u043d\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u0447\u0442\u043e\u0431\u044b \u043e\u0442\u043a\u043b\u044e\u0447\u0430\u0442\u044c \u0445\u043e\u0441\u0442\u044b \u043f\u043e\u0441\u043b\u0435 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u044f host4.local zabbix_host_groups=\u2019[\"Custom group\"]\u2019 #\u043c\u043e\u0436\u043d\u043e \u043f\u0435\u0440\u0435\u0434\u0430\u0442\u044c \u0433\u0440\u0443\u043f\u043f\u044b \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0445\u043e\u0441\u0442\u0430 [all:vars] zabbix_agent_server=my.zabbix.server # \u0430\u0434\u0440\u0435\u0441 \u0441\u0435\u0440\u0432\u0435\u0440\u0430 zabbix_url=https:\/\/my.zabbix.server # URL \u0441\u0435\u0440\u0432\u0435\u0440\u0430 zabbix_api_use=true # \u0433\u043e\u0432\u043e\u0440\u0438\u043c \u0447\u0442\u043e \u0431\u0443\u0434\u0435\u043c \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0442\u044c \u0447\u0435\u0440\u0435\u0437 API zabbix_api_user=Admin zabbix_api_pass=StrongPa$$w0rd zabbix_interface_port=\"10050\" # \u043d\u043e\u043c\u0435\u0440 \u043f\u043e\u0440\u0442\u0430 \u0433\u0434\u0435 \u0436\u0438\u0432\u0435\u0442 \u0430\u0433\u0435\u043d\u0442 zabbix_host_groups=[\"Linux servers\"] # \u0432 \u043a\u0430\u043a\u0443\u044e \u0433\u0440\u0443\u043f\u043f\u0443 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0442\u044c \u0445\u043e\u0441\u0442 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e zabbix_link_templates=[\"Linux by Zabbix agent\"] # \u0441\u043f\u0438\u0441\u043e\u043a template \u0434\u043b\u044f \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e zabbix_interface_type=agent # \u0442\u0438\u043f \u0445\u043e\u0441\u0442\u0430 - \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u0430\u0433\u0435\u043d\u0442\u0430 zabbix_interface_use_ip=\"0\" # \u0433\u043e\u0432\u043e\u0440\u0438\u043c \u0447\u0442\u043e \u0431\u0443\u0434\u0435\u043c \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0442\u044c \u043f\u043e dns fqdn zabbix_interface_ip=\"\" zabbix_host_description=\"My linux server\" # \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e zabbix_host_status=enabled # \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u0445\u043e\u0441\u0442\u0430 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e <\/code><\/pre>\n<p><strong>Windows<\/strong><\/p>\n<p>\u0414\u043b\u044f \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u0430\u0433\u0435\u043d\u0442\u0430 \u043d\u0430 \u0445\u043e\u0441\u0442\u044b \u0441 \u041e\u0421 Windows \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0434\u043e\u0441\u0442\u0443\u043f \u0434\u043b\u044f ansible &#8212; \u044d\u0442\u043e \u0432\u043d\u0435 \u0442\u0435\u043c\u044b \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0438, \u043d\u043e \u0435\u0441\u0442\u044c \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u0430\u044f \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044f \u043d\u0430 \u0441\u0430\u0439\u0442\u0435 ansible &#8212; <a href=\"https:\/\/docs.ansible.com\/ansible\/latest\/user_guide\/windows_setup.html\" rel=\"noopener noreferrer nofollow\"><u>https:\/\/docs.ansible.com\/ansible\/latest\/user_guide\/windows_setup.html<\/u><\/a>&nbsp;<\/p>\n<p>\u0421\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u0444\u0430\u0439\u043b\u0430 windows-inventory:<\/p>\n<pre><code>[all] winhost01.local winhost02.local  zabbix_host_groups=\u2019[\"Custom group\"]\u2019 #\u043c\u043e\u0436\u043d\u043e \u043f\u0435\u0440\u0435\u0434\u0430\u0442\u044c \u0433\u0440\u0443\u043f\u043f\u044b \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0445\u043e\u0441\u0442\u0430 winhost03.local zabbix_host_status=disabled # \u043c\u043e\u0436\u043d\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u0447\u0442\u043e\u0431\u044b \u043e\u0442\u043a\u043b\u044e\u0447\u0430\u0442\u044c \u0445\u043e\u0441\u0442\u044b \u043f\u043e\u0441\u043b\u0435 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u044f [all:vars] ansible_user=user@DOMAIN.LOCAL # \u0435\u0441\u043b\u0438 \u0445\u043e\u0441\u0442\u044b \u0432 \u0434\u043e\u043c\u0435\u043d\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u0434\u043e\u043c\u0435\u043d\u043d\u044b\u0439 \u043f\u0443\u0442\u044c, \u0438 \u0442\u0430\u043a\u0436\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c kerberos \u0432 linux ansible_password=StrongPa$$w0rd ansible_connection=winrm # \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 windows \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0447\u0435\u0440\u0435\u0437 \u0441\u043b\u0443\u0436\u0431\u0443 WinRM ansible_winrm_server_cert_validation=ignore # \u0435\u0441\u043b\u0438 \u0443 \u0432\u0430\u0448\u0435\u0433\u043e \u0434\u043e\u043c\u0435\u043d\u0430 \u0441\u0430\u043c\u043e\u043f\u043e\u0434\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0435 \u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u044b, \u043b\u0443\u0447\u0448\u0435 \u043f\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c ignore zabbix_agent_server=my.zabbix.server # \u0430\u0434\u0440\u0435\u0441 \u0441\u0435\u0440\u0432\u0435\u0440\u0430 zabbix_url=https:\/\/my.zabbix.server # URL \u0441\u0435\u0440\u0432\u0435\u0440\u0430 zabbix_api_use=true # \u0433\u043e\u0432\u043e\u0440\u0438\u043c \u0447\u0442\u043e \u0431\u0443\u0434\u0435\u043c \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0442\u044c \u0447\u0435\u0440\u0435\u0437 API zabbix_api_user=Admin zabbix_api_pass=StrongPa$$w0rd zabbix_interface_port=\"10050\" # \u043d\u043e\u043c\u0435\u0440 \u043f\u043e\u0440\u0442\u0430 \u0433\u0434\u0435 \u0436\u0438\u0432\u0435\u0442 \u0430\u0433\u0435\u043d\u0442 zabbix_host_groups=[\"Windows servers\"]  # \u0432 \u043a\u0430\u043a\u0443\u044e \u0433\u0440\u0443\u043f\u043f\u0443 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0442\u044c \u0445\u043e\u0441\u0442 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e zabbix_link_templates=[\"Windows by Zabbix agent\"] # \u0441\u043f\u0438\u0441\u043e\u043a template \u0434\u043b\u044f \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e zabbix_interface_type=agent # \u0442\u0438\u043f \u0445\u043e\u0441\u0442\u0430 - \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u0430\u0433\u0435\u043d\u0442\u0430 zabbix_interface_use_ip=\"0\" # \u0433\u043e\u0432\u043e\u0440\u0438\u043c \u0447\u0442\u043e \u0431\u0443\u0434\u0435\u043c \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0442\u044c \u043f\u043e dns fqdn zabbix_interface_ip=\"\" zabbix_host_description=\"My windows server\" # \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e zabbix_host_status=enabled # \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u0445\u043e\u0441\u0442\u0430 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e <\/code><\/pre>\n<p><strong>SNMP&nbsp;<\/strong><\/p>\n<p>\u0414\u043b\u044f \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u044f SNMP \u0445\u043e\u0441\u0442\u043e\u0432 \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u0444\u0430\u0439\u043b snmp-inventory:<\/p>\n<pre><code>[all] snmphost1.local zabbix_link_templates='[\"Cisco IOS SNMP\",\"Network Generic Device SNMP\"]' zabbix_host_groups='[\"Network devices\"]' snmp2.local zabbix_link_templates='[\"Template SNMP OS ESXi\"]' zabbix_host_groups='[\"Hypervisors\"]' zabbix_snmp_community=\u201dCommunity\u201d [all:vars] zabbix_url=https:\/\/my.zabbix.server # URL \u0441\u0435\u0440\u0432\u0435\u0440\u0430 zabbix_api_use=true # \u0433\u043e\u0432\u043e\u0440\u0438\u043c \u0447\u0442\u043e \u0431\u0443\u0434\u0435\u043c \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0442\u044c \u0447\u0435\u0440\u0435\u0437 API zabbix_api_user=Admin zabbix_api_pass=StrongPa$$w0rd zabbix_interface_port=\"161\" # \u043d\u043e\u043c\u0435\u0440 \u043f\u043e\u0440\u0442\u0430 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430, \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e 161 zabbix_interface_type=snmp # \u0442\u0438\u043f snmp zabbix_interface_use_ip=\"0\" # \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c \u0447\u0442\u043e \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u043f\u043e dns zabbix_interface_ip=\"\" # \u043f\u0443\u0441\u0442\u043e\u0439 ip zabbix_host_description=\"My SNMP host\" # \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e zabbix_host_status=enabled # \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u0445\u043e\u0441\u0442\u0430 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e zabbix_snmp_community=\"MyCommunity\" # \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c SNMP community <\/code><\/pre>\n<p>\u0412 \u0438\u0442\u043e\u0433\u0435, \u0444\u0430\u0439\u043b\u044b \u0434\u043e\u043b\u0436\u043d\u044b \u0438\u043c\u0435\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0443\u044e \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443 \u0444\u0430\u0439\u043b\u043e\u0432:<\/p>\n<pre><code>. \u251c\u2500\u2500 linux-inventory \u251c\u2500\u2500 snmp-inventory \u251c\u2500\u2500 windows-inventory \u2514\u2500\u2500 zabbix-agent-all.yaml <\/code><\/pre>\n<h3>\u0417\u0430\u043f\u0443\u0441\u043a playbook<\/h3>\n<p>\u0414\u043b\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u043f\u043b\u0435\u0439\u0431\u0443\u043a\u043e\u0432, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u044b:<\/p>\n<p>\u0414\u043b\u044f \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u043d\u0430 Linux \u0445\u043e\u0441\u0442\u0430\u0445:<\/p>\n<pre><code class=\"bash\">ansible-playbook -i linux-inventory zabbix-agent-all.yaml<\/code><\/pre>\n<p>Windows:  <\/p>\n<pre><code>ansible-playbook -i windows-inventory zabbix-agent-all.yaml<\/code><\/pre>\n<p>SNMP:<\/p>\n<pre><code>ansible-playbook -i snmp-inventory zabbix-agent-all.yaml<\/code><\/pre>\n<p>\u0415\u0441\u043b\u0438 \u043d\u0443\u0436\u043d\u0430 \u0442\u043e\u043b\u044c\u043a\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430, \u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u0432\u044b\u0448\u0435 \u0441 \u0442\u044d\u0433\u043e\u043c install:<\/p>\n<pre><code>ansible-playbook -i linux-inventory zabbix-agent-all.yaml -t install<\/code><\/pre>\n<p>\u0415\u0441\u043b\u0438 \u0443 \u0432\u0430\u0441 \u0435\u0441\u0442\u044c \u043e\u0441\u043e\u0431\u044b\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 zabbix \u0438\u043b\u0438 \u0432\u044b \u0445\u043e\u0442\u0438\u0442\u0435 \u043a\u0430\u0441\u0442\u043e\u043c\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c, \u043f\u043e\u043b\u043d\u044b\u0439 \u0441\u043f\u0438\u0441\u043e\u043a \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u0440\u043e\u043b\u0438 \u0438 \u043c\u043e\u0434\u0443\u043b\u044f \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438 \u043d\u0430 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0435 \u043f\u0440\u043e\u0435\u043a\u0442\u0430: <a href=\"https:\/\/github.com\/ansible-collections\/community.zabbix\/blob\/main\/docs\/ZABBIX_AGENT_ROLE.md#role-variables\" rel=\"noopener noreferrer nofollow\">zabbix_agent<\/a> \u0438 <a href=\"https:\/\/docs.ansible.com\/ansible\/2.10\/collections\/community\/zabbix\/zabbix_host_module.html\" rel=\"noopener noreferrer nofollow\">zabbix_host<\/a><\/p>\n<p>\u0412\u0441\u0435 \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u0438 \u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0438 \u0435\u0441\u0442\u044c \u043d\u0430 github: <a href=\"https:\/\/github.com\/piccadil\/zabbix-agent\" rel=\"noopener noreferrer nofollow\">https:\/\/github.com\/piccadil\/zabbix-agent<\/a><\/p>\n<\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/post\/555458\/\"> https:\/\/habr.com\/ru\/post\/555458\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div class=\"post__text post__text_v2\" id=\"post-content-body\">\n<p>\u0414\u0430\u043d\u043d\u0430\u044f \u0441\u0442\u0430\u0442\u044c\u044f \u043f\u0440\u043e \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u043f\u0440\u043e\u0441\u0442\u044b\u0445 ansible \u043f\u043b\u0435\u0439\u0431\u0443\u043a\u043e\u0432 \u0434\u043b\u044f \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u0430\u0433\u0435\u043d\u0442\u043e\u0432 \u043d\u0430 \u0445\u043e\u0441\u0442\u044b \u0441 Linux\/Windows \u0438 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u0438 \u0445\u043e\u0441\u0442\u043e\u0432 \u0447\u0435\u0440\u0435\u0437 API Zabbix, \u0432\u043a\u043b\u044e\u0447\u0430\u044f SNMP \u0445\u043e\u0441\u0442\u044b. \u0411\u0443\u0434\u0443\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0433\u043e\u0442\u043e\u0432\u044b\u0435 \u0440\u043e\u043b\u0438 \u0438 \u043c\u043e\u0434\u0443\u043b\u0438 Ansible Galaxy Zabbix.<\/p>\n<p>Zabbix \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u0438\u043b \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0435 \u0440\u043e\u043b\u0438 \u0438 \u043c\u043e\u0434\u0443\u043b\u0438 \u0434\u043b\u044f \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u043c\u043d\u043e\u0433\u0438\u0445 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u0432 Zabbix \u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u043e\u043c Ansible &#8212; \u043f\u043e\u043b\u043d\u044b\u0439 \u0441\u043f\u0438\u0441\u043e\u043a \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438 \u0437\u0434\u0435\u0441\u044c &#8212;<a href=\"https:\/\/galaxy.ansible.com\/community\/zabbix\" rel=\"noopener noreferrer nofollow\"> <u>https:\/\/galaxy.ansible.com\/community\/zabbix<\/u><\/a><\/p>\n<p>\u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043f\u043e\u0433\u043e\u0432\u043e\u0440\u0438\u043c \u0442\u043e\u043b\u044c\u043a\u043e \u043e <strong>zabbix_agent<\/strong> \u0438 <strong>zabbix_host<\/strong>.<\/p>\n<p><em>*\u042d\u0442\u0430 \u0441\u0442\u0430\u0442\u044c\u044f \u043d\u0435 \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0435\u0442 \u0438 \u043d\u0435 \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0443 \u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0443 Ansible, \u044d\u0442\u043e\u0433\u043e \u0432 \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442\u0435 \u043f\u043e\u043b\u043d\u043e.<\/em><\/p>\n<p><strong>zabbix_agent<\/strong>  <\/p>\n<p>\u042d\u0442\u043e \u0440\u043e\u043b\u044c, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0443 \u0430\u0433\u0435\u043d\u0442\u0430 \u043d\u0430 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0435 \u0441\u0438\u0441\u0442\u0435\u043c\u044b:  <\/p>\n<ul>\n<li>\n<p>Red Hat<\/p>\n<\/li>\n<li>\n<p>Fedora<\/p>\n<\/li>\n<li>\n<p>Debian<\/p>\n<\/li>\n<li>\n<p>Ubuntu<\/p>\n<\/li>\n<li>\n<p>opensuse<\/p>\n<\/li>\n<li>\n<p>Windows (Best effort)<\/p>\n<\/li>\n<li>\n<p>macOS<\/p>\n<\/li>\n<\/ul>\n<p>\u0410\u043a\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0439 \u0441\u043f\u0438\u0441\u043e\u043a \u043d\u0430 \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u043c github \u043f\u0440\u043e\u0435\u043a\u0442\u0430 (<a href=\"https:\/\/github.com\/ansible-collections\/community.zabbix\/blob\/main\/docs\/ZABBIX_AGENT_ROLE.md#operating-systems\" rel=\"noopener noreferrer nofollow\"><u>https:\/\/github.com\/ansible-collections\/community.zabbix\/blob\/main\/docs\/ZABBIX_AGENT_ROLE.md#operating-systems<\/u><\/a>)   <\/p>\n<p><strong>zabbix_host<\/strong><\/p>\n<p>\u042d\u0442\u043e \u043c\u043e\u0434\u0443\u043b\u044c \u0434\u043b\u044f \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u044f\/\u0443\u0434\u0430\u043b\u0435\u043d\u0438\u044f\/\u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0445\u043e\u0441\u0442\u043e\u0432 \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0435 zabbix. \u041f\u043e\u043b\u043d\u043e\u0435 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u043c\u043e\u0434\u0443\u043b\u044f \u0442\u0443\u0442 &#8212; <a href=\"https:\/\/docs.ansible.com\/ansible\/2.10\/collections\/community\/zabbix\/zabbix_host_module.html\" rel=\"noopener noreferrer nofollow\">https:\/\/docs.ansible.com\/ansible\/2.10\/collections\/community\/zabbix\/zabbix_host_module.html<\/a><\/p>\n<h3>\u0418\u0442\u0430\u043a \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u043c \u043a \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0435<\/h3>\n<p>\u041f\u0435\u0440\u0432\u044b\u043c \u0448\u0430\u0433\u043e\u043c \u0431\u0443\u0434\u0435\u0442 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u0438 ansible ( \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u0432 ansible \u0432\u0435\u0440\u0441\u0438\u0438 2.9+):<\/p>\n<pre><code>ansible-galaxy collection install community.zabbix<\/code><\/pre>\n<p>\u041f\u043e\u0441\u043b\u0435 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u0438, \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u0444\u0430\u0439\u043b \u0441 \u043f\u043b\u0435\u0439\u0431\u0443\u043a\u043e\u043c. \u0414\u0430\u043d\u043d\u044b\u0439 \u043f\u043b\u0435\u0439\u0431\u0443\u043a \u0434\u0435\u043b\u0430\u0435\u0442 \u0434\u0432\u0435 \u0432\u0435\u0449\u0438 &#8212; \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u0442 \u0440\u043e\u043b\u044c community.zabbix.zabbix_agent \u043d\u0430 \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u044b\u0435 \u0445\u043e\u0441\u0442\u044b \u0438 \u0432\u0442\u043e\u0440\u044b\u043c \u0448\u0430\u0433\u043e\u043c \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u0443\u0435\u0442 \u0445\u043e\u0441\u0442 \u0432 zabbix \u0447\u0435\u0440\u0435\u0437 \u043c\u043e\u0434\u0443\u043b\u044c community.zabbix.zabbix_host. <\/p>\n<p>\u0421\u043e\u0437\u0434\u0430\u0435\u043c \u0444\u0430\u0439\u043b <strong>zabbix-agent-all.yaml<\/strong> \u0441\u043e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u044b\u043c:<\/p>\n<pre><code>- hosts: all    tasks:     - name: Install agent       include_role:         name:  community.zabbix.zabbix_agent # \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u0442 \u0433\u043e\u0442\u043e\u0432\u0443\u044e \u0440\u043e\u043b\u044c \u043d\u0430 \u0445\u043e\u0441\u0442\u0430\u0445       tags:         - install # \u0434\u043b\u044f \u0443\u0434\u043e\u0431\u0441\u0442\u0432\u0430 \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0442\u044d\u0433\u0438     - name: Create a new host or update an existing host's info # \u0437\u0430\u0434\u0430\u0447\u0430 \u0434\u043b\u044f \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u0438 \u0430\u0433\u0435\u043d\u0442\u043e\u0432 \u0432 zabbix \u0441\u0435\u0440\u0432\u0435\u0440\u0435       local_action:         module: community.zabbix.zabbix_host # \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u0433\u043e\u0442\u043e\u0432\u044b\u0439 \u043c\u043e\u0434\u0443\u043b\u044c zabbix_host \u0434\u043b\u044f \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u0438 \u0430\u0433\u0435\u043d\u0442\u043e\u0432         server_url: \"{{ zabbix_url }}\" # \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f \u0438\u0437 \u0438\u043d\u0432\u0435\u043d\u0442\u0430\u0440\u044f - url \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u0434\u043b\u044f \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u0438 API         login_user: \"{{ zabbix_api_user }}\" # \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f \u0438\u0437 \u0438\u043d\u0432\u0435\u043d\u0442\u0430\u0440\u044f - \u0438\u043c\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u043e\u0431\u044b\u0447\u043d\u043e Admin         login_password: \"{{ zabbix_api_pass }}\" # \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f \u0438\u0437 \u0438\u043d\u0432\u0435\u043d\u0442\u0430\u0440\u044f - \u043f\u0430\u0440\u043e\u043b\u044c          host_name: \"{{ item }}\" - # \u0438\u043c\u044f \u0445\u043e\u0441\u0442\u0430 \u0438\u0437 \u0438\u043d\u0432\u0435\u043d\u0442\u0430\u0440\u044f         visible_name: \"{{ hostvars[item].zabbix_visible_name | default(item) }}\" # \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u0434\u0430\u0442\u044c \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0435\u043c\u043e\u0435 \u0438\u043c\u044f \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0445\u043e\u0441\u0442\u0430         description: \"{{   hostvars[item].zabbix_host_description | default('') }} OS: {{  hostvars[item].ansible_distribution | default('') }} {{  hostvars[item].ansible_distribution_version | default('') }}\" # \u0431\u0435\u0440\u0435\u0442 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u0438\u0437 \u0438\u043d\u0432\u0435\u043d\u0442\u0430\u0440\u044f \u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u0438 \u0432\u0435\u0440\u0441\u0438\u044e \u0438\u0437 \u0441\u043b\u0443\u0436\u0435\u0431\u043d\u044b\u0445 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 ansible         host_groups: \"{{ hostvars[item].zabbix_host_groups }}\" # \u0432 \u043a\u0430\u043a\u0443\u044e \u0445\u043e\u0441\u0442 \u0433\u0440\u0443\u043f\u043f\u0443 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0445\u043e\u0441\u0442         link_templates: \"{{ hostvars[item].zabbix_link_templates }}\" # \u043a\u0430\u043a\u0438\u0435 template \u043f\u0440\u0438\u043c\u0435\u043d\u0438\u0442\u044c \u043a \u0445\u043e\u0441\u0442\u0443         status: \"{{  hostvars[item].zabbix_host_status }}\" # \u0441\u0442\u0430\u0442\u0443\u0441 - Enabled \u0438\u043b\u0438 Disabled         state: present # \u0443\u043a\u0430\u0437\u0430\u043d\u0438\u0435 ansible \u0447\u0442\u043e\u0431\u044b \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0445\u043e\u0441\u0442, \u0438\u0437\u043c\u0435\u043d\u0438\u0432 \u043d\u0430 absent \u043c\u043e\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043e\u0431\u0440\u0430\u0442\u043d\u0443\u044e \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044e \u0443\u0434\u0430\u043b\u0435\u043d\u0438\u044f         inventory_mode: disabled # \u043d\u0435 \u0432\u043a\u043b\u044e\u0447\u0430\u0435\u043c inventory mode         interfaces: # \u043c\u043e\u0436\u043d\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u043e\u0432           - type: \"{{ hostvars[item].zabbix_interface_type }}\" # \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f \u0438\u0437 \u0438\u043d\u0432\u0435\u043d\u0442\u0430\u0440\u044f - \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c SNMP, Agent, JMX, IPMI             main: 1              useip: \"{{ hostvars[item].zabbix_interface_use_ip }}\" # \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043f\u043e ip \u0438\u043b\u0438 \u043f\u043e dns             ip: \"{{ hostvars[item].zabbix_interface_ip }}\" # \u0435\u0441\u043b\u0438 \u0432\u044b\u0431\u0440\u0430\u043d\u043e \u043f\u043e ip - \u0431\u0435\u0440\u0435\u0442\u0441\u044f \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f \u0441 ip \u0430\u0434\u0440\u0435\u0441\u043e\u043c             dns: \"{{ item }}\" # \u0435\u0441\u043b\u0438 \u0432\u044b\u0431\u0440\u0430\u043d\u043e useip: 0 \u0442\u043e \u043d\u0443\u0436\u043d\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u044c FQDN \u0445\u043e\u0441\u0442\u0430 \u0432 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u0432 \u0438\u043d\u0432\u0435\u043d\u0442\u0430\u0440\u0435             port: \"{{ hostvars[item].zabbix_interface_port }}\" # \u0443\u043a\u0430\u0437\u0430\u043d\u0438\u0435 \u043f\u043e\u0440\u0442\u0430       loop: \"{{ groups['all'] }}\" # \u0446\u0438\u043a\u043b \u0447\u0442\u043e\u0431\u044b \u043f\u0440\u043e\u0439\u0442\u0438\u0441\u044c \u043f\u043e \u0432\u0441\u0435\u0445 \u0445\u043e\u0441\u0442\u0430\u043c \u0432 \u0438\u043d\u0432\u0435\u043d\u0442\u0430\u0440\u0435       run_once: true # \u0446\u0438\u043a\u043b \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u043e\u0445\u043e\u0434\u0438\u0442\u044c\u0441\u044f \u043f\u043e \u0432\u0441\u0435\u043c \u0445\u043e\u0441\u0442\u0430\u043c, \u0447\u0442\u043e\u0431\u044b \u043e\u043d \u043d\u0435 \u043f\u0440\u043e\u0448\u0451\u043b \u043f\u043e \u0432\u0441\u0435\u043c \u0445\u043e\u0441\u0442\u0430\u043c \u043d\u0430 \u043a\u0430\u0436\u0434\u043e\u043c \u0445\u043e\u0441\u0442\u0435 \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c \u0447\u0442\u043e\u0431\u044b \u0434\u0430\u043d\u043d\u044b\u0439 \u043c\u043e\u0434\u0443\u043b\u044c \u043e\u0442\u0440\u0430\u0431\u043e\u0442\u0430\u043b \u043e\u0434\u0438\u043d \u0440\u0430\u0437       tags:         - add-host #  \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0442\u044d\u0433\u0438 \u0434\u043b\u044f \u0443\u0434\u043e\u0431\u0441\u0442\u0432<\/code><\/pre>\n<p>\u041d\u0430 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0435 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0432\u044b \u0441\u043c\u043e\u0436\u0435\u0442\u0435 \u043d\u0430\u0439\u0442\u0438 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u0434\u0440\u0443\u0433\u0438\u0445 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043a, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u043a zabbix \u0441\u0435\u0440\u0432\u0435\u0440 \u0447\u0435\u0440\u0435\u0437 http, \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u0432\u0435\u0440\u0441\u0438\u044e \u0430\u0433\u0435\u043d\u0442\u0430 \u0438 \u0442.\u0434., \u0432\u0441\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0442\u0443\u0442:<\/p>\n<p><a href=\"https:\/\/github.com\/ansible-collections\/community.zabbix\/blob\/main\/docs\/ZABBIX_AGENT_ROLE.md#role-variables\" rel=\"noopener noreferrer nofollow\"><u>https:\/\/github.com\/ansible-collections\/community.zabbix\/blob\/main\/docs\/ZABBIX_AGENT_ROLE.md#role-variables<\/u><\/a>&nbsp;<\/p>\n<h3>\u0424\u0430\u0439\u043b\u044b \u0438\u043d\u0432\u0435\u043d\u0442\u0430\u0440\u044f<\/h3>\n<p>\u0414\u0430\u043b\u0435\u0435 \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0442\u0440\u0438 \u0444\u0430\u0439\u043b\u0430 linux-inventory, windows-inventory \u0438 snmp-inventory, \u043c\u043e\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043a\u043e\u043d\u0435\u0447\u043d\u043e \u0432 \u043e\u0434\u043d\u043e\u043c \u0444\u0430\u0439\u043b\u0435, \u043d\u043e \u043c\u043d\u0435 \u043f\u043e\u043a\u0430\u0437\u0430\u043b\u043e\u0441\u044c \u0443\u0434\u043e\u0431\u043d\u0435\u0435 \u0440\u0430\u0437\u0434\u0435\u043b\u0438\u0442\u044c \u0430\u0433\u0435\u043d\u0442\u044b \u043f\u043e \u0442\u0438\u043f\u0443.<\/p>\n<p><strong>Linux \u0445\u043e\u0441\u0442\u044b<\/strong><\/p>\n<p>\u0421\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u0444\u0430\u0439\u043b\u0430 linux-inventory:<\/p>\n<pre><code>[all] host1.local #\u0442\u0443\u0442 \u0432\u044b \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0435 \u0432\u0430\u0448\u0438 \u0445\u043e\u0441\u0442\u044b \u043f\u043e FQDN \u0438\u043b\u0438 IP-\u0430\u0434\u0440\u0435\u0441\u0443 host2.local  zabbix_host_description=\u201dThe host2 description\u201d  host3.local zabbix_host_status=disabled # \u043c\u043e\u0436\u043d\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u0447\u0442\u043e\u0431\u044b \u043e\u0442\u043a\u043b\u044e\u0447\u0430\u0442\u044c \u0445\u043e\u0441\u0442\u044b \u043f\u043e\u0441\u043b\u0435 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u044f host4.local zabbix_host_groups=\u2019[\"Custom group\"]\u2019 #\u043c\u043e\u0436\u043d\u043e \u043f\u0435\u0440\u0435\u0434\u0430\u0442\u044c \u0433\u0440\u0443\u043f\u043f\u044b \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0445\u043e\u0441\u0442\u0430 [all:vars] zabbix_agent_server=my.zabbix.server # \u0430\u0434\u0440\u0435\u0441 \u0441\u0435\u0440\u0432\u0435\u0440\u0430 zabbix_url=https:\/\/my.zabbix.server # URL \u0441\u0435\u0440\u0432\u0435\u0440\u0430 zabbix_api_use=true # \u0433\u043e\u0432\u043e\u0440\u0438\u043c \u0447\u0442\u043e \u0431\u0443\u0434\u0435\u043c \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0442\u044c \u0447\u0435\u0440\u0435\u0437 API zabbix_api_user=Admin zabbix_api_pass=StrongPa$$w0rd zabbix_interface_port=\"10050\" # \u043d\u043e\u043c\u0435\u0440 \u043f\u043e\u0440\u0442\u0430 \u0433\u0434\u0435 \u0436\u0438\u0432\u0435\u0442 \u0430\u0433\u0435\u043d\u0442 zabbix_host_groups=[\"Linux servers\"] # \u0432 \u043a\u0430\u043a\u0443\u044e \u0433\u0440\u0443\u043f\u043f\u0443 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0442\u044c \u0445\u043e\u0441\u0442 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e zabbix_link_templates=[\"Linux by Zabbix agent\"] # \u0441\u043f\u0438\u0441\u043e\u043a template \u0434\u043b\u044f \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e zabbix_interface_type=agent # \u0442\u0438\u043f \u0445\u043e\u0441\u0442\u0430 - \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u0430\u0433\u0435\u043d\u0442\u0430 zabbix_interface_use_ip=\"0\" # \u0433\u043e\u0432\u043e\u0440\u0438\u043c \u0447\u0442\u043e \u0431\u0443\u0434\u0435\u043c \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0442\u044c \u043f\u043e dns fqdn zabbix_interface_ip=\"\" zabbix_host_description=\"My linux server\" # \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e zabbix_host_status=enabled # \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u0445\u043e\u0441\u0442\u0430 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e <\/code><\/pre>\n<p><strong>Windows<\/strong><\/p>\n<p>\u0414\u043b\u044f \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u0430\u0433\u0435\u043d\u0442\u0430 \u043d\u0430 \u0445\u043e\u0441\u0442\u044b \u0441 \u041e\u0421 Windows \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0434\u043e\u0441\u0442\u0443\u043f \u0434\u043b\u044f ansible &#8212; \u044d\u0442\u043e \u0432\u043d\u0435 \u0442\u0435\u043c\u044b \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0438, \u043d\u043e \u0435\u0441\u0442\u044c \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u0430\u044f \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044f \u043d\u0430 \u0441\u0430\u0439\u0442\u0435 ansible &#8212; <a href=\"https:\/\/docs.ansible.com\/ansible\/latest\/user_guide\/windows_setup.html\" rel=\"noopener noreferrer nofollow\"><u>https:\/\/docs.ansible.com\/ansible\/latest\/user_guide\/windows_setup.html<\/u><\/a>&nbsp;<\/p>\n<p>\u0421\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u0444\u0430\u0439\u043b\u0430 windows-inventory:<\/p>\n<pre><code>[all] winhost01.local winhost02.local  zabbix_host_groups=\u2019[\"Custom group\"]\u2019 #\u043c\u043e\u0436\u043d\u043e \u043f\u0435\u0440\u0435\u0434\u0430\u0442\u044c \u0433\u0440\u0443\u043f\u043f\u044b \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0445\u043e\u0441\u0442\u0430 winhost03.local zabbix_host_status=disabled # \u043c\u043e\u0436\u043d\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u0447\u0442\u043e\u0431\u044b \u043e\u0442\u043a\u043b\u044e\u0447\u0430\u0442\u044c \u0445\u043e\u0441\u0442\u044b \u043f\u043e\u0441\u043b\u0435 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u044f [all:vars] ansible_user=user@DOMAIN.LOCAL # \u0435\u0441\u043b\u0438 \u0445\u043e\u0441\u0442\u044b \u0432 \u0434\u043e\u043c\u0435\u043d\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u0434\u043e\u043c\u0435\u043d\u043d\u044b\u0439 \u043f\u0443\u0442\u044c, \u0438 \u0442\u0430\u043a\u0436\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c kerberos \u0432 linux ansible_password=StrongPa$$w0rd ansible_connection=winrm # \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 windows \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0447\u0435\u0440\u0435\u0437 \u0441\u043b\u0443\u0436\u0431\u0443 WinRM ansible_winrm_server_cert_validation=ignore # \u0435\u0441\u043b\u0438 \u0443 \u0432\u0430\u0448\u0435\u0433\u043e \u0434\u043e\u043c\u0435\u043d\u0430 \u0441\u0430\u043c\u043e\u043f\u043e\u0434\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0435 \u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u044b, \u043b\u0443\u0447\u0448\u0435 \u043f\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c ignore zabbix_agent_server=my.zabbix.server # \u0430\u0434\u0440\u0435\u0441 \u0441\u0435\u0440\u0432\u0435\u0440\u0430 zabbix_url=https:\/\/my.zabbix.server # URL \u0441\u0435\u0440\u0432\u0435\u0440\u0430 zabbix_api_use=true # \u0433\u043e\u0432\u043e\u0440\u0438\u043c \u0447\u0442\u043e \u0431\u0443\u0434\u0435\u043c \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0442\u044c \u0447\u0435\u0440\u0435\u0437 API zabbix_api_user=Admin zabbix_api_pass=StrongPa$$w0rd zabbix_interface_port=\"10050\" # \u043d\u043e\u043c\u0435\u0440 \u043f\u043e\u0440\u0442\u0430 \u0433\u0434\u0435 \u0436\u0438\u0432\u0435\u0442 \u0430\u0433\u0435\u043d\u0442 zabbix_host_groups=[\"Windows servers\"]  # \u0432 \u043a\u0430\u043a\u0443\u044e \u0433\u0440\u0443\u043f\u043f\u0443 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0442\u044c \u0445\u043e\u0441\u0442 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e zabbix_link_templates=[\"Windows by Zabbix agent\"] # \u0441\u043f\u0438\u0441\u043e\u043a template \u0434\u043b\u044f \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e zabbix_interface_type=agent # \u0442\u0438\u043f \u0445\u043e\u0441\u0442\u0430 - \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u0430\u0433\u0435\u043d\u0442\u0430 zabbix_interface_use_ip=\"0\" # \u0433\u043e\u0432\u043e\u0440\u0438\u043c \u0447\u0442\u043e \u0431\u0443\u0434\u0435\u043c \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0442\u044c \u043f\u043e dns fqdn zabbix_interface_ip=\"\" zabbix_host_description=\"My windows server\" # \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e zabbix_host_status=enabled # \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u0445\u043e\u0441\u0442\u0430 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e <\/code><\/pre>\n<p><strong>SNMP&nbsp;<\/strong><\/p>\n<p>\u0414\u043b\u044f \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u044f SNMP \u0445\u043e\u0441\u0442\u043e\u0432 \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u0444\u0430\u0439\u043b snmp-inventory:<\/p>\n<pre><code>[all] snmphost1.local zabbix_link_templates='[\"Cisco IOS SNMP\",\"Network Generic Device SNMP\"]' zabbix_host_groups='[\"Network devices\"]' snmp2.local zabbix_link_templates='[\"Template SNMP OS ESXi\"]' zabbix_host_groups='[\"Hypervisors\"]' zabbix_snmp_community=\u201dCommunity\u201d [all:vars] zabbix_url=https:\/\/my.zabbix.server # URL \u0441\u0435\u0440\u0432\u0435\u0440\u0430 zabbix_api_use=true # \u0433\u043e\u0432\u043e\u0440\u0438\u043c \u0447\u0442\u043e \u0431\u0443\u0434\u0435\u043c \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0442\u044c \u0447\u0435\u0440\u0435\u0437 API zabbix_api_user=Admin zabbix_api_pass=StrongPa$$w0rd zabbix_interface_port=\"161\" # \u043d\u043e\u043c\u0435\u0440 \u043f\u043e\u0440\u0442\u0430 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430, \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e 161 zabbix_interface_type=snmp # \u0442\u0438\u043f snmp zabbix_interface_use_ip=\"0\" # \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c \u0447\u0442\u043e \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u043f\u043e dns zabbix_interface_ip=\"\" # \u043f\u0443\u0441\u0442\u043e\u0439 ip zabbix_host_description=\"My SNMP host\" # \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e zabbix_host_status=enabled # \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u0445\u043e\u0441\u0442\u0430 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e zabbix_snmp_community=\"MyCommunity\" # \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c SNMP community <\/code><\/pre>\n<p>\u0412 \u0438\u0442\u043e\u0433\u0435, \u0444\u0430\u0439\u043b\u044b \u0434\u043e\u043b\u0436\u043d\u044b \u0438\u043c\u0435\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0443\u044e \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443 \u0444\u0430\u0439\u043b\u043e\u0432:<\/p>\n<pre><code>. \u251c\u2500\u2500 linux-inventory \u251c\u2500\u2500 snmp-inventory \u251c\u2500\u2500 windows-inventory \u2514\u2500\u2500 zabbix-agent-all.yaml <\/code><\/pre>\n<h3>\u0417\u0430\u043f\u0443\u0441\u043a playbook<\/h3>\n<p>\u0414\u043b\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u043f\u043b\u0435\u0439\u0431\u0443\u043a\u043e\u0432, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u044b:<\/p>\n<p>\u0414\u043b\u044f \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u043d\u0430 Linux \u0445\u043e\u0441\u0442\u0430\u0445:<\/p>\n<pre><code class=\"bash\">ansible-playbook -i linux-inventory zabbix-agent-all.yaml<\/code><\/pre>\n<p>Windows:  <\/p>\n<pre><code>ansible-playbook -i windows-inventory zabbix-agent-all.yaml<\/code><\/pre>\n<p>SNMP:<\/p>\n<pre><code>ansible-playbook -i snmp-inventory zabbix-agent-all.yaml<\/code><\/pre>\n<p>\u0415\u0441\u043b\u0438 \u043d\u0443\u0436\u043d\u0430 \u0442\u043e\u043b\u044c\u043a\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430, \u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u0432\u044b\u0448\u0435 \u0441 \u0442\u044d\u0433\u043e\u043c install:<\/p>\n<pre><code>ansible-playbook -i linux-inventory zabbix-agent-all.yaml -t install<\/code><\/pre>\n<p>\u0415\u0441\u043b\u0438 \u0443 \u0432\u0430\u0441 \u0435\u0441\u0442\u044c \u043e\u0441\u043e\u0431\u044b\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 zabbix \u0438\u043b\u0438 \u0432\u044b \u0445\u043e\u0442\u0438\u0442\u0435 \u043a\u0430\u0441\u0442\u043e\u043c\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c, \u043f\u043e\u043b\u043d\u044b\u0439 \u0441\u043f\u0438\u0441\u043e\u043a \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u0440\u043e\u043b\u0438 \u0438 \u043c\u043e\u0434\u0443\u043b\u044f \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438 \u043d\u0430 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0435 \u043f\u0440\u043e\u0435\u043a\u0442\u0430: <a href=\"https:\/\/github.com\/ansible-collections\/community.zabbix\/blob\/main\/docs\/ZABBIX_AGENT_ROLE.md#role-variables\" rel=\"noopener noreferrer nofollow\">zabbix_agent<\/a> \u0438 <a href=\"https:\/\/docs.ansible.com\/ansible\/2.10\/collections\/community\/zabbix\/zabbix_host_module.html\" rel=\"noopener noreferrer nofollow\">zabbix_host<\/a><\/p>\n<p>\u0412\u0441\u0435 \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u0438 \u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0438 \u0435\u0441\u0442\u044c \u043d\u0430 github: <a href=\"https:\/\/github.com\/piccadil\/zabbix-agent\" rel=\"noopener noreferrer nofollow\">https:\/\/github.com\/piccadil\/zabbix-agent<\/a><\/p>\n<\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/post\/555458\/\"> https:\/\/habr.com\/ru\/post\/555458\/<\/a><br \/><\/br><\/br><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-322473","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/322473","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=322473"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/322473\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=322473"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=322473"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=322473"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}