summaryrefslogtreecommitdiffstats
path: root/external/meta-virtualization/recipes-extended/nagios/nagios-core
diff options
context:
space:
mode:
Diffstat (limited to 'external/meta-virtualization/recipes-extended/nagios/nagios-core')
-rw-r--r--external/meta-virtualization/recipes-extended/nagios/nagios-core/0001-fix-autoheader-error.patch63
-rw-r--r--external/meta-virtualization/recipes-extended/nagios/nagios-core/0001-fix-compile-error-of-missing-headers.patch75
-rw-r--r--external/meta-virtualization/recipes-extended/nagios/nagios-core/0001-fix-segment-fault.patch54
-rw-r--r--external/meta-virtualization/recipes-extended/nagios/nagios-core/eventhandlers_nagioscmd_path.patch73
-rw-r--r--external/meta-virtualization/recipes-extended/nagios/nagios-core/nagios-core-systemd-volatile.conf2
-rw-r--r--external/meta-virtualization/recipes-extended/nagios/nagios-core/nagios-core.service18
-rw-r--r--external/meta-virtualization/recipes-extended/nagios/nagios-core/volatiles2
7 files changed, 287 insertions, 0 deletions
diff --git a/external/meta-virtualization/recipes-extended/nagios/nagios-core/0001-fix-autoheader-error.patch b/external/meta-virtualization/recipes-extended/nagios/nagios-core/0001-fix-autoheader-error.patch
new file mode 100644
index 00000000..014ed1d8
--- /dev/null
+++ b/external/meta-virtualization/recipes-extended/nagios/nagios-core/0001-fix-autoheader-error.patch
@@ -0,0 +1,63 @@
+From 3c51d942f6da08045351ce61cc7f426fa0855489 Mon Sep 17 00:00:00 2001
+From: Chen Qi <Qi.Chen@windriver.com>
+Date: Fri, 31 Aug 2018 10:51:36 +0800
+Subject: [PATCH] fix autoheader error
+
+Upstream-Status: Pending
+
+Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
+---
+ configure.ac | 12 ++++++------
+ 1 file changed, 6 insertions(+), 6 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index 17e436d..16b3e71 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -388,7 +388,7 @@ AC_ARG_WITH(iobroker,
+ case $IOBROKER_METHOD in
+ epoll*)
+ if test "$GLIBC_NEWER_2_4" -eq 1 -a "x$ac_cv_header_sys_epoll_h" = "xyes"; then
+- AC_DEFINE([IOBROKER_USES_EPOLL])
++ AC_DEFINE([IOBROKER_USES_EPOLL], [1], [iobroker uses epoll])
+ else
+ echo "\"epoll\" is not available as an iobroker method."
+ echo "Please use one of the other options."
+@@ -397,7 +397,7 @@ epoll*)
+ ;;
+ poll*)
+ if test "x$ac_cv_header_sys_poll_h" = "xyes" -o "x$ac_cv_header_poll_h" = "xyes"; then
+- AC_DEFINE([IOBROKER_USES_POLL])
++ AC_DEFINE([IOBROKER_USES_POLL], [1], [iobroker uses poll])
+ else
+ echo "\"poll\" is not available as an iobroker method."
+ echo "Please use one of the other options."
+@@ -406,7 +406,7 @@ poll*)
+ ;;
+ select*)
+ if test "x$ac_cv_header_sys_select_h" = "xyes"; then
+- AC_DEFINE([IOBROKER_USES_SELECT])
++ AC_DEFINE([IOBROKER_USES_SELECT], [1], [iobroker uses select])
+ else
+ echo "\"select\" is not available as an iobroker method."
+ echo "Please use one of the other options."
+@@ -415,13 +415,13 @@ select*)
+ ;;
+ none*)
+ if test "$GLIBC_NEWER_2_4" -eq 1 -a "x$ac_cv_header_sys_epoll_h" = "xyes"; then
+- AC_DEFINE([IOBROKER_USES_EPOLL])
++ AC_DEFINE([IOBROKER_USES_EPOLL], [1], [iobroker uses epoll])
+ IOBROKER_METHOD="epoll"
+ elif test "x$ac_cv_header_sys_poll_h" = "xyes" -o "x$ac_cv_header_poll_h" = "xyes"; then
+- AC_DEFINE([IOBROKER_USES_POLL])
++ AC_DEFINE([IOBROKER_USES_POLL], [1], [iobroker uses poll])
+ IOBROKER_METHOD="poll"
+ elif test "x$ac_cv_header_sys_select_h" = "xyes"; then
+- AC_DEFINE([IOBROKER_USES_SELECT])
++ AC_DEFINE([IOBROKER_USES_SELECT], [1], [iobroker uses select])
+ IOBROKER_METHOD="select"
+ else
+ echo "There are no available options for iobroker polling"
+--
+2.7.4
+
diff --git a/external/meta-virtualization/recipes-extended/nagios/nagios-core/0001-fix-compile-error-of-missing-headers.patch b/external/meta-virtualization/recipes-extended/nagios/nagios-core/0001-fix-compile-error-of-missing-headers.patch
new file mode 100644
index 00000000..7f4cfbd7
--- /dev/null
+++ b/external/meta-virtualization/recipes-extended/nagios/nagios-core/0001-fix-compile-error-of-missing-headers.patch
@@ -0,0 +1,75 @@
+From a5e12350cb25b2f9289c0d27e26afc337652d42e Mon Sep 17 00:00:00 2001
+From: Chen Qi <Qi.Chen@windriver.com>
+Date: Fri, 31 Aug 2018 13:33:31 +0800
+Subject: [PATCH] fix compile error of missing headers
+
+Upstream-Status: Pending
+
+Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
+---
+ cgi/getcgi.c | 3 ++-
+ include/shared.h | 31 +++++++++++++++++++++++++++++++
+ 2 files changed, 33 insertions(+), 1 deletion(-)
+
+diff --git a/cgi/getcgi.c b/cgi/getcgi.c
+index 37b479f..1f83e11 100644
+--- a/cgi/getcgi.c
++++ b/cgi/getcgi.c
+@@ -7,10 +7,11 @@
+
+ #include "../include/config.h"
+ #include "../include/getcgi.h"
++#include "../include/shared.h"
++
+ #include <stdio.h>
+ #include <stdlib.h>
+
+-
+ #undef PARANOID_CGI_INPUT
+
+
+diff --git a/include/shared.h b/include/shared.h
+index 84836c7..1dfa0c7 100644
+--- a/include/shared.h
++++ b/include/shared.h
+@@ -1,6 +1,37 @@
+ #ifndef NAGIOS_SHARED_H_INCLUDED
+ #define NAGIOS_SHARED_H_INCLUDED
+
++#include <stdio.h>
++#include <sys/types.h>
++#include <sys/stat.h>
++#include <sys/socket.h>
++#include <sys/mman.h>
++#include <stdlib.h>
++#include <stddef.h>
++#include <stdlib.h>
++#include <memory.h>
++#include <string.h>
++#include <strings.h>
++#include <inttypes.h>
++#include <stdint.h>
++#include <unistd.h>
++#include <dirent.h>
++#include <math.h>
++#include <fcntl.h>
++#include <regex.h>
++#include <ctype.h>
++#include <sys/prctl.h>
++#include <stdarg.h>
++#include <dlfcn.h>
++#include <getopt.h>
++#include <syslog.h>
++#include <pwd.h>
++#include <grp.h>
++#include <netdb.h>
++#include <wchar.h>
++#include <locale.h>
++#include <limits.h>
++
+ #include <time.h>
+ #include "lib/libnagios.h"
+
+--
+2.7.4
+
diff --git a/external/meta-virtualization/recipes-extended/nagios/nagios-core/0001-fix-segment-fault.patch b/external/meta-virtualization/recipes-extended/nagios/nagios-core/0001-fix-segment-fault.patch
new file mode 100644
index 00000000..1ea8da9c
--- /dev/null
+++ b/external/meta-virtualization/recipes-extended/nagios/nagios-core/0001-fix-segment-fault.patch
@@ -0,0 +1,54 @@
+From 65e4539c6eca215d8d79ef8acc5c8842b886752a Mon Sep 17 00:00:00 2001
+From: Chen Qi <Qi.Chen@windriver.com>
+Date: Mon, 3 Sep 2018 13:15:29 +0800
+Subject: [PATCH] fix segment fault
+
+When using strdup(dirname(cfgfile)) directly, we will have segment
+fault. This happens at least for glibc 2.28. So we do it step by
+step, and this would avoid the segment fault.
+
+Upstream-Status: Pending
+
+Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
+---
+ include/shared.h | 1 +
+ xdata/xodtemplate.c | 4 +++-
+ 2 files changed, 4 insertions(+), 1 deletion(-)
+
+diff --git a/include/shared.h b/include/shared.h
+index 1dfa0c7..0188c7d 100644
+--- a/include/shared.h
++++ b/include/shared.h
+@@ -31,6 +31,7 @@
+ #include <wchar.h>
+ #include <locale.h>
+ #include <limits.h>
++#include <libgen.h>
+
+ #include <time.h>
+ #include "lib/libnagios.h"
+diff --git a/xdata/xodtemplate.c b/xdata/xodtemplate.c
+index 33d51f4..da32e69 100644
+--- a/xdata/xodtemplate.c
++++ b/xdata/xodtemplate.c
+@@ -187,6 +187,7 @@ static void xodtemplate_free_template_skiplists(void) {
+ int xodtemplate_read_config_data(const char *main_config_file, int options) {
+ #ifdef NSCORE
+ char *cfgfile = NULL;
++ char *cfgfile_dir = NULL;
+ char *config_base_dir = NULL;
+ char *input = NULL;
+ char *var = NULL;
+@@ -261,7 +262,8 @@ int xodtemplate_read_config_data(const char *main_config_file, int options) {
+ printf("Unable to allocate memory!\n");
+ return ERROR;
+ }
+- config_base_dir = (char *)strdup(dirname(cfgfile));
++ cfgfile_dir = dirname(cfgfile);
++ config_base_dir = (char *)strdup(cfgfile_dir);
+ my_free(cfgfile);
+
+ /* open the main config file for reading (we need to find all the config files to read) */
+--
+2.7.4
+
diff --git a/external/meta-virtualization/recipes-extended/nagios/nagios-core/eventhandlers_nagioscmd_path.patch b/external/meta-virtualization/recipes-extended/nagios/nagios-core/eventhandlers_nagioscmd_path.patch
new file mode 100644
index 00000000..c767162c
--- /dev/null
+++ b/external/meta-virtualization/recipes-extended/nagios/nagios-core/eventhandlers_nagioscmd_path.patch
@@ -0,0 +1,73 @@
+change eventhandlers nagioscmd path
+
+Modify nagios.cmd path to the right location
+at "/var/nagios/rw/nagios.cmd"
+
+Signed-off-by: Rickard Engberg <rickard.engberg@windriver.com>
+Signed-off-by: Vu Tran <vu.tran@windriver.com>
+
+diff --git a/contrib/eventhandlers/disable_active_service_checks b/contrib/eventhandlers/disable_active_service_checks
+index c01f2be..2c2880b 100755
+--- a/contrib/eventhandlers/disable_active_service_checks
++++ b/contrib/eventhandlers/disable_active_service_checks
+@@ -16,7 +16,7 @@
+
+ printfcmd="/usr/bin/printf"
+
+-CommandFile="/usr/local/nagios/var/rw/nagios.cmd"
++CommandFile="/var/nagios/rw/nagios.cmd"
+
+ # get the current date/time in seconds since UNIX epoch
+ datetime=`date +%s`
+diff --git a/contrib/eventhandlers/disable_notifications b/contrib/eventhandlers/disable_notifications
+index a92bb7a..b2c9c06 100755
+--- a/contrib/eventhandlers/disable_notifications
++++ b/contrib/eventhandlers/disable_notifications
+@@ -14,7 +14,7 @@
+
+ printfcmd="/usr/bin/printf"
+
+-CommandFile="/usr/local/nagios/var/rw/nagios.cmd"
++CommandFile="/var/nagios/rw/nagios.cmd"
+
+ # get the current date/time in seconds since UNIX epoch
+ datetime=`date +%s`
+diff --git a/contrib/eventhandlers/enable_active_service_checks b/contrib/eventhandlers/enable_active_service_checks
+index 423c8d9..631fa00 100755
+--- a/contrib/eventhandlers/enable_active_service_checks
++++ b/contrib/eventhandlers/enable_active_service_checks
+@@ -16,7 +16,7 @@
+
+ printfcmd="/usr/bin/printf"
+
+-CommandFile="/usr/local/nagios/var/rw/nagios.cmd"
++CommandFile="/var/nagios/rw/nagios.cmd"
+
+ # get the current date/time in seconds since UNIX epoch
+ datetime=`date +%s`
+diff --git a/contrib/eventhandlers/enable_notifications b/contrib/eventhandlers/enable_notifications
+index 0d3f13d..2cc0b47 100755
+--- a/contrib/eventhandlers/enable_notifications
++++ b/contrib/eventhandlers/enable_notifications
+@@ -14,7 +14,7 @@
+
+ printfcmd="/usr/bin/printf"
+
+-CommandFile="/usr/local/nagios/var/rw/nagios.cmd"
++CommandFile="/var/nagios/rw/nagios.cmd"
+
+ # get the current date/time in seconds since UNIX epoch
+ datetime=`date +%s`
+diff --git a/contrib/eventhandlers/submit_check_result b/contrib/eventhandlers/submit_check_result
+index 5d89f31..790a988 100755
+--- a/contrib/eventhandlers/submit_check_result
++++ b/contrib/eventhandlers/submit_check_result
+@@ -24,7 +24,7 @@
+
+ echocmd="/bin/echo"
+
+-CommandFile="/usr/local/nagios/var/rw/nagios.cmd"
++CommandFile="/var/nagios/rw/nagios.cmd"
+
+ # get the current date/time in seconds since UNIX epoch
+ datetime=`date +%s`
diff --git a/external/meta-virtualization/recipes-extended/nagios/nagios-core/nagios-core-systemd-volatile.conf b/external/meta-virtualization/recipes-extended/nagios/nagios-core/nagios-core-systemd-volatile.conf
new file mode 100644
index 00000000..134fb854
--- /dev/null
+++ b/external/meta-virtualization/recipes-extended/nagios/nagios-core/nagios-core-systemd-volatile.conf
@@ -0,0 +1,2 @@
+d /var/nagios 0755 nagios nagios -
+d /var/run/nagios 0755 nagios nagios -
diff --git a/external/meta-virtualization/recipes-extended/nagios/nagios-core/nagios-core.service b/external/meta-virtualization/recipes-extended/nagios/nagios-core/nagios-core.service
new file mode 100644
index 00000000..61fda3f7
--- /dev/null
+++ b/external/meta-virtualization/recipes-extended/nagios/nagios-core/nagios-core.service
@@ -0,0 +1,18 @@
+[Unit]
+Description=Nagios core
+After=network.target local-fs.target
+
+[Service]
+Type=forking
+User=nagios
+Group=nagios
+PIDFile=/var/run/nagios/nagios.pid
+# Verify Nagios config before start as upstream suggested
+ExecStartPre=/usr/bin/nagios -v /etc/nagios/nagios.cfg
+ExecStart=/usr/bin/nagios -d /etc/nagios/nagios.cfg
+ExecStop=/bin/kill -TERM ${MAINPID}
+ExecStopPost=/bin/rm -f /var/spool/nagios/cmd/nagios.cmd
+ExecReload=/bin/kill -HUP ${MAINPID}
+
+[Install]
+WantedBy=multi-user.target
diff --git a/external/meta-virtualization/recipes-extended/nagios/nagios-core/volatiles b/external/meta-virtualization/recipes-extended/nagios/nagios-core/volatiles
new file mode 100644
index 00000000..e9bb7680
--- /dev/null
+++ b/external/meta-virtualization/recipes-extended/nagios/nagios-core/volatiles
@@ -0,0 +1,2 @@
+d nagios nagios 0755 /var/nagios none
+d nagios nagios 0755 /var/run/nagios none