chef-syslog-handler 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- data/chef-syslog-handler.gemspec +41 -0
- data/lib/chef/syslog/version.rb +23 -0
- data/lib/syslog.rb +23 -0
- metadata +82 -0
@@ -0,0 +1,41 @@
|
|
1
|
+
#
|
2
|
+
# Author:: Paul Morton (<pmorton@biaprotect.com>)
|
3
|
+
#
|
4
|
+
# Copyright:: 2011, Business Intelligence Associates, Inc
|
5
|
+
#
|
6
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
7
|
+
# you may not use this file except in compliance with the License.
|
8
|
+
# You may obtain a copy of the License at
|
9
|
+
#
|
10
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
11
|
+
#
|
12
|
+
# Unless required by applicable law or agreed to in writing, software
|
13
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
14
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
15
|
+
# See the License for the specific language governing permissions and
|
16
|
+
# limitations under the License.
|
17
|
+
#
|
18
|
+
|
19
|
+
# -*- encoding: utf-8 -*-
|
20
|
+
$:.push File.expand_path("../lib", __FILE__)
|
21
|
+
require "chef/syslog/version"
|
22
|
+
|
23
|
+
Gem::Specification.new do |s|
|
24
|
+
s.name = "chef-syslog-handler"
|
25
|
+
s.version = Chef::SYSLOG::VERSION
|
26
|
+
s.authors = ["Paul Morton"]
|
27
|
+
s.email = ["pmorton@biaprotect.com"]
|
28
|
+
s.homepage = "https://github.com/pmorton/chef-syslog-handler"
|
29
|
+
s.summary = %q{Provides a Chef handler which reports run failures and changes to a syslog server.}
|
30
|
+
s.description = File.read("README.rdoc")
|
31
|
+
|
32
|
+
s.rubyforge_project = "chef-syslog-handler"
|
33
|
+
|
34
|
+
s.files = `git ls-files`.split("\n")
|
35
|
+
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
36
|
+
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
37
|
+
s.require_paths = ["lib"]
|
38
|
+
|
39
|
+
s.add_dependency "chef"
|
40
|
+
s.add_dependency "syslogger"
|
41
|
+
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
#
|
2
|
+
# Author:: Paul Morton (<pmorton@biaprotect.com>)
|
3
|
+
#
|
4
|
+
# Copyright:: 2011, Business Intelligence Associates, Inc
|
5
|
+
#
|
6
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
7
|
+
# you may not use this file except in compliance with the License.
|
8
|
+
# You may obtain a copy of the License at
|
9
|
+
#
|
10
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
11
|
+
#
|
12
|
+
# Unless required by applicable law or agreed to in writing, software
|
13
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
14
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
15
|
+
# See the License for the specific language governing permissions and
|
16
|
+
# limitations under the License.
|
17
|
+
#
|
18
|
+
|
19
|
+
class Chef
|
20
|
+
module SYSLOG
|
21
|
+
VERSION="1.0.0"
|
22
|
+
end
|
23
|
+
end
|
data/lib/syslog.rb
ADDED
@@ -0,0 +1,23 @@
|
|
1
|
+
require 'syslogger'
|
2
|
+
|
3
|
+
class Chef
|
4
|
+
|
5
|
+
module SYSLOG
|
6
|
+
class Handler < Chef::Handler
|
7
|
+
def initalize(server, port)
|
8
|
+
@server = server
|
9
|
+
@port = port
|
10
|
+
end
|
11
|
+
|
12
|
+
def report
|
13
|
+
if run_status.failed?
|
14
|
+
|
15
|
+
logger = Syslogger.new("chef", Syslog::LOG_PID, Syslog::LOG_LOCAL7)
|
16
|
+
logger.level = Logger::INFO
|
17
|
+
|
18
|
+
logger.fatal formatted_exception
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
metadata
ADDED
@@ -0,0 +1,82 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: chef-syslog-handler
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
prerelease:
|
5
|
+
version: 1.0.0
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- Paul Morton
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
|
13
|
+
date: 2011-08-19 00:00:00 -07:00
|
14
|
+
default_executable:
|
15
|
+
dependencies:
|
16
|
+
- !ruby/object:Gem::Dependency
|
17
|
+
name: chef
|
18
|
+
prerelease: false
|
19
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
20
|
+
none: false
|
21
|
+
requirements:
|
22
|
+
- - ">="
|
23
|
+
- !ruby/object:Gem::Version
|
24
|
+
version: "0"
|
25
|
+
type: :runtime
|
26
|
+
version_requirements: *id001
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: syslogger
|
29
|
+
prerelease: false
|
30
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
31
|
+
none: false
|
32
|
+
requirements:
|
33
|
+
- - ">="
|
34
|
+
- !ruby/object:Gem::Version
|
35
|
+
version: "0"
|
36
|
+
type: :runtime
|
37
|
+
version_requirements: *id002
|
38
|
+
description: |
|
39
|
+
Chef handler to send syslog messages
|
40
|
+
|
41
|
+
email:
|
42
|
+
- pmorton@biaprotect.com
|
43
|
+
executables: []
|
44
|
+
|
45
|
+
extensions: []
|
46
|
+
|
47
|
+
extra_rdoc_files: []
|
48
|
+
|
49
|
+
files:
|
50
|
+
- chef-syslog-handler.gemspec
|
51
|
+
- lib/chef/syslog/version.rb
|
52
|
+
- lib/syslog.rb
|
53
|
+
has_rdoc: true
|
54
|
+
homepage: https://github.com/pmorton/chef-syslog-handler
|
55
|
+
licenses: []
|
56
|
+
|
57
|
+
post_install_message:
|
58
|
+
rdoc_options: []
|
59
|
+
|
60
|
+
require_paths:
|
61
|
+
- lib
|
62
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
63
|
+
none: false
|
64
|
+
requirements:
|
65
|
+
- - ">="
|
66
|
+
- !ruby/object:Gem::Version
|
67
|
+
version: "0"
|
68
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
69
|
+
none: false
|
70
|
+
requirements:
|
71
|
+
- - ">="
|
72
|
+
- !ruby/object:Gem::Version
|
73
|
+
version: "0"
|
74
|
+
requirements: []
|
75
|
+
|
76
|
+
rubyforge_project: chef-syslog-handler
|
77
|
+
rubygems_version: 1.6.2
|
78
|
+
signing_key:
|
79
|
+
specification_version: 3
|
80
|
+
summary: Provides a Chef handler which reports run failures and changes to a syslog server.
|
81
|
+
test_files: []
|
82
|
+
|