sensu-plugins-edgelab 1.18.3 → 1.18.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: fecc442d8ab565916105f92a86ece560a6fe28260428297525a86db83f6f1f74
4
- data.tar.gz: f220bc7a29a868a26d62de40a142d87d7c497e38bedc013837029841adf88061
3
+ metadata.gz: 5d69148597eecc8e890508809750fffc64d841ef7a1c2c45930da151bececc23
4
+ data.tar.gz: 5e7fa4fea33721e8eafe936c9ac20b55bfaae1bcfdb0ab3a0f3bfc9736dd6134
5
5
  SHA512:
6
- metadata.gz: bf9875358de319422494ec1d4a4b39f4fb7fbbc3063abbf7794a8d282eefd162e7416634be0d8c2a53c6b3bea329817cca2eb950637920563f4944b6e63878b3
7
- data.tar.gz: e021de8c2fd4ca6b55f533a6dda75a6f7304765570579c22b31da052394cc739d1c46e72e8737ed6cfbac9f2bb690743ec688329c060c7626ce40bf84850c229
6
+ metadata.gz: 1cdd49b81483f19f4014ed20831d730d97513b53066e8cdb1d413f79604b224d8468713817e313e6bc355734bc92542f103ce9eba424e8915e4fa26294f1eae8
7
+ data.tar.gz: 62c224e081680bca8be7d5c8788d950a4786b6ba0b7ea19385bdb9416bd25932efe16f505d0f83fbf89fd34ebaaec352536e83da483132d38b3dd9ed54d24965
@@ -80,9 +80,10 @@ class PostgresStatsDBMetrics < Sensu::Plugin::Metric::CLI::Graphite
80
80
  connect_timeout: config[:timeout])
81
81
 
82
82
  # https://www.postgresql.org/docs/10/monitoring-stats.html#PG-STAT-ACTIVITY-VIEW
83
+ # *state* field needs superuser privileges to read state of other users, otherwise we set it to *unknown_state*
83
84
  query = <<END_SQL
84
- SELECT usename, datname, replace(replace(replace(state, ' ', '_'), '(', ''), ')', '') as state, count(*)
85
- FROM pg_stat_activity WHERE usename IS NOT NULL
85
+ SELECT usename, datname, replace(replace(replace(coalesce(state, 'unknown_state'), ' ', '_'), '(', ''), ')', '') as state, count(*)
86
+ FROM pg_stat_activity WHERE usename IS NOT NULL AND datname IS NOT NULL
86
87
  GROUP BY usename, datname, state;
87
88
  END_SQL
88
89
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sensu-plugins-edgelab
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.18.3
4
+ version: 1.18.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Edgelab