码迷,mamicode.com
首页 > 其他好文 > 详细

salt安装zabbix

时间:2016-09-17 16:13:59      阅读:125      评论:0      收藏:0      [点我收藏+]

标签:

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 

 

salt安装zabbix

标签:

原文地址:http://www.cnblogs.com/fanxuanhui/p/5878925.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!