zoukankan      html  css  js  c++  java
  • ansible批量安装zabbix_agent && 修改配置文件

    Ansible常用指令

     

     

    rpm -i https://repo.zabbix.com/zabbix/4.0/rhel/7/x86_64/zabbix-release-4.0-1.el7.noarch.rpm

    rpm -i https://repo.zabbix.com/zabbix/4.0/rhel/6/x86_64/zabbix-release-4.0-1.el6.noarch.rpm

     

     

    yum install zabbix-agent -y

     

    vi /etc/zabbix/zabbix_agentd.conf

     

     

     

     

    ServerActive=127.0.0.1

     

    Hostname=Zabbix server

    Server=127.0.0.1

     

    zabbix-agent部署

    ansible dev3 -m shell -a ‘’     查看配置可用shell模块

    ansible dev3 -m lineinfile -a 'path=/etc/zabbix/zabbix_agentd.conf regexp="^ServerActive=" line="ServerActive=172.17.31.76:10051"'    替换远程文件内容

    ansible dev3 -m lineinfile -a 'path=/etc/zabbix/zabbix_agentd.conf regexp="^Server=" line="Server=127.0.0.1,172.17.31.76"'      替换远程文件内容

     

    Copy  script  yum vars 等常用模块,适用yml文件

    命令行直接使用shell模块简单粗暴。

     

     

     

     

  • 相关阅读:
    浏览器返回按钮不会触发onLoad事件
    js常用方法
    清除浮动
    Hbuilder快捷键
    页面跳转
    castapp.js颜色配置
    mui学习
    css 特殊使用技巧
    mui框架如何实现页面间传值
    从0到千万级访问量网站架构演变史
  • 原文地址:https://www.cnblogs.com/mybxy/p/10312911.html
Copyright © 2011-2022 走看看