diff options
5 files changed, 216 insertions, 0 deletions
diff --git a/recipes-extended/nagios/nagios-nrpe/check_nrpe.cfg b/recipes-extended/nagios/nagios-nrpe/check_nrpe.cfg new file mode 100644 index 00000000..48f3fa5a --- /dev/null +++ b/recipes-extended/nagios/nagios-nrpe/check_nrpe.cfg | |||
| @@ -0,0 +1,11 @@ | |||
| 1 | # this command runs a program $ARG1$ with arguments $ARG2$ | ||
| 2 | define command { | ||
| 3 | command_name check_nrpe | ||
| 4 | command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -c $ARG1$ -a $ARG2$ | ||
| 5 | } | ||
| 6 | |||
| 7 | # this command runs a program $ARG1$ with no arguments | ||
| 8 | define command { | ||
| 9 | command_name check_nrpe_1arg | ||
| 10 | command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -c $ARG1$ | ||
| 11 | } | ||
diff --git a/recipes-extended/nagios/nagios-nrpe/fix-compile-without-openssl.patch b/recipes-extended/nagios/nagios-nrpe/fix-compile-without-openssl.patch new file mode 100644 index 00000000..ab913a8f --- /dev/null +++ b/recipes-extended/nagios/nagios-nrpe/fix-compile-without-openssl.patch | |||
| @@ -0,0 +1,43 @@ | |||
| 1 | fix compile without openssl | ||
| 2 | |||
| 3 | Build with --disable-ssl causes the build to break with | ||
| 4 | this error: | ||
| 5 | |||
| 6 | error: unknown type name 'SSL' | ||
| 7 | void complete_SSL_shutdown( SSL *); | ||
| 8 | |||
| 9 | Signed-off-by: Rickard Engberg <rickard.engberg@windriver.com> | ||
| 10 | Signed-off-by: Vu Tran <vu.tran@windriver.com> | ||
| 11 | |||
| 12 | Index: nrpe-2.15/src/nrpe.c | ||
| 13 | =================================================================== | ||
| 14 | --- nrpe-2.15.orig/src/nrpe.c 2013-09-06 17:27:13.000000000 +0200 | ||
| 15 | +++ nrpe-2.15/src/nrpe.c 2013-11-20 23:22:49.546791020 +0100 | ||
| 16 | @@ -99,9 +99,9 @@ | ||
| 17 | int debug=FALSE; | ||
| 18 | int use_src=FALSE; /* Define parameter for SRC option */ | ||
| 19 | |||
| 20 | - | ||
| 21 | +#ifdef HAVE_SSL | ||
| 22 | void complete_SSL_shutdown( SSL *); | ||
| 23 | - | ||
| 24 | +#endif | ||
| 25 | |||
| 26 | int main(int argc, char **argv){ | ||
| 27 | int result=OK; | ||
| 28 | @@ -1796,6 +1796,7 @@ | ||
| 29 | return OK; | ||
| 30 | } | ||
| 31 | |||
| 32 | +#ifdef HAVE_SSL | ||
| 33 | void complete_SSL_shutdown( SSL *ssl) { | ||
| 34 | |||
| 35 | /* | ||
| 36 | @@ -1816,6 +1817,7 @@ | ||
| 37 | if( SSL_shutdown( ssl)) break; | ||
| 38 | } | ||
| 39 | } | ||
| 40 | +#endif | ||
| 41 | |||
| 42 | /* bail if daemon is running as root */ | ||
| 43 | int check_privileges(void){ | ||
diff --git a/recipes-extended/nagios/nagios-nrpe/fix-configure-uses-host-openssl.patch b/recipes-extended/nagios/nagios-nrpe/fix-configure-uses-host-openssl.patch new file mode 100644 index 00000000..920aabfc --- /dev/null +++ b/recipes-extended/nagios/nagios-nrpe/fix-configure-uses-host-openssl.patch | |||
| @@ -0,0 +1,52 @@ | |||
| 1 | fix configure uses host openssl | ||
| 2 | |||
| 3 | include/dh.h file is needed to be generated with command: | ||
| 4 | |||
| 5 | openssl dhparam -C 512 | ||
| 6 | |||
| 7 | just do not use openssl from host. | ||
| 8 | |||
| 9 | Signed-off-by: Rickard Engberg <rickard.engberg@windriver.com> | ||
| 10 | Signed-off-by: Vu Tran <vu.tran@windriver.com> | ||
| 11 | |||
| 12 | Index: nrpe-2.15/configure.in | ||
| 13 | =================================================================== | ||
| 14 | --- nrpe-2.15.orig/configure.in 2013-09-06 17:27:13.000000000 +0200 | ||
| 15 | +++ nrpe-2.15/configure.in 2013-11-21 14:09:31.798606782 +0100 | ||
| 16 | @@ -330,17 +330,6 @@ | ||
| 17 | |||
| 18 | AC_DEFINE_UNQUOTED(HAVE_SSL,[1],[Have SSL support]) | ||
| 19 | AC_SUBST(HAVE_SSL) | ||
| 20 | - | ||
| 21 | - dnl Generate DH parameters | ||
| 22 | - echo "" | ||
| 23 | - echo "*** Generating DH Parameters for SSL/TLS ***" | ||
| 24 | - if test -f "$ssldir/sbin/openssl"; then | ||
| 25 | - sslbin=$ssldir/sbin/openssl | ||
| 26 | - else | ||
| 27 | - sslbin=$ssldir/bin/openssl | ||
| 28 | - fi | ||
| 29 | - # awk to strip off meta data at bottom of dhparam output | ||
| 30 | - $sslbin dhparam -C 512 | awk '/^-----/ {exit} {print}' > include/dh.h | ||
| 31 | fi | ||
| 32 | fi | ||
| 33 | |||
| 34 | Index: nrpe-2.15/configure | ||
| 35 | =================================================================== | ||
| 36 | --- nrpe-2.15.orig/configure 2013-09-06 17:27:13.000000000 +0200 | ||
| 37 | +++ nrpe-2.15/configure 2013-11-21 14:11:45.491269701 +0100 | ||
| 38 | @@ -6738,14 +6738,6 @@ | ||
| 39 | |||
| 40 | |||
| 41 | echo "" | ||
| 42 | - echo "*** Generating DH Parameters for SSL/TLS ***" | ||
| 43 | - if test -f "$ssldir/sbin/openssl"; then | ||
| 44 | - sslbin=$ssldir/sbin/openssl | ||
| 45 | - else | ||
| 46 | - sslbin=$ssldir/bin/openssl | ||
| 47 | - fi | ||
| 48 | - # awk to strip off meta data at bottom of dhparam output | ||
| 49 | - $sslbin dhparam -C 512 | awk '/^-----/ {exit} {print}' > include/dh.h | ||
| 50 | fi | ||
| 51 | fi | ||
| 52 | |||
diff --git a/recipes-extended/nagios/nagios-nrpe/nagios-nrpe.service b/recipes-extended/nagios/nagios-nrpe/nagios-nrpe.service new file mode 100644 index 00000000..c5a0bdac --- /dev/null +++ b/recipes-extended/nagios/nagios-nrpe/nagios-nrpe.service | |||
| @@ -0,0 +1,10 @@ | |||
| 1 | [Unit] | ||
| 2 | Description=Nagios nrpe plugin | ||
| 3 | After=syslog.target network.target | ||
| 4 | |||
| 5 | [Service] | ||
| 6 | ExecStart=/usr/bin/nrpe -c /etc/nagios/nrpe.cfg -f | ||
| 7 | TimeoutSec=60 | ||
| 8 | |||
| 9 | [Install] | ||
| 10 | WantedBy=multi-user.target | ||
diff --git a/recipes-extended/nagios/nagios-nrpe_3.2.1.bb b/recipes-extended/nagios/nagios-nrpe_3.2.1.bb new file mode 100644 index 00000000..94933367 --- /dev/null +++ b/recipes-extended/nagios/nagios-nrpe_3.2.1.bb | |||
| @@ -0,0 +1,100 @@ | |||
| 1 | require nagios-common.inc | ||
| 2 | |||
| 3 | DESCRIPTION = "Nagios Remote Plugin Executor" | ||
| 4 | HOMEPAGE = "http://exchange.nagios.org" | ||
| 5 | SECTION = "console/network" | ||
| 6 | PRIORITY = "optional" | ||
| 7 | LICENSE = "GPLv2" | ||
| 8 | |||
| 9 | LIC_FILES_CHKSUM = "file://src/nrpe.c;beginline=1;endline=35;md5=0dadd78599abbc737af81432702e9161" | ||
| 10 | |||
| 11 | SRCNAME = "nrpe" | ||
| 12 | |||
| 13 | SRC_URI = "https://github.com/NagiosEnterprises/nrpe/releases/download/${SRCNAME}-${PV}/${SRCNAME}-${PV}.tar.gz \ | ||
| 14 | file://check_nrpe.cfg \ | ||
| 15 | file://nagios-nrpe.service \ | ||
| 16 | " | ||
| 17 | |||
| 18 | SRC_URI[md5sum] = "8997e195fea93cdceb8c7ed8ac1d43bc" | ||
| 19 | SRC_URI[sha256sum] = "8ad2d1846ab9011fdd2942b8fc0c99dfad9a97e57f4a3e6e394a4ead99c0f1f0" | ||
| 20 | |||
| 21 | S = "${WORKDIR}/${SRCNAME}-${PV}" | ||
| 22 | |||
| 23 | inherit autotools-brokensep update-rc.d systemd | ||
| 24 | |||
| 25 | # IP address of server which proxy should connect to | ||
| 26 | MONITORING_PROXY_SERVER_IP ??= "192.168.7.2" | ||
| 27 | |||
| 28 | # IP address of server which agent should connect to | ||
| 29 | MONITORING_AGENT_SERVER_IP ??= "192.168.7.4" | ||
| 30 | |||
| 31 | EXTRA_OECONF += "--with-nrpe-user=${NAGIOS_USER} \ | ||
| 32 | --with-nrpe-group=${NAGIOS_GROUP} \ | ||
| 33 | ac_cv_lib_wrap_main=no \ | ||
| 34 | ac_cv_path_PERL=${bindir}/perl \ | ||
| 35 | " | ||
| 36 | |||
| 37 | EXTRA_OECONF_SSL = "--with-ssl=${STAGING_DIR_HOST} \ | ||
| 38 | --with-ssl-inc=${STAGING_DIR_HOST}${includedir} \ | ||
| 39 | --with-ssl-lib=${STAGING_DIR_HOST}${libdir} \ | ||
| 40 | " | ||
| 41 | |||
| 42 | PACKAGECONFIG[ssl] = "${EXTRA_OECONF_SSL},--disable-ssl,openssl," | ||
| 43 | PACKAGECONFIG[cmdargs] = "--enable-command-args,--disable-command-args,," | ||
| 44 | PACKAGECONFIG[bashcomp] = "--enable-bash-command-substitution,--disable-bash-command-substitution,," | ||
| 45 | |||
| 46 | PACKAGECONFIG ??= "cmdargs bashcomp" | ||
| 47 | |||
| 48 | do_configure() { | ||
| 49 | oe_runconf || die "make failed" | ||
| 50 | } | ||
| 51 | |||
| 52 | do_compile() { | ||
| 53 | oe_runmake all | ||
| 54 | } | ||
| 55 | |||
| 56 | do_install_append() { | ||
| 57 | oe_runmake 'DESTDIR=${D}' install-daemon | ||
| 58 | oe_runmake 'DESTDIR=${D}' install-config | ||
| 59 | |||
| 60 | install -d ${D}${sysconfdir}/init.d | ||
| 61 | install -m 755 ${B}/startup/debian-init ${D}${sysconfdir}/init.d/nrpe | ||
| 62 | |||
| 63 | install -d ${D}${NAGIOS_CONF_DIR}/nrpe.d | ||
| 64 | echo "include_dir=${NAGIOS_CONF_DIR}/nrpe.d" >> ${D}${NAGIOS_CONF_DIR}/nrpe.cfg | ||
| 65 | |||
| 66 | sed -e "s/^allowed_hosts=.*/allowed_hosts=${MONITORING_AGENT_SERVER_IP}/g" \ | ||
| 67 | -i ${D}${NAGIOS_CONF_DIR}/nrpe.cfg | ||
| 68 | |||
| 69 | install -d ${D}${NAGIOS_PLUGIN_CONF_DIR} | ||
| 70 | install -m 664 ${WORKDIR}/check_nrpe.cfg ${D}${NAGIOS_PLUGIN_CONF_DIR} | ||
| 71 | |||
| 72 | if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then | ||
| 73 | install -d ${D}${systemd_unitdir}/system | ||
| 74 | install -m 644 ${WORKDIR}/nagios-nrpe.service ${D}${systemd_unitdir}/system/ | ||
| 75 | fi | ||
| 76 | |||
| 77 | rmdir -p --ignore-fail-on-non-empty ${D}${localstatedir}/nagios | ||
| 78 | } | ||
| 79 | |||
| 80 | PACKAGES = "${PN}-dbg ${PN}-plugin ${PN}-daemon" | ||
| 81 | |||
| 82 | FILES_${PN}-plugin = "${NAGIOS_PLUGIN_DIR} \ | ||
| 83 | ${NAGIOS_PLUGIN_CONF_DIR} \ | ||
| 84 | " | ||
| 85 | |||
| 86 | FILES_${PN}-daemon = "${sysconfdir} \ | ||
| 87 | ${bindir} \ | ||
| 88 | ${nonarch_libdir}/tmpfiles.d/ \ | ||
| 89 | " | ||
| 90 | |||
| 91 | RDEPENDS_${PN}-daemon = "nagios-base" | ||
| 92 | RDEPENDS_${PN}-plugin = "nagios-base" | ||
| 93 | |||
| 94 | SYSTEMD_PACKAGES = "${PN}-daemon" | ||
| 95 | SYSTEMD_SERVICE_${PN}-daemon = "nagios-nrpe.service" | ||
| 96 | SYSTEMD_AUTO_ENABLE_${PN}-daemon = "enable" | ||
| 97 | |||
| 98 | INITSCRIPT_PACKAGES = "${PN}-daemon" | ||
| 99 | INITSCRIPT_NAME_${PN}-daemon = "nrpe" | ||
| 100 | INITSCRIPT_PARAMS_${PN}-daemon = "defaults" | ||
