简体   繁体   English

可以更改munin图的更新间隔吗?

[英]Possible to change update interval for munin graphs?

I will like to munin to graph after every two minutes to increase the granularity. 我希望每隔两分钟就能通过图表来增加粒度。 There are some links pointing out that its somehow possible with munin 2.0 , any idea how? 有一些链接指出它在某种程度上可能与munin 2.0,任何想法如何?

I haven't tried it, but this question in the FAQ suggests you cannot: 我没有尝试过,但常见问题解答中的这个问题表明你不能:

Munin runs at an interval of every five minutes (*/5) on debian systems by default. 默认情况下,Munin在debian系统上以每五分钟(* / 5)的间隔运行。 Is it possible to change this interval to an arbitrary value? 是否可以将此间隔更改为任意值?

Just edit /etc/cron.d/munin. 只需编辑/etc/cron.d/munin。

However, this won't change Munin's (or rather RRD's) granularity; 但是,这不会改变Munin(或更确切地说是RRD)的粒度; all RRD files are constructed to create 5 minutes averages, and no matter how often you update the RRD files the output won't be (much) different. 构造所有RRD文件以创建5分钟平均值,无论您更新RRD文件的频率如何,输出都不会(很多)不同。 Changing this (default) behaviour has been proposed in Ticket #5. 在故障单#5中已经提出了更改此(默认)行为。

However, if you look at ticket #5 , the last post (closing it) is: 但是,如果您查看机票#5 ,最后一篇文章(关闭它)是:

current trunk fully supports custom update_rate, and increase resolution of .rrd files accordingly. 当前主干完全支持自定义update_rate,并相应地提高.rrd文件的分辨率。

So, if you're using a fairly recent version of munin, it might be worth a try. 所以,如果你使用的是最新版本的munin,那么值得一试。

Increasing the resolution of Munin data capture is accomplished at the plugin level , not the munin core level. 提高Munin数据捕获的分辨率是在插件级别而不是munin核心级别完成的。 This means that it is not possible to simply change an entire installation to increase resolution. 这意味着无法简单地更改整个安装以提高分辨率。 Instead, each plugin must be modified independently. 相反,每个插件必须独立修改。

The two critical plugin config values that determine resolution are 确定分辨率的两个关键插件配置值是

graph_data_size
update_rate # in seconds
  • graph_data_size determines the size and structure of the RRD file used to store captured data. graph_data_size确定用于存储捕获数据的RRD文件的大小和结构。
  • update_rate indicates how frequently new data is expected. update_rate表示预期新数据的频率。

Since cron has a lower bound of one minute as its tightest possible resolution, that's the easiest to achieve. 由于cron具有一分钟的下限作为其最可能的分辨率,这是最容易实现的。 Simply update the cron to run every minute and modify the plugin config to include these values 只需更新cron即可每分钟运行一次并修改插件配置以包含这些值

graph_data_size custom 1d, 1m for 1w, 5m for 1t, 15m for 1y
update_rate 60

Sub-minute resolution requires caching datapoints in between cron runs and embedding time data (seconds since epoch). 亚分​​钟分辨率要求在cron运行和嵌入时间数据(自纪元以来的秒数)之间缓存数据点。 I provide full details in these three posts: 我在这三篇文章中提供了完整的细节:

http://software.danielwatrous.com/understanding-munin-plugins/ http://software.danielwatrous.com/understanding-munin-plugins/

http://software.danielwatrous.com/increase-munin-resolution-to-one-minute/ http://software.danielwatrous.com/increase-munin-resolution-to-one-minute/

http://software.danielwatrous.com/increase-munin-resolution-to-sub-minute/ http://software.danielwatrous.com/increase-munin-resolution-to-sub-minute/

Munin uses cron job to run itself every 5 minutes by default. Munin默认使用cron作业每5分钟运行一次。 You can change it in the crontab. 您可以在crontab中更改它。 On my CentOS system it is located in /etc/cron.d/munin and looks like this: 在我的CentOS系统上,它位于/etc/cron.d/munin中,如下所示:

#
# cron-jobs for munin
#

MAILTO=root

*/5 * * * *     /usr/bin/munin-cron

I have changed it in the past to 我过去改过它了

*/1 * * * *     /usr/bin/munin-cron

However since using Amazon AWS's monitoring system, I don't need Munin that often and now keep it at 10 minutes on the servers where I use it. 但是,由于使用亚马逊AWS的监控系统,我不需要经常使用Munin,现在在我使用它的服务器上保持10分钟。

zeeshan said: 泽山说:

Munin uses cron job to run itself every 5 minutes by default. Munin默认使用cron作业每5分钟运行一次。 You can change it in the crontab. 您可以在crontab中更改它。 On my CentOS system it is located in /etc/cron.d/munin and looks like this: 在我的CentOS系统上,它位于/etc/cron.d/munin中,如下所示:

#

cron-jobs for munin munin的cron-jobs

#

MAILTO=root MAILTO =根

*/5 * * * * /usr/bin/munin-cron * / 5 * * * * / usr / bin / munin-cron

I have changed it in the past to 我过去改过它了

*/1 * * * * /usr/bin/munin-cron * / 1 * * * * / usr / bin / munin-cron

However since using Amazon AWS's monitoring system, I don't need Munin that often and now keep it at 10 minutes on the servers where I use it. 但是,由于使用亚马逊AWS的监控系统,我不需要经常使用Munin,现在在我使用它的服务器上保持10分钟。

You are about munin-server, because munin-agent does not have cron jobs. 你是关于munin-server的,因为munin-agent没有cron工作。 Your graphs will not take a step to less than 5 min. 您的图表不会超过5分钟。

To change graph period ( step ) look here: http://munin-monitoring.org/wiki/faq#Q:CanImakeagraphshowvaluesperminuteinsteadofpersecond 要更改图形周期(步骤),请查看此处: http//munin-monitoring.org/wiki/faq#Q : CanImakeagraphshowvaluesperminuteinsteadofpersecond

Sample: 样品:

[server.example.com]
  address 10.0.0.1
  postfix_mailstats.graph_period second

to set graph period to seconds. 将图形周期设置为秒。 But be sure, that you have changed /etc/cron.d/munin for minimal time interval like graph_period in /etc/munin/munin.conf 但是请确保,您已将/etc/cron.d/munin更改为最短的时间间隔,例如/etc/munin/munin.conf中的graph_period

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

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