Zabbix_agent deployment_PHP tutorial
Zabbix_agent deployment
Reference documents:
1. zabbix monitors linux host: http://www.osyunwei.com/archives /8035.html
1. Environment
Server: Based on CentOS-7-x86_64-1511, zabbix-3.0.1 server has been deployed
ServerIP: 192.168.11.252
Agent: CentOS-6.4- x86_64
AgentIP: 192.168.21.252, the route is reachable server
2. Software acquisition
Zabbix official website download address: http://www.zabbix.com/download.php
The current latest LTS version download address: http://jaist.dl.sourceforge.net /project/zabbix/ZABBIX Latest Stable/3.0.1/zabbix-3.0.1.tar.gz
3. Preparation
1. iptables settings
[root@localhost ~]# vim /etc/sysconfig/iptables
-A INPUT -s 192.168.11.252 -p tcp -m state --state NEW -m tcp--dport 10050 -j ACCEPT
-A OUTPUT -d 192.168.11.252 -p tcp -m state --state NEW -m tcp--dport 10051 -j ACCEPT
#zabbix_agent port 10050, the agent adopts passive mode, and the server actively connects to the agent; the agent also has an active mode, which can be configured in the agent's configuration file
# zabbix_trapper port 10051, agent active or trapper Method to connect to the server
# The server ip is specified here for security, which can be ignored
2. selinux
[root@localhost~]# getenforce
# Check whether selinux is closed. If it is running, it needs to be closed
[root@localhost~]# vim /etc/selinux/config
#SELINUX=enforcing
SELINUX=disabled
[root@localhost~]# setenforce 0
# Make the configuration take effect immediately
4. Install zabbix_agent
1. Dependency packages
Description: zabbix_agent requires relatively few dependency packages, but basic compilation dependency packages are still needed, such as gcc, gcc-c, etc. The initial centos system here is installed according to the compilation environment. The compilation and installation went smoothly. It is not certain which dependent packages are needed in addition to the basic compilation environment. Readers can try compilation and installation first, and deal with any errors if they occur.
2. Add user
groupaddzabbix
useradd-g zabbix -s /sbin/nologin zabbix
#Create user zabbix and add user zabbix Go to user group zabbix
3. Add service port
vim/etc/services
# Zabbix
zabbix-agent 10050/tcp # Zabbix Agent
zabbix-agent 10050/udp # Zabbix Agent
zabbix-trapper 10051/tcp # Zabbix Trapper
zabbix-trapper 10051/udp # Zabbix Trapper
#Add the port corresponding to the zabbix service.
has been added in the default services document. 4. Install zabbix_agent
ln -s/usr/local/lib/libiconv.so .2 /usr/lib/libiconv.so.2
/sbin/ldconfig
#Make the configuration take effect immediately
#It is possible that libiconv.so.2 cannot be found file, no impact has been found yet
tar -zxvf/usr/local/src/zabbix-3.0.1.tar.gz
cd/usr/local /src/zabbix-3.0.1
./configure--prefix=/usr/local/zabbix --enable-agent
#Only install zabbix_agent
make
makeinstall
ln -s/usr/local/zabbix/sbin/* /usr/local/sbin/
ln -s/usr/ local/zabbix/bin/* /usr/local/bin/
#Add soft links to zabbix_agent related execution files
5. Configuration
Modify zabbix_agnet configuration file
vim /usr/local/zabbix/etc/zabbix_agentd.conf
Server=192.168.11.252
Include=/usr/local/zabbix/etc/zabbix_agentd.conf.d /
UnsafeUserParameters=1
#Enable custom key
Add boot script
cp/usr/local/src/zabbix-3.0.1 /misc/init.d/fedora/core/zabbix_agentd/etc/rc.d/init.d/zabbix_agentd
#Client
chownzabbix:zabbix /etc /rc.d/init.d/zabbix_agentd
chmod x/etc/rc.d/init.d/zabbix_agentd
#Add script execution permissions
vim/etc/rc.d/init. d/zabbix_agentd
BASEDIR=/usr/local/zabbix/
#Edit the installation directory of zabbix in the client startup script
chkconfig-- level 35 zabbix_agentd on
#Add boot startup
6. Startup verification
service zabbix_agentdstart
ps aux |grep zabbix_agentd
netstat-tunlp | grep zabbix
# Check whether the Zabbix client is running normally
Test whether the communication between the Zabbix client and the Zabbix server is normal, as follows The command is executed on the zabbix server:
zabbix_get-s 192.168.21.252 -p 10050 -k "system.uptime"
2533194
#If there is data echo, the communication is normal , 192.168.21.252 is the zabbix client IP address; if the echo is abnormal, you can check the agent log. According to the file configuration, the default is /tmp/zabbix_agentd.log
5. Add linux host monitoring
1. Create a host
Open the zabbix server in the browser:
http://192.168.11.252/zabbix
ConfigurationàHostsàCreate host
2. Host information
under the Host tag:
Customize "Host name";
Select "Groups", if not, create a new "Newgroup";
Select "Agentinterfaces" for monitoring mode, fill in "IP ADDRESS", the default is Connect to port 10050 in IP mode, do not make any changes, and leave the rest as default.
3. Select the monitoring template
Under the Templates tab:
"Link new templates", Selectà selected Template OSLinux Template àAdd confirms adding the template, and the added template will be displayed in "Linked Templates";
Click the "Add" button at the bottom of the page, and the host is added successfully.
4. Status Observation
The host is added successfully and automatically returns to the Hosts page. For the created host, mainly observe the status of "STATUS" and "AVAILABILITY", as follows:
If the status is abnormal, you can check the server-side log, according to the configuration file , the default is /tmp/zabbix_server.log.

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

In recent days, Ice Universe has been steadily revealing details about the Galaxy S25 Ultra, which is widely believed to be Samsung's next flagship smartphone. Among other things, the leaker claimed that Samsung only plans to bring one camera upgrade

OnLeaks has now partnered with Android Headlines to provide a first look at the Galaxy S25 Ultra, a few days after a failed attempt to generate upwards of $4,000 from his X (formerly Twitter) followers. For context, the render images embedded below h

Alongside announcing two new smartphones, TCL has also announced a new Android tablet called the NXTPAPER 14, and its massive screen size is one of its selling points. The NXTPAPER 14 features version 3.0 of TCL's signature brand of matte LCD panels

The Vivo Y300 Pro just got fully revealed, and it's one of the slimmest mid-range Android phones with a large battery. To be exact, the smartphone is only 7.69 mm thick but features a 6,500 mAh battery. This is the same capacity as the recently launc

In recent days, Ice Universe has been steadily revealing details about the Galaxy S25 Ultra, which is widely believed to be Samsung's next flagship smartphone. Among other things, the leaker claimed that Samsung only plans to bring one camera upgrade

Samsung has not offered any hints yet about when it will update its Fan Edition (FE) smartphone series. As it stands, the Galaxy S23 FE remains the company's most recent edition, having been presented at the start of October 2023. However, plenty of

Motorola has released countless devices this year, although only two of them are foldables. For context, while most of the world has received the pair as the Razr 50 and Razr 50 Ultra, Motorola offers them in North America as the Razr 2024 and Razr 2

The Redmi Note 14 Pro Plus is now official as a direct successor to last year'sRedmi Note 13 Pro Plus(curr. $375 on Amazon). As expected, the Redmi Note 14 Pro Plus heads up the Redmi Note 14 series alongside theRedmi Note 14and Redmi Note 14 Pro. Li
