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

  • 相关阅读:
    Web服务技术协议:REST与SOAP
    几种常见的Web服务器
    在浏览器中输入网址后是怎么跳转到指定的服务器的
    forward(请求转发)和redirect(重定向)的区别
    Hook钩子编程
    闭包
    JSP
    临界区与锁
    进程
    LeetCode Search for a Range
  • 原文地址:https://www.cnblogs.com/charon2/p/10349865.html
Copyright © 2011-2022 走看看