简体   繁体   English

如何在munin中配置特定图表以每天更新而不是每5分钟更新一次?

[英]how to configure specific graphs in munin to update every day instead of every 5 minutes?

The default update interval in Munin is 5 minutes which is OK for most purposes. Munin的默认更新间隔为5分钟,大多数情况下都可以。

For some cases though 5 minutes is too frequent, useless and sometimes increases load of the servers being watched. 对于某些情况,虽然5分钟太频繁,无用,有时会增加正在观看的服务器的负载。 For example, I want to graph database sizes once every day and I have plugins written for that. 例如,我想每天绘制一次数据库大小,并为此编写插件。 But sampling every 5 minutes could be costly in terms of performance. 但是,每5分钟采样一次,在性能方面可能会很昂贵。

So, is it possible to configure Munin for specific graphs to update every day or every hour instead of every 5 minutes? 那么,是否可以将Munin配置每天或每小时而不是每5分钟更新一次?

You can change the interval for all graphs see the munin FAQ 您可以更改所有图表的间隔,请参阅munin常见问题解答

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文件的频率如何,输出都不会(很多)不同。

But I think you do not want it ? 但我觉得你不想要它? :) :)

I think you can optimize your script, you can store the result in a file and for each call you can verify if the file modify date is the same of the current date. 我认为您可以优化脚本,可以将结果存储在文件中,每次调用都可以验证文件修改日期是否与当前日期相同。 If not, just call the database for retrieve the database size and all others time you return the content file. 如果没有,只需调用数据库以检索数据库大小,并在所有其他时间返回内容文件。 It should consume less resource. 它应该消耗更少的资源。

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

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