sensu-plugins-postgres 2.1.0 → 2.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +7 -1
- data/bin/metric-postgres-statsbgwriter.rb +5 -1
- data/bin/metric-postgres-statsdb.rb +5 -13
- data/lib/sensu-plugins-postgres/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 53dd0ab010a9c794e9bc8749de4f984f970efd0d6d0854cb9fa6ab4a2652da6e
|
4
|
+
data.tar.gz: 254c3bc144d8020e86b55fc34bc5384d38c5ca106f2fead8d2e845b90e022ed8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6a02b4954a670bb251d9de50b5674040b62f277d26f9bac8a25b11be489acc68a2edb3360f484616bafacddc2a1d23f43e0576a808dfd15be4aa0334995a308a
|
7
|
+
data.tar.gz: 4527303091cdd47d1433ff109e3ec1876d35cbe43894ee77fdbcad19468cb8659ee2e08f149a251ded198e12d81282f3edca82596a2029626cb5a1892af388f3
|
data/CHANGELOG.md
CHANGED
@@ -5,6 +5,11 @@ This CHANGELOG follows the format listed [here](https://github.com/sensu-plugins
|
|
5
5
|
|
6
6
|
## [Unreleased]
|
7
7
|
|
8
|
+
## [2.2.0] - 2018-10-16
|
9
|
+
### Added
|
10
|
+
- metric-postgres-statsbgwriter.rb: additional metrics (@phumpal)
|
11
|
+
- metric-postgres-statsdb.rb additional metrics (@phumpal)
|
12
|
+
|
8
13
|
## [2.1.0] - 2018-10-16
|
9
14
|
### Added
|
10
15
|
- Moves check_vsn and compute_lag to library method (@phumpal)
|
@@ -153,7 +158,8 @@ This CHANGELOG follows the format listed [here](https://github.com/sensu-plugins
|
|
153
158
|
### Added
|
154
159
|
- initial release
|
155
160
|
|
156
|
-
[Unreleased]: https://github.com/sensu-plugins/sensu-plugins-postgres/compare/2.
|
161
|
+
[Unreleased]: https://github.com/sensu-plugins/sensu-plugins-postgres/compare/2.2.0...HEAD
|
162
|
+
[2.2.0]: https://github.com/sensu-plugins/sensu-plugins-postgres/compare/2.1.0...2.2.0
|
157
163
|
[2.1.0]: https://github.com/sensu-plugins/sensu-plugins-postgres/compare/2.0.0...2.1.0
|
158
164
|
[2.0.0]: https://github.com/sensu-plugins/sensu-plugins-postgres/compare/1.4.6...2.0.0
|
159
165
|
[1.4.6]: https://github.com/sensu-plugins/sensu-plugins-postgres/compare/1.4.5...1.4.6
|
@@ -84,8 +84,9 @@ class PostgresStatsDBMetrics < Sensu::Plugin::Metric::CLI::Graphite
|
|
84
84
|
connect_timeout: config[:timeout])
|
85
85
|
request = [
|
86
86
|
'select checkpoints_timed, checkpoints_req,',
|
87
|
+
'checkpoint_write_time, checkpoint_sync_time,',
|
87
88
|
'buffers_checkpoint, buffers_clean,',
|
88
|
-
'maxwritten_clean, buffers_backend,',
|
89
|
+
'maxwritten_clean, buffers_backend, buffers_backend_fsync',
|
89
90
|
'buffers_alloc',
|
90
91
|
'from pg_stat_bgwriter'
|
91
92
|
]
|
@@ -93,10 +94,13 @@ class PostgresStatsDBMetrics < Sensu::Plugin::Metric::CLI::Graphite
|
|
93
94
|
result.each do |row|
|
94
95
|
output "#{config[:scheme]}.bgwriter.checkpoints_timed", row['checkpoints_timed'], timestamp
|
95
96
|
output "#{config[:scheme]}.bgwriter.checkpoints_req", row['checkpoints_req'], timestamp
|
97
|
+
output "#{config[:scheme]}.bgwriter.checkpoints_write_time", row['checkpoint_write_time'], timestamp
|
98
|
+
output "#{config[:scheme]}.bgwriter.checkpoints_sync_time", row['checkpoint_sync_time'], timestamp
|
96
99
|
output "#{config[:scheme]}.bgwriter.buffers_checkpoint", row['buffers_checkpoint'], timestamp
|
97
100
|
output "#{config[:scheme]}.bgwriter.buffers_clean", row['buffers_clean'], timestamp
|
98
101
|
output "#{config[:scheme]}.bgwriter.maxwritten_clean", row['maxwritten_clean'], timestamp
|
99
102
|
output "#{config[:scheme]}.bgwriter.buffers_backend", row['buffers_backend'], timestamp
|
103
|
+
output "#{config[:scheme]}.bgwriter.buffers_backend_fsync", row['buffers_backend_fsync'], timestamp
|
100
104
|
output "#{config[:scheme]}.bgwriter.buffers_alloc", row['buffers_alloc'], timestamp
|
101
105
|
end
|
102
106
|
end
|
@@ -29,6 +29,7 @@
|
|
29
29
|
# for details.
|
30
30
|
#
|
31
31
|
|
32
|
+
require 'active_support/core_ext/hash'
|
32
33
|
require 'sensu-plugins-postgres/pgpass'
|
33
34
|
require 'sensu-plugin/metric/cli'
|
34
35
|
require 'pg'
|
@@ -89,23 +90,14 @@ class PostgresStatsDBMetrics < Sensu::Plugin::Metric::CLI::Graphite
|
|
89
90
|
port: config[:port],
|
90
91
|
connect_timeout: config[:timeout])
|
91
92
|
request = [
|
92
|
-
'select
|
93
|
-
'blks_read, blks_hit,',
|
94
|
-
'tup_returned, tup_fetched, tup_inserted, tup_updated, tup_deleted',
|
93
|
+
'select *',
|
95
94
|
"from pg_stat_database where datname='#{config[:database]}'"
|
96
95
|
]
|
97
96
|
con.exec(request.join(' ')) do |result|
|
98
97
|
result.each do |row|
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
output "#{config[:scheme]}.statsdb.#{config[:database]}.blks_read", row['blks_read'], timestamp
|
103
|
-
output "#{config[:scheme]}.statsdb.#{config[:database]}.blks_hit", row['blks_hit'], timestamp
|
104
|
-
output "#{config[:scheme]}.statsdb.#{config[:database]}.tup_returned", row['tup_returned'], timestamp
|
105
|
-
output "#{config[:scheme]}.statsdb.#{config[:database]}.tup_fetched", row['tup_fetched'], timestamp
|
106
|
-
output "#{config[:scheme]}.statsdb.#{config[:database]}.tup_inserted", row['tup_inserted'], timestamp
|
107
|
-
output "#{config[:scheme]}.statsdb.#{config[:database]}.tup_updated", row['tup_updated'], timestamp
|
108
|
-
output "#{config[:scheme]}.statsdb.#{config[:database]}.tup_deleted", row['tup_deleted'], timestamp
|
98
|
+
row.except('datid', 'stats_reset').each do |key, value|
|
99
|
+
output "#{config[:scheme]}.statsdb.#{config[:database]}.#{key}", value.to_s, timestamp
|
100
|
+
end
|
109
101
|
end
|
110
102
|
end
|
111
103
|
|