collectd
是否正確支持write_graphite
插件的多個實例? Collectd手冊頁似乎一個例子來表明這一點:https://collectd.org/documentation/manpages/collectd.conf.5.shtml#built_in_targets收集多個write_graphite實例
我想配置chains
具體而言,PostCacheChain
,並通過在collectd write_graphite
插件的多個實例發送指標。原因是,不同的度量標準需要不同的前綴。
我無法將兩個實例都發送到石墨,只有一個或其他作品。
使用,netstat
我可以看到兩個插座從我的collectd主機建立到石墨主機。運行tcpdump
顯示兩個連接的SYN-ACK,但只有一個實例發送數據。應該通過第二個實例發送的度量標準不會顯示在tcpdump或石墨上。
爲write_graphite
看起來像這樣的配置:
LoadPlugin "write_graphite"
<Plugin "write_graphite">
<Node "def_prefix">
Host "metrics.example.com"
Port "2003"
Prefix "collectd."
LogSendErrors true
Protocol "TCP"
StoreRates true
AlwaysAppendDS true
SeparateInstances true
</Node>
<Node "statsd_prefix">
Host "metrics.example.com"
Port "2003"
Prefix "statsd."
LogSendErrors true
Protocol "TCP"
StoreRates true
AlwaysAppendDS true
SeparateInstances true
</Node>
</Plugin>
而對於PostCacheChain
:
LoadPlugin match_regex
PostCacheChain "PostCache"
<Chain "PostCache">
<Rule "statsd_prefix"> # metrics from statsd plugin use diff prefix
<Match "regex">
Plugin "^statsd$"
</Match>
<Target "write">
Plugin "write_graphite/statsd_prefix"
</Target>
<Target "return">
</Target>
</Rule>
<Target "write">
Plugin "write_graphite/def_prefix"
</Target>
</Chain>
感謝您的幫助。
您是否嘗試過使用自定義postcachechain規則? –
@RyanCox沒有自定義PostCache規則,它只會使用write_graphite插件的默認實例(或第一個實例)。 –
好的,我的問題是,服務器並不是真正的石墨,它在監聽模式下是'nc'。否則多個石墨實例工作正常。 –