sensu-plugins-postgres 1.4.1 → 1.4.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -1
- data/bin/metric-postgres-locks.rb +4 -4
- data/lib/sensu-plugins-postgres/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e9eb754d56e7a8ade27af0fb36aeb08d0f3633e9
|
4
|
+
data.tar.gz: ad88363188072fcb94db781a5572d52f6cb50b84
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: affc3257c83dff3ec5c102329e999e3d8a3c61f0ca15fac497d79507683d91cb163103970d90a985602bb9f277cee18bc2ed24679b51b529ff26dfc062413899
|
7
|
+
data.tar.gz: 4ec0f25b880fbd08427d4d55b508611b12ae7a6fd27922045c3fe2bfbf062a115639db3f05f38c7c3890c594351beba08447d271e979827ef1066ecdeee0dabf
|
data/CHANGELOG.md
CHANGED
@@ -5,6 +5,10 @@ This CHANGELOG follows the format listed [here](https://github.com/sensu-plugins
|
|
5
5
|
|
6
6
|
## [Unreleased]
|
7
7
|
|
8
|
+
## [1.4.2] - 2017-09-27
|
9
|
+
### Fixed
|
10
|
+
- metric-postgres-locks.rb: Fix lock count collection (@madboxkr)
|
11
|
+
|
8
12
|
## [1.4.1] - 2017-09-26
|
9
13
|
### Fixed
|
10
14
|
- metrics-postgres-query.rb: Add a nil check to avoid failure when the query result is empty (@eheydrick)
|
@@ -118,7 +122,8 @@ This CHANGELOG follows the format listed [here](https://github.com/sensu-plugins
|
|
118
122
|
### Added
|
119
123
|
- initial release
|
120
124
|
|
121
|
-
[Unreleased]: https://github.com/sensu-plugins/sensu-plugins-postgres/compare/1.4.
|
125
|
+
[Unreleased]: https://github.com/sensu-plugins/sensu-plugins-postgres/compare/1.4.2...HEAD
|
126
|
+
[1.4.2]: https://github.com/sensu-plugins/sensu-plugins-postgres/compare/1.4.1...1.4.2
|
122
127
|
[1.4.1]: https://github.com/sensu-plugins/sensu-plugins-postgres/compare/1.4.0...1.4.1
|
123
128
|
[1.4.0]: https://github.com/sensu-plugins/sensu-plugins-postgres/compare/1.3.0...1.4.0
|
124
129
|
[1.3.0]: https://github.com/sensu-plugins/sensu-plugins-postgres/compare/1.2.0...1.3.0
|
@@ -90,15 +90,15 @@ class PostgresStatsDBMetrics < Sensu::Plugin::Metric::CLI::Graphite
|
|
90
90
|
port: config[:port],
|
91
91
|
connect_timeout: config[:timeout])
|
92
92
|
request = [
|
93
|
-
'SELECT mode, count(mode) FROM pg_locks',
|
94
|
-
"
|
95
|
-
'
|
93
|
+
'SELECT mode, count(mode) AS count FROM pg_locks',
|
94
|
+
"WHERE database = (SELECT oid FROM pg_database WHERE datname = '#{config[:database]}')",
|
95
|
+
'GROUP BY mode'
|
96
96
|
]
|
97
97
|
|
98
98
|
con.exec(request.join(' ')) do |result|
|
99
99
|
result.each do |row|
|
100
100
|
lock_name = row['mode'].downcase.to_sym
|
101
|
-
locks_per_type[lock_name]
|
101
|
+
locks_per_type[lock_name] = row['count']
|
102
102
|
end
|
103
103
|
end
|
104
104
|
|