我正在嘗試使用perl編寫的slapd_
munin插件,我幾乎不知道該插件。 The full plugin is available here。我得到的錯誤是這一個:slapd_ 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;
我通過outputing所有變量試圖調試/對象如下:
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.
由於所有的變量似乎設置,我真的不明白我得到的錯誤信息
問:任何人都可以建議如何調試此腳本?
您確定$ basedn已被賦值嗎?用參考打印 – canavanin