zoukankan      html  css  js  c++  java
  • zabbix_agent安装

    #!/bin/bash
    #by Charon2Pluto
    #(linux)
    ML=`df |awk '{print $2,$NF}'|sort -n|tail -1|awk '{print $2}'`

    if [ "$ML" = "/ecapp" ]; then
    ML=/ecapp/soft
    fi

    tar zxf zabbix-4.0.1.tar.gz

    cd zabbix-4.0.1
    ./configure --prefix=$ML/zabbix_agent --enable-agent && make install

    mkdir -p $ML/zabbix_agent/{logs,scripts}

    cp $ML/zabbix_agent/etc/zabbix_agentd.conf $ML/zabbix_agent/etc/zabbix_agentd.conf.bak

    Hostname=`hostname`

    sed -i "/# PidFile=/tmp/zabbix_agentd.pid/a PidFile="$ML"/zabbix_agent/zabbix_agentd.pid" $ML/zabbix_agent/etc/zabbix_agentd.conf

    sed -i "s@LogFile=/tmp/zabbix_agentd.log@LogFile="$ML"/zabbix_agent/logs/zabbix_agentd.log@" $ML/zabbix_agent/etc/zabbix_agentd.conf

    sed -i 's|# StartAgents=3|StartAgents=0|' $ML/zabbix_agent/etc/zabbix_agentd.conf

    sed -i 's|Server=127.0.0.1|Server=172.30.208.89|' $ML/zabbix_agent/etc/zabbix_agentd.conf

    sed -i 's|ServerActive=127.0.0.1|ServerActive=172.30.208.89|' $ML/zabbix_agent/etc/zabbix_agentd.conf

    sed -i "s|Hostname=Zabbix server|Hostname="$Hostname"|" $ML/zabbix_agent/etc/zabbix_agentd.conf

    sed -i "/# Include=/usr/local/etc/zabbix_agentd.conf.d/*.conf/a Include="$ML"/zabbix_agent/etc/zabbix_agentd.conf.d/*.conf" $ML/zabbix_agent/etc/zabbix_agentd.conf

    grep -v "^#" $ML/zabbix_agent/etc/zabbix_agentd.conf

    rm -rf $ML/zabbix-4.0.1
    rm -rf $ML/zabbix-4.0.1.tar.gz
    rm -rf $ML/zabbix.sh

  • 相关阅读:
    Postman教程大全
    Java关键字(一)——instanceof
    RocketMQ(1)-架构原理----通用MQ知识点
    CAP理论的理解
    Buy the Ticket HDU
    高斯消元求多元一次方程(讲解+板子)
    P3709 大爷的字符串题 莫队
    P4074 [WC2013]糖果公园 树上莫队带修改
    java的静态代码块和类变量的隐式覆盖
    SP10707 COT2
  • 原文地址:https://www.cnblogs.com/charon2/p/10349865.html
Copyright © 2011-2022 走看看