## Summary The 1.2.x-affected subset of a batch of small, independent, unaddressed bugs from the open-issue backlog (the two develop-only issues from the same audit, #583 and #580, are not applicable here — see the companion PR for `develop`). ## Fixes - **`poll_host()` skips `mysql_thread_end()` when the device row is missing** — the early `return` on `num_rows != 1` released both DB connections and freed six allocations, but never called `mysql_thread_end()`, unlike the other two exit paths. Added the missing call. - **SNMPv3 passphrase scrubbing flag never set** — `zero_sensitive` was a function-local initialized to 0 and never assigned, so every guarded `memset()` was dead code. Made scrubbing of this module's own heap copies (`Apsz`/`Xpsz`) unconditional. Left the caller's `snmp_password`/`snmp_priv_passphrase` alone rather than also scrubbing those in place — those are `host_t`-owned and get reused for later session rebuilds against the same host, so zeroing them would have broken subsequent polls. - **`php_readpipe()` FD_SET without an FD_SETSIZE check** — `FD_SET()` doesn't range-check, so a read descriptor at or above `FD_SETSIZE` (1024 on glibc) wrote past the end of the on-stack `fd_set`. Added a bounds check that treats an out-of-range descriptor as a script-server failure (mark undefined, close, restart) instead of calling `FD_SET`/`select()` on it. - **Signal handler never re-arms, so the second SIGPIPE kills the poller** — every fatal signal reset itself to `SIG_DFL` and never re-armed. That's the right idiom for a real fault (SIGSEGV and friends re-execute and die with a core), but SIGPIPE is a routine, recurring condition — a second one previously killed the whole poller. Re-arm only SIGPIPE. - **spine fails to link on Fedora: undefined reference to `usmDESPrivProtocol`** — some distributions ship a `net-snmp-config.h` that advertises DES as the default privacy protocol while the shipped `libnetsnmp` doesn't export the symbol. Added an `AC_LINK_IFELSE` probe for the actual symbol and guarded the fallback to use `usmAESPrivProtocol` when it's absent. ## Testing Full build via WSL (`./bootstrap && ./configure --enable-warnings && make`) produces the `spine` binary with no new warnings in `poller.c`, `snmp.c`, `php.c`, or `error.c`. Confirmed the new `usmDESPrivProtocol` configure probe correctly detects the missing symbol in this build environment (which also lacks it) and takes the AES fallback path without a link error. Closes #594 Closes #600 Closes #605 Closes #607 Closes #575
Spine: a poller for Cacti
Spine is a high speed poller replacement for cmd.php. It is almost 100%
compatible with the legacy cmd.php processor and provides much more flexibility,
speed and concurrency than cmd.php.
Make sure that you have the proper development environment to compile Spine. This includes compilers, header files and things such as libtool. If you have questions please consult the forums and/or online documentation.
Unix Installation
These instructions assume the default install location for spine of
/usr/local/spine. If you choose to use another prefix, make sure you update
the commands as required for that new path.
To compile and install Spine using MySQL versions 5.5 or higher please do the following:
./bootstrap
./configure
make
make install
chown root:root /usr/local/spine/bin/spine
chmod u+s /usr/local/spine/bin/spine
To compile and install Spine using MySQL versions previous to 5.5 please do the following:
./bootstrap
./configure --with-reentrant
make
make install
chown root:root /usr/local/spine/bin/spine
chmod +s /usr/local/spine/bin/spine
Windows Installation
CYGWIN Prerequisite
-
Download Cygwin for Window from https://www.cygwin.com/
-
Install Cygwin by executing the downloaded setup program
-
Select Install from Internet
-
Select Root Directory: C:\cygwin
-
Select a mirror which is close to your location
-
Once on the package selection section make sure to select the following (TIP: use the search!):
- autoconf
- automake
- dos2unix
- gcc-core
- gzip
- help2man
- inetutils-src
- libmysqlclient
- libmariadb-devel
- libssl-devel
- libtool
- m4
- make
- net-snmp-devel
- openssl-devel
- wget
-
Wait for installation to complete, coffee time!
-
Move the cygwin setup to the C:\cygwin\ folder for future usage.
Compile Spine
-
Open Cygwin shell prompt (C:\Cygwin\cygwin.bat) and brace yourself to use unix commands on Windows.
-
Download the Spine source to the current directory:
-
Extract Spine into C:\Cygwin\usr\src<spineversion>:
tar xzvf cacti-spine-*.tar.gz -
Change into the Spine directory:
cd /usr/src/cacti-spine-* -
Run bootstrap to prepare Spine for compilation:
./bootstrap -
Follow the instruction which bootstrap outputs.
-
Update the spine.conf file for your installation of Cacti. You can optionally move it to a better location if you choose to do so, make sure to copy the spine.conf as well.
-
Ensure that Spine runs well by running with
/usr/local/spine/spine -R -S -V 3 -
Update Cacti
PathsSetting to point to the Spine binary and update thePoller Typeto Spine. For the spine binary on Windows x64, and using default locations, that would beC:\cygwin64\usr\local\spine\bin\spine.exe -
If all is good Spine will be run from the poller in place of cmd.php.
Known Issues
-
On Windows, Microsoft does not support a TCP Socket send timeout. Therefore, if you are using TCP ping on Windows, spine will not perform a second or subsequent retries to connect and the host will be assumed down on the first failure.
If this is a problem it is suggested to use another Availability/Reachability method, or moving to Linux/UNIX.
-
Spine takes quite a few MySQL connections. The number of connections is calculated as follows: (1 for main poller + 1 per each thread + 1 per each script server)
Therefore, if you have 4 processes, with 10 threads each, and 5 script servers each your spine will take approximately:
total connections = 4 * ( 1 + 10 + 5 ) = 64 -
On older MySQL versions, different libraries had to be used to make MySQL thread safe. MySQL versions 5.0 and 5.1 require this flag. If you are using these version of MySQL, you must use the --with-reentrant configure flag.
Copyright (c) 2004-2024 - The Cacti Group, Inc.