我正在使用ganglia 3.6.0进行监视。我有一个收集、聚合集群中所有主机的指标的应用程序。然后把他们送到格蒙德。应用程序运行在host1上。
这里的问题是,当设置false =false时,ganglia最终认为这是只来自host1的度量。实际上,这些度量标准是由host1生成的,但适用于集群中的所有主机。
但是在设置spoof=true时,我希望gmond会接受我指定的主机名。但gmond完全不接受这些指标。这些指标是host1上没有显示的事件。
我使用的代码是从应用Ganglia 3.1x格式的GangliaSink (从hadoop )复制的。
xdr_int(128); // metric_id = metadata_msg
xdr_string(getHostName()); // hostname
xdr_string(name); // metric name
xdr_int(1); // spoof = True
xdr_string(type); // metric type
xdr_string(name); // metric name
xdr_string(gConf.getUnits()); // units
xdr_int(gSlope.ordinal()); // slope
xdr_int(gConf.getTmax()); // tmax, the maximum time between metrics
xdr_int(gConf.getDmax()); // dmax, the maximum data value
xdr_int(1); /*Num of the entries in extra_value field for
Ganglia 3.1.x*/
xdr_string("GROUP"); /*Group attribute*/
xdr_string(groupName); /*Group value*/
// send the metric to Ganglia hosts
emitToGangliaHosts();
// Now we send out a message with the actual value.
// Technically, we only need to send out the metadata message once for
// each metric, but I don't want to have to record which metrics we did and
// did not send.
xdr_int(133); // we are sending a string value
xdr_string(getHostName()); // hostName
xdr_string(name); // metric name
xdr_int(1); // spoof = True
xdr_string("%s"); // format field
xdr_string(value); // metric value
// send the metric to Ganglia hosts
emitToGangliaHosts();我确实为每个指标指定了主机名。但它似乎没有被gmond所使用/识别。
发布于 2014-01-14 12:23:21
解决了这个..。hostName格式问题。格式需要类似于ip:hostname,例如,1.2.3.4:host0000001,或者任何string:string都可以:-)
https://stackoverflow.com/questions/21109355
复制相似问题