ubuntu 14.04 Install SPINE engine for Cacti
1.- Download package
Web site: http://cacti.net/spine_download.php
Package: cacti-spine-0.8.8c.tar.gz
wget http://www.cacti.net/downloads/spine/cacti-spine-0.8.8c.tar.gz tar -xzvf cacti-spine-0.8.8c.tar.gz cd cacti-spine-0.8.8c
2.- Prepare development environment
Be sure you have autoconf, automake and libtool to compile.
apt-get install autoconf automake libtool apt-get install libsnmp-dev libsnmp-base libsnmp30 apt-get install mysql-client libmysqlclient-dev
3.- Install Spine
305 #LDFLAGS="-L$SNMP_LIBDIR $LDFLAGS" 306 if test -n "$SNMP_LIBDIR"; then 307 LDFLAGS="-L$SNMP_LIBDIR $LDFLAGS" 308 fi UCD-SNMP error configure.ac 수정 348 #if test "$USE_NET_SNMP" = "no"; then 349 # AC_CHECK_LIB(snmp, snmp_timeout, 350 # LIBS="-lsnmp $LIBS", 351 # AC_MSG_ERROR(Cannot find UCD-SNMP libraries(snmp))) 352 #fi
vi cacti-spine-0.8.8c/configure.ac
a.-aclocal
aclocal
b.- libtoolize –force
libtoolize --force libtoolize: putting auxiliary files in AC_CONFIG_AUX_DIR, `config'. libtoolize: linking file `config/ltmain.sh' libtoolize: Consider adding `AC_CONFIG_MACRO_DIR([m4])' to configure.ac and libtoolize: rerunning libtoolize, to keep the correct libtool macros in-tree. libtoolize: Consider adding `-I m4' to ACLOCAL_AMFLAGS in Makefile.am.
c.- autoheader, autoconf and automake
autoheader autoconf automake --add-missing configure.ac:12: warning: AM_INIT_AUTOMAKE: two- and three-arguments forms are deprecated. For more info, see: configure.ac:12: http://www.gnu.org/software/automake/manual/automake.html#Modernize-AM_005fINIT_005fAUTOMAKE-invocation
d.- ./configure
./configure checking build system type... x86_64-unknown-linux-gnu checking host system type... x86_64-unknown-linux-gnu checking for a BSD-compatible install... /usr/bin/install -c checking whether build environment is sane... yes checking for a thread-safe mkdir -p... /bin/mkdir -p checking for gawk... gawk checking whether make sets $(MAKE)... yes checking whether make supports nested variables... yes checking for gawk... (cached) gawk checking for gcc... gcc checking whether the C compiler works... yes checking for C compiler default output file name... a.out checking for suffix of executables... checking whether we are cross compiling... no checking for suffix of object files... o checking whether we are using the GNU C compiler... yes checking whether gcc accepts -g... yes checking for gcc option to accept ISO C89... none needed checking whether gcc understands -c and -o together... yes checking for style of include used by make... GNU checking dependency style of gcc... gcc3 checking how to run the C preprocessor... gcc -E checking whether ln -s works... yes checking how to print strings... printf checking for a sed that does not truncate output... /bin/sed checking for grep that handles long lines and -e... /bin/grep checking for egrep... /bin/grep -E checking for fgrep... /bin/grep -F checking for ld used by gcc... /usr/bin/ld checking if the linker (/usr/bin/ld) is GNU ld... yes checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B checking the name lister (/usr/bin/nm -B) interface... BSD nm checking the maximum length of command line arguments... 1572864 checking whether the shell understands some XSI constructs... yes checking whether the shell understands "+="... yes checking how to convert x86_64-unknown-linux-gnu file names to x86_64-unknown-linux-gnu format... func_convert_file_noop checking how to convert x86_64-unknown-linux-gnu file names to toolchain format... func_convert_file_noop checking for /usr/bin/ld option to reload object files... -r checking for objdump... objdump checking how to recognize dependent libraries... pass_all checking for dlltool... no checking how to associate runtime and link libraries... printf %s\n checking for ar... ar checking for archiver @FILE support... @ checking for strip... strip checking for ranlib... ranlib checking command to parse /usr/bin/nm -B output from gcc object... ok checking for sysroot... no checking for mt... mt checking if mt is a manifest tool... no checking for ANSI C header files... yes checking for sys/types.h... yes checking for sys/stat.h... yes checking for stdlib.h... yes checking for string.h... yes checking for memory.h... yes checking for strings.h... yes checking for inttypes.h... yes checking for stdint.h... yes checking for unistd.h... yes checking for dlfcn.h... yes checking for objdir... .libs checking if gcc supports -fno-rtti -fno-exceptions... no checking for gcc option to produce PIC... -fPIC -DPIC checking if gcc PIC flag -fPIC -DPIC works... yes checking if gcc static flag -static works... yes checking if gcc supports -c -o file.o... yes checking if gcc supports -c -o file.o... (cached) yes checking whether the gcc linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes checking whether -lc should be explicitly linked in... no checking dynamic linker characteristics... GNU/Linux ld.so checking how to hardcode library paths into programs... immediate checking whether stripping libraries is possible... yes checking if libtool supports shared libraries... yes checking whether to build shared libraries... yes checking whether to build static libraries... yes checking whether to enable -Wall... no checking for threadsafe gethostbyname()... no checking for gethostbyname_r in -lnls... no checking for socket in -lsocket... no checking for floor in -lm... yes checking for pthread_exit in -lpthread... yes checking for deflate in -lz... yes checking for kstat_close in -lkstat... no checking for CRYPTO_realloc in -lcrypto... yes checking for ANSI C header files... (cached) yes checking sys/socket.h usability... yes checking sys/socket.h presence... yes checking for sys/socket.h... yes checking sys/select.h usability... yes checking sys/select.h presence... yes checking for sys/select.h... yes checking sys/wait.h usability... yes checking sys/wait.h presence... yes checking for sys/wait.h... yes checking sys/time.h usability... yes checking sys/time.h presence... yes checking for sys/time.h... yes checking assert.h usability... yes checking assert.h presence... yes checking for assert.h... yes checking ctype.h usability... yes checking ctype.h presence... yes checking for ctype.h... yes checking errno.h usability... yes checking errno.h presence... yes checking for errno.h... yes checking signal.h usability... yes checking signal.h presence... yes checking for signal.h... yes checking math.h usability... yes checking math.h presence... yes checking for math.h... yes checking malloc.h usability... yes checking malloc.h presence... yes checking for malloc.h... yes checking netdb.h usability... yes checking netdb.h presence... yes checking for netdb.h... yes checking for signal.h... (cached) yes checking stdarg.h usability... yes checking stdarg.h presence... yes checking for stdarg.h... yes checking stdio.h usability... yes checking stdio.h presence... yes checking for stdio.h... yes checking syslog.h usability... yes checking syslog.h presence... yes checking for syslog.h... yes checking for netinet/in_systm.h... yes checking for netinet/in.h... yes checking for netinet/ip.h... yes checking for netinet/ip_icmp.h... yes checking for unsigned long long... yes checking for long long... yes checking for an ANSI C-conforming const... yes checking for size_t... yes checking whether time.h and sys/time.h may both be included... yes checking whether struct tm is in sys/time.h or time.h... time.h checking return type of signal handlers... void checking for malloc... yes checking for calloc... yes checking for gettimeofday... yes checking for strerror... yes checking for strtoll... yes checking priv.h usability... no checking priv.h presence... no checking for priv.h... no checking whether we are using Solaris privileges... no checking sys/capability.h usability... no checking sys/capability.h presence... no checking for sys/capability.h... no checking whether we are using Linux Capabilities... no checking for mysql_init in -lmysqlclient_r... yes checking for mysql_thread_init in -lmysqlclient_r... yes checking if UCD-SNMP needs crypto support... no checking if Net-SNMP needs crypto support... yes checking for snmp_timeout in -lnetsnmp... no Cannot find NET-SNMP libraries(snmp)... checking UCD-SNMP checking for the spine results buffer size... 1024 bytes checking for the maximum simultaneous spine scripts... 20 checking for the maximum MySQL buffer size... 65536 checking whether we are using traditional popen... no checking whether to verify net-snmp library vs header versions... no checking for glibc gethostbyname_r... no checking for Solaris/Irix gethostbyname_r... no checking for HP-UX gethostbyname_r... no checking that generated files are newer than configure... done configure: creating ./config.status config.status: creating Makefile config.status: creating config/config.h config.status: executing depfiles commands config.status: executing libtool commands
e.- make
make CDPATH="${ZSH_VERSION+.}:" && cd . && /bin/bash /tmp/cacti-spine-0.8.8c/config/missing aclocal-1.14 cd . && /bin/bash /home/webadm/cacti-spine-0.8.8c/config/missing automake-1.14 --gnu configure.ac:12: warning: AM_INIT_AUTOMAKE: two- and three-arguments forms are deprecated. For more info, see: configure.ac:12: http://www.gnu.org/software/automake/manual/automake.html#Modernize-AM_005fINIT_005fAUTOMAKE-invocation CDPATH="${ZSH_VERSION+.}:" && cd . && /bin/bash /tmp/cacti-spine-0.8.8c/config/missing autoconf /bin/bash ./config.status --recheck running CONFIG_SHELL=/bin/bash /bin/bash ./configure --no-create --no-recursion checking build system type... x86_64-unknown-linux-gnu checking host system type... x86_64-unknown-linux-gnu checking for a BSD-compatible install... /usr/bin/install -c checking whether build environment is sane... yes checking for a thread-safe mkdir -p... /bin/mkdir -p checking for gawk... gawk checking whether make sets $(MAKE)... yes checking whether make supports nested variables... yes checking for gawk... (cached) gawk checking for gcc... gcc checking whether the C compiler works... yes checking for C compiler default output file name... a.out checking for suffix of executables... checking whether we are cross compiling... no checking for suffix of object files... o checking whether we are using the GNU C compiler... yes checking whether gcc accepts -g... yes checking for gcc option to accept ISO C89... none needed checking whether gcc understands -c and -o together... yes checking for style of include used by make... GNU checking dependency style of gcc... gcc3 checking how to run the C preprocessor... gcc -E checking whether ln -s works... yes checking how to print strings... printf checking for a sed that does not truncate output... /bin/sed checking for grep that handles long lines and -e... /bin/grep checking for egrep... /bin/grep -E checking for fgrep... /bin/grep -F checking for ld used by gcc... /usr/bin/ld checking if the linker (/usr/bin/ld) is GNU ld... yes checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B checking the name lister (/usr/bin/nm -B) interface... BSD nm checking the maximum length of command line arguments... 3458764513820540925 checking whether the shell understands some XSI constructs... yes checking whether the shell understands "+="... yes checking how to convert x86_64-unknown-linux-gnu file names to x86_64-unknown-linux-gnu format... func_convert_file_noop checking how to convert x86_64-unknown-linux-gnu file names to toolchain format... func_convert_file_noop checking for /usr/bin/ld option to reload object files... -r checking for objdump... objdump checking how to recognize dependent libraries... pass_all checking for dlltool... no checking how to associate runtime and link libraries... printf %s\n checking for ar... ar checking for archiver @FILE support... @ checking for strip... strip checking for ranlib... ranlib checking command to parse /usr/bin/nm -B output from gcc object... ok checking for sysroot... no checking for mt... mt checking if mt is a manifest tool... no checking for ANSI C header files... yes checking for sys/types.h... yes checking for sys/stat.h... yes checking for stdlib.h... yes checking for string.h... yes checking for memory.h... yes checking for strings.h... yes checking for inttypes.h... yes checking for stdint.h... yes checking for unistd.h... yes checking for dlfcn.h... yes checking for objdir... .libs checking if gcc supports -fno-rtti -fno-exceptions... no checking for gcc option to produce PIC... -fPIC -DPIC checking if gcc PIC flag -fPIC -DPIC works... yes checking if gcc static flag -static works... yes checking if gcc supports -c -o file.o... yes checking if gcc supports -c -o file.o... (cached) yes checking whether the gcc linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes checking whether -lc should be explicitly linked in... no checking dynamic linker characteristics... GNU/Linux ld.so checking how to hardcode library paths into programs... immediate checking whether stripping libraries is possible... yes checking if libtool supports shared libraries... yes checking whether to build shared libraries... yes checking whether to build static libraries... yes checking whether to enable -Wall... no checking for threadsafe gethostbyname()... no checking for gethostbyname_r in -lnls... no checking for socket in -lsocket... no checking for floor in -lm... yes checking for pthread_exit in -lpthread... yes checking for deflate in -lz... yes checking for kstat_close in -lkstat... no checking for CRYPTO_realloc in -lcrypto... yes checking for ANSI C header files... (cached) yes checking sys/socket.h usability... yes checking sys/socket.h presence... yes checking for sys/socket.h... yes checking sys/select.h usability... yes checking sys/select.h presence... yes checking for sys/select.h... yes checking sys/wait.h usability... yes checking sys/wait.h presence... yes checking for sys/wait.h... yes checking sys/time.h usability... yes checking sys/time.h presence... yes checking for sys/time.h... yes checking assert.h usability... yes checking assert.h presence... yes checking for assert.h... yes checking ctype.h usability... yes checking ctype.h presence... yes checking for ctype.h... yes checking errno.h usability... yes checking errno.h presence... yes checking for errno.h... yes checking signal.h usability... yes checking signal.h presence... yes checking for signal.h... yes checking math.h usability... yes checking math.h presence... yes checking for math.h... yes checking malloc.h usability... yes checking malloc.h presence... yes checking for malloc.h... yes checking netdb.h usability... yes checking netdb.h presence... yes checking for netdb.h... yes checking for signal.h... (cached) yes checking stdarg.h usability... yes checking stdarg.h presence... yes checking for stdarg.h... yes checking stdio.h usability... yes checking stdio.h presence... yes checking for stdio.h... yes checking syslog.h usability... yes checking syslog.h presence... yes checking for syslog.h... yes checking for netinet/in_systm.h... yes checking for netinet/in.h... yes checking for netinet/ip.h... yes checking for netinet/ip_icmp.h... yes checking for unsigned long long... yes checking for long long... yes checking for an ANSI C-conforming const... yes checking for size_t... yes checking whether time.h and sys/time.h may both be included... yes checking whether struct tm is in sys/time.h or time.h... time.h checking return type of signal handlers... void checking for malloc... yes checking for calloc... yes checking for gettimeofday... yes checking for strerror... yes checking for strtoll... yes checking priv.h usability... no checking priv.h presence... no checking for priv.h... no checking whether we are using Solaris privileges... no checking sys/capability.h usability... no checking sys/capability.h presence... no checking for sys/capability.h... no checking whether we are using Linux Capabilities... no checking for mysql_init in -lmysqlclient_r... yes checking for mysql_thread_init in -lmysqlclient_r... yes checking if UCD-SNMP needs crypto support... no checking if Net-SNMP needs crypto support... yes checking for snmp_timeout in -lnetsnmp... yes checking for the spine results buffer size... 1024 bytes checking for the maximum simultaneous spine scripts... 20 checking for the maximum MySQL buffer size... 65536 checking whether we are using traditional popen... no checking whether to verify net-snmp library vs header versions... no checking for glibc gethostbyname_r... yes checking for Solaris/Irix gethostbyname_r... no checking for HP-UX gethostbyname_r... no checking that generated files are newer than configure... done configure: creating ./config.status /bin/bash ./config.status config.status: creating Makefile config.status: creating config/config.h config.status: executing depfiles commands config.status: executing libtool commands gcc -DHAVE_CONFIG_H -I. -I./config -I/usr/include/net-snmp -I/usr/include/net-snmp/.. -I/usr/include/mysql -g -O2 -MT sql.o -MD -MP -MF .deps/sql.Tpo -c -o sql.o sql.c mv -f .deps/sql.Tpo .deps/sql.Po gcc -DHAVE_CONFIG_H -I. -I./config -I/usr/include/net-snmp -I/usr/include/net-snmp/.. -I/usr/include/mysql -g -O2 -MT spine.o -MD -MP -MF .deps/spine.Tpo -c -o spine.o spine.c mv -f .deps/spine.Tpo .deps/spine.Po gcc -DHAVE_CONFIG_H -I. -I./config -I/usr/include/net-snmp -I/usr/include/net-snmp/.. -I/usr/include/mysql -g -O2 -MT util.o -MD -MP -MF .deps/util.Tpo -c -o util.o util.c util.c: In function 쁟heckAsRoot util.c:1286:10: warning: ignoring return value of 쁲eteuid declared with attribute warn_unused_result [-Wunused-result] seteuid(0); ^ util.c:1294:11: warning: ignoring return value of 쁲eteuid declared with attribute warn_unused_result [-Wunused-result] seteuid(getuid()); ^ mv -f .deps/util.Tpo .deps/util.Po gcc -DHAVE_CONFIG_H -I. -I./config -I/usr/include/net-snmp -I/usr/include/net-snmp/.. -I/usr/include/mysql -g -O2 -MT snmp.o -MD -MP -MF .deps/snmp.Tpo -c -o snmp.o snmp.c mv -f .deps/snmp.Tpo .deps/snmp.Po gcc -DHAVE_CONFIG_H -I. -I./config -I/usr/include/net-snmp -I/usr/include/net-snmp/.. -I/usr/include/mysql -g -O2 -MT locks.o -MD -MP -MF .deps/locks.Tpo -c -o locks.o locks.c mv -f .deps/locks.Tpo .deps/locks.Po gcc -DHAVE_CONFIG_H -I. -I./config -I/usr/include/net-snmp -I/usr/include/net-snmp/.. -I/usr/include/mysql -g -O2 -MT poller.o -MD -MP -MF .deps/poller.Tpo -c -o poller.o poller.c mv -f .deps/poller.Tpo .deps/poller.Po gcc -DHAVE_CONFIG_H -I. -I./config -I/usr/include/net-snmp -I/usr/include/net-snmp/.. -I/usr/include/mysql -g -O2 -MT nft_popen.o -MD -MP -MF .deps/nft_popen.Tpo -c -o nft_popen.o nft_popen.c mv -f .deps/nft_popen.Tpo .deps/nft_popen.Po gcc -DHAVE_CONFIG_H -I. -I./config -I/usr/include/net-snmp -I/usr/include/net-snmp/.. -I/usr/include/mysql -g -O2 -MT php.o -MD -MP -MF .deps/php.Tpo -c -o php.o php.c mv -f .deps/php.Tpo .deps/php.Po gcc -DHAVE_CONFIG_H -I. -I./config -I/usr/include/net-snmp -I/usr/include/net-snmp/.. -I/usr/include/mysql -g -O2 -MT ping.o -MD -MP -MF .deps/ping.Tpo -c -o ping.o ping.c ping.c: In function 쁯ing_icmp ping.c:271:11: warning: ignoring return value of 쁲eteuid declared with attribute warn_unused_result [-Wunused-result] seteuid(0); ^ ping.c:285:13: warning: ignoring return value of 쁲eteuid declared with attribute warn_unused_result [-Wunused-result] seteuid(getuid()); ^ ping.c:300:10: warning: ignoring return value of 쁲eteuid declared with attribute warn_unused_result [-Wunused-result] seteuid(getuid()); ^ ping.c:420:17: warning: ignoring return value of 쁲eteuid declared with attribute warn_unused_result [-Wunused-result] seteuid(0); ^ ping.c:426:17: warning: ignoring return value of 쁲eteuid declared with attribute warn_unused_result [-Wunused-result] seteuid(getuid()); ^ ping.c:464:12: warning: ignoring return value of 쁲eteuid declared with attribute warn_unused_result [-Wunused-result] seteuid(0); ^ ping.c:470:12: warning: ignoring return value of 쁲eteuid declared with attribute warn_unused_result [-Wunused-result] seteuid(getuid()); ^ ping.c:485:12: warning: ignoring return value of 쁲eteuid declared with attribute warn_unused_result [-Wunused-result] seteuid(0); ^ ping.c:491:12: warning: ignoring return value of 쁲eteuid declared with attribute warn_unused_result [-Wunused-result] seteuid(getuid()); ^ mv -f .deps/ping.Tpo .deps/ping.Po gcc -DHAVE_CONFIG_H -I. -I./config -I/usr/include/net-snmp -I/usr/include/net-snmp/.. -I/usr/include/mysql -g -O2 -MT keywords.o -MD -MP -MF .deps/keywords.Tpo -c -o keywords.o keywords.c mv -f .deps/keywords.Tpo .deps/keywords.Po gcc -DHAVE_CONFIG_H -I. -I./config -I/usr/include/net-snmp -I/usr/include/net-snmp/.. -I/usr/include/mysql -g -O2 -MT error.o -MD -MP -MF .deps/error.Tpo -c -o error.o error.c mv -f .deps/error.Tpo .deps/error.Po /bin/bash ./libtool --tag=CC --mode=link gcc -I/usr/include/net-snmp -I/usr/include/net-snmp/.. -I/usr/include/mysql -g -O2 -o spine sql.o spine.o util.o snmp.o locks.o poller.o nft_popen.o php.o ping.o keywords.o error.o -lnetsnmp -lmysqlclient_r -lmysqlclient_r -lcrypto -lz -lpthread -lm libtool: link: gcc -I/usr/include/net-snmp -I/usr/include/net-snmp/.. -I/usr/include/mysql -g -O2 -o spine sql.o spine.o util.o snmp.o locks.o poller.o nft_popen.o php.o ping.o keywords.o error.o -lnetsnmp -lmysqlclient_r -lcrypto -lz -lpthread -lm
f.- make install
make install (CDPATH="${ZSH_VERSION+.}:" && cd . && /bin/bash /tmp/cacti-spine-0.8.8c/config/missing autoheader) rm -f config/stamp-h1 touch config/config.h.in cd . && /bin/bash ./config.status config/config.h config.status: creating config/config.h config.status: config/config.h is unchanged make[1]: Entering directory `/tmp/cacti-spine-0.8.8c' /bin/mkdir -p '/usr/local/spine/bin' /bin/bash ./libtool --mode=install /usr/bin/install -c spine '/usr/local/spine/bin' libtool: install: /usr/bin/install -c spine /usr/local/spine/bin/spine /bin/mkdir -p '/usr/local/spine/etc' /usr/bin/install -c -m 644 spine.conf.dist '/usr/local/spine/etc' make[1]: se sale del directorio `/tmp/cacti-spine-0.8.8c'
4.- Configure spine.conf file
Updatedb and locate spine. My case: /usr/local/spine/etc
cd /usr/local/spine/etc/ cp spine.conf.dist spine.conf vi spine.conf
Change from:
DB_Host localhost
DB_Database cacti
DB_User cactiuser
DB_Pass cactiuser
DB_Port 3306
To:
DB_Host localhost
DB_Database cactidb
DB_User cactiuser
DB_Pass cactiuserpassword
DB_Port 3306
Remember that include/config.php is:
$database_type = “mysql”;
$database_default = “cactidb”;
$database_hostname = “localhost”;
$database_username = “cactiuser”;
$database_password = “cactiuserpassword”;
$database_port = “3306”;
5.- Update spine binary location:
Console -> Settings->Paths->Alternate Poller Path-> Spine Poller File Path = /usr/local/spine/bin/spine
6.- Change main Poller and frecuency
Console -> Settings->Poller Poller Type = spine Poller Interval = every minute Cron Interval = every 5 minutes