CentOS 7下Puppet推送Zabbix Agent
CentOS 7下Puppet推送Zabbix Agent
创建zabbix模块目录:
$ mkdir -p /etc/puppet/modules/zabbix/{manifests,templates}
创建init.pp清单:
$ cat /etc/puppet/modules/zabbix/manifests/init.pp class zabbix { package { 'epel-release': ensure => installed, } package { 'zabbix22-agent': ensure => installed, } file { '/etc/zabbix/zabbix_agentd.conf': content => template("zabbix/zabbix_agentd.conf.erb"), ensure => file, } service { 'zabbix-agent': ensure => "running", hasstatus => true, enable => true, } Package["zabbix22-agent"] -> File["/etc/zabbix/zabbix_agentd.conf"] -> Service["zabbix-agent"] }
创建zabbix_agentd.conf.erb模板:
$ cp /etc/zabbix/zabbix_agentd.conf /etc/puppet/modules/zabbix/templates/zabbix_agentd.conf.erb $ cat /etc/puppet/modules/zabbix/templates/zabbix_agentd.conf.erb Server=<%= zabbix_server %> ServerActive=<%= zabbix_server %> Hostname=<%= fqdn %> ... ... ... ...
编辑site.pp:
$# cat /etc/puppet/manifests/site.pp Package { allow_virtual => true, } node default { $zabbix_server = "192.168.154.137" include zabbix }
更多Zabbix相关教程集合:
ZABBIX 的详细介绍:请点这里
ZABBIX 的下载地址:请点这里
相关推荐
zhangwentaohh 2020-06-05
YJWcsdn 2020-01-17
84453864 2020-01-17
tanzhe0 2020-01-13
小新没有蜡笔 2019-12-11
nicolesmile 2019-12-04
ppppfly 2015-08-20
83274251 2012-05-09
sxjinmingjie 2019-06-30
winxcoder 2019-06-28
80327065 2019-06-27
xinluke 2019-03-17
mayongzhancsdn 2018-04-26
83317360 2018-05-28
onepiecedn 2013-11-02
88971932 2013-05-23
Justypc 2013-05-23
ballyyang 2012-11-10