Page 1 of 2

I can't install Net-snmp

Posted: Thu Jun 07, 2012 9:42 am
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,

I can't install net-snmp

Posted: Thu Jun 07, 2012 9:49 am
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,

Re: I can't install Net-snmp

Posted: Thu Jun 07, 2012 6:58 pm
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.

Re: I can't install Net-snmp

Posted: Fri Jun 08, 2012 6:27 am
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?

Re: I can't install Net-snmp

Posted: Fri Jun 08, 2012 10:02 am
by agriffin
The package is named libnet-snmp-perl on Debian-based distros.

Re: I can't install Net-snmp

Posted: Fri Jun 08, 2012 11:02 am
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.

:|

Re: I can't install Net-snmp

Posted: Fri Jun 08, 2012 7:30 pm
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

Re: I can't install Net-snmp

Posted: Wed Jun 13, 2012 5:07 am
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?

Re: I can't install Net-snmp

Posted: Wed Jun 13, 2012 10:07 am
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.

Re: I can't install Net-snmp

Posted: Wed Jun 13, 2012 6:37 pm
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.