共计 1683 个字符,预计需要花费 5 分钟才能阅读完成。
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 相关教程集合:
Ubuntu 14.04 下 Zabbix2.4.5 源码编译安装 http://www.linuxidc.com/Linux/2015-05/117657.htm
CentOS 7 LNMP 环境搭建 Zabbix3.0 http://www.linuxidc.com/Linux/2017-02/140134.htm
Ubuntu 16.04 安装部署监控系统 Zabbix2.4 http://www.linuxidc.com/Linux/2017-03/141436.htm
Zabbix 监控安装部署及警报配置 http://www.linuxidc.com/Linux/2017-03/141611.htm
Zabbix 触发器表达式详解 http://www.linuxidc.com/Linux/2017-03/141921.htm
Ubuntu 16.04 下安装部署 Zabbix3.0 http://www.linuxidc.com/Linux/2017-02/140395.htm
CentOS 6.3 下 Zabbix 监控 apache server-status http://www.linuxidc.com/Linux/2013-05/84740.htm
CentOS 7 下 Zabbix 3.0 安装详解 http://www.linuxidc.com/Linux/2017-03/141716.htm
64 位 CentOS 6.2 下安装 Zabbix 2.0.6 http://www.linuxidc.com/Linux/2014-11/109541.htm
ZABBIX 的详细介绍:请点这里
ZABBIX 的下载地址:请点这里
本文永久更新链接地址:http://www.linuxidc.com/Linux/2017-05/144255.htm