1. zabbix monitors linux host: http://www.osyunwei.com/archives /8035.html
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
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
[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
[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
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.
groupaddzabbix
useradd-g zabbix -s /sbin/nologin zabbix
#Create user zabbix and add user zabbix Go to user group zabbix
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.
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
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
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
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
Open the zabbix server in the browser:
http://192.168.11.252/zabbix
ConfigurationàHostsàCreate host
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.
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.
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.