itamae-plugin-recipe-zabbix 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/.gitignore +10 -0
- data/.rspec +2 -0
- data/.travis.yml +4 -0
- data/Gemfile +4 -0
- data/README.md +59 -0
- data/Rakefile +6 -0
- data/bin/console +14 -0
- data/bin/setup +7 -0
- data/itamae-plugin-recipe-zabbix.gemspec +24 -0
- data/lib/itamae/plugin/recipe/zabbix.rb +30 -0
- data/lib/itamae/plugin/recipe/zabbix/agent.rb +17 -0
- data/lib/itamae/plugin/recipe/zabbix/templates/etc/zabbix/zabbix_agentd.conf.erb +18 -0
- data/lib/itamae/plugin/recipe/zabbix/version.rb +9 -0
- metadata +98 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 8222e81e825b69610b78eec4b6f490120fadb23d
|
4
|
+
data.tar.gz: c3a333dbbf92e3ef42ea42bcda9e1221fce19508
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 44c43f75cd098a01c84080742cfadf763db1b98f6b752f31308f166ff7083afc66ab6625075034827ea78c1a253190d1922c669c6f88e10883a7ac232ac2607d
|
7
|
+
data.tar.gz: 164af23e647bc997b287963643e14db5ecdec06ce2de9c1c32c918cfcdee53cb1a178a9505b6c0e43529fb50daabc8ce1031df0386f2813f4b22b7794702422e
|
data/.gitignore
ADDED
data/.rspec
ADDED
data/.travis.yml
ADDED
data/Gemfile
ADDED
data/README.md
ADDED
@@ -0,0 +1,59 @@
|
|
1
|
+
# Itamae::Plugin::Recipe::Zabbix
|
2
|
+
|
3
|
+
Itamae recipe plugin for zabbix
|
4
|
+
|
5
|
+
## Installation
|
6
|
+
|
7
|
+
Add this line to your application's Gemfile:
|
8
|
+
|
9
|
+
```ruby
|
10
|
+
gem 'itamae-plugin-recipe-zabbix'
|
11
|
+
```
|
12
|
+
|
13
|
+
And then execute:
|
14
|
+
|
15
|
+
$ bundle
|
16
|
+
|
17
|
+
Or install it yourself as:
|
18
|
+
|
19
|
+
$ gem install itamae-plugin-recipe-zabbix
|
20
|
+
|
21
|
+
## Usage
|
22
|
+
|
23
|
+
### Install
|
24
|
+
|
25
|
+
```ruby
|
26
|
+
include_recipe "zabbix"
|
27
|
+
include_recipe "zabbix::agent"
|
28
|
+
```
|
29
|
+
|
30
|
+
```yaml
|
31
|
+
zabbix:
|
32
|
+
version: 2.2
|
33
|
+
server: zabbix.example.com
|
34
|
+
port: 10050
|
35
|
+
hostname: local.example.com
|
36
|
+
host_metadata:
|
37
|
+
userparameters:
|
38
|
+
```
|
39
|
+
|
40
|
+
### Userparameters
|
41
|
+
|
42
|
+
```ruby
|
43
|
+
include_recipe "zabbix"
|
44
|
+
|
45
|
+
zabbix_userparameters "all" do
|
46
|
+
path File.expand_path(File.dirname(__FILE__)) + "/zabbix/templates/etc/zabbix/zabbix_agentd.d/"
|
47
|
+
end
|
48
|
+
```
|
49
|
+
|
50
|
+
```yaml
|
51
|
+
zabbix:
|
52
|
+
userparameters:
|
53
|
+
- userparameter_hoge.conf.erb
|
54
|
+
- userparameter_piyo.conf.erb
|
55
|
+
```
|
56
|
+
|
57
|
+
## Contributing
|
58
|
+
|
59
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/itamae-plugin-recipe-zabbix.
|
data/Rakefile
ADDED
data/bin/console
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require "bundler/setup"
|
4
|
+
require "itamae/plugin/recipe/zabbix"
|
5
|
+
|
6
|
+
# You can add fixtures and/or initialization code here to make experimenting
|
7
|
+
# with your gem easier. You can also use a different console, if you like.
|
8
|
+
|
9
|
+
# (If you use this, don't forget to add pry to your Gemfile!)
|
10
|
+
# require "pry"
|
11
|
+
# Pry.start
|
12
|
+
|
13
|
+
require "irb"
|
14
|
+
IRB.start
|
data/bin/setup
ADDED
@@ -0,0 +1,24 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'itamae/plugin/recipe/zabbix/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "itamae-plugin-recipe-zabbix"
|
8
|
+
spec.version = Itamae::Plugin::Recipe::Zabbix::VERSION
|
9
|
+
spec.authors = ["zaru"]
|
10
|
+
spec.email = ["zarutofu@gmail.com"]
|
11
|
+
|
12
|
+
spec.summary = %q{Itamae plugin to install zabbix agent}
|
13
|
+
spec.description = %q{Itamae plugin to install zabbix agent}
|
14
|
+
spec.homepage = "https://github.com/zaru/itamae-plugin-recipe-zabbix"
|
15
|
+
|
16
|
+
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
17
|
+
spec.bindir = "exe"
|
18
|
+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
19
|
+
spec.require_paths = ["lib"]
|
20
|
+
|
21
|
+
spec.add_development_dependency "bundler", "~> 1.10"
|
22
|
+
spec.add_development_dependency "rake", "~> 10.0"
|
23
|
+
spec.add_development_dependency "rspec"
|
24
|
+
end
|
@@ -0,0 +1,30 @@
|
|
1
|
+
require "itamae/plugin/recipe/zabbix/version"
|
2
|
+
|
3
|
+
zabbix_version = 2.2 # or 1.8 ~ 2.4
|
4
|
+
zabbix_version = node[:zabbix][:version] if node[:zabbix][:version]
|
5
|
+
|
6
|
+
platform = "rhel" # or debian, ubuntu
|
7
|
+
platform = node[:zabbix][:platform] if node[:zabbix][:platform]
|
8
|
+
|
9
|
+
platform_version = "6"
|
10
|
+
platform_version = node[:zabbix][:platform_version] if node[:zabbix][:platform_version]
|
11
|
+
|
12
|
+
cpu = "x86_64" # or i386
|
13
|
+
cpu = node[:zabbix][:platform_cpu] if node[:zabbix][:platform_cpu]
|
14
|
+
|
15
|
+
package "http://repo.zabbix.com/zabbix/#{zabbix_version}/#{platform}/#{platform_version}/#{cpu}/zabbix-release-#{zabbix_version}-1.el#{platform_version}.noarch.rpm" do
|
16
|
+
not_if "rpm -q zabbix-release"
|
17
|
+
end
|
18
|
+
|
19
|
+
define :zabbix_userparameters, path: "" do
|
20
|
+
path = params[:path]
|
21
|
+
|
22
|
+
node[:zabbix][:userparameters].each do |f|
|
23
|
+
template "/etc/zabbix/zabbix_agentd.d/#{f}" do
|
24
|
+
owner "root"
|
25
|
+
group "root"
|
26
|
+
source path + "/#{f}"
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
%w( zabbix-agent ).each do |pkg|
|
2
|
+
package pkg
|
3
|
+
end
|
4
|
+
|
5
|
+
template "/etc/zabbix/zabbix_agentd.conf" do
|
6
|
+
owner "root"
|
7
|
+
group "root"
|
8
|
+
source "./templates/etc/zabbix/zabbix_agentd.conf.erb"
|
9
|
+
end
|
10
|
+
|
11
|
+
service 'zabbix-agent' do
|
12
|
+
action [:enable, :start]
|
13
|
+
end
|
14
|
+
|
15
|
+
service "zabbix-agent" do
|
16
|
+
subscribes :restart, "template[/etc/zabbix/zabbix_agentd.conf]"
|
17
|
+
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
PidFile=/var/run/zabbix/zabbix_agentd.pid
|
2
|
+
LogFile=/var/log/zabbix/zabbix_agentd.log
|
3
|
+
LogFileSize=0
|
4
|
+
EnableRemoteCommands=1
|
5
|
+
|
6
|
+
Server=<%= node[:zabbix][:server] %>
|
7
|
+
ListenPort=<%= node[:zabbix][:port] %>
|
8
|
+
ServerActive=<%= node[:zabbix][:server] %>
|
9
|
+
|
10
|
+
<% if node[:zabbix][:hostname] %>
|
11
|
+
Hostname=<%= node[:zabbix][:hostname] %>
|
12
|
+
<% else %>
|
13
|
+
HostnameItem=system.hostname
|
14
|
+
HostMetadata=<%= node[:zabbix][:host_metadata] %>
|
15
|
+
<% end %>
|
16
|
+
|
17
|
+
AllowRoot=1
|
18
|
+
Include=/etc/zabbix/zabbix_agentd.d/
|
metadata
ADDED
@@ -0,0 +1,98 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: itamae-plugin-recipe-zabbix
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- zaru
|
8
|
+
autorequire:
|
9
|
+
bindir: exe
|
10
|
+
cert_chain: []
|
11
|
+
date: 2015-10-28 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: bundler
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '1.10'
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '1.10'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rake
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '10.0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '10.0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rspec
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ">="
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
55
|
+
description: Itamae plugin to install zabbix agent
|
56
|
+
email:
|
57
|
+
- zarutofu@gmail.com
|
58
|
+
executables: []
|
59
|
+
extensions: []
|
60
|
+
extra_rdoc_files: []
|
61
|
+
files:
|
62
|
+
- ".gitignore"
|
63
|
+
- ".rspec"
|
64
|
+
- ".travis.yml"
|
65
|
+
- Gemfile
|
66
|
+
- README.md
|
67
|
+
- Rakefile
|
68
|
+
- bin/console
|
69
|
+
- bin/setup
|
70
|
+
- itamae-plugin-recipe-zabbix.gemspec
|
71
|
+
- lib/itamae/plugin/recipe/zabbix.rb
|
72
|
+
- lib/itamae/plugin/recipe/zabbix/agent.rb
|
73
|
+
- lib/itamae/plugin/recipe/zabbix/templates/etc/zabbix/zabbix_agentd.conf.erb
|
74
|
+
- lib/itamae/plugin/recipe/zabbix/version.rb
|
75
|
+
homepage: https://github.com/zaru/itamae-plugin-recipe-zabbix
|
76
|
+
licenses: []
|
77
|
+
metadata: {}
|
78
|
+
post_install_message:
|
79
|
+
rdoc_options: []
|
80
|
+
require_paths:
|
81
|
+
- lib
|
82
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
83
|
+
requirements:
|
84
|
+
- - ">="
|
85
|
+
- !ruby/object:Gem::Version
|
86
|
+
version: '0'
|
87
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
88
|
+
requirements:
|
89
|
+
- - ">="
|
90
|
+
- !ruby/object:Gem::Version
|
91
|
+
version: '0'
|
92
|
+
requirements: []
|
93
|
+
rubyforge_project:
|
94
|
+
rubygems_version: 2.4.5.1
|
95
|
+
signing_key:
|
96
|
+
specification_version: 4
|
97
|
+
summary: Itamae plugin to install zabbix agent
|
98
|
+
test_files: []
|