1

下午好。

我正在尝试使用 memcached 插件,当我使用命令“munin-run”测试它们时出现错误。

返回的错误是:

Use of uninitialized value $ip in substitution (s///) at /etc/munin/plugins/memcached_hits line 28.
Use of uninitialized value $ip in concatenation (.) or string at /etc/munin/plugins/memcached_hits line 29.
Use of uninitialized value $port in concatenation (.) or string at /etc/munin/plugins/memcached_hits line 29.
Use of uninitialized value $ip in hash element at /usr/share/perl5/Cache/Memcached.pm line 253.
Use of uninitialized value $ip in index at /usr/share/perl5/Cache/Memcached.pm line 279.
Use of uninitialized value in subroutine entry at /usr/share/perl5/Cache/Memcached.pm line 288.
Bad arg length for Socket::pack_sockaddr_in, length is 0, should be 4 at /usr/lib/perl/5.14/Socket.pm line 260.

memcached_hits 插件的第 28 行和第 29 行,分别参考下面的代码:

$ip =~ s/_/./g;
my $address = "$ip:$port";

我很难找到解决方案。任何人都可以帮助我吗?

谢谢你。

4

1 回答 1

2

确保您的 memcached 配置文件可能位于此处:

/etc/munin/plugin-conf.d/memcached

看起来像这样:

[memcached_*]
env.host 127.0.0.1
env.port 11211
env.timescale 3

一些默认配置文件包含有关 env 行的额外信息,如下所示:

# BAD! DELETE *default*
[memcached_*]
env.host 127.0.0.1  *default*
env.port 11211      *default*
env.timescale 3     *default*
于 2013-03-25T16:34:05.123 回答