Skip to content

Commit 3c46e55

Browse files
committed
feature: Make spine compatible with Streams
* feature: Make spine work with streams * issue: Remove old configrue --with-reentrant option
1 parent 7489f20 commit 3c46e55

File tree

6 files changed

+17
-34
lines changed

6 files changed

+17
-34
lines changed

CHANGELOG

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ The Cacti Group | spine
33
1.3.0
44
-feature#5090: Enhance number recognition within Spine
55
-feature#3740: Ability to disable a site
6+
-feature: Make spine work with Stream feature
67

78
1.2.28
89
-issue#350: When using Ping or SNMP Uptime, host is not always detected properly

bootstrap

+1-10
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ echo " These instructions assume the default install location for spine"
8686
echo " of /usr/local/spine. If you choose to use another prefix, make"
8787
echo " sure you update the commands as required for that new path."
8888
echo ""
89-
echo " To compile and install Spine using MySQL versions 5.5 or higher"
89+
echo " To compile and install Spine using MySQL or MariaDB"
9090
echo " please do the following:"
9191
echo ""
9292
echo " ./configure"
@@ -95,14 +95,5 @@ echo " make install"
9595
echo " chown root:root /usr/local/spine/bin/spine"
9696
echo " chmod +s /usr/local/spine/bin/spine"
9797
echo ""
98-
echo " To compile and install Spine using MySQL versions previous to 5.5"
99-
echo " please do the following:"
100-
echo ""
101-
echo " ./configure --with-reentrant"
102-
echo " make"
103-
echo " make install"
104-
echo " chown root:root /usr/local/spine/bin/spine"
105-
echo " chmod +s /usr/local/spine/bin/spine"
106-
echo ""
10798

10899
exit 0

configure.ac

+11-23
Original file line numberDiff line numberDiff line change
@@ -57,14 +57,6 @@ AC_ARG_WITH(snmp,
5757
[SNMP_DIR=$withval]
5858
)
5959

60-
# reentrant
61-
MYSQL_REENTRANT=0
62-
AC_ARG_WITH(reentrant,
63-
AS_HELP_STRING([--with-reentrant],[If using MySQL versions less than 5.5 you must choose this option
64-
]),
65-
[MYSQL_REENTRANT=1]
66-
)
67-
6860
# if host_alias is empty, ac_cv_host_alias may still have the info
6961
if test -z "$host_alias"; then
7062
host_alias=$ac_cv_host_alias
@@ -298,27 +290,23 @@ else
298290
)
299291
fi
300292

301-
if test $MYSQL_REENTRANT = 1 ; then
293+
if test -f $MYSQL_LIB_DIR/libmysqlclient_r.a -o -f $MYSQL_LIB_DIR/libmysqlclient_r.$ShLib; then
302294
LIBS="-lmysqlclient_r -lm -ldl $LIBS"
303295
else
304-
if test -f $MYSQL_LIB_DIR/libmysqlclient_r.a -o -f $MYSQL_LIB_DIR/libmysqlclient_r.$ShLib; then
296+
if test -f $MYSQL_LIB_DIR/libmysqlclient_r.a -o -f $MYSQL_LIB_DIR/libmysqlclient_r.$ShLib ; then
305297
LIBS="-lmysqlclient_r -lm -ldl $LIBS"
306298
else
307-
if test -f $MYSQL_LIB_DIR/libmysqlclient_r.a -o -f $MYSQL_LIB_DIR/libmysqlclient_r.$ShLib ; then
308-
LIBS="-lmysqlclient_r -lm -ldl $LIBS"
299+
if test "$HAVE_MYSQL" = "yes"; then
300+
if test $unamestr = 'OpenBSD'; then
301+
LIBS="-lmysqlclient -lm $LIBS"
302+
else
303+
LIBS="-lmysqlclient -lm -ldl $LIBS"
304+
fi
309305
else
310-
if test "$HAVE_MYSQL" = "yes"; then
311-
if test $unamestr = 'OpenBSD'; then
312-
LIBS="-lmysqlclient -lm $LIBS"
313-
else
314-
LIBS="-lmysqlclient -lm -ldl $LIBS"
315-
fi
306+
if test -f $MYSQL_LIB_DIR/libperconaserverclient.a -o -f $MYSQL_LIB_DIR/libperconaserverclient.$ShLib; then
307+
LIBS="-lperconaserverclient -lm -ldl $LIBS"
316308
else
317-
if test -f $MYSQL_LIB_DIR/libperconaserverclient.a -o -f $MYSQL_LIB_DIR/libperconaserverclient.$ShLib; then
318-
LIBS="-lperconaserverclient -lm -ldl $LIBS"
319-
else
320-
LIBS="-lmariadbclient -lm -ldl $LIBS"
321-
fi
309+
LIBS="-lmariadbclient -lm -ldl $LIBS"
322310
fi
323311
fi
324312
fi

poller.c

+2
Original file line numberDiff line numberDiff line change
@@ -736,6 +736,8 @@ void poll_host(int device_counter, int host_id, int host_thread, int host_thread
736736
} else {
737737
SPINE_LOG_MEDIUM(("Device[%i] HT[%i] No host availability check possible for '%s'", host->id, host_thread, host->hostname));
738738
}
739+
} else if (host->availability_method == AVAIL_STREAM) {
740+
update_host_status(HOST_UP, host, ping, host->availability_method);
739741
} else {
740742
if (ping_host(host, ping) == HOST_UP) {
741743
host->ignore_host = FALSE;

spine.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -638,7 +638,7 @@ int main(int argc, char *argv[]) {
638638
}
639639

640640
if (set.poller_id_exists) {
641-
qp += sprintf(qp, " AND host.poller_id = %i", set.poller_id);
641+
qp += sprintf(qp, " AND h.poller_id = %i", set.poller_id);
642642
}
643643

644644
qp += sprintf(qp, " ORDER BY picount DESC");

spine.h

+1
Original file line numberDiff line numberDiff line change
@@ -275,6 +275,7 @@
275275
#define AVAIL_SNMP_OR_PING 4
276276
#define AVAIL_SNMP_GET_SYSDESC 5
277277
#define AVAIL_SNMP_GET_NEXT 6
278+
#define AVAIL_STREAM 7
278279

279280
#define PING_ICMP 1
280281
#define PING_UDP 2

0 commit comments

Comments
 (0)