I can't install Net-snmp

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Jethro
Posts: 11
Joined: Thu Jun 07, 2012 9:25 am

I can't install Net-snmp

Post by Jethro »

Hey,
I keep getting the (Return code of 127 is out of bounds - plugin may be missing) error on the web browser when I am trying to use the check_snmp service. I have looked at this is because I have no check_snmp, I thought that if I installed net-snmp and net-snmp-utils it would help to resolve this. I tried apt-get install net-snmp and apt-get install net-snmp-utils, both times I get the error 'E: Unable to locate package'. I tried to download net-snmp-5.7.1 and unzip and install it. It unzipped successfully then I tried to ./configure && make && make install where it started to work but then said:
/usr/bin/ld: cannot find -lperl
collect2: ld returned 1 exit status
make[1]: *** [libnetsnmpagent.la] Error 1
make[1]: Leaving directory `/usr/local/nagios/libexec/extra/net-snmp-5.7.1/agent'
make: *** [subdirs] Error 1

I can't find a successful way to install net-snmp and net-snmp-utils.
Can somebody please help me?
Thanks,
Jethro
Posts: 11
Joined: Thu Jun 07, 2012 9:25 am

I can't install net-snmp

Post by Jethro »

Hey,
I was having troubles with the finding the uptime using check_snmp so I checked my plugins to see if it was in there and it wasn't. I therefore tried to install net-snmp and net-snmp-utils to help resolve this issue. I tried apt-get install with both of these but they both came back saying E : Unable to locate package, I updated my apt-get list and still no luck. I then tried to download the net-snmp-5.7.1 and it was installing perfectly until it gave me this message:
/usr/bin/ld: cannot find -lperl
collect2: ld returned 1 exit status
make[1]: *** [libnetsnmpagent.la] Error 1
make[1]: Leaving directory `/usr/local/nagios/libexec/extra/net-snmp-5.7.1/agent'
make: *** [subdirs] Error 1
I can't find any successful way to install net-snmp and net-snmp-utils, please could somebody help me. I am using Ubuntu server 11.04.
Thanks,
User avatar
jsmurphy
Posts: 989
Joined: Wed Aug 18, 2010 9:46 pm

Re: I can't install Net-snmp

Post by jsmurphy »

I think you've got several hurdles here:

1. You need to install perl: apt-get perl
2. Then you need the SNMP utilities: apt-get net-snmp and net-snmp-utils
3. Recompile the nagios-plugins package... this time it should create check_snmp
4. Profit.

I think that will get you well on your way to some SNMP monitoring.
Jethro
Posts: 11
Joined: Thu Jun 07, 2012 9:25 am

Re: I can't install Net-snmp

Post by Jethro »

Thanks for the quick answer but I already have perl and it is the latest version. apt-get net-snmp still comes back with E: Unable to locate package
Do you have any other ideas?
agriffin
Posts: 876
Joined: Mon May 09, 2011 9:36 am

Re: I can't install Net-snmp

Post by agriffin »

The package is named libnet-snmp-perl on Debian-based distros.
Jethro
Posts: 11
Joined: Thu Jun 07, 2012 9:25 am

Re: I can't install Net-snmp

Post by Jethro »

apt-get install libnet-snmp-perl
Reading package lists... Done
Building dependency tree
Reading state information... Done
libnet-snmp-perl is already the newest version.
libnet-snmp-perl set to manually installed.
0 upgraded, 0 newly installed, 0 to remove and 5 not upgraded.

:|
User avatar
jsmurphy
Posts: 989
Joined: Wed Aug 18, 2010 9:46 pm

Re: I can't install Net-snmp

Post by jsmurphy »

So after some quick google wizardry it seems you need to install the libperl-dev package as well: apt-get install libperl-dev
Jethro
Posts: 11
Joined: Thu Jun 07, 2012 9:25 am

Re: I can't install Net-snmp

Post by Jethro »

Thanks again, libperl-dev installed perfectly. However net-snmp and net-snmp-utils still can't be located. Am I doing something very wrong?
agriffin
Posts: 876
Joined: Mon May 09, 2011 9:36 am

Re: I can't install Net-snmp

Post by agriffin »

I don't know what's going wrong exactly. You could just try installing nagios-plugins-standard with apt and copy the check_snmp binary from there.
User avatar
jsmurphy
Posts: 989
Joined: Wed Aug 18, 2010 9:46 pm

Re: I can't install Net-snmp

Post by jsmurphy »

agriffin wrote:I don't know what's going wrong exactly. You could just try installing nagios-plugins-standard with apt and copy the check_snmp binary from there.
Agreed you've officially stumped me, I haven't done a ubuntu install of Nagios for nearly 4 years now (so things have probably changed a lot)... but I don't remember coming across this particular issue.
Locked