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 

  • 相关阅读:
    ZooKeeper Java例子(六)
    css盒模型
    竖直方向三栏布局
    水平方向三栏布局
    js判断一个字符串是以某个字符串开头
    js防止重复点击
    升级 AngularJS 至 Angular
    js实现大文件分片上传的方法
    使用svn进行本地代码管理
    angular使用代理解决跨域
  • 原文地址:https://www.cnblogs.com/fanxuanhui-linux/p/5878925.html
Copyright © 2011-2022 走看看