Re: [Nagios-devel] Nagios 4 on Solaris 10
Posted: Thu Feb 07, 2013 10:08 am
--Apple-Mail-24--327561740
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain; charset="us-ascii"
Guys,
We've managed to fix this issue with the worker threads. It is due to =
EPOLL not being available on Solaris, so we switch to using SELECT =
instead. Patch is below (nagios_solaris_uses_select.patch), though it =
should be detected via configure instead.
We apply various patches to Solaris builds only, some of which look like =
you've already fixed. The patches we apply are:
* Adding include/sunos.h and base/sunos.h for missing vasprintf(), =
asprintf()
* nagios_build_on_solaris.patch to include above - this should be done =
via configure, maybe via libnagios
* nagios_solaris_rlimit.patch - looks like this is already applied by =
Andreas
* nagios_solaris_compile_errors_for_comments_h.patch - this is =
probably incorrectly done but mimics Nagios 3
Ton
--Apple-Mail-24--327561740
Content-Disposition: attachment; filename="nagios_solaris_uses_select.patch"
Content-Type: application/octet-stream; name="nagios_solaris_uses_select.patch"
Content-Transfer-Encoding: 7bit
diff -ur nagios-4.0.20130107-orig/lib/Makefile.in nagios-4.0.20130107/lib/Makefile.in
--- nagios-4.0.20130107-orig/lib/Makefile.in 2012-12-24 15:29:25.000000000 +0000
+++ nagios-4.0.20130107/lib/Makefile.in 2013-02-05 09:26:20.000000000 +0000
@@ -2,7 +2,7 @@
COV_CFLAGS = -ggdb3 -O0 -ftest-coverage -fprofile-arcs -pg
LDFLAGS =
CFLAGS ?= @CFLAGS@
-ALL_CFLAGS = -Wall $(CFLAGS) @DEFS@
+ALL_CFLAGS = -Wall -DIOBROKER_USES_SELECT $(CFLAGS) @DEFS@
LIBNAME = libnagios.a
all: $(LIBNAME)
--Apple-Mail-24--327561740
Content-Disposition: attachment; filename="sunos.c"
Content-Type: application/octet-stream; name="sunos.c"
Content-Transfer-Encoding: 7bit
#include
#include
#include
#include
#include
#define CHUNKSIZE 512
int
vasprintf(char **ret, const char *fmt, va_list ap)
{
int chunks;
size_t buflen;
char *buf;
int len;
chunks = ((strlen(fmt) + 1) / CHUNKSIZE) + 1;
buflen = chunks * CHUNKSIZE;
for (;;) {
if ((buf = malloc(buflen)) == NULL) {
*ret = NULL;
return -1;
}
len = vsnprintf(buf, buflen, fmt, ap);
if (len >= 0 && len = 0 are required for vsnprintf implementation that
* return -1 of buffer insufficient
*/
if (len >= 0 && len >= buflen) {
buflen = len + 1;
}
}
*ret = buf;
return len;
FILE *fp;
*ret = NULL;
}
int
asprintf(char **ret, const char *fmt, ...)
{
int len;
va_list ap;
va_start(ap, fmt);
len = vasprintf(ret, fmt, ap);
va_end(ap);
return len;
}
--Apple-Mail-24--327561740
Content-Disposition: attachment; filename="sunos.h"
Content-Type: application/octet-stream; name="sunos.h"
Content-Transfer-Encoding: 7bit
#ifndef SUN_LEN
#define SUN_LEN(ptr) ((size_t) (((struct sockaddr_un *) 0)->sun_path) + strlen ((ptr)->sun_path))
#endif
/*
int vasprintf(char **ret, const char *fmt, va_list ap);
int asprintf(char **ret, const char *fmt, ...);
*/
--Apple-Mail-24--327561740
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset="us-ascii"
--Apple-Mail-24--327561740
Content-Disposition: attachment; filename="nagios_build_on_solaris.patch"
Content-Type: application/octet-stream; name="nagios_build_on_solaris.patch"
Content-Transfer-Encoding: 7bit
--- nagios-4.0.20130107.original/base/Makefile.in Mon Dec 24 15:29:58 2012
+++ nagios-4.0.20130107/base/Makefile.in Mon Jan 7 17:03:00 2013
@@ -118,7 +118,7 @@
DDATADEPS=$(DDATALIBS)
-OBJS=$(BROKER_O) $(SRC_COMMON)/shared.o nerd.o query-handler.o workers.o checks.o config.o commands.o events.o flapping.o logging.o macros-base.o netutils.o notifications.o sehandlers.o utils.o $(RDATALIBS) $(CDATALIBS) $(ODATALIBS) $(SDATALIBS) $(PDATALIBS) $(DDATALIBS) $(BASEEXTRALIBS)
+OBJS=sunos.o $(BROKER_O) $(SRC_COMMON)/shared.o nerd.o query-handler.o workers.o checks.o config.o commands.o events.o flapping.o logging.o macros-base.o netutils.o notifications.o sehandlers.o utils.o $(RDATALIBS) $(CDATALIBS) $(ODATALIBS) $(SDATALIBS) $(PDATALIBS) $(DDATALIBS) $(
...[email truncated]...
This post was automatically imported from historical nagios-devel mailing list archives
Original poster: [email protected]
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain; charset="us-ascii"
Guys,
We've managed to fix this issue with the worker threads. It is due to =
EPOLL not being available on Solaris, so we switch to using SELECT =
instead. Patch is below (nagios_solaris_uses_select.patch), though it =
should be detected via configure instead.
We apply various patches to Solaris builds only, some of which look like =
you've already fixed. The patches we apply are:
* Adding include/sunos.h and base/sunos.h for missing vasprintf(), =
asprintf()
* nagios_build_on_solaris.patch to include above - this should be done =
via configure, maybe via libnagios
* nagios_solaris_rlimit.patch - looks like this is already applied by =
Andreas
* nagios_solaris_compile_errors_for_comments_h.patch - this is =
probably incorrectly done but mimics Nagios 3
Ton
--Apple-Mail-24--327561740
Content-Disposition: attachment; filename="nagios_solaris_uses_select.patch"
Content-Type: application/octet-stream; name="nagios_solaris_uses_select.patch"
Content-Transfer-Encoding: 7bit
diff -ur nagios-4.0.20130107-orig/lib/Makefile.in nagios-4.0.20130107/lib/Makefile.in
--- nagios-4.0.20130107-orig/lib/Makefile.in 2012-12-24 15:29:25.000000000 +0000
+++ nagios-4.0.20130107/lib/Makefile.in 2013-02-05 09:26:20.000000000 +0000
@@ -2,7 +2,7 @@
COV_CFLAGS = -ggdb3 -O0 -ftest-coverage -fprofile-arcs -pg
LDFLAGS =
CFLAGS ?= @CFLAGS@
-ALL_CFLAGS = -Wall $(CFLAGS) @DEFS@
+ALL_CFLAGS = -Wall -DIOBROKER_USES_SELECT $(CFLAGS) @DEFS@
LIBNAME = libnagios.a
all: $(LIBNAME)
--Apple-Mail-24--327561740
Content-Disposition: attachment; filename="sunos.c"
Content-Type: application/octet-stream; name="sunos.c"
Content-Transfer-Encoding: 7bit
#include
#include
#include
#include
#include
#define CHUNKSIZE 512
int
vasprintf(char **ret, const char *fmt, va_list ap)
{
int chunks;
size_t buflen;
char *buf;
int len;
chunks = ((strlen(fmt) + 1) / CHUNKSIZE) + 1;
buflen = chunks * CHUNKSIZE;
for (;;) {
if ((buf = malloc(buflen)) == NULL) {
*ret = NULL;
return -1;
}
len = vsnprintf(buf, buflen, fmt, ap);
if (len >= 0 && len = 0 are required for vsnprintf implementation that
* return -1 of buffer insufficient
*/
if (len >= 0 && len >= buflen) {
buflen = len + 1;
}
}
*ret = buf;
return len;
FILE *fp;
*ret = NULL;
}
int
asprintf(char **ret, const char *fmt, ...)
{
int len;
va_list ap;
va_start(ap, fmt);
len = vasprintf(ret, fmt, ap);
va_end(ap);
return len;
}
--Apple-Mail-24--327561740
Content-Disposition: attachment; filename="sunos.h"
Content-Type: application/octet-stream; name="sunos.h"
Content-Transfer-Encoding: 7bit
#ifndef SUN_LEN
#define SUN_LEN(ptr) ((size_t) (((struct sockaddr_un *) 0)->sun_path) + strlen ((ptr)->sun_path))
#endif
/*
int vasprintf(char **ret, const char *fmt, va_list ap);
int asprintf(char **ret, const char *fmt, ...);
*/
--Apple-Mail-24--327561740
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset="us-ascii"
--Apple-Mail-24--327561740
Content-Disposition: attachment; filename="nagios_build_on_solaris.patch"
Content-Type: application/octet-stream; name="nagios_build_on_solaris.patch"
Content-Transfer-Encoding: 7bit
--- nagios-4.0.20130107.original/base/Makefile.in Mon Dec 24 15:29:58 2012
+++ nagios-4.0.20130107/base/Makefile.in Mon Jan 7 17:03:00 2013
@@ -118,7 +118,7 @@
DDATADEPS=$(DDATALIBS)
-OBJS=$(BROKER_O) $(SRC_COMMON)/shared.o nerd.o query-handler.o workers.o checks.o config.o commands.o events.o flapping.o logging.o macros-base.o netutils.o notifications.o sehandlers.o utils.o $(RDATALIBS) $(CDATALIBS) $(ODATALIBS) $(SDATALIBS) $(PDATALIBS) $(DDATALIBS) $(BASEEXTRALIBS)
+OBJS=sunos.o $(BROKER_O) $(SRC_COMMON)/shared.o nerd.o query-handler.o workers.o checks.o config.o commands.o events.o flapping.o logging.o macros-base.o netutils.o notifications.o sehandlers.o utils.o $(RDATALIBS) $(CDATALIBS) $(ODATALIBS) $(SDATALIBS) $(PDATALIBS) $(DDATALIBS) $(
...[email truncated]...
This post was automatically imported from historical nagios-devel mailing list archives
Original poster: [email protected]