Skip to content

Instantly share code, notes, and snippets.

@braoru
Created June 22, 2015 06:26
Show Gist options
  • Save braoru/19a448403a103c041978 to your computer and use it in GitHub Desktop.
Save braoru/19a448403a103c041978 to your computer and use it in GitHub Desktop.
(check-openshift) [sebastien@ecudehe check-openshift]$ python check_poc_openshift.py
The db connection
Database(MongoClient(['osbmdbp02.leshop.local:27017', 'osbmdbp01:27017', 'osbmdbp03.leshop.local:27017']), 'openshift_b_prod')
The collection
Collection(Database(MongoClient(['osbmdbp02.leshop.local:27017', 'osbmdbp01:27017', 'osbmdbp03.leshop.local:27017']), 'openshift_b_prod'), 'districts')
The district
{'_id': ObjectId('557a9f7a2496b29694000001'),
'servers': [{'_id': ObjectId('557d92332496b226ae000001'),
'active': True,
'name': 'osbnodp01.osb.internal.leshop.ch',
'unresponsive': False},
{'_id': ObjectId('557d92402496b2eb70000001'),
'active': True,
'name': 'osbnodp02.osb.internal.leshop.ch',
'unresponsive': False},
{'_id': ObjectId('557d924e2496b279ab000001'),
'active': True,
'name': 'osbnodp03.osb.internal.leshop.ch',
'unresponsive': False},
{'_id': ObjectId('557d925e2496b2bb42000001'),
'active': True,
'name': 'osbnodp04.osb.internal.leshop.ch',
'unresponsive': False}]}
{'_id': ObjectId('557a9f7a2496b29694000001'),
'servers': [{'_id': ObjectId('557d92332496b226ae000001'),
'active': True,
'name': 'osbnodp01.osb.internal.leshop.ch',
'unresponsive': False},
{'_id': ObjectId('557d92402496b2eb70000001'),
'active': True,
'name': 'osbnodp02.osb.internal.leshop.ch',
'unresponsive': False},
{'_id': ObjectId('557d924e2496b279ab000001'),
'active': True,
'name': 'osbnodp03.osb.internal.leshop.ch',
'unresponsive': False},
{'_id': ObjectId('557d925e2496b2bb42000001'),
'active': True,
'name': 'osbnodp04.osb.internal.leshop.ch',
'unresponsive': False}]}
mongodb servers status
{'osbnodp01.osb.internal.leshop.ch': {'active': True, 'unresponsive': False},
'osbnodp02.osb.internal.leshop.ch': {'active': True, 'unresponsive': False},
'osbnodp03.osb.internal.leshop.ch': {'active': True, 'unresponsive': False},
'osbnodp04.osb.internal.leshop.ch': {'active': True, 'unresponsive': False}}
Command to execute
oo-mco rpc rpcutil ping -j -I osbnodp01.osb.internal.leshop.ch
JSON mco ping output
[{'action': 'ping',
'agent': 'rpcutil',
'data': {'pong': 1434953871},
'sender': 'osbnodp01.osb.internal.leshop.ch',
'statuscode': 0,
'statusmsg': 'OK'}]
Command to execute
oo-mco rpc rpcutil ping -j -I osbnodp02.osb.internal.leshop.ch
JSON mco ping output
[]
Command to execute
oo-mco rpc rpcutil ping -j -I osbnodp03.osb.internal.leshop.ch
JSON mco ping output
[]
Command to execute
oo-mco rpc rpcutil ping -j -I osbnodp04.osb.internal.leshop.ch
JSON mco ping output
[]
mco servers status
{'osbnodp01.osb.internal.leshop.ch': {'active': True, 'unresponsive': False},
'osbnodp02.osb.internal.leshop.ch': {'active': False, 'unresponsive': True},
'osbnodp03.osb.internal.leshop.ch': {'active': False, 'unresponsive': True},
'osbnodp04.osb.internal.leshop.ch': {'active': False, 'unresponsive': True}}
Critical: 3 unresponsive openshift nodes | 'prod-osb-3gb_mongodb_active_nodes'=4;;;;; 'prod-osb-3gb_mongodb_unresponsive_servers'=0;2;3;;; 'prod-osb-3gb_mco_active_nodes'=1;;;;; 'prod-osb-3gb_mco_unresponsive_servers'=3;2;3;;;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment