1、准备机器,,使用内网网段
2、服务端安装
zabbix tar包,解压直接免网络安装http://pan.baidu.com/s/1eSeUr6M
我的测试环境是CentOS6.9
郑重提示:请按照下面的步骤按顺序执行
tar xfP zabbix3.0.9_yum.tar.gz
yum -y --nogpgcheck -C install httpd zabbix-web zabbix-server-mysql zabbix-web-mysql zabbix-get mysql-server php55w php55w-mysql php55w-common php55w-gd php55w-mbstring php55w-mcrypt php55w-devel php55w-xml php55w-bcmath zabbix-get zabbix-java-gateway wqy-microhei-fonts net-snmp net-snmp-utils
最好是个空机子,不用装mysql,上面yum安装包里面已经有了,
-nogpgcheck 不检查gpg证书
-C 直接使用系统yum缓存,不下载更新yum缓存,
/bin/sh zabbix_init.sh
此时打开浏览器,输入网址10.0.0.61/zabbix即可发现惊喜
- 所有客户端安装zabbix-agent
rpm -ivh http://mirrors.aliyun.com/zabbix/zabbix/3.0/rhel/6/x86_64/zabbix-agent-3.0.9-1.el6.x86_64.rpm
yum localinstall
http://mirrors.aliyun.com/zabbix/zabbix/3.0/rhel/6/x86_64/zabbix-agent-3.0.9-1.el6.x86_64.rpm
sed -i ‘s#Server=127.0.0.1#Server=172.16.1.61#’ /etc/zabbix/zabbix_agentd.conf
/etc/init.d/zabbix-agent start
status
server {
listen 127.0.0.1:80;
stub_status on;
access_log off;
}
vim /etc/zabbix/zabbix_agentd.conf
UserParameter=nginx_active,curl -s 127.0.0.1/nginx_status|awk '/Active/ {print $NF}'
UserParameter=nginx_accepts,curl -s 127.0.0.1/nginx_status|awk 'NR==3 {print $1}'
UserParameter=nginx_handled,curl -s 127.0.0.1/nginx_status|awk 'NR==3 {print $2}'
UserParameter=nginx_requests,curl -s 127.0.0.1/nginx_status|awk 'NR==3 {print $3}'
UserParameter=nginx_reading,curl -s 127.0.0.1/nginx_status|awk 'NR==4 {print $2}'
UserParameter=nginx_writing,curl -s 127.0.0.1/nginx_status|awk 'NR==4 {print $4}'
UserParameter=nginx_waiting,curl -s 127.0.0.1/nginx_status|awk 'NR==4 {print $6}'
/etc/init.d/zabbix-agent restart