summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenedikt Böhm <bb@xnull.de>2011-02-11 17:38:49 +0100
committerBenedikt Böhm <bb@xnull.de>2011-02-11 17:38:49 +0100
commitacebbdb79832d21ebcac0afd89886b6a96463d11 (patch)
tree2e1642faa6d17974986614d03dc25a2fa138b75f /net-analyzer
parentfix dependencies in monetdb (diff)
downloadbetagarden-acebbdb79832d21ebcac0afd89886b6a96463d11.tar.gz
betagarden-acebbdb79832d21ebcac0afd89886b6a96463d11.tar.bz2
betagarden-acebbdb79832d21ebcac0afd89886b6a96463d11.zip
add nagios-core with escalation patch
Diffstat (limited to 'net-analyzer')
-rw-r--r--net-analyzer/nagios-core/Manifest7
-rw-r--r--net-analyzer/nagios-core/files/99_nagios3.conf15
-rw-r--r--net-analyzer/nagios-core/files/conf.d10
-rw-r--r--net-analyzer/nagios-core/files/lighttpd_nagios3-r1.conf24
-rw-r--r--net-analyzer/nagios-core/files/nagios-3.2.3-escalation.patch12
-rw-r--r--net-analyzer/nagios-core/files/nagios357
-rw-r--r--net-analyzer/nagios-core/nagios-core-3.2.3.ebuild211
7 files changed, 336 insertions, 0 deletions
diff --git a/net-analyzer/nagios-core/Manifest b/net-analyzer/nagios-core/Manifest
new file mode 100644
index 0000000..baf5ff4
--- /dev/null
+++ b/net-analyzer/nagios-core/Manifest
@@ -0,0 +1,7 @@
+AUX 99_nagios3.conf 377 RMD160 79f66fc0ae78fb856bd38ba479dbc8af4c2cf989 SHA1 cc2b21a6dec8c15641100284c66d95c2996da687 SHA256 0bfa88db78ab036d177c68da20a8fd2f567ba8c9f54c14cfb8e1fc121641051b
+AUX conf.d 409 RMD160 8b08c01284fc590a2291164589da42515d1a0586 SHA1 dd7bf46facd6a3069794ad9623cddd854198520e SHA256 a5122b19248c375b7b7c80bb5568fcaf334de316c611a85795960c2b9f6a6d5a
+AUX lighttpd_nagios3-r1.conf 482 RMD160 ec8c04a951f9cab2f9561fd224c4771fcb328158 SHA1 2e6a0d8d1290db425435f2613e48efa92d201455 SHA256 0cbe138afb954ee434dd3ea3146fc0677533085c2f2f8fa7faebe0bb3a64e172
+AUX nagios-3.2.3-escalation.patch 614 RMD160 d5d23a471516ba48da0f4420703525420a13f42b SHA1 5f416535e3b49b3a3b42ed90732f020fcf986d08 SHA256 e5e171ed19a3b94e5df279cef0e141672298fc78da71cdee050d0fa3a7b930c0
+AUX nagios3 1441 RMD160 b0b9361c9e4515904ebf1b41ac0be557f59e7a96 SHA1 5351b5d19c0ba51555fc3d7436290006a3acc59d SHA256 e92406af772d1dfc352a476af5cc6c57483f3796d663f1f63c52b44738284644
+DIST nagios-3.2.3.tar.gz 3249447 RMD160 3c09034069416c5f4dd5071e34516b1154c276b2 SHA1 fcb2c016c1b803bac71442d0ee8375b737906421 SHA256 7ec850a4d1d8d8ee36b06419ac912695e29962641c757cf21301b1befcb23434
+EBUILD nagios-core-3.2.3.ebuild 6118 RMD160 73ffd952140e726fad046f5b1be1cd3ac162648c SHA1 e0a91551fbc1fd9cfc7576324ada05e0cbb8dc44 SHA256 a03e41aee37222d861e069c641117caaca38593c1ab1523912f334e115d55cd6
diff --git a/net-analyzer/nagios-core/files/99_nagios3.conf b/net-analyzer/nagios-core/files/99_nagios3.conf
new file mode 100644
index 0000000..074f9ce
--- /dev/null
+++ b/net-analyzer/nagios-core/files/99_nagios3.conf
@@ -0,0 +1,15 @@
+<IfDefine NAGIOS>
+ ScriptAlias /nagios/cgi-bin/ /usr/lib/nagios/cgi-bin/
+ <Directory "/usr/lib/nagios/cgi-bin/">
+ AllowOverride AuthConfig
+ Options ExecCGI
+ Order allow,deny
+ Allow from all
+ </Directory>
+ Alias /nagios /usr/share/nagios/htdocs
+ <Directory "/usr/share/nagios/htdocs">
+ AllowOverride AuthConfig
+ Order allow,deny
+ Allow from all
+ </Directory>
+</IfDefine>
diff --git a/net-analyzer/nagios-core/files/conf.d b/net-analyzer/nagios-core/files/conf.d
new file mode 100644
index 0000000..338311a
--- /dev/null
+++ b/net-analyzer/nagios-core/files/conf.d
@@ -0,0 +1,10 @@
+# Copyright 1999-2004 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/net-analyzer/nagios-core/files/conf.d,v 1.1 2004/08/20 13:38:13 eldad Exp $
+
+# Distributed monitoring users will want to configure here the ip/hostname of the central server.
+# It will be used by submit_check_result_via_nsca.
+NAGIOS_NSCA_HOST="localhost"
+
+
+
diff --git a/net-analyzer/nagios-core/files/lighttpd_nagios3-r1.conf b/net-analyzer/nagios-core/files/lighttpd_nagios3-r1.conf
new file mode 100644
index 0000000..6e25770
--- /dev/null
+++ b/net-analyzer/nagios-core/files/lighttpd_nagios3-r1.conf
@@ -0,0 +1,24 @@
+server.modules += ("mod_cgi")
+server.modules += ("mod_auth")
+server.modules += ("mod_alias")
+
+auth.require += ( "/nagios" =>
+ (
+ "method" => "digest",
+ "realm" => "nagios",
+ "require" => "valid-user"
+ )
+)
+
+$HTTP["url"] =~ "^/nagios/cgi-bin/" {
+ dir-listing.activate = "disable"
+ cgi.assign = (
+ ".pl" => "/usr/bin/perl",
+ ".cgi" => ""
+ )
+}
+
+alias.url += (
+ "/nagios/cgi-bin" => "/usr/lib/nagios/cgi-bin",
+ "/nagios" => "/usr/share/nagios/htdocs"
+)
diff --git a/net-analyzer/nagios-core/files/nagios-3.2.3-escalation.patch b/net-analyzer/nagios-core/files/nagios-3.2.3-escalation.patch
new file mode 100644
index 0000000..c4875b0
--- /dev/null
+++ b/net-analyzer/nagios-core/files/nagios-3.2.3-escalation.patch
@@ -0,0 +1,12 @@
+diff --git a/common/macros.c b/common/macros.c
+index 6cddd00..e628da8 100644
+--- a/common/macros.c
++++ b/common/macros.c
+@@ -2602,6 +2602,7 @@ int init_macrox_names(void){
+ add_macrox_name(MACRO_HOSTATTEMPT,"HOSTATTEMPT");
+ add_macrox_name(MACRO_NOTIFICATIONTYPE,"NOTIFICATIONTYPE");
+ add_macrox_name(MACRO_NOTIFICATIONNUMBER,"NOTIFICATIONNUMBER");
++ add_macrox_name(MACRO_NOTIFICATIONISESCALATED,"NOTIFICATIONISESCALATED");
+ add_macrox_name(MACRO_HOSTEXECUTIONTIME,"HOSTEXECUTIONTIME");
+ add_macrox_name(MACRO_SERVICEEXECUTIONTIME,"SERVICEEXECUTIONTIME");
+ add_macrox_name(MACRO_HOSTLATENCY,"HOSTLATENCY");
diff --git a/net-analyzer/nagios-core/files/nagios3 b/net-analyzer/nagios-core/files/nagios3
new file mode 100644
index 0000000..83b9332
--- /dev/null
+++ b/net-analyzer/nagios-core/files/nagios3
@@ -0,0 +1,57 @@
+#!/sbin/runscript
+# Copyright 1999-2004 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/net-analyzer/nagios-core/files/nagios3,v 1.1 2008/04/27 18:41:25 dertobi123 Exp $
+
+opts="${opts} reload checkconfig"
+
+depend() {
+ need net
+ use dns logger firewall
+ after mysql postgresql
+}
+
+reload()
+{
+ checkconfig || return 1
+ ebegin "Reloading configuration"
+ killall -HUP nagios &>/dev/null
+ eend $?
+}
+
+checkconfig() {
+ # Silent Check
+ /usr/sbin/nagios -v /etc/nagios/nagios.cfg &>/dev/null && return 0
+
+ # Now we know there's problem - run again and display errors
+ /usr/sbin/nagios -v /etc/nagios/nagios.cfg
+ eend $? "Configuration Error. Please fix your configfile"
+}
+
+start() {
+ checkconfig || return 1
+ ebegin "Starting nagios"
+ touch /var/nagios/nagios.log /var/nagios/status.sav
+ chown nagios:nagios /var/nagios/nagios.log /var/nagios/status.sav
+ rm -f /var/nagios/rw/nagios.cmd
+ start-stop-daemon --quiet --start --startas /usr/sbin/nagios \
+ -e HOME="/var/nagios/home" --pidfile /var/nagios/nagios.lock \
+ -- -d /etc/nagios/nagios.cfg
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping nagios"
+ start-stop-daemon --quiet --stop --pidfile /var/nagios/nagios.lock
+ rm -f /var/nagios/status.log /var/nagios/nagios.tmp /var/nagios/nagios.lock /var/nagios/rw/nagios.cmd
+ eend $?
+}
+
+svc_restart() {
+ checkconfig || return 1
+ ebegin "Restarting nagios"
+ svc_stop
+ svc_start
+ eend $?
+}
+
diff --git a/net-analyzer/nagios-core/nagios-core-3.2.3.ebuild b/net-analyzer/nagios-core/nagios-core-3.2.3.ebuild
new file mode 100644
index 0000000..7e6393b
--- /dev/null
+++ b/net-analyzer/nagios-core/nagios-core-3.2.3.ebuild
@@ -0,0 +1,211 @@
+# Copyright 1999-2010 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/net-analyzer/nagios-core/nagios-core-3.2.3.ebuild,v 1.1 2010/10/07 16:24:10 dertobi123 Exp $
+
+EAPI="2"
+
+inherit eutils depend.apache toolchain-funcs
+
+MY_P=${PN/-core}-${PV}
+DESCRIPTION="Nagios Core - Check daemon, CGIs, docs"
+HOMEPAGE="http://www.nagios.org/"
+SRC_URI="mirror://sourceforge/nagios/${MY_P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~ppc ~ppc64 ~sparc ~x86"
+IUSE="debug lighttpd perl +web vim-syntax"
+DEPEND="virtual/mailx
+ web? (
+ >=media-libs/gd-1.8.3-r5[jpeg,png]
+ lighttpd? ( www-servers/lighttpd dev-lang/php[cgi] )
+ apache2? ( || ( dev-lang/php[apache2] dev-lang/php[cgi] ) )
+ )
+ perl? ( >=dev-lang/perl-5.6.1-r7 )"
+RDEPEND="${DEPEND}
+ vim-syntax? ( app-vim/nagios-syntax )"
+
+want_apache2
+
+S="${WORKDIR}/${MY_P}"
+
+pkg_setup() {
+ depend.apache_pkg_setup
+
+ enewgroup nagios
+ enewuser nagios -1 /bin/bash /var/nagios/home nagios
+}
+
+src_prepare() {
+ local strip="$(echo '$(MAKE) strip-post-install')"
+ sed -i -e "s:${strip}::" {cgi,base}/Makefile.in || die "sed failed in Makefile.in"
+ epatch "${FILESDIR}"/nagios-3.2.3-escalation.patch
+}
+
+src_configure() {
+ local myconf
+
+ if use perl ; then
+ myconf="${myconf} --enable-embedded-perl --with-perlcache"
+ fi
+
+ if use debug; then
+ myconf="${myconf} --enable-DEBUG0"
+ myconf="${myconf} --enable-DEBUG1"
+ myconf="${myconf} --enable-DEBUG2"
+ myconf="${myconf} --enable-DEBUG3"
+ myconf="${myconf} --enable-DEBUG4"
+ myconf="${myconf} --enable-DEBUG5"
+ fi
+
+ if use !apache2 && use !lighttpd ; then
+ myconf="${myconf} --with-command-group=nagios"
+ else
+ if use apache2 ; then
+ myconf="${myconf} --with-command-group=apache"
+ myconf="${myconf} --with-httpd-conf=/etc/apache2/conf.d"
+ elif use lighttpd ; then
+ myconf="${myconf} --with-command-group=lighttpd"
+ fi
+ fi
+
+ econf ${myconf} \
+ --prefix=/usr \
+ --bindir=/usr/sbin \
+ --sbindir=/usr/$(get_libdir)/nagios/cgi-bin \
+ --datadir=/usr/share/nagios/htdocs \
+ --localstatedir=/var/nagios \
+ --sysconfdir=/etc/nagios \
+ --libexecdir=/usr/$(get_libdir)/nagios/plugins \
+ || die "./configure failed"
+}
+
+src_compile() {
+ emake CC=$(tc-getCC) nagios || die "make failed"
+
+ if use web ; then
+ # Only compile the CGI's if "web" useflag is set.
+ emake CC=$(tc-getCC) DESTDIR="${D}" cgis || die
+ fi
+}
+
+src_install() {
+ dodoc Changelog INSTALLING LEGAL README UPGRADING
+
+ if ! use web ; then
+ sed -i -e 's/cd $(SRC_CGI) && $(MAKE) $@/# line removed due missing web use flag/' \
+ -e 's/cd $(SRC_HTM) && $(MAKE) $@/# line removed due missing web use flag/' \
+ Makefile
+ fi
+
+ sed -i -e 's/^contactgroups$//g' Makefile
+
+ emake DESTDIR="${D}" install
+ emake DESTDIR="${D}" install-config
+ emake DESTDIR="${D}" install-commandmode
+
+ newinitd "${FILESDIR}"/nagios3 nagios
+ newconfd "${FILESDIR}"/conf.d nagios
+
+ # Apache Module
+ if use web ; then
+ if use apache2 ; then
+ insinto "${APACHE_MODULES_CONFDIR}"
+ doins "${FILESDIR}"/99_nagios3.conf
+ elif use lighttpd ; then
+ insinto /etc/lighttpd
+ newins "${FILESDIR}/lighttpd_nagios3-r1.conf" nagios.conf
+ else
+ ewarn "${CATEGORY}/${PF} only supports Apache-2.x or Lighttpd webserver"
+ ewarn "out-of-the-box. Since you are not using one of them, you"
+ ewarn "have to configure your webserver accordingly yourself."
+ fi
+
+ fi
+
+ for dir in etc/nagios var/nagios ; do
+ chown -R nagios:nagios "${D}/${dir}" || die "Failed chown of ${D}/${dir}"
+ done
+
+ chown -R root:root "${D}"/usr/$(get_libdir)/nagios
+ find "${D}"/usr/$(get_libdir)/nagios -type d -print0 | xargs -0 chmod 755
+ find "${D}"/usr/$(get_libdir)/nagios/cgi-bin -type f -print0 | xargs -0 chmod 755
+
+ keepdir /etc/nagios
+ keepdir /var/nagios
+ keepdir /var/nagios/archives
+ keepdir /var/nagios/rw
+ keepdir /var/nagios/spool/checkresults
+
+ if use !apache2 && use !lighttpd; then
+ chown -R nagios:nagios "${D}"/var/nagios/rw || die "Failed chown of ${D}/var/nagios/rw"
+ else
+ if use apache2 ; then
+ chown -R nagios:apache "${D}"/var/nagios/rw || die "Failed chown of ${D}/var/nagios/rw"
+ elif use lighttpd ; then
+ chown -R nagios:lighttpd "${D}"/var/nagios/rw || die "Failed chown of ${D}/var/nagios/rw"
+ fi
+ fi
+
+ chmod ug+s "${D}"/var/nagios/rw || die "Failed Chmod of ${D}/var/nagios/rw"
+ chmod 0750 "${D}"/etc/nagios || die "Failed chmod of ${D}/etc/nagios"
+}
+
+pkg_postinst() {
+ elog "If you want nagios to start at boot time"
+ elog "remember to execute:"
+ elog " rc-update add nagios default"
+ elog
+
+ if use web ; then
+ elog "This does not include cgis that are perl-dependent"
+ elog "Currently traceroute.cgi is perl-dependent"
+ elog "To have ministatus.cgi requires copying of ministatus.c"
+ elog "to cgi directory for compiling."
+
+ elog "Note that the user your webserver is running at needs"
+ elog "read-access to /etc/nagios."
+ elog
+
+ if use apache2 || use lighttpd ; then
+ elog "There are several possible solutions to accomplish this,"
+ elog "choose the one you are most comfortable with:"
+ elog
+ if use apache2 ; then
+ elog " usermod -G nagios apache"
+ elog "or"
+ elog " chown nagios:apache /etc/nagios"
+ elog
+ elog "Also edit /etc/conf.d/apache2 and add \"-D NAGIOS\""
+ elif use lighttpd ; then
+ elog " usermod -G nagios lighttpd "
+ elog "or"
+ elog " chown nagios:lighttpd /etc/nagios"
+ fi
+ elog
+ elog "That will make nagios's web front end visable via"
+ elog "http://localhost/nagios/"
+ elog
+ else
+ elog "IMPORTANT: Do not forget to add the user your webserver"
+ elog "is running as to the nagios group!"
+ fi
+
+ else
+ elog "Please note that you have installed Nagios without web interface."
+ elog "Please don't file any bugs about having no web interface when you do this."
+ elog "Thank you!"
+ fi
+
+ elog
+ elog "If your kernel has /proc protection, nagios"
+ elog "will not be happy as it relies on accessing the proc"
+ elog "filesystem. You can fix this by adding nagios into"
+ elog "the group wheel, but this is not recomended."
+ elog
+}
+
+pkg_postinst() {
+ einfo "Fixing permissions"
+ chown nagios:nagios "${ROOT}"var/nagios
+}