+ if server_status.get('repl'):
+ hosts = server_status['repl']['hosts']
+ for host in hosts:
+ chart_name = '_'.join([host, 'state'])
+ self.order.append(chart_name)
+ self.definitions[chart_name] = {
+ 'options': [None, "%s state" % host, "state",
+ 'replication', 'mongodb.replication_state', 'line'],
+ 'lines': [
+ ]}
+ for state, description in REPLSET_STATES:
+ self.definitions[chart_name]['lines'].append(['_'.join([host, 'state', state]), description, 'absolute', 1, 1])
+
+