def check_connection(self):
        try:
            # Create connection and allow reading data from slave
            self.connection = pymongo.Connection(self.host, self.port, slave_okay=True, replicaSet=self.replicaset)
        except Exception as e:
            return {
                'state': 'ERROR',
                'messages' : {
                    'error' : [str(e)]
                }
            }

        return {
            'state': 'OK',
            'messages' : {
                'info': [self.connection.server_info()['sysInfo']]
            }
        }
Connect to Mongo, save connection in self.connection
dataset/ETHPy150Open gooddata/smoker/smoker/server/plugins/mongo.py/Plugin.check_connection