Memcached:插件Munin错误

时间:2013-02-21 17:55:03

标签: memcached munin

下午好。

我正在尝试使用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";

我很难找到解决方案。亲切的,有人能帮助我吗?

谢谢。

1 个答案:

答案 0 :(得分: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*