How to install agent in zabbix
This article mainly introduces how zabbix installs agent, which has certain reference value. Interested friends can refer to it. I hope you will gain a lot after reading this article. Let Xiaobian take you to understand it together.
Create zabbix users and groups
# groupadd zabbix
# useradd -g zabbix zabbix -s /sbin/nologin
2, Decompress zabbix source package and compile and install
# tar -xf zabbix-3.2.2.tar.gz
# cd zabbix-3.2.2
# ./ configure --prefix=/usr/local/zabbix --enable-agent
# make && make install
3. Copy zabbix client startup script to/etc/init.d directory
# cd /usr/local/zabbix-3.2.2/misc/
# cp init.d/tru64/zabbix_agentd /etc/init.d/
# chmod +x /etc/init.d/zabbix_agentd
4. Modify zabbix_agentd startup script to modify the DAEMON startup command path to the path specified during installation.
vim /etc/init.d/zabbix_agentd
DAEMON=/usr/local/zabbix/sbin/zabbix_agentd
5. Set zabbix_agentd service startup
You need to add the following two sentences to #!/ After bin/bash.
vi /etc/init.d/zabbix_agentd
# chkconfig: 2345 10 90
# description: zabbix_agentd
chkconfig zabbix_agentd on
chkconfig --list |grep zabbix check
Edit zabbix_agent configuration file
vi /usr/local/zabbix/etc/zabbix_agentd.conf
LogFile=/var/log/zabbix/zabbix_agentd.log
Server=172.16.7.5
ServerActive=172.16.7.5:10051
Hostname=Zabbix server
EnableRemoteCommands=1
LogRemoteCommands=1
# egrep -v "^#|^$" /usr/local/zabbix/etc/zabbix_agentd.conf
LogFile=/var/log/zabbix/zabbix_agentd.log
Server=172.16.7.5
ServerActive=172.16.7.5
Hostname=Zabbix server
EnableRemoteCommands=1
LogRemoteCommands=1
7. Create a log directory and set permissions
# mkdir /var/log/zabbix
# chown -R zabbix.zabbix /var/log/zabbix/
# chown -R zabbix.zabbix /usr/local/zabbix/
Start zabbix_agentd service
# /etc/init.d/zabbix_agentd start
9. Check whether zabbix_agentd service starts successfully
# netstat -nltp | grep zabbix
tcp 0 0 172.16.10.152:10050 0.0.0.0:* LISTEN 26143/zabbix_agentd
At this point, zabbix_agend has been installed!
in the implementation
# ./ configure --prefix=/usr/local/zabbix --enable-agent
It is possible to report the following error
configure: error: Unable to use libpcre (libpcre check failed)
implementation
yum -y install pcre*
would be nice
Or most of the time it's lack of dependency, it's OK to install it once
yum -y install net-snmp-devel libxml2-devel libcurl-deve libevent libevent-devel
yum -y install mysql-dev gcc net-snmp-devel curl-devel perl-DBI php-gd php-mysql php-bcmath php-mbstring php-xm
Thank you for reading this article carefully. I hope that the article "zabbix how to install agent" shared by Xiaobian will be helpful to everyone. At the same time, I hope that everyone will support you a lot and pay attention to the industry information channel. More relevant knowledge is waiting for you to learn!