Skip to content

Commit

Permalink
Merge pull request #70 from puppetlabs-seteam/maju6406sensu
Browse files Browse the repository at this point in the history
Adding optional sensu monitoring to tse-control repo
  • Loading branch information
maju6406 authored May 23, 2018
2 parents f48c4bf + 078c56a commit 8b73289
Show file tree
Hide file tree
Showing 29 changed files with 756 additions and 44 deletions.
3 changes: 2 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,13 @@ gem 'rubocop-rspec'
gem 'rest-client'
gem 'facter', '2.4.6'
gem 'r10k', '>= 2.5.5'
gem 'hiera-eyaml', '~> 2.1'

group :development, :unit_tests do
gem 'metadata-json-lint'
gem 'rspec-puppet-facts', :git => 'https://github.com/mcanevet/rspec-puppet-facts.git',
:ref => 'fe21de12108fbab0123bdc4db2365a29ea62f171'
gem 'puppet-blacksmith', '>= 3.4.0'
gem 'puppet-blacksmith', '>= 4.1.2'
gem 'simplecov'
gem 'simplecov-console'
gem 'rspec-puppet', :git => 'https://github.com/rodjek/rspec-puppet.git',
Expand Down
28 changes: 17 additions & 11 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ GEM
docker-api (1.33.6)
excon (>= 0.38.0)
json
domain_name (0.5.20170404)
domain_name (0.5.20180417)
unf (>= 0.0.5, < 1.0.0)
excon (0.59.0)
facter (2.4.6)
Expand Down Expand Up @@ -296,6 +296,10 @@ GEM
os (~> 0.9)
signet (~> 0.7)
hiera (3.4.2)
hiera-eyaml (2.1.0)
highline (~> 1.6.19)
trollop (~> 2.0)
highline (1.6.21)
hirb (0.7.3)
hocon (1.2.5)
http-cookie (1.0.3)
Expand Down Expand Up @@ -331,7 +335,9 @@ GEM
json-schema (~> 2.8)
spdx-licenses (~> 1.0)
method_source (0.9.0)
mime-types (2.99.3)
mime-types (3.1)
mime-types-data (~> 3.2015)
mime-types-data (3.2016.0521)
mini_portile2 (2.3.0)
minitar (0.6.1)
minitest (5.10.3)
Expand Down Expand Up @@ -378,9 +384,8 @@ GEM
hiera (>= 2.0, < 4)
json_pure (~> 1.8)
locale (~> 2.1)
puppet-blacksmith (3.4.0)
puppet (>= 2.7.16)
rest-client (~> 1.8.0)
puppet-blacksmith (4.1.2)
rest-client (~> 2.0)
puppet-lint (2.3.3)
puppet-syntax (2.4.1)
rake
Expand Down Expand Up @@ -422,10 +427,10 @@ GEM
declarative (< 0.1.0)
declarative-option (< 0.2.0)
uber (< 0.2.0)
rest-client (1.8.0)
rest-client (2.0.2)
http-cookie (>= 1.0.2, < 2.0)
mime-types (>= 1.16, < 3.0)
netrc (~> 0.7)
mime-types (>= 1.16, < 4.0)
netrc (~> 0.8)
retriable (3.1.1)
rspec (3.6.0)
rspec-core (~> 3.6.0)
Expand Down Expand Up @@ -498,7 +503,7 @@ GEM
uber (0.1.0)
unf (0.1.4)
unf_ext
unf_ext (0.0.7.4)
unf_ext (0.0.7.5)
unicode-display_width (1.3.0)
xml-simple (1.1.5)

Expand All @@ -512,11 +517,12 @@ DEPENDENCIES
beaker-puppet_install_helper
beaker-rspec
facter (= 2.4.6)
hiera-eyaml (~> 2.1)
master_manipulator
metadata-json-lint
parallel_tests
puppet (< 5.0.0)
puppet-blacksmith (>= 3.4.0)
puppet-blacksmith (>= 4.1.2)
puppet-syntax (>= 2.4.0)
puppetlabs_spec_helper
r10k (>= 2.5.5)
Expand All @@ -532,4 +538,4 @@ DEPENDENCIES
simplecov-console

BUNDLED WITH
1.15.1
1.16.1
14 changes: 11 additions & 3 deletions Puppetfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ mod 'puppetlabs/exec', '0.1.0'
mod 'puppetlabs-resource', '0.1.0'
mod 'puppetlabs-service', '0.1.3'
mod 'puppetlabs/inifile', '1.6.0'
mod "puppetlabs/stdlib", '4.17.0'
mod "puppetlabs/stdlib", '4.25.1'
mod 'puppetlabs-ciscopuppet', '1.7.0'
mod "puppetlabs/concat", '4.0.0'
mod 'puppetlabs-acl', '2.0.1'
Expand Down Expand Up @@ -38,13 +38,14 @@ mod 'puppetlabs-apt', '4.1.0'
mod 'puppetlabs-facter_task', '0.1.3'
mod 'puppetlabs-docker', '1.0.1'
mod 'puppetlabs-transition', '0.1.1'
mod 'puppetlabs-gcc', '0.3.0'
mod 'puppetlabs-distelli_agent', '0.1.0'
mod 'maestrodev-wget', '1.7.3'

# Forge Community Modules
mod 'jfryman-selinux', '0.4.0'
mod 'ghoneycutt-ssh', '3.52.0'
mod 'puppet-archive', '2.0.0'
mod 'puppet-archive', '3.0.0'
mod 'trlinkin/domain_membership', '1.1.2'
mod 'ipcrm/echo', '0.1.3'
mod 'stahnma/epel', '1.3.0'
Expand All @@ -56,7 +57,7 @@ mod 'WhatsARanjit/node_manager', '0.4.2'
mod 'cyberious/pget', '1.1.0'
mod 'lwf/remote_file', '1.1.3'
mod 'ajjahn/samba', '0.5.0'
mod 'puppet-staging', '2.2.0'
mod 'puppet-staging', '3.2.0'
mod 'ayohrling-local_security_policy', '0.6.1'
mod 'thias-sysctl', '1.0.6'
mod 'reidmv/unzip', '0.1.2'
Expand Down Expand Up @@ -84,6 +85,13 @@ mod 'nexcess-auditd', '2.0.0'
mod 'jdowning-rbenv', '2.2.0'
mod 'puppet-windows_env', '2.3.0'
mod 'camptocamp-systemd', '1.1.0'
mod 'sensu-sensu', '2.52.0'
mod 'puppet-rabbitmq', '8.2.2'
mod 'arioch-redis', '3.1.0'
mod 'yelp-uchiwa', '2.0.0'
mod 'computology-packagecloud', '0.3.2'
mod 'herculesteam-augeasproviders_core', '2.1.4'
mod 'herculesteam-augeasproviders_sysctl', '2.2.0'

mod 'tse-tse_facts',
:git => 'https://github.com/puppetlabs/tse-module-tse_facts.git'
Expand Down
62 changes: 62 additions & 0 deletions data/common.yaml
Original file line number Diff line number Diff line change
@@ -1,2 +1,64 @@
---
puppet_enterprise::profile::master::check_for_updates: false

# flag for enabling general sensu monitoring for the node
profile::platform::baseline::enable_monitoring: false

# flag for enabling webserver monitoring via sensu
profile::app::sample_website::linux::enable_monitoring: false
profile::app::sample_website::windows::enable_monitoring: false

profile::app::redis::bind: '127.0.0.1'

profile::app::sensu::server::rabbitmq_host: '127.0.0.1'
profile::app::sensu::server::rabbitmq_user: 'admin'
profile::app::sensu::server::rabbitmq_password: 'puppetlabs'
profile::app::sensu::server::rabbitmq_vhost: '/sensu'
profile::app::sensu::server::subscriptions:
- "all"
- "sensu-server"
- "%{::kernel}"

profile::app::sensu::client::rabbitmq_host: 'sensu-server.pdx.puppet.vm'
profile::app::sensu::client::rabbitmq_user: "%{alias('profile::app::sensu::server::rabbitmq_user')}"
profile::app::sensu::client::rabbitmq_password: "%{alias('profile::app::sensu::server::rabbitmq_password')}"
profile::app::sensu::client::rabbitmq_vhost: "%{alias('profile::app::sensu::server::rabbitmq_vhost')}"
profile::app::sensu::client::subscriptions:
- "all"
- "%{::kernel}"

profile::app::sensu::handlers::mailer_from: '[email protected]'
profile::app::sensu::handlers::mailer_to:
- '[email protected]'

profile::app::sensu::handlers::hipchat_url: 'https://api.hipchat.com'
profile::app::sensu::handlers::hipchat_apikey: 'tb1mz4vQR0SGBlrAdaUkOOzWE9aFqCChHhTwISqh'
profile::app::sensu::handlers::hipchat_room: 'seteam notification sandbox'
profile::app::sensu::handlers::hipchat_from: 'beersy'
profile::app::sensu::handlers::hipchat_message_template: |
<%=
[
"<b>Sensu:</b> #{@event['client']['name']} ",
@event["action"].eql?("resolve") ? "RESOLVED" : "ALERT",
"<br><b>event</b> - [#{event_name}]<br>",
"<b>command</b>: #{@event['check']['command']}<br>",
"<b>occurrences</b>: #{@event['occurrences']}<br><b>Output:</b>",
@event["check"]["notification"] || @event["check"]["output"],
"<br>",
playbook,
].join
%>

profile::app::sensu::plugins::plugin_list:
- 'sensu-plugins-http'
- 'sensu-plugins-rabbitmq'
- 'sensu-plugins-redis'
- 'sensu-plugins-disk-checks'
- 'sensu-plugins-load-checks'
- 'sensu-plugins-memory-checks'
- 'sensu-plugins-process-checks'
- 'sensu-plugins-hardware'
- 'sensu-plugins-ntp'
- 'sensu-plugins-mailer'
- 'sensu-plugins-dns'
- 'sensu-plugins-hipchat'
91 changes: 68 additions & 23 deletions site/profile/files/app/sample_website/css/main.css
Original file line number Diff line number Diff line change
@@ -1,23 +1,68 @@
body {
margin-top: 200px;
margin-left: 60px;
width: 70%;
font-family: 'Helvetica', 'Arial', 'Sans-Serif';
background:black url(../img/logo.png) no-repeat left top;
}

a { text-decoration: none; color: #999; }
a:hover { text-decoration: underline; }

p, ul { font-size: 1.5em; line-height: 0.5em; color: #fff; }

h1, h2, h3, h4 { color: #ffad1a }
h1 { font-size: 2em; }
h2 { font-size: 1.7em; }
h3 { font-size: 1.5em; }
h4 { font-size: 1.3em; }

nav ul, footer ul { padding: 0px; list-style: none; font-weight: bold; }
nav ul li, footer ul li { display: inline; margin-right: 20px; }

footer { border-top: 1px solid #d5d5d5; font-size: .8em; }
body {
margin-top: 200px;
margin-left: 60px;
width: 70%;
font-family: 'Helvetica', 'Arial', 'Sans-Serif';
background: black url(../img/logo.png) no-repeat left top;
}

a {
text-decoration: none;
color: #999;
}

a:hover {
text-decoration: underline;
}

p,
ul {
font-size: 1.5em;
line-height: 0.5em;
color: #fff;
}

h1,
h2,
h3,
h4 {
color: #ffad1a
}

h1.error {
color: #ff0000;
}

h1 {
font-size: 2em;
}

h2 {
font-size: 1.7em;
}

h3 {
font-size: 1.5em;
}

h4 {
font-size: 1.3em;
}

nav ul,
footer ul {
padding: 0px;
list-style: none;
font-weight: bold;
}

nav ul li,
footer ul li {
display: inline;
margin-right: 20px;
}

footer {
border-top: 1px solid #d5d5d5;
font-size: .8em;
}
35 changes: 35 additions & 0 deletions site/profile/manifests/app/rabbitmq.pp
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# install rabbitmq
class profile::app::rabbitmq {

include packagecloud
packagecloud::repo { 'rabbitmq/rabbitmq-server':
type => 'rpm',
require => Class['packagecloud']
}

packagecloud::repo { 'rabbitmq/erlang':
type => 'rpm',
require => Class['packagecloud']
}

class { 'rabbitmq':
package_ensure => 'latest',
repos_ensure => true,
require => [
Class['packagecloud'],
Package['erlang'],
],
}

package { 'erlang':
ensure => 'latest',
require => Packagecloud::Repo['rabbitmq/erlang']
}

firewall { '5672 allow rabbitmq access':
dport => '5672',
proto => tcp,
action => accept,
}

}
16 changes: 16 additions & 0 deletions site/profile/manifests/app/redis.pp
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# install redis
class profile::app::redis (
String $bind,
){
require epel
class { 'redis':
bind => $bind,
require => Class['::epel']
}

firewall { '6379 allow redis access':
dport => '6379',
proto => tcp,
action => accept,
}
}
Loading

0 comments on commit 8b73289

Please sign in to comment.