# Zabbix\_Agent

### zabbix\_agentd.conf

```
PidFile=/var/run/zabbix/zabbix_agentd.pid
LogFile=/var/log/zabbix/zabbix_agentd.log
DebugLevel=3
Server={{ zabbix_server }}
ListenPort=10050
ListenIP={{ ansible_default_ipv4.address }}
ServerActive={{ zabbix_server }}
Hostname={{ ansible_default_ipv4.address }} 
Include=/etc/zabbix/zabbix_agentd.d/*.conf
UserParameter=tcp.status[*],ss -antp |awk '{a[$$1]++}END{print a["'$1'"]}'
```

### zabbix\_agent.yaml

```yaml
---
- hosts: all
  vars:
  - zabbix_server: 192.168.0.11
  tasks:
    - name: Install zabbix agent - CentOS6
      yum: name=https://repo.zabbix.com/zabbix/4.0/rhel/6/x86_64/zabbix-agent-4.0.0-2.el6.x86_64.rpm state=present
      when: ansible_distribution == "CentOS" and ansible_distribution_major_version == "6"
    - name: Install zabbix agent - CentOS7
      yum: name=https://repo.zabbix.com/zabbix/4.0/rhel/7/x86_64/zabbix-agent-4.0.0-2.el7.x86_64.rpm state=present
      when: ansible_distribution == "CentOS" and ansible_distribution_major_version == "7"

    - name: Copy zabbix agent configuration file
      template: src=zabbix_agentd.conf.j2 dest=/etc/zabbix/zabbix_agentd.conf

    - name: Start zabbix agent
      service: name=zabbix-agent state=started enabled=true
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://close.gitbook.io/yun-wei-bi-ji/centos/zabbix/zabbix_agent.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
