Skip to content
Permalink
Browse files

FIX: postgres_sessions: handle case of no active/no idle sessions

  • Loading branch information
MathiasKettner committed Nov 26, 2012
1 parent b343df2 commit 24227c2901fa5fb30ed5bf0d49a11521bfee2f07
Showing with 8 additions and 3 deletions.
  1. +3 −0 ChangeLog
  2. +5 −3 checks/postgres_sessions
@@ -169,6 +169,9 @@
* FIX: fixed detection of existing groups when creating new groups
* FIX: allow email addresses like test@test.test-test.com

Checks & Agents:
* FIX: postgres_sessions: handle case of no active/no idle sessions


1.2.0p3:
Mulitisite
@@ -29,15 +29,17 @@
# t 4

# t -> idle sessions, f -> active sessions
# Note: one (or both?) lines might be missing. They will never show 0.

def inventory_postgres_sessions(info):
if len(info) == 2:
# inventorize only if at least one idle or active session exist
if info:
return [(None, {})]

def check_postgres_sessions(_no_item, params, info):
parsed = dict(info)
idle = int(parsed['t'])
running = int(parsed['f'])
idle = int(parsed.get('t', 0))
running = int(parsed.get('f', 0))
total = idle + running

status = 0

0 comments on commit 24227c2

Please sign in to comment.
You can’t perform that action at this time.