首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Ganglia欺骗在向gmond发送数据时不起作用

Ganglia欺骗在向gmond发送数据时不起作用
EN

Stack Overflow用户
提问于 2014-01-14 08:56:55
回答 1查看 916关注 0票数 0

我正在使用ganglia 3.6.0进行监视。我有一个收集、聚合集群中所有主机的指标的应用程序。然后把他们送到格蒙德。应用程序运行在host1上。

这里的问题是,当设置false =false时,ganglia最终认为这是只来自host1的度量。实际上,这些度量标准是由host1生成的,但适用于集群中的所有主机。

但是在设置spoof=true时,我希望gmond会接受我指定的主机名。但gmond完全不接受这些指标。这些指标是host1上没有显示的事件。

我使用的代码是从应用Ganglia 3.1x格式的GangliaSink (从hadoop )复制的。

代码语言:javascript
复制
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所使用/识别。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2014-01-14 12:23:21

解决了这个..。hostName格式问题。格式需要类似于ip:hostname,例如,1.2.3.4:host0000001,或者任何string:string都可以:-)

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/21109355

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档