pet*_*rus 6 monitoring munin logging syslog filter
Munin 非常冗长,并且在每次运行时都会将一堆内容记录到munin-graph.log
、munin-html.log
和munin-limits.log
中。munin-update.log
munin-cron
log_level 0
我已经通过在munin-node.conf中设置来降低 munin-node 日志记录级别,效果很好。munin-node.log
仅在生成错误消息时更新。
不过我也尝试在 中添加相同的选项munin.conf
,但它使 munin 崩溃。
如何减少 munin 写入的日志量?
试图找出 munin.conf 中允许哪些字段,我最终阅读了源代码Config.pm的源代码。
不幸的是,对日志记录的唯一引用如下:
config => bless ( {
debug => 0,
logdir => $Munin::Common::Defaults::MUNIN_LOGDIR,
}, $class )
Run Code Online (Sandbox Code Playgroud)
但进一步查看源代码会显示最近对记录的消息的一些提交:
@@ -90,7 +90,7 @@ while (new CGI::Fast) {
my $pinpoint = undef;
my $path = $ENV{PATH_INFO} || "";
- INFO "Request path is $path";
+ DEBUG "Request path is $path";
# The full URL looks like this:
# Case 1:
@@ -133,7 +133,7 @@ while (new CGI::Fast) {
my ($dom, $host, $serv, $scale) =
$path =~ m#^/(.*)/([^/]+)/([\w-]+)-([\w=,]+)\.png#; ## avoid bug in vim
- INFO "asked for ($dom, $host, $serv, $scale)";
+ DEBUG "asked for ($dom, $host, $serv, $scale)";
if ($scale =~ /pinpoint=(\d+),(\d+)/) {
$pinpoint = [ $1, $2, ];
Run Code Online (Sandbox Code Playgroud)
我将 munin 升级到 2.0.6-1,因为我正在运行Debian stable 的 1.4.5-3,并且日志记录确实减少了!