Hello community, here is the log from the commit of package cacti-spine for openSUSE:Factory checked in at 2020-04-13 12:53:35 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/cacti-spine (Old) and /work/SRC/openSUSE:Factory/.cacti-spine.new.3248 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "cacti-spine" Mon Apr 13 12:53:35 2020 rev:26 rq:793395 version:1.2.11 Changes: -------- --- /work/SRC/openSUSE:Factory/cacti-spine/cacti-spine.changes 2020-02-18 13:29:44.860742454 +0100 +++ /work/SRC/openSUSE:Factory/.cacti-spine.new.3248/cacti-spine.changes 2020-04-13 12:53:37.544656982 +0200 @@ -1,0 +2,7 @@ +Sat Apr 11 13:11:21 UTC 2020 - Andreas Stieger <[email protected]> + +- cacti-spine 1.2.11: + * fix warnings due to 'Recache Event Detected for Device' + * Fix database, network and polling errors + +------------------------------------------------------------------- Old: ---- cacti-spine-1.2.9.tar.gz New: ---- cacti-spine-1.2.11.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ cacti-spine.spec ++++++ --- /var/tmp/diff_new_pack.XPW1zW/_old 2020-04-13 12:53:38.128657236 +0200 +++ /var/tmp/diff_new_pack.XPW1zW/_new 2020-04-13 12:53:38.132657238 +0200 @@ -1,7 +1,7 @@ # # spec file for package cacti-spine # -# Copyright (c) 2020 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2020 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -17,7 +17,7 @@ Name: cacti-spine -Version: 1.2.9 +Version: 1.2.11 Release: 0 Summary: Threaded poller for Cacti written in C License: LGPL-2.1-or-later ++++++ cacti-spine-1.2.9.tar.gz -> cacti-spine-1.2.11.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cacti-spine-1.2.9/CHANGELOG new/cacti-spine-1.2.11/CHANGELOG --- old/cacti-spine-1.2.9/CHANGELOG 2020-02-13 21:48:35.000000000 +0100 +++ new/cacti-spine-1.2.11/CHANGELOG 2020-04-06 04:15:20.000000000 +0200 @@ -1,5 +1,17 @@ The Cacti Group | spine +1.2.11 +-issue#122: Unable to compile spine on OpenBSD +-issue#129: Repeated warnings due to 'Recache Event Detected for Device' +-issue#134: No error is recorded to log file when database is incorrect +-issue#144: MySQL retry logic is not working as expected +-issue#149: When using IPv6 address, segmentation fault can occur due to incorrectly using IPv4 ping +-issue#150: When polling results are null, segmentation errors may occur +-issue#151: When collecting data, spine should be stripping alpha characters from output + +1.2.10 +-feature: release to match Cacti release + 1.2.9 -issue#124: Improve logging of snmp multiple OID get function -issue#129: PCOMMAND Device[XXXX] WARNING: Recache Event Detected for Device @@ -416,7 +428,7 @@ -feature: enabled signal handling in cactid 0.8.6h -Not released. Syncing with Cacti distribution again. +-feature: Not released. Syncing with Cacti distribution again. 0.8.6g -bug#0000609: console "error" messages should go to stderr instead of stdout diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cacti-spine-1.2.9/common.h new/cacti-spine-1.2.11/common.h --- old/cacti-spine-1.2.9/common.h 2020-02-13 21:48:35.000000000 +0100 +++ new/cacti-spine-1.2.11/common.h 2020-04-06 04:15:20.000000000 +0200 @@ -1,7 +1,7 @@ /* ex: set tabstop=4 shiftwidth=4 autoindent: +-------------------------------------------------------------------------+ - | Copyright (C) 2004-2019 The Cacti Group | + | Copyright (C) 2004-2020 The Cacti Group | | | | This program is free software; you can redistribute it and/or | | modify it under the terms of the GNU Lesser General Public | @@ -93,6 +93,7 @@ #include <stdio.h> #include <syslog.h> #include <stdbool.h> +#include <arpa/inet.h> #if HAVE_STDINT_H # include <stdint.h> @@ -102,6 +103,8 @@ # include <netinet/in_systm.h> # include <netinet/in.h> # include <netinet/ip.h> +# include <netinet/ip6.h> +# include <netinet/icmp6.h> # include <netinet/ip_icmp.h> #endif diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cacti-spine-1.2.9/configure.ac new/cacti-spine-1.2.11/configure.ac --- old/cacti-spine-1.2.9/configure.ac 2020-02-13 21:48:35.000000000 +0100 +++ new/cacti-spine-1.2.11/configure.ac 2020-04-06 04:15:20.000000000 +0200 @@ -1,5 +1,5 @@ AC_PREREQ(2.53) -AC_INIT(Spine Poller, 1.2.9, http://www.cacti.net/issues.php) +AC_INIT(Spine Poller, 1.2.11, http://www.cacti.net/issues.php) AC_CONFIG_AUX_DIR(config) AC_SUBST(ac_aux_dir) @@ -66,13 +66,12 @@ *solaris*) CPPFLAGS="$CPPFLAGS -D_POSIX_PTHREAD_SEMANTICS";; *freebsd*) - LIBS="$LIBS -pthread" - LDFLAGS="-lexecinfo" + LIBS="$LIBS -pthread -lexecinfo" AC_DEFINE(HAVE_LIBPTHREAD, 1);; *darwin*) ShLib="dylib";; *) - LDFLAGS="-lpthread -lssl -lm $LDFLAGS";; + LIBS="-lpthread -lssl $LIBS" esac # Checks for programs. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cacti-spine-1.2.9/error.c new/cacti-spine-1.2.11/error.c --- old/cacti-spine-1.2.9/error.c 2020-02-13 21:48:35.000000000 +0100 +++ new/cacti-spine-1.2.11/error.c 2020-04-06 04:15:20.000000000 +0200 @@ -1,7 +1,7 @@ /* ex: set tabstop=4 shiftwidth=4 autoindent: +-------------------------------------------------------------------------+ - | Copyright (C) 2004-2019 The Cacti Group | + | Copyright (C) 2004-2020 The Cacti Group | | | | This program is free software; you can redistribute it and/or | | modify it under the terms of the GNU Lesser General Public | diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cacti-spine-1.2.9/error.h new/cacti-spine-1.2.11/error.h --- old/cacti-spine-1.2.9/error.h 2020-02-13 21:48:35.000000000 +0100 +++ new/cacti-spine-1.2.11/error.h 2020-04-06 04:15:20.000000000 +0200 @@ -1,7 +1,7 @@ /* ex: set tabstop=4 shiftwidth=4 autoindent: +-------------------------------------------------------------------------+ - | Copyright (C) 2004-2019 The Cacti Group | + | Copyright (C) 2004-2020 The Cacti Group | | | | This program is free software; you can redistribute it and/or | | modify it under the terms of the GNU Lesser General Public | diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cacti-spine-1.2.9/keywords.c new/cacti-spine-1.2.11/keywords.c --- old/cacti-spine-1.2.9/keywords.c 2020-02-13 21:48:35.000000000 +0100 +++ new/cacti-spine-1.2.11/keywords.c 2020-04-06 04:15:20.000000000 +0200 @@ -1,7 +1,7 @@ /* ex: set tabstop=4 shiftwidth=4 autoindent: +-------------------------------------------------------------------------+ - | Copyright (C) 2004-2019 The Cacti Group | + | Copyright (C) 2004-2020 The Cacti Group | | | | This program is free software; you can redistribute it and/or | | modify it under the terms of the GNU Lesser General Public | diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cacti-spine-1.2.9/keywords.h new/cacti-spine-1.2.11/keywords.h --- old/cacti-spine-1.2.9/keywords.h 2020-02-13 21:48:35.000000000 +0100 +++ new/cacti-spine-1.2.11/keywords.h 2020-04-06 04:15:20.000000000 +0200 @@ -1,7 +1,7 @@ /* ex: set tabstop=4 shiftwidth=4 autoindent: +-------------------------------------------------------------------------+ - | Copyright (C) 2004-2019 The Cacti Group | + | Copyright (C) 2004-2020 The Cacti Group | | | | This program is free software; you can redistribute it and/or | | modify it under the terms of the GNU Lesser General Public | diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cacti-spine-1.2.9/locks.c new/cacti-spine-1.2.11/locks.c --- old/cacti-spine-1.2.9/locks.c 2020-02-13 21:48:35.000000000 +0100 +++ new/cacti-spine-1.2.11/locks.c 2020-04-06 04:15:20.000000000 +0200 @@ -1,7 +1,7 @@ /* ex: set tabstop=4 shiftwidth=4 autoindent: +-------------------------------------------------------------------------+ - | Copyright (C) 2004-2019 The Cacti Group | + | Copyright (C) 2004-2020 The Cacti Group | | | | This program is free software; you can redistribute it and/or | | modify it under the terms of the GNU Lesser General Public | diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cacti-spine-1.2.9/locks.h new/cacti-spine-1.2.11/locks.h --- old/cacti-spine-1.2.9/locks.h 2020-02-13 21:48:35.000000000 +0100 +++ new/cacti-spine-1.2.11/locks.h 2020-04-06 04:15:20.000000000 +0200 @@ -1,7 +1,7 @@ /* ex: set tabstop=4 shiftwidth=4 autoindent: +-------------------------------------------------------------------------+ - | Copyright (C) 2004-2019 The Cacti Group | + | Copyright (C) 2004-2020 The Cacti Group | | | | This program is free software; you can redistribute it and/or | | modify it under the terms of the GNU Lesser General Public | diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cacti-spine-1.2.9/php.c new/cacti-spine-1.2.11/php.c --- old/cacti-spine-1.2.9/php.c 2020-02-13 21:48:35.000000000 +0100 +++ new/cacti-spine-1.2.11/php.c 2020-04-06 04:15:20.000000000 +0200 @@ -1,7 +1,7 @@ /* ex: set tabstop=4 shiftwidth=4 autoindent: +-------------------------------------------------------------------------+ - | Copyright (C) 2004-2019 The Cacti Group | + | Copyright (C) 2004-2020 The Cacti Group | | | | This program is free software; you can redistribute it and/or | | modify it under the terms of the GNU Lesser General Public | @@ -233,22 +233,22 @@ default: if (FD_ISSET(php_processes[php_process].php_read_fd, &fds)) { bptr = result_string; - + while (1) { i = read(php_processes[php_process].php_read_fd, bptr, RESULTS_BUFFER-(bptr-result_string)); - + if (i <= 0) { SET_UNDEFINED(result_string); break; } - + bptr += i; *bptr = '\0'; /* make what we've got into a string */ - + if ((cp = strstr(result_string,"\n")) != 0) { break; } - + if (bptr >= result_string+BUFSIZE) { SPINE_LOG(("ERROR: SS[%i] The Script Server result was longer than the acceptable range", php_process)); SET_UNDEFINED(result_string); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cacti-spine-1.2.9/php.h new/cacti-spine-1.2.11/php.h --- old/cacti-spine-1.2.9/php.h 2020-02-13 21:48:35.000000000 +0100 +++ new/cacti-spine-1.2.11/php.h 2020-04-06 04:15:20.000000000 +0200 @@ -1,7 +1,7 @@ /* ex: set tabstop=4 shiftwidth=4 autoindent: +-------------------------------------------------------------------------+ - | Copyright (C) 2004-2019 The Cacti Group | + | Copyright (C) 2004-2020 The Cacti Group | | | | This program is free software; you can redistribute it and/or | | modify it under the terms of the GNU Lesser General Public | diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cacti-spine-1.2.9/ping.c new/cacti-spine-1.2.11/ping.c --- old/cacti-spine-1.2.9/ping.c 2020-02-13 21:48:35.000000000 +0100 +++ new/cacti-spine-1.2.11/ping.c 2020-04-06 04:15:20.000000000 +0200 @@ -1,7 +1,7 @@ /* ex: set tabstop=4 shiftwidth=4 autoindent: +-------------------------------------------------------------------------+ - | Copyright (C) 2004-2019 The Cacti Group | + | Copyright (C) 2004-2020 The Cacti Group | | | | This program is free software; you can redistribute it and/or | | modify it under the terms of the GNU Lesser General Public | @@ -65,16 +65,22 @@ } if (!strstr(host->hostname, "localhost")) { - if (host->ping_method == PING_ICMP) { - ping_result = ping_icmp(host, ping); - } else if (host->ping_method == PING_UDP) { - ping_result = ping_udp(host, ping); - } else if (host->ping_method == PING_TCP) { - ping_result = ping_tcp(host, ping); + if (get_address_type(host) == 1) { + if (host->ping_method == PING_ICMP) { + ping_result = ping_icmp(host, ping); + } else if (host->ping_method == PING_UDP) { + ping_result = ping_udp(host, ping); + } else if (host->ping_method == PING_TCP) { + ping_result = ping_tcp(host, ping); + } + } else if (host->availability_method == AVAIL_PING) { + snprintf(ping->ping_status, 50, "0.000"); + snprintf(ping->ping_response, SMALL_BUFSIZE, "PING: Device is Unknown or is IPV6. Please use the SNMP ping options only."); + return HOST_DOWN; } } else { snprintf(ping->ping_status, 50, "0.000"); - snprintf(ping->ping_response, SMALL_BUFSIZE, "PING: Device does not require ping"); + snprintf(ping->ping_response, SMALL_BUFSIZE, "PING: Device does not require ping."); ping_result = HOST_UP; } } @@ -318,6 +324,7 @@ break; } } + #if !(defined(__CYGWIN__) && !defined(SOLAR_PRIV)) if (hasCaps() != TRUE) { if (seteuid(getuid()) == -1) { @@ -383,6 +390,12 @@ return HOST_DOWN; } + if (is_debug_device(host->id)) { + SPINE_LOG(("Device[%i] DEBUG: Attempting to ping %s, seq %d (Retry %d of %d)", host->id, new_hostname, icmp->icmp_seq, retry_count, host->ping_retries)); + } else { + SPINE_LOG_DEBUG(("Device[%i] DEBUG: Attempting to ping %s, seq %d (Retry %d of %d)", host->id, new_hostname, icmp->icmp_seq, retry_count, host->ping_retries)); + } + /* decrement the timeout value by the total time */ timeout.tv_sec = rint((host_timeout - total_time) / 1000); timeout.tv_usec = ((int) (host_timeout - total_time) % 1000) * 1000; @@ -835,6 +848,66 @@ } } +/*! \fn int get_address_type(host_t *host) + * \brief determines using getaddrinfo the iptype and returns the iptype + * + * \return 1 - IPv4, 2 - IPv6, 0 - Unknown + */ +int get_address_type(host_t *host) { + struct addrinfo hints, *res, *res_list; + char addrstr[255]; + void *ptr; + int addr_found = FALSE; + + memset(&hints, 0, sizeof(hints)); + + hints.ai_family = AF_UNSPEC; + hints.ai_socktype = SOCK_DGRAM; + hints.ai_flags = AI_CANONNAME | AI_ADDRCONFIG; + int error; + + if ((error = getaddrinfo(host->hostname, NULL, &hints, &res_list)) != 0) { + SPINE_LOG(("WARNING: Unable to determine address info for %s (%s)", host->hostname, gai_strerror(error))); + if (res_list != NULL) { + freeaddrinfo(res_list); + } + return SPINE_NONE; + } + + for (res = res_list; res != NULL; res = res->ai_next) { + inet_ntop(res->ai_family, res->ai_addr->sa_data, addrstr, 100); + + switch(res->ai_family) { + case AF_INET: + ptr = &((struct sockaddr_in *) res->ai_addr)->sin_addr; + addr_found = TRUE; + break; + case AF_INET6: + ptr = &((struct sockaddr_in6 *) res->ai_addr)->sin6_addr; + addr_found = TRUE; + break; + } + + inet_ntop(res->ai_family, ptr, addrstr, 100); + + SPINE_LOG_HIGH(("Device[%d] IPv%d address %s (%s)\n", host->id, res->ai_family == PF_INET6 ? 6:4, addrstr, res->ai_canonname)); + + if (res->ai_family != PF_INET6) { + freeaddrinfo(res_list); + + return SPINE_IPV4; + } + } + + freeaddrinfo(res_list); + + if (addr_found) { + return SPINE_IPV6; + } else { + return SPINE_NONE; + } +} + /*! \fn int init_sockaddr(struct sockaddr_in *name, const char *hostname, unsigned short int port) * \brief converts a hostname to an internet address * @@ -848,33 +921,62 @@ // Initialize the hints structure memset(&hints, 0, sizeof hints); - // This should be AF_UNSPEC and we should work out if we are using - // AF_INET or AF_INET6 later, but without checking the rest of spine - // for IPv6 compatibility, lets first make it work with IPv4 only hints.ai_family = AF_INET; + hints.ai_flags = AI_CANONNAME | AI_ADDRCONFIG; retry_count = 0; rv = 0; - while (1) { + while (TRUE) { rv = getaddrinfo(hostname, NULL, &hints, &hostinfo); - if (rv) { - if (rv == TRY_AGAIN && retry_count < 3) { - if (hostinfo != NULL) { - freeaddrinfo(hostinfo); - } - retry_count++; - usleep(50000); - continue; - } else { - SPINE_LOG(("WARNING: Error resolving host %s (%s)", hostname, gai_strerror(rv))); - if (hostinfo != NULL) { - freeaddrinfo(hostinfo); - } - return FALSE; - } - } else { + if (rv == 0) { break; + } else { + switch (rv) { + case EAI_AGAIN: + if (retry_count < 3) { + SPINE_LOG(("WARNING: EAGAIN received resolving after 3 retryies for host %s (%s)", hostname, gai_strerror(rv))); + if (hostinfo != NULL) { + freeaddrinfo(hostinfo); + } + + retry_count++; + usleep(50000); + continue; + } else { + SPINE_LOG(("WARNING: Error resolving after 3 retryies for host %s (%s)", hostname, gai_strerror(rv))); + if (hostinfo != NULL) { + freeaddrinfo(hostinfo); + } + return FALSE; + } + + break; + case EAI_FAIL: + SPINE_LOG(("WARNING: DNS Server reported permanent error for host %s (%s)", hostname, gai_strerror(rv))); + if (hostinfo != NULL) { + freeaddrinfo(hostinfo); + } + return FALSE; + + break; + case EAI_MEMORY: + SPINE_LOG(("WARNING: Out of memory trying to resolve host %s (%s)", hostname, gai_strerror(rv))); + if (hostinfo != NULL) { + freeaddrinfo(hostinfo); + } + return FALSE; + + break; + default: + SPINE_LOG(("WARNING: Unknown error while resolving host %s (%s)", hostname, gai_strerror(rv))); + if (hostinfo != NULL) { + freeaddrinfo(hostinfo); + } + return FALSE; + + break; + } } } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cacti-spine-1.2.9/ping.h new/cacti-spine-1.2.11/ping.h --- old/cacti-spine-1.2.9/ping.h 2020-02-13 21:48:35.000000000 +0100 +++ new/cacti-spine-1.2.11/ping.h 2020-04-06 04:15:20.000000000 +0200 @@ -1,7 +1,7 @@ /* ex: set tabstop=4 shiftwidth=4 autoindent: +-------------------------------------------------------------------------+ - | Copyright (C) 2004-2019 The Cacti Group | + | Copyright (C) 2004-2020 The Cacti Group | | | | This program is free software; you can redistribute it and/or | | modify it under the terms of the GNU Lesser General Public | @@ -142,4 +142,5 @@ extern char *remove_tcp_udp_from_hostname(char *hostname); extern void update_host_status(int status, host_t *host, ping_t *ping, int availability_method); extern int init_sockaddr(struct sockaddr_in *name, const char *hostname, unsigned short int port); +extern int get_address_type(host_t *host); extern unsigned short int get_checksum(void* buf, int len); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cacti-spine-1.2.9/poller.c new/cacti-spine-1.2.11/poller.c --- old/cacti-spine-1.2.9/poller.c 2020-02-13 21:48:35.000000000 +0100 +++ new/cacti-spine-1.2.11/poller.c 2020-04-06 04:15:20.000000000 +0200 @@ -1,7 +1,7 @@ /* ex: set tabstop=4 shiftwidth=4 autoindent: +-------------------------------------------------------------------------+ - | Copyright (C) 2004-2019 The Cacti Group | + | Copyright (C) 2004-2020 The Cacti Group | | | | This program is free software; you can redistribute it and/or | | modify it under the terms of the GNU Lesser General Public | @@ -745,9 +745,11 @@ } poll_result[0] = '\0'; snprintf(poll_result, BUFSIZE, "%s", sysUptime); - } else { + } else if (strstr(reindex->arg1, ".1.3.6.1.2.1.1.3.0")) { poll_result = snmp_get(host, reindex->arg1); snprintf(sysUptime, BUFSIZE, "%s", poll_result); + } else { + poll_result = snmp_get(host, reindex->arg1); } if (is_debug_device(host->id)) { @@ -833,7 +835,7 @@ query3[0] = '\0'; /* assume ok if host is up and result wasn't obtained */ - if ((IS_UNDEFINED(poll_result)) || (STRIMATCH(poll_result, "No Such Instance"))) { + if (poll_result == NULL || (IS_UNDEFINED(poll_result)) || (STRIMATCH(poll_result, "No Such Instance"))) { if (is_debug_device(host->id) || set.spine_log_level == 2) { SPINE_LOG(("Device[%i] HT[%i] DQ[%i] RECACHE ASSERT FAILED: '%s=%s'", host->id, host_thread, reindex->data_query_id, reindex->assert_value, poll_result)); } @@ -1173,7 +1175,7 @@ /* is valid output, continue */ } else { /* remove double or single quotes from string */ - snprintf(temp_result, RESULTS_BUFFER, "%s", snmp_oids[j].result); + snprintf(temp_result, RESULTS_BUFFER, "%s", strip_alpha(trim(snmp_oids[j].result))); snprintf(snmp_oids[j].result , RESULTS_BUFFER, "%s", temp_result); /* detect erroneous non-numeric result */ @@ -1474,7 +1476,7 @@ /* is valid output, continue */ } else { /* remove double or single quotes from string */ - snprintf(temp_result, RESULTS_BUFFER, "%s", snmp_oids[j].result); + snprintf(temp_result, RESULTS_BUFFER, "%s", strip_alpha(trim(snmp_oids[j].result))); snprintf(snmp_oids[j].result , RESULTS_BUFFER, "%s", temp_result); /* detect erroneous non-numeric result */ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cacti-spine-1.2.9/poller.h new/cacti-spine-1.2.11/poller.h --- old/cacti-spine-1.2.9/poller.h 2020-02-13 21:48:35.000000000 +0100 +++ new/cacti-spine-1.2.11/poller.h 2020-04-06 04:15:20.000000000 +0200 @@ -1,7 +1,7 @@ /* ex: set tabstop=4 shiftwidth=4 autoindent: +-------------------------------------------------------------------------+ - | Copyright (C) 2004-2019 The Cacti Group | + | Copyright (C) 2004-2020 The Cacti Group | | | | This program is free software; you can redistribute it and/or | | modify it under the terms of the GNU Lesser General Public | diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cacti-spine-1.2.9/snmp.c new/cacti-spine-1.2.11/snmp.c --- old/cacti-spine-1.2.9/snmp.c 2020-02-13 21:48:35.000000000 +0100 +++ new/cacti-spine-1.2.11/snmp.c 2020-04-06 04:15:20.000000000 +0200 @@ -1,7 +1,7 @@ /* ex: set tabstop=4 shiftwidth=4 autoindent: +-------------------------------------------------------------------------+ - | Copyright (C) 2004-2019 The Cacti Group | + | Copyright (C) 2004-2020 The Cacti Group | | | | This program is free software; you can redistribute it and/or | | modify it under the terms of the GNU Lesser General Public | @@ -383,7 +383,7 @@ snprint_value(temp_result, RESULTS_BUFFER, vars->name, vars->name_length, vars); - snprint_asciistring(result_string, RESULTS_BUFFER, temp_result, strlen(temp_result)); + snprintf(result_string, RESULTS_BUFFER, "%s", trim(temp_result)); } else { SPINE_LOG_HIGH(("ERROR: Failed to get oid '%s' for Device[%d]", snmp_oid, current_host->id)); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cacti-spine-1.2.9/snmp.h new/cacti-spine-1.2.11/snmp.h --- old/cacti-spine-1.2.9/snmp.h 2020-02-13 21:48:35.000000000 +0100 +++ new/cacti-spine-1.2.11/snmp.h 2020-04-06 04:15:20.000000000 +0200 @@ -1,7 +1,7 @@ /* ex: set tabstop=4 shiftwidth=4 autoindent: +-------------------------------------------------------------------------+ - | Copyright (C) 2004-2019 The Cacti Group | + | Copyright (C) 2004-2020 The Cacti Group | | | | This program is free software; you can redistribute it and/or | | modify it under the terms of the GNU Lesser General Public | diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cacti-spine-1.2.9/spine.c new/cacti-spine-1.2.11/spine.c --- old/cacti-spine-1.2.9/spine.c 2020-02-13 21:48:35.000000000 +0100 +++ new/cacti-spine-1.2.11/spine.c 2020-04-06 04:15:20.000000000 +0200 @@ -1,7 +1,7 @@ /* ex: set tabstop=4 shiftwidth=4 autoindent: +-------------------------------------------------------------------------+ - | Copyright (C) 2004-2019 The Cacti Group | + | Copyright (C) 2004-2020 The Cacti Group | | | | This program is free software; you can redistribute it and/or | | modify it under the terms of the GNU Lesser General Public | @@ -1000,7 +1000,7 @@ 0 /* ENDMARKER */ }; - printf("SPINE %s Copyright 2004-2019 by The Cacti Group\n", VERSION); + printf("SPINE %s Copyright 2004-2020 by The Cacti Group\n", VERSION); if (only_version == FALSE) { printf("\n"); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cacti-spine-1.2.9/spine.conf.dist new/cacti-spine-1.2.11/spine.conf.dist --- old/cacti-spine-1.2.9/spine.conf.dist 2020-02-13 21:48:35.000000000 +0100 +++ new/cacti-spine-1.2.11/spine.conf.dist 2020-04-06 04:15:20.000000000 +0200 @@ -29,6 +29,7 @@ # | DB_Pass The password for the Cacti user | # | SNMP_Clientaddr Bind SNMP to a specific address for sites that use | # | higher security levels | +# | Cacti_Log Optional path to the Cacti log file | # +-------------------------------------------------------------------------+ # | Settings for Remote Polling | # +-------------------------------------------------------------------------+ @@ -48,12 +49,13 @@ #DB_SSL_Key #DB_SSL_Cert #DB_SSL_CA +#Cacti_Log /var/www/html/cacti/log/cacti.log -RDB_Host localhost -RDB_Database cacti -RDB_User cactiuser -RDB_Pass cactiuser -RDB_Port 3306 +#RDB_Host localhost +#RDB_Database cacti +#RDB_User cactiuser +#RDB_Pass cactiuser +#RDB_Port 3306 #RDB_UseSSL 0 #RDB_SSL_Key #RDB_SSL_Cert diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cacti-spine-1.2.9/spine.h new/cacti-spine-1.2.11/spine.h --- old/cacti-spine-1.2.9/spine.h 2020-02-13 21:48:35.000000000 +0100 +++ new/cacti-spine-1.2.11/spine.h 2020-04-06 04:15:20.000000000 +0200 @@ -1,7 +1,7 @@ /* ex: set tabstop=4 shiftwidth=4 autoindent: +-------------------------------------------------------------------------+ - | Copyright (C) 2004-2019 The Cacti Group | + | Copyright (C) 2004-2020 The Cacti Group | | | | This program is free software; you can redistribute it and/or | | modify it under the terms of the GNU Lesser General Public | @@ -45,6 +45,10 @@ #define LOCAL 0 #define REMOTE 1 +#define SPINE_NONE 0 +#define SPINE_IPV4 1 +#define SPINE_IPV6 2 + #ifndef __GNUC__ # define __attribute__(x) /* NOTHING */ #endif diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cacti-spine-1.2.9/sql.c new/cacti-spine-1.2.11/sql.c --- old/cacti-spine-1.2.9/sql.c 2020-02-13 21:48:35.000000000 +0100 +++ new/cacti-spine-1.2.11/sql.c 2020-04-06 04:15:20.000000000 +0200 @@ -1,7 +1,7 @@ /* ex: set tabstop=4 shiftwidth=4 autoindent: +-------------------------------------------------------------------------+ - | Copyright (C) 2004-2019 The Cacti Group | + | Copyright (C) 2004-2020 The Cacti Group | | | | This program is free software; you can redistribute it and/or | | modify it under the terms of the GNU Lesser General Public | @@ -62,29 +62,27 @@ if (mysql_query(mysql, query)) { error = mysql_errno(mysql); - if (error == 2013 && errno == EINTR) { - usleep(50000); - continue; - } - - if ((error == 1213) || (error == 1205)) { + if (error == 2013 || error == 2006) { + db_disconnect(mysql); usleep(50000); + db_connect(type, mysql); error_count++; if (error_count > 30) { - SPINE_LOG(("ERROR: Too many Lock/Deadlock errors occurred!, SQL Fragment:'%s'", query_frag)); - return FALSE; + SPINE_LOG(("FATAL: Too many Reconnect Attempts!")); + exit(1); } continue; - } else if (error == 2006 && errno == EINTR) { - db_disconnect(mysql); + } + + if ((error == 1213) || (error == 1205)) { usleep(50000); - db_connect(type, mysql); error_count++; if (error_count > 30) { - die("FATAL: Too many Reconnect Attempts!\n"); + SPINE_LOG(("ERROR: Too many Lock/Deadlock errors occurred!, SQL Fragment:'%s'", query_frag)); + return FALSE; } continue; @@ -141,7 +139,8 @@ error_count++; if (error_count > 30) { - die("FATAL: Too many Lock/Deadlock errors occurred!, SQL Fragment:'%s'\n", query_frag); + SPINE_LOG(("FATAL: Too many Lock/Deadlock errors occurred!, SQL Fragment:'%s'", query_frag)); + exit(1); } continue; @@ -152,12 +151,14 @@ error_count++; if (error_count > 30) { - die("FATAL: Too many Reconnect Attempts!\n"); + SPINE_LOG(("FATAL: Too many Reconnect Attempts!")); + exit(1); } continue; } else { - die("FATAL: MySQL Error:'%i', Message:'%s'", error, mysql_error(mysql)); + SPINE_LOG(("FATAL: MySQL Error:'%i', Message:'%s'", error, mysql_error(mysql))); + exit(1); } } else { mysql_res = mysql_store_result(mysql); @@ -235,7 +236,8 @@ mysql_init(mysql); if (mysql == NULL) { - die("FATAL: MySQL unable to allocate memory and therefore can not connect"); + SPINE_LOG(("FATAL: MySQL unable to allocate memory and therefore can not connect")); + exit(1); } MYSQL_SET_OPTION(MYSQL_OPT_READ_TIMEOUT, (char *)&rtimeout, "read timeout"); @@ -289,7 +291,7 @@ error = mysql_errno(mysql); db_disconnect(mysql); - if (error == 2013 && errno == EINTR) { + if ((error == 2003 || error == 2013) && errno == EINTR) { usleep(50000); tries++; success = FALSE; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cacti-spine-1.2.9/sql.h new/cacti-spine-1.2.11/sql.h --- old/cacti-spine-1.2.9/sql.h 2020-02-13 21:48:35.000000000 +0100 +++ new/cacti-spine-1.2.11/sql.h 2020-04-06 04:15:20.000000000 +0200 @@ -1,7 +1,7 @@ /* ex: set tabstop=4 shiftwidth=4 autoindent: +-------------------------------------------------------------------------+ - | Copyright (C) 2004-2019 The Cacti Group | + | Copyright (C) 2004-2020 The Cacti Group | | | | This program is free software; you can redistribute it and/or | | modify it under the terms of the GNU Lesser General Public | diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cacti-spine-1.2.9/util.c new/cacti-spine-1.2.11/util.c --- old/cacti-spine-1.2.9/util.c 2020-02-13 21:48:35.000000000 +0100 +++ new/cacti-spine-1.2.11/util.c 2020-04-06 04:15:20.000000000 +0200 @@ -1,7 +1,7 @@ /* ex: set tabstop=4 shiftwidth=4 autoindent: +-------------------------------------------------------------------------+ - | Copyright (C) 2004-2019 The Cacti Group | + | Copyright (C) 2004-2020 The Cacti Group | | | | This program is free software; you can redistribute it and/or | | modify it under the terms of the GNU Lesser General Public | @@ -912,8 +912,11 @@ if (!set.stderr_notty) { fprintf(stderr,"WARNING: DB_PreG is no longer supported\n"); } - } - else if (STRIMATCH(p1, "SNMP_Clientaddr")) STRNCOPY(set.snmp_clientaddr, p2); + } else if (STRIMATCH(p1, "Cacti_Log")) { + STRNCOPY(set.path_logfile, p2); + set.logfile_processed = 1; + set.log_destination = LOGDEST_BOTH; + } else if (STRIMATCH(p1, "SNMP_Clientaddr")) STRNCOPY(set.snmp_clientaddr, p2); else if (!set.stderr_notty) { fprintf(stderr,"WARNING: Unrecongized directive: %s=%s in %s\n", p1, p2, file); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cacti-spine-1.2.9/util.h new/cacti-spine-1.2.11/util.h --- old/cacti-spine-1.2.9/util.h 2020-02-13 21:48:35.000000000 +0100 +++ new/cacti-spine-1.2.11/util.h 2020-04-06 04:15:20.000000000 +0200 @@ -1,7 +1,7 @@ /* ex: set tabstop=4 shiftwidth=4 autoindent:* +-------------------------------------------------------------------------+ - | Copyright (C) 2004-2019 The Cacti Group | + | Copyright (C) 2004-2020 The Cacti Group | | | | This program is free software; you can redistribute it and/or | | modify it under the terms of the GNU Lesser General Public |
