Chinaunix首页 | 论坛 | 博客
  • 博客访问: 30940
  • 博文数量: 19
  • 博客积分: 0
  • 博客等级: 民兵
  • 技术积分: 10
  • 用 户 组: 普通用户
  • 注册时间: 2015-03-24 21:19
文章分类

全部博文(19)

分类: LINUX

2015-12-23 11:10:31

原文地址:Zabbix 监控 linux主机 作者:baochenggood


Zabbix 监控 linux主机
前面有写安装zabbix-client端,这里我用脚本安装的,方便批量部署


脚本内容如下:



点击(此处)折叠或打开

  1. #!/bin/bash
  2. # Guying 2015/12/2 15:42
  3. #version v1
  4. ###zabbix client install ##########
  5. ####关闭selinux 和防火墙#########
  6. /etc/init.d/iptables stop;chkconfig iptables off
  7. sed -i "s/SELINUX=.*/SELINUX=disabled/g" /etc/selinux/config
  8. /usr/sbin/setenforce 0
  9. ###################################################
  10. yum install epel-release -y && yum install zabbix22-agent -y
  11. #######这里提示输入的是zabb-server 的ip地址######################
  12. echo "Please input zabbix server ipaddress:"
  13. read ipaddress
  14. sed -i "s/Server=.*/Server=$ipaddress/g" /etc/zabbix_agentd.conf
  15. sed -i "s/ServerActive=.*/ServerActive=$ipaddress:10051/g" /etc/zabbix_agentd.conf
  16. #这里提示输入的主机名要和,添加监控主机名对应,否则无法通讯,建议将主机名添加到#zabbix-server 的/etc/hosts 文件里面#
  17. echo "Please input hostname:"
  18. read hostname
  19. sed -i "s/Hostname=.*/Hostname=$hostname/g" /etc/zabbix_agentd.conf
  20. /etc/init.d/zabbix-agentd restart ;chkconfig zabbix-agentd on


执行过脚本,只需在zabbix UI 上面,添加该主机即可

注意:  主机名写到zabbix-server /etc/hosts 里面,主机名和,添加主机的名字对应

阅读(1131) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~