zabbix agent 安装

来源:互联网 发布:手机优化排名 编辑:程序博客网 时间:2024/06/09 20:03
#!/bin/shpath=/opt/zabbixver=http://downloads.sourceforge.net/project/zabbix/ZABBIX%20Latest%20Stable/3.0.4/zabbix-3.0.4.tar.gzwgetp=/usr/local/srcserver=192.168.1.55check=`lsof -i :10050`conf=$path/etc/zabbix_agentd.confname=`ifconfig |grep netmask|grep -v "127.0.0.1"|awk '{print $2}'`user=zabbix##############下载agent源码包############yum -y group install Development Toolsuseradd -M -s /sbin/nologin zabbixyum -y install lsof wget cd $wgetpif [[ -f zabbix-3.0.4.tar.gz ]]; thenecho "文件已存在"cd zabbix-3.0.4./configure --prefix=$path --enable-agentelsewget $vertar -xvzf zabbix-3.0.4.tar.gzcd zabbix-3.0.4./configure --prefix=$path --enable-agentfi#if [[ $? != 0 ]]; then#echo "zabbix install faile pls 检查依赖问题 "#fimake if [[ $? != 0 ]]; thenecho " make failed "fimake installsleep 2 cd $path##############备份zabbix.confcp $conf $conf-$(date +%F)######替换配置文件#############cat << EOF >$confLogFile=/tmp/zabbix_agentd.logServer=$server#ServerActive=$serverHostname=$nameUnsafeUserParameters=1EnableRemoteCommands=1RefreshActiveChecks=300Timeout=5Include=$path/etc/zabbix_agentd.conf.d/EOFchown -R zabbix.zabbix $pathsleep 2./sbin/zabbix_agentd######检测agent是否启动$checkif [[ $? == 0 ]]; thenecho "zabbix is runing"elseecho "zabbix is runing failed"fitailf /tmp/zabbix_agentd.log


附上window安装:

C:\Windows\system32>C:\zabbix_agents\bin\win64\zabbix_agentd.exe -i -c C:\zabbix_agents\conf\zabbix_agentd.win.conf#注意顺序 -i -czabbix_agentd.exe [1468]: service [Zabbix Agent] installed successfullyzabbix_agentd.exe [1468]: event source [Zabbix Agent] installed successfully


windows agent配置文件

LogFile=C:\zabbix_agents\zabbix_agentd.logServer=172.16.100.106#ServerActive=172.16.100.106Hostname=172.16.100.81UnsafeUserParameters=1EnableRemoteCommands=1RefreshActiveChecks=300Timeout=5#Include=c:\zabbix_agents\zabbix_agentd.conf.d\*.conf



0 0
原创粉丝点击