Skip to content
This repository has been archived by the owner on Jul 11, 2020. It is now read-only.

Commit

Permalink
Run check_ntp_time
Browse files Browse the repository at this point in the history
Sam Kottler committed Jun 19, 2014
1 parent 322754a commit 1014216
Showing 3 changed files with 26 additions and 18 deletions.
2 changes: 1 addition & 1 deletion Berksfile.lock
Original file line number Diff line number Diff line change
@@ -216,7 +216,7 @@ GRAPH
rubygems-repo (0.0.6)
aptly (>= 0.0.0)
rubygems (>= 0.0.0)
rubygems-sensu (0.0.39)
rubygems-sensu (0.0.40)
chef-vault (>= 0.0.0)
sensu (>= 0.0.0)
rubygems-ssh (0.0.3)
2 changes: 1 addition & 1 deletion cookbooks/rubygems-sensu/metadata.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name 'rubygems-sensu'
maintainer 'RubyGems.org ops team'

version '0.0.39'
version '0.0.40'

depends 'chef-vault'
depends 'sensu'
40 changes: 24 additions & 16 deletions cookbooks/rubygems-sensu/recipes/base.rb
Original file line number Diff line number Diff line change
@@ -1,40 +1,48 @@
gem_package "sensu-plugin" do
gem_binary "/opt/sensu/embedded/bin/gem"
gem_package 'sensu-plugin' do
gem_binary '/opt/sensu/embedded/bin/gem'
end

package "nagios-plugins"
package 'nagios-plugins'

%w{ check-procs.rb }.each do |plugin|
cookbook_file "/etc/sensu/plugins/#{plugin}" do
source plugin
path "/etc/sensu/plugins/#{plugin}"
owner "sensu"
group "sensu"
mode "0755"
owner 'sensu'
group 'sensu'
mode '0755'
action :create
end
end

sensu_check "check_procs" do
command "/opt/sensu/embedded/bin/ruby /etc/sensu/plugins/check-procs.rb"
handlers ["default", "slack"]
subscribers ["all"]
sensu_check 'check_procs' do
command '/opt/sensu/embedded/bin/ruby /etc/sensu/plugins/check-procs.rb'
handlers ['default', 'slack']
subscribers ['all']
interval 30
additional(:notification => 'There is a high number of procs running', :occurences => 3)
end

sensu_check "check_ssh" do
command "/usr/lib/nagios/plugins/check_ssh localhost"
handlers ["default", "slack"]
subscribers ["all"]
sensu_check 'check_ssh' do
command '/usr/lib/nagios/plugins/check_ssh localhost'
handlers ['default', 'slack']
subscribers ['all']
interval 30
additional(:notification => 'sshd is not running', :occurences => 3)
end

sensu_check "check_apt" do
command "/usr/lib/nagios/plugins/check_apt"
sensu_check 'check_apt' do
command '/usr/lib/nagios/plugins/check_apt'
handlers ['default', 'slack']
subscribers ['all']
interval 60
additional(:notification => 'There are pending package upgrades', :occurences => 3)
end

sensu_check 'check_ntp_time' do
command '/usr/lib/nagios/plugins/check_ntp_time -H localhost'
handlers ['default', 'slack']
subscribers ['all']
interval 30
additional(:notification => 'NTP is out of sync', :occurences => 3)
end

0 comments on commit 1014216

Please sign in to comment.