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

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: rubygems/rubygems-chef
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 98e1249251e0
Choose a base ref
...
head repository: rubygems/rubygems-chef
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 85a284dadc73
Choose a head ref
  • 4 commits
  • 13 files changed
  • 1 contributor

Commits on Mar 7, 2015

  1. new apt check script

    dwradcliffe committed Mar 7, 2015
    Copy the full SHA
    30da4e3 View commit details
  2. remove extra blank line

    dwradcliffe committed Mar 7, 2015
    Copy the full SHA
    a1236cb View commit details
  3. add missing depends

    dwradcliffe committed Mar 7, 2015
    Copy the full SHA
    d52a332 View commit details
  4. fix foodcritic errors

    dwradcliffe committed Mar 7, 2015
    Copy the full SHA
    85a284d View commit details
2 changes: 1 addition & 1 deletion Berksfile.lock
Original file line number Diff line number Diff line change
@@ -325,7 +325,7 @@ GRAPH
nginx (>= 0.0.0)
rubygems (>= 0.0.0)
rubygems-ruby (0.0.4)
rubygems-sensu (0.1.18)
rubygems-sensu (0.1.20)
build-essential (>= 0.0.0)
chef-vault (>= 0.0.0)
cpan (>= 0.0.0)
1 change: 1 addition & 0 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -14,6 +14,7 @@ FoodCritic::Rake::LintTask.new(:foodcritic) do |t|
tags: [
'~FC003',
'~FC011',
'~FC015',
'~FC017'
]
}
1 change: 1 addition & 0 deletions cookbooks/rubygems-app/metadata.rb
Original file line number Diff line number Diff line change
@@ -9,6 +9,7 @@
depends 'nodejs'
depends 'postfix', '3.2.0'
depends 'rubygems'
depends 'rubygems-metrics'
depends 'rubygems-ruby'
depends 'runit'
depends 'unicorn'
1 change: 1 addition & 0 deletions cookbooks/rubygems-balancer/metadata.rb
Original file line number Diff line number Diff line change
@@ -6,3 +6,4 @@
depends 'logrotate'
depends 'nginx'
depends 'rubygems'
depends 'rubygems-metrics'
65 changes: 0 additions & 65 deletions cookbooks/rubygems-doorman/definitions/doorman.rb

This file was deleted.

2 changes: 2 additions & 0 deletions cookbooks/rubygems-monitoring/metadata.rb
Original file line number Diff line number Diff line change
@@ -7,7 +7,9 @@
depends 'cpan'
depends 'dnsimple'
depends 'nginx'
depends 'nodejs'
depends 'rubygems'
depends 'rubygems-sensu'
depends 'runit'

supports 'ubuntu'
1 change: 1 addition & 0 deletions cookbooks/rubygems-redis/metadata.rb
Original file line number Diff line number Diff line change
@@ -7,6 +7,7 @@
depends 'redisio'
depends 'rubygems'
depends 'rubygems-backups'
depends 'rubygems-metrics'
depends 'sysctl'

supports 'ubuntu'
2 changes: 2 additions & 0 deletions cookbooks/rubygems-ruby/metadata.rb
Original file line number Diff line number Diff line change
@@ -2,4 +2,6 @@

version '0.0.4'

depends 'apt'

supports 'ubuntu', '= 14.04'
38 changes: 38 additions & 0 deletions cookbooks/rubygems-sensu/files/default/check_apt.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#!/bin/sh

# Standard Nagios plugin return codes.
STATUS_OK=0
STATUS_WARNING=1
STATUS_CRITICAL=2
STATUS_UNKNOWN=3

# Query pending updates.
updates=$(/usr/lib/update-notifier/apt-check 2>&1)
if [ $? -ne 0 ]; then
echo "Querying pending updates failed."
exit $STATUS_UNKNOWN
fi

# Check for the case where there are no updates.
if [ "$updates" = "0;0" ]; then
echo "All packages are up-to-date."
exit $STATUS_OK
fi;

security=$(echo "$updates" | cut -d ";" -f 2)
pending=$(echo "$updates" | cut -d ";" -f 1)

echo "$security security update(s) pending. $pending non-security update(s) pending."

if [ "$security" != "0" ]; then
exit $STATUS_CRITICAL
fi

if [ "$pending" != "0" ]; then
exit $STATUS_WARNING
fi

# If we've gotten here, we did something wrong since our "0;0" check should have
# matched at the very least.
echo "Script failed, manual intervention required."
exit $STATUS_UNKNOWN
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.1.18'
version '0.1.20'

depends 'build-essential'
depends 'chef-vault'
4 changes: 2 additions & 2 deletions cookbooks/rubygems-sensu/recipes/base.rb
Original file line number Diff line number Diff line change
@@ -36,11 +36,11 @@
end

sensu_check 'check_apt' do
command '/usr/lib/nagios/plugins/check_apt'
command '/etc/sensu/plugins/check_apt.sh'
handlers ['slack']
subscribers ['all']
interval 60
additional(notification: 'There are pending package upgrades', occurrences: 3)
additional(occurrences: 2)
end

sensu_check 'check_ntp_time' do
2 changes: 1 addition & 1 deletion cookbooks/rubygems-sensu/recipes/default.rb
Original file line number Diff line number Diff line change
@@ -34,7 +34,7 @@

package 'postgresql-client'

%w( check-procs.rb check_postgres.pl check_memcached.pl ).each do |plugin|
%w( check-procs.rb check_postgres.pl check_memcached.pl check_apt.sh ).each do |plugin|
cookbook_file "/etc/sensu/plugins/#{plugin}" do
source plugin
path "/etc/sensu/plugins/#{plugin}"
1 change: 0 additions & 1 deletion cookbooks/rubygems-utility/recipes/default.rb
Original file line number Diff line number Diff line change
@@ -12,4 +12,3 @@
packages.each do |pkg|
package pkg
end