• 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

  • 相关阅读:
    c#大圣之路笔记——c# 页面加载数据过长等待显示框
    Python(五)
    Python(四)
    Python(三)
    python(二)数据类型与变量
    初识Python
    Linux初识(九)
    Linux初识(八)正则表达式
    Linux基础初识(七)
    Linux基础初识(六)
  • 原文地址:https://www.cnblogs.com/charon2/p/10349865.html
Copyright © 2020-2023  润新知