Commit Graph
1156 Commits
Author SHA1 Message Date
netniV 1e0ff53ea7 Prepare for release 1.2.26 release/1.2.26 2023-12-24 02:12:33 +00:00
TheWitness 49fe8c8d4f Update for Cacti 1.2.26 release 2023-12-22 12:47:22 -05:00
TheWitness 564d0ef6ff QA: Fix a few unused variables 2023-12-08 17:12:45 -05:00
eriksejrandErik Sejr 582e33f967 Fix Clang 16 compiler warning autological-pointer-compare (#334)
While compiling sql.c clang 16 generates the following warning:

```
sql.c:407:27: warning: comparison of address of 'db_pool_local[id].mysql' not equal to a null pointer is always true [-Wtautological-pointer-compare]
                        if (&db_pool_local[id].mysql != NULL) {
                             ~~~~~~~~~~~~~~~~~~^~~~~    ~~~~
sql.c:428:28: warning: comparison of address of 'db_pool_remote[id].mysql' not equal to a null pointer is always true [-Wtautological-pointer-compare]
                        if (&db_pool_remote[id].mysql != NULL) {
                             ~~~~~~~~~~~~~~~~~~~^~~~~    ~~~~
```

If the conditional is always true then the fix is to remove the
conditional in this instance

Co-authored-by: Erik Sejr <eriks@ssicanada.com>
2023-12-08 17:04:18 -05:00
3f27127baa Clang wrn fmt long int (#339)
I actually think this one should be an unsigned long int instead of just
a long int.

---------

Co-authored-by: Erik Sejr <eriks@ssicanada.com>
Co-authored-by: TheWitness <thewitness@cacti.net>
2023-12-08 17:02:19 -05:00
eriksejrandErik Sejr a446e5ac85 Fix Clang 16 warning: format (2) (#337)
This one is clear case of a simple format oopsie.

Co-authored-by: Erik Sejr <eriks@ssicanada.com>
2023-12-08 16:43:35 -05:00
eriksejrandErik Sejr 901884d8b9 Fix Clang 16 warning: pointer-sign (#336)
while compiling spine clang 16 generates the following warning:

```
snmp.c:590:58: warning: passing 'char[2048]' to parameter of type 'const u_char *' (aka 'const unsigned char *') converts between pointers to integer types where one is of the unique plain 'char' type and the other is not [-Wpointer-sign]
                                                snprint_asciistring(result_string, RESULTS_BUFFER, temp_result, strlen(temp_result));
```

If the function treats this as a unsigned char *, I don't see any issue
casting it as such before passing it in to suppress the warning.

Co-authored-by: Erik Sejr <eriks@ssicanada.com>
2023-12-08 16:43:13 -05:00
eriksejrandErik Sejr a75accc4ad Fix Clang 16 compiler warning: format (1) (#335)
While compiling Clang 16 generates the following warnings.

in spine.c:

```
spine.c:934:101: warning: format specifies type 'long' but the argument has type 'pthread_t' (aka 'struct pthread *') [-Wformat]
                                SPINE_LOG_DEBUG(("DEBUG: Device[%i] Valid Thread to be Created (%ld)", poller_details->host_id, threads[device_counter]));
```

in util.c:
```
util.c:1265:100: warning: format specifies type 'long' but the argument has type 'pthread_t' (aka 'struct pthread *') [-Wformat]
        snprintf(logprefix, SMALL_BUFSIZE, "SPINE: Poller[%i] PID[%i] PT[%ld] ", set.poller_id, getpid(), pthread_self());
```
This one i'm not as sure about, maybe this should be cast to a long
unsigned int instead? I have not had problems running it this way but
i'm not 100% sure this the right fix.

Co-authored-by: Erik Sejr <eriks@ssicanada.com>
2023-12-08 16:41:59 -05:00
TheWitness ff05c7b935 QA: Fixing #333 - Spine not honoring threads settings 2023-12-07 18:33:30 -05:00
TheWitness 0431fc7655 QA: Minor wording change for Issue #315
This wording should be a bit more informative.
2023-11-19 13:12:52 -05:00
TheWitness e68e18af1d Update CHANGELOG for #331 - Ping only option
* This was committed here: 0a988cbe41
2023-11-19 13:04:11 -05:00
TheWitness 3b39d22432 Fixing #315 - Invalid Per Second OID failures
Invalid ERROR: No such Instance for oid '.1.3.6.1.6.3.10.2.1.3.0' when per second uptime OID is not found
2023-11-13 16:46:06 -05:00
TheWitness 1a15dfecba Fixing #329 - CLI thread feature for testing
Allow users to override the threads setting at the command line
2023-11-13 08:32:35 -05:00
mikygeeandCharlie Root 14e89ec748 Correction bug Cacti#324 add -lexecinfo to configure.ac for OpenBSD (#327)
Co-authored-by: Charlie Root <root@villa.expertinet.fr>
2023-11-07 09:44:20 -08:00
TheWitness b6194bd0e4 QA: Add proper statistics when device threads are 1 2023-11-07 09:21:07 -05:00
TheWitness 0d149456a3 QA: Add additional details for thread closure issue 2023-11-07 09:07:45 -05:00
TheWitness 1d28ee7371 Fixing #323 - Device 0 Assumption
Wrong number of devices in stats due to device 0 assumption
2023-11-05 08:42:09 -05:00
TheWitness 0a988cbe41 Fixing #321 - Polling devices with no poller items
Spine does not check a host with no poller items
2023-10-30 20:52:42 -04:00
TheWitness 977d67e6f5 Fix Bootstrap Language #318 (#320) 2023-10-06 15:17:09 -04:00
TheWitness aac1b49fd6 Fixing #317 - MySQL Auto-Reconnect
WARNING: MYSQL_OPT_RECONNECT is deprecated and will be removed in a future version.
2023-09-22 10:27:48 -04:00
netniV 429ebd0fa9 Update CHANGELOG for 1.2.25 release/1.2.25 2023-09-04 23:31:16 +00:00
TheWitness cb4e402d3d QA: Fixing #312 - Complex SNMP Results
Spine won't work with complex SNMP results #v2
2023-08-24 09:03:23 -04:00
TheWitness ec7faa8f44 Minor fixup for #432 - Reversed the strstr() arguments 2023-08-12 11:48:55 -04:00
TheWitness 9c6265fe1f Fixing Issue on #234
At least it'll work for a /usr/bin/ install path
2023-07-31 08:27:42 -04:00
TheWitness b3da99598b Fixing #234 Sanity Checks
Spine should see if script to be executed is executable
2023-07-30 11:08:58 -04:00
TheWitness 0c9a8be0d0 Updating CHANGELOG for #291 2023-07-29 12:40:10 -04:00
TheWitness e74abf6de6 Updating CHANGELOG for #294 2023-07-29 12:36:16 -04:00
TheWitness 069f5045e4 QA: Minor change to #308
The plus sign is redundant
2023-07-29 12:29:59 -04:00
TheWitness a60f7c3a2e Fixing #308 and merge issue
- Function strip_alpha() does not strip non-numeric leading characters
- GitHub merge created an issue with switch syntax.
2023-07-29 12:12:25 -04:00
TheWitness 3f20413120 Two minor performece enhancements
-feature:   Do not sort by snmp port if you only have snmp on one port
-feature:   Order Devices by their number of poller items and Device Threads
-issue: Remove legacy setting device_threads_exist
2023-07-29 12:01:52 -04:00
netniV bc7cb816ba Improve downed Device detection (#304)
This relates to cacti/#5356
2023-06-08 11:37:22 +00:00
netniV a93f5b41db Downed device detection only checks one of the two uptime OIDs (#304) 2023-06-08 10:07:24 +00:00
netniV 6c977c82aa Update spine version to 1.2.25 2023-06-08 09:50:05 +00:00
netniV 1ba0341d83 Update CHANGELOG for #303, #305, #306 2023-06-08 09:49:22 +00:00
eriksejrandErik Sejr ad8968c0b5 Fix backtrace/execinfo.h compilation issue on FreeBSD (#305)
On FreeBSD when configured with default settings, compilation of spine
will always fail:

```
/bin/sh ./libtool  --tag=CC    --mode=link cc  -I/usr/local/include/net-snmp -I/usr/local/include/net-snmp/.. -I/usr/local/include/mysql -g -O2   -L/usr/local/lib -L/usr/local/lib/mysql -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 -lm -ldl -lmysqlclient -lm -ldl -lcrypto -lz -lpthread -ldl -lm -lpthread -lssl
libtool: link: cc -I/usr/local/include/net-snmp -I/usr/local/include/net-snmp/.. -I/usr/local/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  -L/usr/local/lib -L/usr/local/lib/mysql -lnetsnmp -lmysqlclient_r -lmysqlclient -lcrypto -lz -ldl -lm -lpthread -lssl
ld: error: undefined symbol: backtrace
>>> referenced by error.c:85
>>>               error.o:(spine_signal_handler)

ld: error: undefined symbol: backtrace_symbols
>>> referenced by error.c:86
>>>               error.o:(spine_signal_handler)
cc: error: linker command failed with exit code 1 (use -v to see invocation)
*** Error code 1

Stop.
```

When the configure script is run it correctly shows that backtraces are
not supported on this platform:

```
...
checking whether we are using traditional popen... no
checking whether to verify net-snmp library vs header versions... no
checking if we can support backtracing... no
checking if we can support mysql/mariadb retry count... no
checking if we can support mysql/mariadb ssl keys... yes
...
```

And yet in config/config.h we have HAVE_EXECINFO_H defined:

```
/* Do we have backtracing capabilities? */
#define HAVE_EXECINFO_H 1
```

This is because of an error in configure.ac where the value of
HAVE_EXECINFO_H is set twice, the first time by
AC_CHECK_HEADERS(execinfo.h) which returns true (The FreeBSD system does
have execinfo.h, it just does not support the function used here) and a
2nd time later on by a AC_LINK_IFELSE:

```
# See if we can support backtracing
AC_MSG_CHECKING([if we can support backtracing])
AC_LINK_IFELSE([AC_LANG_PROGRAM([[
    #include <stdlib.h>
    #include <execinfo.h>
  ]], [[
    void *array[10];
    size_t size;

    // get void*'s for all entries on the stack
    size = backtrace(array, 10);
    if (size) {
      exit(0);
    } else {
      exit(1);
    }
  ]])],[  AC_MSG_RESULT(yes)
     AC_DEFINE(HAVE_EXECINFO_H,1,[Do we have backtracing capabilities?])
  ],[AC_MSG_RESULT(no)
])
```
Even though the above AC_LANG_PROGRAM fails on FreeBSD, because of the
earlier AC_CHECK_HEADERS succeeding HAVE_EXECINFO_H is already defined
and remains that way leading to the compilation failure.

Since the AC_LANG_PROGRAM check here seems more thorough then the simple
header check and will fail anyway if execinfo.h does not exist I think
the correct course of action here is to remove the AC_CHECK_HEADERS
macro for this particular header completely.

Co-authored-by: Erik Sejr <eriks@ssimicro.com>
2023-04-05 20:28:03 -04:00
eriksejrandErik Sejr 6caa5c3402 bootstrap shell script contains some PHP cruft (#306)
Probably a copy/paste error, it does not impact the functionality of the
script, just throws an error when it is run.

Co-authored-by: Erik Sejr <eriks@ssimicro.com>
2023-04-05 20:26:46 -04:00
Jing Chen 202fbf263f Fixed: compile warning on RHEL7/RHEL8 (#303) 2023-03-06 20:55:10 -05:00
netniV 653ed069be Preparing for 1.2.24 release release/1.2.24 2023-02-15 12:00:49 +00:00
TheWitness 99897ee6c6 Fixing Issue #298 - Timeout
Odd Cacti log format issue when script server timeout happened
2023-01-18 19:05:33 -05:00
djpa3k be2e2b7aeb Fix possible SIGSERV error (#297) 2023-01-10 14:35:52 +00:00
Mark Brugnoli-Vinten 4d5c5dcd68 Update copyright year for 2023 2023-01-04 10:24:52 +00:00
netniV a86a46c261 Release 1.2.23 release/1.2.23 2023-01-02 14:39:36 +00:00
TheWitness 3c18382eb0 QA on #292 & #293 - Missed minor change 2022-12-16 10:02:30 -05:00
TheWitness 961dab27fb Fixing #292 and #293 - SQL_NO_CACHE & Logging
* Improve Script Server Timeout Logging
* Add SQL_NO_CACHE to Spine Queries
2022-12-16 09:58:33 -05:00
TheWitness dfa48e49aa QA: Revert update_lasttime
Due to the design change, we can revert this code.
2022-12-03 09:47:59 -05:00
TheWitness a2555f9430 QA: Don't update device lasttime too often 2022-11-30 22:14:04 -05:00
TheWitness c488868259 QA: Don't update the lasttime too often 2022-11-30 22:04:57 -05:00
netniV 9cadc633ea Unexpected reindexing occurs when using uptime as the reindex method (#287)
Closes #287
2022-11-23 13:58:32 +00:00
TheWitness daf4087c5d Fixing #286 - Row Cache support
Add 'Row Cache' support for spine
2022-11-20 14:12:54 -05:00
TheWitness 5e180e7662 More lite formatting 2022-11-17 20:41:14 -05:00