mirror of
git://git.yoctoproject.org/meta-virtualization.git
synced 2025-07-19 20:59:41 +02:00
nagios-nsca: add recipe with latest stable version 2.9.1
Signed-off-by: Chen Qi <Qi.Chen@windriver.com> Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
This commit is contained in:
parent
a73f7b18bc
commit
61a90af162
|
@ -0,0 +1,52 @@
|
||||||
|
From da37e6ce2a8cc315845440488cd2f8dab0a17bfe Mon Sep 17 00:00:00 2001
|
||||||
|
From: "John C. Frickson" <jfrickson@nagios.com>
|
||||||
|
Date: Wed, 7 Oct 2015 14:06:58 -0500
|
||||||
|
Subject: [PATCH] Fix missing argument in open calls
|
||||||
|
|
||||||
|
Commit b9f2c08dfdf31430f972a48781fc115c4af13cfe
|
||||||
|
from https://github.com/NagiosEnterprises/nsca
|
||||||
|
|
||||||
|
Fix for issue http://tracker.nagios.org/view.php?id=286
|
||||||
|
|
||||||
|
Upstream-Status: Backport
|
||||||
|
|
||||||
|
Singed-off-by: John C. Frickson <jfrickson@nagios.com>
|
||||||
|
Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
|
||||||
|
[MA: Context updated to allow application to older version]
|
||||||
|
Signed-off-by: Mark Asselstine <mark.asselstine@windriver.com>
|
||||||
|
---
|
||||||
|
Changelog | 4 ++++
|
||||||
|
src/nsca.c | 2 +-
|
||||||
|
2 files changed, 5 insertions(+), 1 deletion(-)
|
||||||
|
|
||||||
|
diff --git a/Changelog b/Changelog
|
||||||
|
index 3a7edd4..00ea11e 100644
|
||||||
|
--- a/Changelog
|
||||||
|
+++ b/Changelog
|
||||||
|
@@ -2,6 +2,10 @@
|
||||||
|
NSCA Changelog
|
||||||
|
**************
|
||||||
|
|
||||||
|
+2.9.x - xx/xx/xxxx
|
||||||
|
+------------------
|
||||||
|
+- Fix missing argument in open calls (Xavier Bachelot / John Frickson)
|
||||||
|
+
|
||||||
|
2.9.1 - 01/27/2012
|
||||||
|
------------------
|
||||||
|
- Applied patch to allow packets arriving with a future time stamp (Daniel Wittenberg)
|
||||||
|
diff --git a/src/nsca.c b/src/nsca.c
|
||||||
|
index 6b0e436..0e70b8b 100644
|
||||||
|
--- a/src/nsca.c
|
||||||
|
+++ b/src/nsca.c
|
||||||
|
@@ -477,7 +477,7 @@ static int read_config_file(char *filename){
|
||||||
|
int checkresult_test_fd=-1;
|
||||||
|
char *checkresult_test=NULL;
|
||||||
|
asprintf(&checkresult_test,"%s/nsca.test.%i",check_result_path,getpid());
|
||||||
|
- checkresult_test_fd=open(checkresult_test,O_WRONLY|O_CREAT);
|
||||||
|
+ checkresult_test_fd=open(checkresult_test,O_WRONLY|O_CREAT,S_IWUSR);
|
||||||
|
if (checkresult_test_fd>0){
|
||||||
|
unlink(checkresult_test);
|
||||||
|
}
|
||||||
|
--
|
||||||
|
2.11.0
|
||||||
|
|
67
recipes-extended/nagios/nagios-nsca/init-script.in
Normal file
67
recipes-extended/nagios/nagios-nsca/init-script.in
Normal file
|
@ -0,0 +1,67 @@
|
||||||
|
#!/bin/sh
|
||||||
|
#
|
||||||
|
# Last Modified 01-07-2003 Ethan Galstad (nagios@nagios.org)
|
||||||
|
# Notes
|
||||||
|
# This script takes care of starting and stopping the NSCA daemon.
|
||||||
|
# Modeled after init script for NRPE written by jaclu@grm.se
|
||||||
|
#
|
||||||
|
# chkconfig: 2345 80 30
|
||||||
|
# description: nsca is a daemon for accepting service check results \
|
||||||
|
# from applications running on other hosts.
|
||||||
|
# processname: nsca
|
||||||
|
# config: /usr/local/nagios/etc/nsca.cfg
|
||||||
|
|
||||||
|
### BEGIN INIT INFO
|
||||||
|
# Provides: nsca
|
||||||
|
# Required-Start: $remote_fs $syslog
|
||||||
|
# Required-Stop: $remote_fs $syslog
|
||||||
|
# Default-Start: 2 3 4 5
|
||||||
|
# Default-Stop: 0 1 6
|
||||||
|
# Short-Description: start and stop nagios nsca daemon
|
||||||
|
# Description: start and stop nagios nsca daemon
|
||||||
|
### END INIT INFO
|
||||||
|
|
||||||
|
|
||||||
|
# Source function library
|
||||||
|
if [ -f /etc/rc.d/init.d/functions ]; then
|
||||||
|
. /etc/rc.d/init.d/functions
|
||||||
|
elif [ -f /etc/init.d/functions ]; then
|
||||||
|
. /etc/init.d/functions
|
||||||
|
elif [ -f /etc/rc.d/functions ]; then
|
||||||
|
. /etc/rc.d/functions
|
||||||
|
fi
|
||||||
|
|
||||||
|
NscaBin=@bindir@/nsca
|
||||||
|
NscaCfg=@sysconfdir@/nsca.cfg
|
||||||
|
LockFile=/var/lock/nsca
|
||||||
|
|
||||||
|
# See how we were called.
|
||||||
|
case "$1" in
|
||||||
|
start)
|
||||||
|
# Start daemons.
|
||||||
|
echo -n "Starting nsca: "
|
||||||
|
start-stop-daemon --start --exec $NscaBin -- -s -c $NscaCfg
|
||||||
|
RETVAL=$?
|
||||||
|
echo
|
||||||
|
touch $LockFile
|
||||||
|
;;
|
||||||
|
stop)
|
||||||
|
# Stop daemons.
|
||||||
|
echo -n "Shutting down nsca: "
|
||||||
|
start-stop-daemon --stop --exec $NscaBin
|
||||||
|
echo
|
||||||
|
rm -f $LockFile
|
||||||
|
;;
|
||||||
|
restart)
|
||||||
|
$0 stop
|
||||||
|
$0 start
|
||||||
|
;;
|
||||||
|
status)
|
||||||
|
status nsca
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
echo "Usage: nsca {start|stop|restart|status}"
|
||||||
|
exit 1
|
||||||
|
esac
|
||||||
|
|
||||||
|
exit 0
|
12
recipes-extended/nagios/nagios-nsca/nagios-nsca.service
Normal file
12
recipes-extended/nagios/nagios-nsca/nagios-nsca.service
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
[Unit]
|
||||||
|
Description=Nagios nsca plugin
|
||||||
|
After=syslog.target network.target
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
Type=forking
|
||||||
|
ExecStart=/usr/bin/nsca -s -c /etc/nagios/nsca.cfg
|
||||||
|
PIDFile=/var/run/nsca.pid
|
||||||
|
TimeoutSec=60
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=multi-user.target
|
85
recipes-extended/nagios/nagios-nsca_2.9.1.bb
Normal file
85
recipes-extended/nagios/nagios-nsca_2.9.1.bb
Normal file
|
@ -0,0 +1,85 @@
|
||||||
|
require nagios-common.inc
|
||||||
|
|
||||||
|
DESCRIPTION = "Nagios Service Check Acceptor"
|
||||||
|
HOMEPAGE = "http://exchange.nagios.org"
|
||||||
|
SECTION = "console/network"
|
||||||
|
PRIORITY = "optional"
|
||||||
|
LICENSE = "GPLv2"
|
||||||
|
|
||||||
|
LIC_FILES_CHKSUM = "file://src/nsca.c;beginline=1;endline=16;md5=c1bd17485c5c1dd42f664fe8b3528674"
|
||||||
|
|
||||||
|
SRCNAME = "nsca"
|
||||||
|
|
||||||
|
SRC_URI = "http://prdownloads.sourceforge.net/sourceforge/nagios/${SRCNAME}-${PV}.tar.gz \
|
||||||
|
file://init-script.in \
|
||||||
|
file://nagios-nsca.service \
|
||||||
|
file://0001-Fix-missing-argument-in-open-calls.patch \
|
||||||
|
"
|
||||||
|
|
||||||
|
SRC_URI[md5sum] = "3fe2576a8cc5b252110a93f4c8d978c6"
|
||||||
|
SRC_URI[sha256sum] = "fb12349e50838c37954fe896ba6a026c09eaeff2f9408508ad7ede53e9ea9580"
|
||||||
|
|
||||||
|
S = "${WORKDIR}/${SRCNAME}-${PV}"
|
||||||
|
|
||||||
|
inherit update-rc.d autotools-brokensep systemd dos2unix
|
||||||
|
|
||||||
|
DEPENDS = "libmcrypt"
|
||||||
|
|
||||||
|
EXTRA_OECONF += "--with-nsca-user=${NAGIOS_USER} \
|
||||||
|
--with-nsca-group=${NAGIOS_GROUP} \
|
||||||
|
--with-libmcrypt-prefix=${STAGING_DIR_HOST} \
|
||||||
|
ac_cv_path_LIBMCRYPT_CONFIG=${STAGING_BINDIR_CROSS}/libmcrypt-config \
|
||||||
|
ac_cv_lib_wrap_main=no \
|
||||||
|
ac_cv_path_PERL=${bindir}/perl \
|
||||||
|
"
|
||||||
|
|
||||||
|
do_configure() {
|
||||||
|
cp ${WORKDIR}/init-script.in ${S}/init-script.in
|
||||||
|
oe_runconf || die "make failed"
|
||||||
|
}
|
||||||
|
|
||||||
|
do_install() {
|
||||||
|
CONF_DIR=${D}${NAGIOS_CONF_DIR}
|
||||||
|
|
||||||
|
install -d ${CONF_DIR}
|
||||||
|
install -d ${D}${sysconfdir}/init.d
|
||||||
|
install -d ${D}${bindir}
|
||||||
|
|
||||||
|
install -m 755 ${S}/sample-config/nsca.cfg ${CONF_DIR}
|
||||||
|
install -m 755 ${S}/sample-config/send_nsca.cfg ${CONF_DIR}
|
||||||
|
install -m 755 ${S}/init-script ${D}${sysconfdir}/init.d/nsca
|
||||||
|
|
||||||
|
install -m 755 ${S}/src/nsca ${D}${bindir}
|
||||||
|
install -m 755 ${S}/src/send_nsca ${D}${bindir}
|
||||||
|
|
||||||
|
if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then
|
||||||
|
install -d ${D}${systemd_unitdir}/system
|
||||||
|
install -m 644 ${WORKDIR}/nagios-nsca.service ${D}${systemd_unitdir}/system/
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
PACKAGES = "${PN}-dbg ${PN}-daemon ${PN}-client"
|
||||||
|
|
||||||
|
FILES_${PN}-daemon = "${sysconfdir}/init.d \
|
||||||
|
${NAGIOS_CONF_DIR}/nsca.cfg \
|
||||||
|
${bindir}/nsca \
|
||||||
|
"
|
||||||
|
|
||||||
|
FILES_${PN}-client = "${NAGIOS_CONF_DIR}/send_nsca.cfg \
|
||||||
|
${bindir}/send_nsca \
|
||||||
|
"
|
||||||
|
|
||||||
|
RDEPENDS_${PN}-daemon += "libmcrypt \
|
||||||
|
nagios-base \
|
||||||
|
"
|
||||||
|
RDEPENDS_${PN}-client += "libmcrypt \
|
||||||
|
nagios-base \
|
||||||
|
"
|
||||||
|
|
||||||
|
SYSTEMD_PACKAGES = "${PN}-daemon"
|
||||||
|
SYSTEMD_SERVICE_${PN}-daemon = "nagios-nsca.service"
|
||||||
|
SYSTEMD_AUTO_ENABLE_${PN}-daemon = "enable"
|
||||||
|
|
||||||
|
INITSCRIPT_PACKAGES = "${PN}-daemon"
|
||||||
|
INITSCRIPT_NAME_${PN}-daemon = "nsca"
|
||||||
|
INITSCRIPT_PARAMS_${PN}-daemon = "defaults"
|
Loading…
Reference in New Issue
Block a user