Discussion:
problem while installing net snmp
anshul mittal
2009-04-30 17:46:32 UTC
Permalink
to install net snmp first i gave the ./configure command.then i gave make
command.
It is giving the following error

/usr/bin/ld: cannot find -lperl
collect2: ld returned 1 exit status
make[1]: *** [snmpd] Error 1
make[1]: Leaving directory
`/home/administrator/Desktop/net-snmp-5.4.2.1/agent'
make: *** [subdirs] Error 1

I did this as root.Also i tried to give --with perl-module==ARGS but it
didnt work.Can someone please tell me whats the problem
Regards

Anshul
Kuczynski, Edward
2009-04-30 18:24:47 UTC
Permalink
You need to install perl

Apt-get install perl

Ed (who may have a question later)

________________________________
From: anshul mittal [mailto:***@gmail.com]
Sent: Thursday, April 30, 2009 1:47 PM
To: net-snmp-***@lists.sourceforge.net
Subject: problem while installing net snmp

to install net snmp first i gave the ./configure command.then i gave make command.
It is giving the following error

/usr/bin/ld: cannot find -lperl
collect2: ld returned 1 exit status
make[1]: *** [snmpd] Error 1
make[1]: Leaving directory `/home/administrator/Desktop/net-snmp-5.4.2.1/agent'
make: *** [subdirs] Error 1

I did this as root.Also i tried to give --with perl-module==ARGS but it didnt work.Can someone please tell me whats the problem
Regards

Anshul
Kuczynski, Edward
2009-04-30 21:27:49 UTC
Permalink
OK, somehow I've missed something. I have it working on fedora core9. Looked at the FAQ.

Switched over to a new machine, debian, that already has net-snmp installed.

Ran mib2c fine. Got output .c/.h and copied to netsnmp/agent/mibgroup and added code AND logging. Especially in the init_XXXobject.
Ran configure -with-mib-modules="XXXobject"
Ran make, make install. Yes .o and .lo are remade.

Ran net-snmp-config -configure-options and I see "-with-mib-modules="XXXobject"

Then ran daemon, snmpd with debug and I see NO debug output from the init_XXXXobject like I do in fedora. Tailing /var/log/snmpd.log
So please tell me what did I miss?? I do see the request go to the agent, and it knows the alpha name of the object.

Snmptranslate will work. But an snmpget gives the expected no such object in agent(expected since I never saw the load msg)

I doubt it's a permission issue, its all read only, and I config'd for v2c read only with public. But that shouldn't stop it from calling init should it?

So why won't it call the init?, Isn't the new MIB code now linked into the main agent? How do you debug this. IS there a -D token I can use???

Thanks in advance.
Ed
Dave Shield
2009-05-01 07:53:17 UTC
Permalink
Post by Kuczynski, Edward
Then ran daemon, snmpd with debug and I see NO debug output from the
init_XXXXobject like I do in fedora. Tailing /var/log/snmpd.log
So please tell me what did I miss??
One possibility is that you have two agents installed on the system,
and the running agent is the "other one" (without your new module).
Try retrieving the value of UCD-SNMP-MIB::versionConfigurationOptions.0
This should give you the same results as net-snmp-config

Also, if you walk the NET-SNMP-AGENT-MIB::nsModuleName object,
you ought to see mention of your new module - assuming that it's
being registered correctly. Though given your report, I strongly suspect
that it won't be there.
Post by Kuczynski, Edward
I do see the request go to the agent,
and it knows the alpha name of the object.
What do you mean by "know[ing] the alpha name of the object"?
Post by Kuczynski, Edward
Snmptranslate will work.
That simply means that the MIB file is in place, and is being read
in by the library MIB parser. In the same way, the command line
tools (snmpget, snmpwalk, etc) will be reading in the MIB file, and
hence able to ask for your new MIB objects.
But that's completely separate from whether the agent actually
*implements* these objects,
Post by Kuczynski, Edward
I doubt it’s a permission issue, its all read only, and I config’d for v2c
read only with public. But that shouldn’t stop it from calling init should it?
No.
That should be invoked when the agent first starts up.

It's probably worth checking that the file
agent/mibgroup/mib_modules_inits.h
does make mention of init_XXXobject.

Just to check - what is the filename of the code file that contains
this initialisation routine?

Dave
Kuczynski, Edward
2009-05-04 19:29:44 UTC
Permalink
Thanks Dave,

I did check and did not have another agent running.
Checked version and saw the module.
Didn't see it in nsModulename
Snmptranslate works, and the snmpget can take the oid alpha name and print the oid.
So I did an apt-get remove and then installed from the tarball, and it worked!!
I'll have to investigate more later if time allows.
Thanks again Dave


Ed


-----Original Message-----
From: ***@googlemail.com [mailto:***@googlemail.com] On Behalf Of Dave Shield
Sent: Friday, May 01, 2009 3:53 AM
To: Kuczynski, Edward
Cc: net-snmp-***@lists.sourceforge.net
Subject: Re: problem getting agent to call mib init code
Post by Kuczynski, Edward
Then ran daemon, snmpd with debug and I see NO debug output from the
init_XXXXobject like I do in fedora. Tailing /var/log/snmpd.log
So please tell me what did I miss??
One possibility is that you have two agents installed on the system,
and the running agent is the "other one" (without your new module).
Try retrieving the value of UCD-SNMP-MIB::versionConfigurationOptions.0
This should give you the same results as net-snmp-config

Also, if you walk the NET-SNMP-AGENT-MIB::nsModuleName object,
you ought to see mention of your new module - assuming that it's
being registered correctly. Though given your report, I strongly suspect
that it won't be there.
Post by Kuczynski, Edward
I do see the request go to the agent,
and it knows the alpha name of the object.
What do you mean by "know[ing] the alpha name of the object"?
Post by Kuczynski, Edward
Snmptranslate will work.
That simply means that the MIB file is in place, and is being read
in by the library MIB parser. In the same way, the command line
tools (snmpget, snmpwalk, etc) will be reading in the MIB file, and
hence able to ask for your new MIB objects.
But that's completely separate from whether the agent actually
*implements* these objects,
Post by Kuczynski, Edward
I doubt it's a permission issue, its all read only, and I config'd for v2c
read only with public. But that shouldn't stop it from calling init should it?
No.
That should be invoked when the agent first starts up.

It's probably worth checking that the file
agent/mibgroup/mib_modules_inits.h
does make mention of init_XXXobject.

Just to check - what is the filename of the code file that contains
this initialisation routine?

Dave

Kuczynski, Edward
2009-04-30 21:38:52 UTC
Permalink
I didn't see this show up, so sorry if it's a repeat.

Install perl
Apt-get install perl-dev

________________________________
From: anshul mittal [mailto:***@gmail.com]
Sent: Thursday, April 30, 2009 1:47 PM
To: net-snmp-***@lists.sourceforge.net
Subject: problem while installing net snmp

to install net snmp first i gave the ./configure command.then i gave make command.
It is giving the following error

/usr/bin/ld: cannot find -lperl
collect2: ld returned 1 exit status
make[1]: *** [snmpd] Error 1
make[1]: Leaving directory `/home/administrator/Desktop/net-snmp-5.4.2.1/agent'
make: *** [subdirs] Error 1

I did this as root.Also i tried to give --with perl-module==ARGS but it didnt work.Can someone please tell me whats the problem
Regards

Anshul
Loading...