Skip to content

Commit 3b5c1c4

Browse files
author
Matt Jones
committed
update repo
1 parent 5f8f6e3 commit 3b5c1c4

8 files changed

+28
-23
lines changed

.travis.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,15 @@ notifications:
1616
on_failure: always
1717
script:
1818
- bundle exec rake default
19+
- gem build sensu-plugins-postgres.gemspec
20+
- gem install sensu-plugins-postgres-*.gem
1921
deploy:
2022
provider: rubygems
2123
api_key:
22-
secure: CEl8sMqHZhUSekhiGoePkcbTl7vKt4aufE10TWKFX9aCL7eUyqzDX7K1desQeP27ZjXflF876/LgvsSDhOeifdIaolBSpSXu/9e6YuCDdGWInAcSKjBK8lYTpfQqF2NGqOapJce+v+mAkNiLiMmTZUN8YL8XO4ziPmuoMeW2NBg=
24+
secure: L3ot3q90Sz+1dhi1Lxg4rvxZ0AEUCq2dL55Gzau48wou72T3GYSDBoqVGnZPmQcS9miNy4J7NZMxUgfoycnceqUkkue8+ss4c42NtrYs+SLU+rnmB/cwLTBQJ1ERRNXqgOYTwWt8EuIy6Dong1oCu8voFSj7NH4sXxTTO7RFho8=
2325
gem: sensu-plugins-postgres
2426
on:
25-
tags: true
27+
ags: true
2628
all_branches: true
2729
rvm: 1.9.3
2830
rvm: 2.0

CHANGELOG.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,20 @@ This CHANGELOG follows the format listed at [Keep A Changelog](http://keepachang
3030
- updated sensu-plugin gem to 1.2.0
3131

3232
## [0.0.2] - 2015-06-03
33-
3433
### Fixed
3534
- added binstubs
3635

3736
### Changed
3837
- removed cruft from /lib
3938

4039
## 0.0.1 - 2015-04-30
41-
4240
### Added
4341
- initial release
42+
43+
[Unreleased]: https://github.com/sensu-plugins/sensu-plugins-postgres/compare/0.0.7...HEAD
44+
[0.0.7]: https://github.com/sensu-plugins/sensu-plugins-postgres/compare/0.0.6...0.0.7
45+
[0.0.6]: https://github.com/sensu-plugins/sensu-plugins-postgres/compare/0.0.5...0.0.6
46+
[0.0.5]: https://github.com/sensu-plugins/sensu-plugins-postgres/compare/0.0.4...0.0.5
47+
[0.0.4]: https://github.com/sensu-plugins/sensu-plugins-postgres/compare/0.0.3...0.0.4
48+
[0.0.3]: https://github.com/sensu-plugins/sensu-plugins-postgres/compare/0.0.2...0.0.3
49+
[0.0.2]: https://github.com/sensu-plugins/sensu-plugins-postgres/compare/0.0.1...0.0.2

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
[![Code Climate](https://codeclimate.com/github/sensu-plugins/sensu-plugins-postgres/badges/gpa.svg)](https://codeclimate.com/github/sensu-plugins/sensu-plugins-postgres)
66
[![Test Coverage](https://codeclimate.com/github/sensu-plugins/sensu-plugins-postgres/badges/coverage.svg)](https://codeclimate.com/github/sensu-plugins/sensu-plugins-postgres)
77
[![Dependency Status](https://gemnasium.com/sensu-plugins/sensu-plugins-postgres.svg)](https://gemnasium.com/sensu-plugins/sensu-plugins-postgres)
8-
[![Codeship Status for sensu-plugins/sensu-plugins-postgres](https://codeship.com/projects/985aceb0-e89b-0132-adeb-62885e5c211b/status?branch=master)](https://codeship.com/projects/82843)
98

109
## Functionality
1110

Rakefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ end
3434

3535
desc 'Test for binstubs'
3636
task :check_binstubs do
37-
bin_list = Gem::Specification.load('sensu-plugins-ansible.gemspec').executables
37+
bin_list = Gem::Specification.load('sensu-plugins-postgres.gemspec').executables
3838
bin_list.each do |b|
3939
`which #{ b }`
4040
unless $CHILD_STATUS.success?

bin/check-postgres-query.rb

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -91,16 +91,16 @@ class CheckPostgresQuery < Sensu::Plugin::Check::CLI
9191
def run
9292
begin
9393
con = PG::Connection.new(config[:hostname], config[:port], nil, nil, config[:db], config[:user], config[:password])
94-
res = con.exec("#{config[:query]}")
94+
res = con.exec(config[:query].to_s)
9595
rescue PG::Error => e
9696
unknown "Unable to query PostgreSQL: #{e.message}"
9797
end
9898

99-
if config[:check_tuples]
100-
value = res.ntuples
101-
else
102-
value = res.first.values.first.to_f
103-
end
99+
value = if config[:check_tuples]
100+
res.ntuples
101+
else
102+
res.first.values.first.to_f
103+
end
104104

105105
calc = Dentaku::Calculator.new
106106
if config[:critical] && calc.evaluate(config[:critical], value: value)

bin/metric-postgres-graphite.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ def lag_compute(res1, res, m_segbytes) # rubocop:disable NestedMethodDefinition
9797

9898
# Compute lag
9999
lag = lag_compute(res1, res, m_segbytes)
100-
output "#{config[:scheme]}", lag
100+
output config[:scheme].to_s, lag
101101

102102
ok
103103
end

bin/metrics-postgres-query.rb

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -81,16 +81,16 @@ class MetricsPostgresQuery < Sensu::Plugin::Metric::CLI::Graphite
8181
def run
8282
begin
8383
con = PG::Connection.new(config[:hostname], config[:port], nil, nil, config[:db], config[:user], config[:password])
84-
res = con.exec("#{config[:query]}")
84+
res = con.exec(config[:query].to_s)
8585
rescue PG::Error => e
8686
unknown "Unable to query PostgreSQL: #{e.message}"
8787
end
8888

89-
if config[:check_tuples]
90-
value = res.ntuples
91-
else
92-
value = res.first.values.first
93-
end
89+
value = if config[:check_tuples]
90+
res.ntuples
91+
else
92+
res.first.values.first
93+
end
9494

9595
output config[:scheme], value
9696
ok

sensu-plugins-postgres.gemspec

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,9 @@ else
99
require_relative 'lib/sensu-plugins-postgres'
1010
end
1111

12-
#pvt_key = '~/.ssh/gem-private_key.pem'
13-
1412
Gem::Specification.new do |s|
1513
s.authors = ['Sensu-Plugins and contributors']
16-
#s.cert_chain = ['certs/sensu-plugins.pem']
14+
1715
s.date = Date.today.to_s
1816
s.description = 'This plugin provides native PostgreSQL
1917
instrumentation for monitoring and metrics
@@ -37,7 +35,7 @@ Gem::Specification.new do |s|
3735
s.post_install_message = 'You can use the embedded Ruby by setting EMBEDDED_RUBY=true in /etc/default/sensu'
3836
s.require_paths = ['lib']
3937
s.required_ruby_version = '>= 1.9.3'
40-
#s.signing_key = File.expand_path(pvt_key) if $PROGRAM_NAME =~ /gem\z/
38+
4139
s.summary = 'Sensu plugins for postgres'
4240
s.test_files = s.files.grep(%r{^(test|spec|features)/})
4341
s.version = SensuPluginsPostgres::Version::VER_STRING

0 commit comments

Comments
 (0)