1

我正在尝试安装munin-mysql 插件,但遇到了一个奇怪的错误。DBI.pmMunin 抱怨它在@INC 中找不到:

[root@mybox perl5]# munin-run mysql
Can't locate DBI.pm in @INC (@INC contains: /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 .) at /etc/munin/plugins/mysql line 127.
BEGIN failed--compilation aborted at /etc/munin/plugins/mysql line 127.

但是,它确实在路径中,并且恰好在/usr/local/lib64/perl5. 它是通过命令安装的cpanm DBI。事实上,有几个DBI.pm文件;我怎么知道要使用哪一个?

[root@mybox perl5]# find / -name DBI.pm
/root/.cpan/build/DBI-1.634-Aazmvi/blib/lib/Bundle/DBI.pm
/root/.cpan/build/DBI-1.634-Aazmvi/blib/lib/DBI.pm
/root/.cpan/build/DBI-1.634-Aazmvi/lib/Bundle/DBI.pm
/root/.cpan/build/DBI-1.634-Aazmvi/DBI.pm
/root/.cpanm/work/1460983027.32244/DBI-1.634/blib/lib/Bundle/DBI.pm
/root/.cpanm/work/1460983027.32244/DBI-1.634/blib/lib/DBI.pm
/root/.cpanm/work/1460983027.32244/DBI-1.634/lib/Bundle/DBI.pm
/root/.cpanm/work/1460983027.32244/DBI-1.634/DBI.pm
/root/munin-mysql-master/t/mock/DBI.pm
/usr/local/lib64/perl5/Bundle/DBI.pm
/usr/local/lib64/perl5/DBI.pm

相关问题:

4

1 回答 1

3

munin-run切换用户。默认用户是nobody。该用户可能没有读取文件的权限。

该脚本必须以足够的权限运行,通常以 root 身份运行,因为它切换到 munin-node 的默认用户(通常是“nobody”)或任何专门配置为运行给定插件的用户。

检查munin-run --debug它以哪个用户身份运行并检查该用户是否可以阅读/usr/local/lib64/perl5/DBI.pm.

于 2016-04-18T17:08:09.813 回答