ZABBIX_AGENTD Environment Deployment
- Zabbix AGENTD Deployment
- Zabbix Web page Add monitoring
System environment
Zabbix_client
[[email protected]_Client_56 ~]# cat /etc/redhat-release CentOS Linux release 7.5.1804 (Core) [[email protected]_Client_56 ~]# uname -r 3.10.0-862.el7.x86_64[[email protected]_Client_56 ~]# hostnameZabbix_Client_56.8[[email protected]_Client_56 ~]# ip a| grep 192.168. inet 192.168.56.8/24 brd 192.168.56.255 scope global noprefixroute dynamic eth0
Zabbix AGENTD Deployment
Zabbix Download
wget https://sourceforge.net/projects/zabbix/files/ZABBIX%20Latest%20Stable/4.0.0/zabbix-4.0.0.tar.gz
Create a Zabbix user group
[[email protected]_Client_56 zabbix-4.0.0]# groupadd zabbix[[email protected]_Client_56 zabbix-4.0.0]# useradd -g zabbix -s /sbin/nologin zabbix
Unzip the build installation
[[email protected]_Client_56 src]# tar xf zabbix-4.0.0.tar.gz[[email protected]_Client_56 src]# cd zabbix-4.0.0[[email protected]_Client_56 zabbix-4.0.0]# yum install gcc-c++ -y[[email protected]_Client_56 zabbix-4.0.0]# ./configure --prefix=/usr/local/zabbix --enable-ipv6 --enable-agent[[email protected]_Client_56 zabbix-4.0.0]# make && make install
Copy boot file
[[email protected]_Client_56 zabbix-4.0.0]# cp -rf misc/init.d/tru64/zabbix_agentd /etc/init.d/[[email protected]_Client_56 zabbix-4.0.0]# chmod +x /etc/init.d/zabbix_agentd [[email protected]_Client_56 zabbix-4.0.0]# vim /etc/init.d/zabbix_agentd添加以下两行,修改最后一行的zabbix路径#chkconfig:35 95 96#description:Zabbix_agentdDAEMON=/usr/local/zabbix/sbin/zabbix_agentd
Modifying the Zabbix agentd configuration file
[[email protected]_Client_56 zabbix-4.0.0]# cd /usr/local/zabbix/etc/[[email protected]_Client_56 etc]# grep -Ev "#|^$" zabbix_agentd.confLogFile=/tmp/zabbix_agentd.log #日志路径Server=192.168.56.7 #被动模式,Zabbix服务器主动来获取数据,该地址指向Zabbix Server地址ServerActive=192.168.56.7 #主动模式,客户端主动向服务端提交数据,此地址也为zabbix Server地址Hostname=192.168.56.8 #主机名称,一般写为IP地址Include=/usr/local/zabbix/etc/zabbix_agentd.conf.d/*.conf #外链文件
Start Agentd
[[email protected]_Client_56 etc]# /etc/init.d/zabbix_agentd startZabbix agent started.[[email protected]_Client_56 etc]# chkconfig zabbix_agentd on
# # # #Zabbix Web page Add monitoring
Network test
[[email protected]_Client_56 etc]# systemctl stop iptables[[email protected]_Client_56 etc]# systemctl stop firewalld[[email protected]_Client_56 etc]# setenforce 0[[email protected]_Client_56 etc]# telnet 192.168.56.7 10051 #测速服务器的10051端口是否通讯Trying 192.168.56.7...Connected to 192.168.56.7.Escape character is ‘^]‘.
Zabbix Server Get Data test
[[email protected]_server_56 html]# zabbix_get--helpusage:zabbix_get-s host-name-or-ip [-P Port-number] [-I ip-address]-K item-key #语法 zabbix_get-h zabbix_get-vget data from Zabbix agent. General Options:-S--host host-name-or-ip Specify host name or IP address of a host #-s specify AGENTD address, can be IP, host Name, domain name, etc.-p--port port-number Specify port number of agent running on the host #指定get端口, default is 10050 (default:10050)-I--source-address ip-address specify source IP address #指定源IP, S Erver the address of the machine, if the server has multiple IP, you specify a, generally do not specify-K--key item-key Specify key of the item to retrieve value for #指 Set the key value you want to get keys, there is the system default key, you can also customize-H--help Display this help message-v--version display ver Sion number #版本Example (s): Zabbix_get-s 127.0.0.1-p 10050-k "System.cpu.load[all,avg1 ] "#示例, get the key value data for this machine
实例:[[email protected]_Server_56 html]# zabbix_get -k "system.cpu.load[all]" -s 192.168.56.8 -p 100500.000000[[email protected]_Server_56 html]# zabbix_get -k "system.hostname" -s 192.168.56.8 -p 10050Zabbix_Client_56.8[[email protected]_Server_56 html]# zabbix_get -k "agent.hostname" -s 192.168.56.8 -p 10050192.168.56.8
Adding host Monitoring
注意:为了便于新手学习,字体改为了中文菜单栏上找到配置——》主机群组——》创建主机群组
然后找到配置——》主机——》创建主机
别急添加,再切换到模版页面,应用模版
再来切换到主机资产记录,资产记录简称(CMDB)
填写完之后,点击最下方的添加
想要看到我们监控的数据,可以到last data(最新数据)里面
Zabbix AGENTD Environment Deployment