简体   繁体   English

Munin Graph-如何设置MySQL慢查询和munin统计信息的最大上限?

[英]Munin Graph - How To Set Max Upper Limit For mysql slowqueries & munin stats?

Wow, this is my very first post on stackoverflow! 哇,这是我关于stackoverflow的第一篇文章! Been using results for years, but this is the first time I'm 100% stumped and decided to join! 多年来一直使用结果,但这是我第一次100%陷入困境并决定加入!

I use Munin to monitor and graph stuff like CPU, Memory, Loads, etc. on my VPS. 我使用Munin在我的VPS上监视和绘制CPU,内存,负载等内容并对其绘制图形。

Sometimes I get a huge statistical outlier data point that throws my graphs out of whack. 有时,我会得到一个巨大的统计异常数据点,这使我的图表显得格格不入。 I want to set the upper limit for these graphs to simply avoid having these outliers impact the rest of the data view. 我想为这些图表设置上限,以仅避免这些异常值影响数据视图的其余部分。

After hours of digging and experimenting I was able to change the upper limit on Loads by doing the following: 经过数小时的挖掘和试验,我可以通过执行以下操作来更改载荷的上限:

cd /etc/munin/plugins
pico load

I changed: echo 'graph_args --base 1000 -l 0' 我改变了: echo 'graph_args --base 1000 -l 0'

to: echo 'graph_args --base 1000 -l 0 -u 5 --rigid' 至: echo 'graph_args --base 1000 -l 0 -u 5 --rigid'

It worked perfectly! 效果很好!

Unfortunately I've tried everything to get munin stats processing time and mysql slowqueries to have an upper limit and can't figure it out! 不幸的是,我已经尽一切努力使munin stats处理时间和mysql slowqueries有一个上限,无法弄清楚!

Here is the line in mysql_slowqueries 这是mysql_slowqueries中的行

echo 'graph_args --base 1000 -l 0'

... and for munin_stats ...以及munin_stats

"graph_args --base 1000 -l 0\n",

I've tried every combo of -u and --upper-limit for both of those and nothing I do is impacting the display of the graph to show a max upper limit. 我已经尝试了-u--upper-limit每个组合,而我所做的任何事情都不会影响图形的显示以显示最大上限。

Any ideas on what I need to change those lines to so I can get a fixed upper limit max? 关于我需要将这些行更改为什么的任何想法,以便可以获得固定的最大上限?

Thanks! 谢谢!

I highly encourage playing with the scripts, even though you run the risk of them being overwritten by an update. 我极力鼓励您使用脚本,即使您冒着被更新覆盖的风险。 Just back them up and replace them if you think it's needed. 只需备份它们,并在需要时更换它们。 If you have built or improved things, don't forget to share them with us on github: https://github.com/munin-monitoring/munin 如果您已经构建或改进了东西,请不要忘记在github上与我们分享它们: https//github.com/munin-monitoring/munin

When you set --upper-limit to 100 and your value is 110, your graph will run to 110. If you add --rigid , your graph scale will stay at 100, and the line will be clipped, which is what you wanted in this case. 当您将--upper-limit设置为100且值是110时,图形将运行到110。如果添加--rigid ,则图形比例将保持在100,并且将剪切线,这就是您想要的在这种情况下。

Your mysql_slowqueries graph line should read something like (it puts a limit on 100): 您的mysql_slowqueries图行应显示类似(它限制为100):

echo 'graph_args --base 1000 -l 0 --upper-limit 100 --rigid'

Changing the scripts ist highly discouraged since with the next update they might be replaced by the package manager and ando your changes. 强烈建议不要更改脚本,因为在下一次更新时,它们可能会被程序包管理器和您所做的更改所取代。

Munin gives you different ways to define limits on the settings. Munin提供了不同的方法来定义设置限制。 One the node itself as well as on the server. 一个节点本身以及服务器上。

You can find (sort of) an answer in the FAQ. 您可以在常见问题解答中找到答案。

For me it worked really nicely to just create a file named /etc/munin/plugin-conf.d/load.conf with the following content: 对我来说,仅创建一个名为/etc/munin/plugin-conf.d/load.conf的文件,其内容如下:

[load]
    env.load_warning 5
    env.load_critical 10

Restart munin-node to apply the changes and on the next update of the graph you can see theat the "warning" and "critical" levels have been set by clocking on the load-graph in the overview (table below the graphs) 重新启动munin节点以应用更改,并在图表的下一次更新中,您可以通过在概述中的负载图表上进行计时来设置“警告”和“关键”级别(图表下方的表)

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

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