Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1358629
  • 博文数量: 145
  • 博客积分: 1440
  • 博客等级: 少尉
  • 技术积分: 2986
  • 用 户 组: 普通用户
  • 注册时间: 2012-07-24 23:47
个人简介

我一直在走,至少还有条路,也好于无路可走…

文章分类

全部博文(145)

文章存档

2023年(1)

2017年(2)

2016年(5)

2015年(13)

2014年(13)

2013年(70)

2012年(41)

分类: LINUX

2015-12-03 18:32:34


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 里面,主机名和,添加主机的名字对应

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