Skip to content
Permalink
Browse files

#2019 FIX heartbeat_crm: Be compatible to yet unknown crm_mon output …

…format
  • Loading branch information
LarsMichelsen committed Feb 25, 2015
1 parent 3593d02 commit af1690fcc19b948100cdbf832c06aa89928a39ed
Showing with 21 additions and 13 deletions.
  1. +10 −0 .werks/2019
  2. +1 −0 ChangeLog
  3. +10 −13 checks/heartbeat_crm
@@ -0,0 +1,10 @@
Title: heartbeat_crm: Be compatible to yet unknown crm_mon output format
Level: 1
Component: checks
Class: fix
Compatible: compat
State: unknown
Version: 1.2.7i1
Date: 1424876750


@@ -195,6 +195,7 @@
* 1890 FIX: cisco_temperature: Replaces cisco_temp_perf and cisco_temp_sensor...
NOTE: Please refer to the migration notes!
* 2018 FIX: ibm_imm_health: Fixed exception when host does provides empty SNMP data
* 2019 FIX: heartbeat_crm: Be compatible to yet unknown crm_mon output format

Multisite:
* 1758 Improved exception hander: Shows details without additional debug request, added mailto link for error report...
@@ -78,9 +78,9 @@ def heartbeat_crm_parse_general(info):
last_updated = ' '.join(line[2:])
elif ' '.join(line[0:2]) == 'Current DC:':
dc = line[2]
elif ' '.join(line[1:3])[:-1] == 'Nodes configured':
elif ' '.join(line[1:3]).rstrip('.,') == 'Nodes configured':
num_nodes = int(line[0])
elif ' '.join(line[1:3]) == 'Resources configured.':
elif ' '.join(line[1:3]).rstrip('.,') == 'Resources configured':
num_resources = int(line[0])
return (last_updated, dc, num_nodes, num_resources)

@@ -97,17 +97,14 @@ def inventory_heartbeat_crm(info):
# - Check the number of nodes/resources
# - Check the age of "last updated"
settings = host_extra_conf_merged(g_hostname, inventory_heartbeat_crm_rules)
try:
last_updated, dc, num_nodes, num_resources = heartbeat_crm_parse_general(info)
params = {
'num_nodes' : num_nodes,
'num_resources' : num_resources,
}
if settings.get('naildown_dc', False):
params['dc'] = dc
return [(None, params)]
except:
return # No useful information found
last_updated, dc, num_nodes, num_resources = heartbeat_crm_parse_general(info)
params = {
'num_nodes' : num_nodes,
'num_resources' : num_resources,
}
if settings.get('naildown_dc', False):
params['dc'] = dc
return [(None, params)]

def check_heartbeat_crm(item, params, info):
if len(info) > 0:

0 comments on commit af1690f

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