diff options
author | Ned Ludd <solar@gentoo.org> | 2003-07-05 16:03:34 +0000 |
---|---|---|
committer | Ned Ludd <solar@gentoo.org> | 2003-07-05 16:03:34 +0000 |
commit | c2ddfa84e716f81e88bd9d2df5d5c64eff7fc231 (patch) | |
tree | 0f50acf4d991ba3f1100b4800bf1bdfde83b3ce1 /net-analyzer | |
parent | initial import of prelude-nagios plugin courtesy of Michael Boman Bug# 23777 (diff) | |
download | gentoo-2-c2ddfa84e716f81e88bd9d2df5d5c64eff7fc231.tar.gz gentoo-2-c2ddfa84e716f81e88bd9d2df5d5c64eff7fc231.tar.bz2 gentoo-2-c2ddfa84e716f81e88bd9d2df5d5c64eff7fc231.zip |
initial import of prelude-nagios plugin courtesy of Michael Boman Bug# 23777
Diffstat (limited to 'net-analyzer')
5 files changed, 121 insertions, 1 deletions
diff --git a/net-analyzer/prelude-nagios/ChangeLog b/net-analyzer/prelude-nagios/ChangeLog new file mode 100644 index 000000000000..c6fbe999e5ec --- /dev/null +++ b/net-analyzer/prelude-nagios/ChangeLog @@ -0,0 +1,10 @@ +# ChangeLog for net-analyzer/prelude-nagios +# Copyright 2000-2003 Gentoo Technologies, Inc.; Distributed under the GPL v2 +# $Header: /var/cvsroot/gentoo-x86/net-analyzer/prelude-nagios/ChangeLog,v 1.1 2003/07/05 16:03:27 solar Exp $ + +*prelude-nagios-0.0.2 (05 Jul 2003) + + 05 Jul 2003; <solar@gentoo.org> prelude-nagios-0.0.2.ebuild, + files/prelude-nagios-0.0.2-001.patch: + initial import of prelude-nagios plugin courtesy of Michael Boman Bug# 23777 + diff --git a/net-analyzer/prelude-nagios/Manifest b/net-analyzer/prelude-nagios/Manifest index c0d437ff4952..956693b1f737 100644 --- a/net-analyzer/prelude-nagios/Manifest +++ b/net-analyzer/prelude-nagios/Manifest @@ -1,3 +1,4 @@ -MD5 5c6f479b1a631c5e2ca18165a29ca128 prelude-nagios-0.0.2.ebuild 1159 +MD5 4af0a9c7095835bc490eaad1b8163dbe prelude-nagios-0.0.2.ebuild 1276 +MD5 b51038f288dc69578743dcbfd7cffef4 ChangeLog 455 MD5 38deb4c75b8cafde875b533ab5ae7b78 files/digest-prelude-nagios-0.0.2 72 MD5 fdc08ad12de3e7b0a010a302b70c9271 files/prelude-nagios-0.0.2-001.patch 1988 diff --git a/net-analyzer/prelude-nagios/files/digest-prelude-nagios-0.0.2 b/net-analyzer/prelude-nagios/files/digest-prelude-nagios-0.0.2 new file mode 100644 index 000000000000..40cd9de4dd85 --- /dev/null +++ b/net-analyzer/prelude-nagios/files/digest-prelude-nagios-0.0.2 @@ -0,0 +1 @@ +MD5 d52a30c9cf5e00a357d484eb38ceb215 prelude-nagios-0.0.2.tar.gz 808960 diff --git a/net-analyzer/prelude-nagios/files/prelude-nagios-0.0.2-001.patch b/net-analyzer/prelude-nagios/files/prelude-nagios-0.0.2-001.patch new file mode 100644 index 000000000000..0f11f13b814e --- /dev/null +++ b/net-analyzer/prelude-nagios/files/prelude-nagios-0.0.2-001.patch @@ -0,0 +1,64 @@ +--- prelude-nagios-0.0.2/src/idmef.c 2003-01-31 03:05:25.000000000 +0800 ++++ prelude-nagios-0.0.3/src/idmef.c 2003-06-28 06:00:49.000000000 +0800 +@@ -48,7 +48,7 @@ + + + +-#define ANALYZER_MODEL "Prelude module for Nagios" ++#define ANALYZER_MODEL "Prelude Nagios" + #define ANALYZER_CLASS "Network Supervision System" + #define ANALYZER_MANUFACTURER "ExaProbe http://www.exaprobe.com" + +@@ -77,6 +77,7 @@ + static idmef_message_t *msg; + static idmef_alert_t *alert; + static idmef_target_t *target; ++idmef_classification_t *classification = NULL; + + + /* Misc info to be used in the additional data idmef field*/ +@@ -112,7 +113,9 @@ + char *description = NULL; + int len = 0; + const char *host = NULL; +- ++ char classification_message[256]; ++ char *final_class_message; ++ + idmef_alert_assessment_new(alert); + assessment = alert->assessment; + +@@ -198,7 +201,16 @@ + len += sprintf(description+len, "; "); + len += sprintf(description+len, "service is %s", target_service_state); + } +- ++ ++ snprintf(classification_message, sizeof(classification_message), "Host %s%s%s is %s", ++ host, ++ target_service_descr ? " service " : "", ++ target_service_descr ? target_service_descr : "", ++ target_service_state ? target_service_state : target_state); ++ ++ final_class_message = strdup(classification_message); ++ idmef_string_set(&classification->name, final_class_message); ++ free( final_class_message ); + + idmef_string_set(&impact->description, description); + +@@ -330,7 +342,6 @@ + int idmef_init(void) + { + struct timeval tv; +- idmef_classification_t *classification = NULL; + idmef_node_t *node = NULL; + + msgbuf = prelude_msgbuf_new(0); +@@ -352,7 +363,6 @@ + return -1; + } + +- idmef_string_set_constant(&classification->name, CLASSIFICATION_NAME); + + gettimeofday(&tv, NULL); + alert->create_time.sec = tv.tv_sec; diff --git a/net-analyzer/prelude-nagios/prelude-nagios-0.0.2.ebuild b/net-analyzer/prelude-nagios/prelude-nagios-0.0.2.ebuild new file mode 100644 index 000000000000..e71aba46880a --- /dev/null +++ b/net-analyzer/prelude-nagios/prelude-nagios-0.0.2.ebuild @@ -0,0 +1,44 @@ +# Copyright 1999-2003 Gentoo Technologies, Inc. +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/net-analyzer/prelude-nagios/prelude-nagios-0.0.2.ebuild,v 1.1 2003/07/05 16:03:27 solar Exp $ + +DESCRIPTION="Plugin for Nagios to talk with Prelude" +HOMEPAGE="http://www.exaprobe.com/labs/downloads/index.php3?DIR=/downloads/Nagios_Plugin" +SRC_URI="http://www.exaprobe.com/labs/downloads/Nagios_Plugin/prelude-nagios-${PV}.tar.gz" +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="~x86" +IUSE="" +DEPEND=" + || ( libprelude libprelude-cvs ) + nagios-core" + +RDEPEND="${DEPEND}" +S=${WORKDIR}/${P} + +src_unpack() { + # prelude-nagios-0.0.2.tar.gz is a POSIX tar archive from exaprobe + # In the future I think we should to try to avoid calling + # tar directly from ebuilds. + + # Our possible solutions. + # 1) email exaprobe and inform them that the .tar.gz is only a .tar + # 2) Repackage the tarball as a .bz2 and put it on a gentoo mirror + + tar xvf ${DISTDIR}/${A} -C ${WORKDIR} + #unpack ${A} + epatch ${FILESDIR}/prelude-nagios-${PV}-001.patch +} + +src_compile() { + econf || die "econf failed" + emake || die "emake failed" +} + +src_install() { + insinto /etc/prelude-nagios + doins prelude-nagios.conf + + exeinto /usr/nagios/bin + doexe src/prelude-nagios +} |