我正在尝试实现slapd_
用 perl 编写的 munin 插件,我对此一无所知。完整的插件可在此处获得。我得到的错误是这个:
Use of uninitialized value in concatenation (.) or string at
/etc/munin/plugins/slapd_localhost line 232, <DATA> line 275.
第 232 行是这一行:
my $searchdn = $ops{$action}->{'search'} . "," . $basedn;
我尝试通过输出所有变量/对象进行调试,如下所示:
use Data::Dumper; # top of script
# [...]
print Dumper(%ops);
print "action = [$action]\n";
print "basedn = [$basedn]\n\n";
my $searchdn = $ops{$action}->{'search'} . "," . $basedn;
当我再次运行它时,我得到的是:
[...] # 15 other variables belonging to $ops
$VAR16 = {
'info' => 'The graph shows the number of Waiters',
'search' => 'cn=Waiters',
'desc' => 'The current number of Waiters',
'filter' => '(|(cn=Write)(cn=Read))',
'title' => 'Number of Waiters',
'label2' => {
'read' => 'Read',
'write' => 'Write'
},
'vlabel' => 'Waiters'
};
action = [localhost]
action = [cn=Monitor]
Use of uninitialized value in concatenation (.) or string at /etc/munin/plugins/slapd_localhost line 237, <DATA> line 275.
由于似乎设置了所有变量,我真的不明白我收到的错误消息
问:有人可以建议如何调试这个脚本吗?