客户端部署
[[email protected] ~]# find /etc/yum.repos.d/ -name ‘*.repo‘ -exec mv {} {}.back \; [[email protected] ~]# vim /etc/yum.repos.d/aliyun.repo [aliyun] name=centos6 baseurl=https://mirrors.aliyun.com/centos/6/os/x86_64/ enabled=1 gpgkey=https://mirrors.aliyun.com/centos/6/os/x86_64/RPM-GPG-KEY-CentOS-6 gpgcheck=1 [epel] name=Extra Packages for Enterprise Linux 6 - $basearch baseurl=http://mirrors.aliyun.com/epel/6/$basearch http://mirrors.aliyuncs.com/epel/6/$basearch failovermethod=priority enabled=1 gpgcheck=0 gpgkey= [[email protected] ~]# yum -y install zabbix22-agent.x86_64 [[email protected] ~]# service zabbix-agentd start [[email protected] ~]# chkconfig zabbix-agent on [[email protected] ~]# cd /etc/zabbix/ [[email protected] zabbix]# cp zabbix_agent.conf zabbix_agent.conf.bak [[email protected] zabbix]# vim zabbix_agent.conf Server=192.168.1.111 #服务端ip地址 [[email protected] ~]# vim /etc/zabbix_agentd.conf Server=192.168.1.111 ServerActive=192.168.1.111 [[email protected] zabbix]# service zabbix-agentd restart
部署完成后在服务端测试,能获取到客户端主机名,说明服务端能对客户端进行监控
[[email protected] ~]# zabbix_get -s 192.168.1.102 -k system.hostname www.nginx.com
时间: 2024-12-20 01:20:34