简体   繁体   English

石墨与收集。 保留不适用

[英]graphite vs collectd. retentions not applied

I have installed collectd on BIND9 hosts and configured it to pass metrics to graphite. 我已经在BIND9主机上安装了collectd并将其配置为将指标传递给石墨。 I want to be able to view metrics for at least 1 month but retentions in storage-schema.conf not applied for collectd section, and applied last default section that stores only last 24h metrics. 我希望能够查看至少1个月的指标,但是storage-schema.conf中的保留不适用于“收集”部分,并且未应用仅存储最近24小时指标的最新默认部分。 I understand that I need to set correct retentions regex to match metrics but it is seems to me that is correct already but it does not work :( 我了解我需要设置正确的保留值正则表达式以匹配指标,但是在我看来这是正确的,但它不起作用:(

My storage-schemas.conf looks like this for now: 我的storage-schemas.conf现在看起来像这样:

[carbon]
pattern = ^carbon\.
retentions = 60:90d

[mxservers]
pattern = ^mx-servers\.*
retentions = 60s:7d,5m:2y 

[ns.servers]
pattern = ^ns\d\.collectd\..*
retentions = 60s:7d,10m:2y

[collectd]
pattern =^collectd\.*
retentions = 60s:7d,10m:2y 

# *** Netapp Monitoring ***
[netapp.capacity]
pattern = ^netapp\.capacity\.*
retentions = 15m:100d, 1d:5y

[netapp.poller.capacity]
pattern = ^netapp\.poller\.capacity\.*
retentions = 15m:100d, 1d:5y

[netapp.perf]
pattern = ^netapp\.perf\.*
retentions = 60s:35d, 5m:100d, 15m:395d, 1h:5y

[netapp.poller.perf]
pattern = ^netapp\.poller\.perf\.*
retentions = 60s:35d, 5m:100d, 15m:395d, 1h:5y

[netapp.perf7]
pattern = ^netapp\.perf7\.*
retentions = 60s:35d, 5m:100d, 15m:395d, 1h:5y

[netapp.poller.perf7]
pattern = ^netapp\.poller\.perf7\.*
retentions = 60s:35d, 5m:100d, 15m:395d, 1h:5y
# *** Netapp Monitoring ***

[default_1min_for_1day]
pattern = .*
retentions = 60s:1d

I have a problem with section named - [ns.servers], tried to set regex in it to: 我对名为[ns.servers]的部分有问题,试图将其中的正则表达式设置为:

^ns\d\.collectd\.
^ns\d\.collectd\..*
^ns.\.collectd\.
^ns.\.collectd\..*

None of them solves the problem. 他们都不能解决问题。 The metrics are stored with names like this: 度量标准以如下名称存储:

ns1.collectd.load.load.shortterm
ns2.collectd.load.load.longterm
ns1.collectd.interface-bond0.if_packets.rx
ns2.collectd.interface-bond0.if_packets.tx

Please help me to set correct regex to get it match. 请帮助我设置正确的正则表达式以使其匹配。

Did you happen to configure the regexes in storage-schemas.conf after the .wsp files were created? 创建.wsp文件之后,是否碰巧在storage-schemas.conf中配置了正则表达式? If so you have to resize the existing .wsp files manually. 如果是这样,则必须手动调整现有.wsp文件的大小。 You can do this with the whisper-resize utility included in the whisper package (or just delete the files and let carbon recreate them). 您可以使用whisper软件包中包含的whisper-resize实用程序来执行此操作(或只是删除文件并让carbon重新创建它们)。

storage-schemas.conf is only applied when creating a new .wsp file. storage-schemas.conf仅在创建新的.wsp文件时应用。

I finally realized what the problem is! 我终于意识到问题出在哪里! I take a look to /var/log/carbon/creates.log and found that my metrics for collecd is stored as ns2/collectd.* - "hostname"+"/"+"collectd" - because in configuration of collectd on DNS-servers there was an option Postfix "/collectd" that make this. 我看一下/var/log/carbon/creates.log ,发现我的collecd度量标准存储为ns2/collectd.* collected ns2/collectd.* -“ hostname” +“ /” +“ collected”-因为在DNS上收集的配置-servers有一个选项Postfix "/collectd"使之完成。

05/06/2017 09:54:22 :: creating database file /var/lib/graphite/whisper/ns2/collectd/cpu-1/cpu-idle.wsp (archive=[(60, 1440)] xff=None agg=None)
05/06/2017 09:54:22 :: new metric ns2/collectd.disk-sda.disk_octets.write matched schema default_1min_for_1day
05/06/2017 09:54:22 :: new metric ns2/collectd.disk-sda.disk_octets.write matched aggregation schema default

So the solution was to make regex look like this: pattern = ^ns[1-2]\\/collectd\\.* - escaped "/" - character and then I deleted old metrics and new metric files was created with correct retentions! 因此解决方案是使正则表达式看起来像这样: pattern = ^ns[1-2]\\/collectd\\.* -转义为“ /”-字符,然后我删除了旧指标,并使用正确的保留时间创建了新的指标文件!

05/06/2017 11:32:12 :: creating database file /var/lib/graphite/whisper/ns2/collectd/df-boot-efi/df_complex-free.wsp (archive=[(60, 10080), (600, 105120)] xff=None agg=None)
05/06/2017 11:32:12 :: new metric ns2/collectd.interface-eth0.if_errors.tx matched schema ns.servers
05/06/2017 11:32:12 :: new metric ns2/collectd.interface-eth0.if_errors.tx matched aggregation schema default

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM