               return fulfill result
       )
 
+  pingAsync = (elasticsearchClt) ->
+    new Promise((fulfill,reject) ->
+      elasticsearchClt.ping {
+        requestTimeout: 3000
+        hello: 'elasticsearch!'
+        }, (err) ->
+          if err
+            return reject err
+          else
+            return fulfill true
+    )
+
   app.get "/healthcheck", (req, res, next) ->
     answer = {}
     answer['uptime'] = secondes
     promises = []
 
-    #Check postgresDbs connection
+    #Check postgresDbs connections
     if config.postgresDbs
       postgresDbs = config.postgresDbs()
       for postgresDb in postgresDbs

          if promises[i] == 'mongo'
            databases = mongo
            j = 1
          else
            if result.isFulfilled()
              databases['database_' + j] = true
            else
              databases['database_' + j] = false
          i++
          j++

        answer['postgres'] = postgres
        answer['mongo'] = mongo
        res.send(answer)
    else
      res.send(answer)


    promises.push 'mongo'

    #Check mongoDb connections
    if config.mongoDbs
      mongoDbs = config.mongoDbs()
      for mongoDb in mongoDbs
        promises.push collectionNamesAsync(mongoDb)

    promises.push 'elasticsearch'

    #Check elasticsearch connections
    if config.elasticsearchClts
      elasticsearchClts = config.elasticsearchClts
      for elasticsearchClt in elasticsearchClts
        promises.push pingAsync(elasticsearchClt)

    if promises.length > 2
      Promise.settle(promises).then (results) ->
        mongo = {}
        postgres = {}
        elastic = {}
        databases = postgres
        i = 0
        j = 1
