   ctx.write writes, (err, written) ->
     next err, if written then ctx.OK else ctx.PASS
 
+###
+Hadoop
+------
+
+Upload the "hadoop-metrics2.properties" to connect Hadoop with Ganglia.
+###
 module.exports.push name: 'Ganglia Monitor # Hadoop', callback: (ctx, next) ->
   collector = ctx.host_with_module 'phyla/hdp/ganglia_collector'
   ctx.write

  ctx.execute cmds, (err, executed) ->
    next err, if executed then ctx.OK else ctx.PASS

module.exports.push name: 'Ganglia Monitor # Configuration', timeout: -1, callback: (ctx, next) ->
  collector = ctx.host_with_module 'phyla/hdp/ganglia_collector'
  writes = []

  , (err, uploaded) ->
    next err, if uploaded then ctx.OK else ctx.PASS

###
Host
----

Setup the Ganglia hosts. Categories are "HDPNameNode", "HDPResourceManager", 
"HDPSlaves" and "HDPHBaseMaster".
###
module.exports.push name: 'Ganglia Monitor # Host', timeout: -1, callback: (ctx, next) ->
  cmds = []
  # On the NameNode and SecondaryNameNode servers, to configure the gmond emitters
  if ctx.has_any_modules 'phyla/hdp/hdfs_nn', 'phyla/hdp/hdfs_snn'
    cmds.push cmd: "/usr/libexec/hdp/ganglia/setupGanglia.sh -c HDPNameNode"
