perlquestion
suba
<p> Update </p>
Sorry, this was my mistake. The error did not come from the script, but another module that already tried to load the same mibs before the addMibDirs in the main script. Don't ask why... After removing the other LoadModule everything works.
<strike>
<p>Does anyone use the SNMP module? (not Net::SNMP)?</p>
<p>I have the following code:</p>
<code>
&SNMP::addMibDirs("FULL_PATH/mibs");
&SNMP::loadModules("IRONPORT-SMI","ASYNCOS-MAIL-MIB");
</code>
<p>Script is located in FULL_PATH.</p>
<p>If my CWD is FULL_PATH everything is great.
Otherwise I get:</p>
<code>
Cannot find module (IRONPORT-SMI): At line 0 in (none)
Cannot find module (ASYNCOS-MAIL-MIB): At line 0 in (none)
</code>
<p>
I did an strace and see (shortened the output a bit):
</p>
<code>
stat64("./mibs/.index" ... -1 ENOENT
open("./mibs" ... = -1 ENOENT
write(2, "Cannot find module (IRONPORT-SMI"...
write(2, "Cannot find module (ASYNCOS-MAIL"...
</code>
a bit later...
<code>
stat64("FULL_PATH/mibs/.index" ... = 0
stat64("FULL_PATH/mibs" ... = 0
open("FULL_PATH/mibs/.index" ... = 3
</code>
and continues to open and read the necessary MIB-Files. Even stranger: I use all OIDs by Name, not numbers some work some lead to "Unknown Object Identifier".
<p>
I could just drop the needed MIBs in the default directories, but this does bug me a bit. What am I doing wrong?
</p>
</strike>