[Nut-upsdev] SNMP And SuSE
Eric Wilde
ewilde at bsmdevelopment.com
Fri Jan 28 21:23:48 UTC 2011
Attempting to install the SNMP driver on Enterprise SuSE 10.0. The
version of NUT is 2.6.0.
To begin with, I installed the net-snmp and net-snmp-devel packages,
using YAST. If I do this command:
net-snmp-config --version --base-cflags --libs
The result is:
5.3.0.1
-DINET6 -O2 -fmessage-length=0 -Wall -D_FORTIFY_SOURCE=2 -g \
-fno-strict-aliasing -fstack-protector-all -Dlinux \
-I/usr/include/rpm -I/usr/include
-L/usr/lib64 -lnetsnmp -lcrypto -lm -L/usr/lib -lwrap
If I then execute the configure command:
./configure --with-user=ups --with-group=ups --sysconfdir=/etc/ups \
--mandir=/usr/share/man --witn-snmp
I get this message:
configure: error: "Net-SNMP libraries not found, required for
SNMP drivers"
The claim that the library doesn't exist is incorrect. The library
is properly installed, as demonstrated by the "net-snmp-config"
command. Rather, configure fails because the configure step that
checks "for ac_func in init_snmp" fails to compile properly. Even
if the library is properly installed, the compile fails and configure
assumes that the library isn't present. Incidentally, the installed
library does include the "init_snmp" entry point.
The configure code in question reads like this:
ac_fn_c_check_func "$LINENO" "init_snmp" "ac_cv_func_init_snmp"
if test "x$ac_cv_func_init_snmp" = x""yes; then :
cat >>confdefs.h <<_ACEOF
#define HAVE_INIT_SNMP 1
_ACEOF
I was able to bypass the problem by changing it to this:
if test "x$ac_cv_func_init_snmp" != x""yes; then :
Naturally, this is just a kludge, not a permanent fix, which would
require figuring out why the compile fails.
Anyway, by making this kludge, the configure step is able to
complete. However, the "-L/usr/lib -lwrap" value returned by the
"net-snmp-config" command is bogus. The Makefile must also be
hacked to remove this parameter from the link flags in both the
top-level Makefile and the "drivers" subdirectory Makefile.
After that, the code compiles correctly. It also runs correctly.
Incidentally, the remarks in the snmp-ups driver man page that say
"APC AP9606 APC Web/SNMP management card, perhaps others" could
definitely use updating, since the driver categorically works with
the AP9617 card. Since the AP9617 card is programmatically
identical to the AP9618 and AP9619 cards, I'd say that it's safe to
claim that the driver works with all three.
One more note. I flashed the AP9617 firmware to the latest
"apc_hw02_aos373_sumx372" version. I'm using V1.0 SNMP. No idea
whether V3.0 SNMP works.
Eric Wilde
More information about the Nut-upsdev
mailing list