阿里云-云小站(无限量代金券发放中)
【腾讯云】云服务器、云数据库、COS、CDN、短信等热卖云产品特惠抢购

CentOS 7下Puppet推送Zabbix Agent

151次阅读
没有评论

共计 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

正文完
星哥说事-微信公众号
post-qrcode
 
星锅
版权声明:本站原创文章,由 星锅 2022-01-21发表,共计1683字。
转载说明:除特殊说明外本站文章皆由CC-4.0协议发布,转载请注明出处。
【腾讯云】推广者专属福利,新客户无门槛领取总价值高达2860元代金券,每种代金券限量500张,先到先得。
阿里云-最新活动爆款每日限量供应
评论(没有评论)
验证码
【腾讯云】云服务器、云数据库、COS、CDN、短信等云产品特惠热卖中