zoukankan      html  css  js  c++  java
  • salt安装zabbix

    states文件:

     

     

    [root@super65 base]# cat top.sls
    base:
      '*':
        - init.env_init
    [root@super65 base]# cat init/env_init.sls
    include:
      - init.zabbix_agent

    [root@super65 base]# cat init/zabbix_agent.sls
    zabbix-agent:
      pkg.installed:
        - name: zabbix22-agent

      file.managed:
        - name: /etc/zabbix_agentd.conf
        - source: salt://init/files/zabbix_agentd.conf
        - tmplate: jinjia
        - defaults:
          Server: {{ pillar['zabbix-agent']['Zabbix-Server'] }}
        - require:
        - pkg: zabbix-agent

      service.running:
        - enable: True
        - watch:
        - pkg: zabbix-agent
        - file: zabbix-agent

    [root@super65 pillar]# cat base/top.sls
    base:
      '*':
        - zabbix
    [root@super65 pillar]# cat base/zabbix.sls
    zabbix-agent:
      Zabbix-Server: 192.168.1.65

    [root@super65 files]# grep -Ev "^$|^#" zabbix_agentd.conf
    PidFile=/var/run/zabbix/zabbix_agentd.pid
    LogFile=/var/log/zabbix/zabbix_agentd.log
    LogFileSize=0
    Server={{Server}}
    ServerActive=127.0.0.1
    Hostname=Zabbix server
    Include=/etc/zabbix_agentd.conf.d/

    启动时没这个文件会报错:

    mkdri /etc/zabbix_agentd.conf.d

     执行:

    [root@super65 ~]# salt '*' state.highstate test=True

    [root@super65 ~]# salt '*' state.highstate 

  • 相关阅读:
    如何学好编程
    进制转换
    第五周学习总结 20201204 于瀛鹏
    xor运算
    20201204 于瀛鹏 第四周学习总结
    20201204 于瀛鹏 第三周学习总结
    IEEE754浮点数
    base64编码
    罗马数字(1-3999)转阿拉伯数字
    俄罗斯方块
  • 原文地址:https://www.cnblogs.com/fanxuanhui-linux/p/5878925.html
Copyright © 2011-2022 走看看