diff options
author | pgollucci <pgollucci@FreeBSD.org> | 2008-08-14 10:58:34 +0800 |
---|---|---|
committer | pgollucci <pgollucci@FreeBSD.org> | 2008-08-14 10:58:34 +0800 |
commit | 29ba4a45bf7b980d1a2699122289918cc0a16fa7 (patch) | |
tree | 1cd99b1d57ca0fff5cd00f62d9ccd80d65e86bbd /net-mgmt | |
parent | 01051812f8e714cdef5df72cfb47967346888120 (diff) | |
download | freebsd-ports-gnome-29ba4a45bf7b980d1a2699122289918cc0a16fa7.tar.gz freebsd-ports-gnome-29ba4a45bf7b980d1a2699122289918cc0a16fa7.tar.zst freebsd-ports-gnome-29ba4a45bf7b980d1a2699122289918cc0a16fa7.zip |
The NDOUTILS addon is designed to store all configuration and event data from
Nagios in a database. Storing information from Nagios in a database will allow
for quicker retrieval and processing of that data and will help serve as a
foundation for the development of a new PHP-based web interface in Nagios 3.0.
WWW: http://www.nagios.org
Approved by: araujo (mentor)
Diffstat (limited to 'net-mgmt')
-rw-r--r-- | net-mgmt/Makefile | 1 | ||||
-rw-r--r-- | net-mgmt/ndoutils/Makefile | 77 | ||||
-rw-r--r-- | net-mgmt/ndoutils/distinfo | 3 | ||||
-rw-r--r-- | net-mgmt/ndoutils/files/ndo2db.in | 29 | ||||
-rw-r--r-- | net-mgmt/ndoutils/files/patch-config__misccommands.cfg | 13 | ||||
-rw-r--r-- | net-mgmt/ndoutils/files/patch-config__nagios.cfg | 12 | ||||
-rw-r--r-- | net-mgmt/ndoutils/files/patch-config__ndo2db.cfg | 11 | ||||
-rw-r--r-- | net-mgmt/ndoutils/files/patch-config__ndomod.cfg | 23 | ||||
-rw-r--r-- | net-mgmt/ndoutils/files/pkg-message.in | 10 | ||||
-rw-r--r-- | net-mgmt/ndoutils/pkg-descr | 6 | ||||
-rw-r--r-- | net-mgmt/ndoutils/pkg-plist | 64 |
11 files changed, 249 insertions, 0 deletions
diff --git a/net-mgmt/Makefile b/net-mgmt/Makefile index c59483a74daf..c60fdd6ac8b5 100644 --- a/net-mgmt/Makefile +++ b/net-mgmt/Makefile @@ -120,6 +120,7 @@ SUBDIR += nat SUBDIR += nav SUBDIR += nbtscan + SUBDIR += ndoutils SUBDIR += ndpmon SUBDIR += nedi SUBDIR += nefu diff --git a/net-mgmt/ndoutils/Makefile b/net-mgmt/ndoutils/Makefile new file mode 100644 index 000000000000..f0b12db3e303 --- /dev/null +++ b/net-mgmt/ndoutils/Makefile @@ -0,0 +1,77 @@ +# New ports collection makefile for: ndoutils +# Date created: 14 February 2008 +# Whom: Philip M. Gollucci <pgollucci@p6m7g8.com> +# +# $FreeBSD$ +# + +PORTNAME= ndoutils +PORTVERSION= 1.4b7 +CATEGORIES= net-mgmt +MASTER_SITES= SF +MASTER_SITE_SUBDIR= nagios + +MAINTAINER= pgollucci@FreeBSD.org +COMMENT= Keep Nagios perfdata in MySQL or Postgresql database + +RUN_DEPENDS= ${LOCALBASE}/bin/nagios:${PORTSDIR}/net-mgmt/nagios-devel + +GNU_CONFIGURE= yes + +CFLAGS+= -I${LOCALBASE}/include -fPIC + +CONFIGURE_ENV+= CFLAGS="${CFLAGS}" +CONFIGURE_ARGS+= --sysconfdir=${PREFIX}/etc/ndoutils + +CFG_FILES= misccommands ndo2db ndomod + +USE_RC_SUBR= ndo2db + +SUB_FILES= pkg-message + +.if !defined(WITHOUT_MYSQL) +USE_MYSQL=yes +CONFIGURE_ARGS+= --enable-mysql \ + --with-mysql-lib=${LOCALBASE}/lib/mysql \ + --with-mysql-inc=${LOCALBASE}/include +.else +CONFIGURE_ARGS+= --disable-mysql +.endif + +.if defined(WITH_PGSQL) +USE_PGSQL=yes +CONFIGURE_ARGS+= --enable-pgsql \ + --with-pgsql-lib=${LOCALBASE}/lib/pgsql \ + --with-pgsql-inc=${LOCALBASE}/include/pgsql +.else +CONFIGURE_ARGS+= --disable-pgsql +.endif + +.if defined(WITHOUT_MYSQL) && defined(WITHOUT_PGSQL) +IGNORE= you should define at least 1 of WITH_MYSQL or WITH_PGSQL, WITH_MYSQL=yes is the default +.endif + +.if !defined(NOPORTDOCS) +PLIST_SUB+= PORTDOCS="" +.else +PLIST_SUB+= PORTDOCS="@comment " +.endif + +do-install: + @${INSTALL_PROGRAM} ${WRKSRC}/src/ndo2db-3x ${PREFIX}/bin/ + @${INSTALL_PROGRAM} ${WRKSRC}/src/ndomod-3x.o ${PREFIX}/bin/ + @${INSTALL_PROGRAM} ${WRKSRC}/src/file2sock ${PREFIX}/bin/ + @${INSTALL_PROGRAM} ${WRKSRC}/src/log2ndo ${PREFIX}/bin/ + @${INSTALL_PROGRAM} ${WRKSRC}/src/sockdebug ${PREFIX}/bin/ + @(cd ${WRKSRC}/db && ${COPYTREE_SHARE} \* ${DATADIR}/) +.if !defined(NOPORTDOCS) + @${MKDIR} ${DOCSDIR} + @(cd ${WRKSRC}/docs && ${COPYTREE_SHARE} \* ${DOCSDIR}/) +.endif + @for i in ${CFG_FILES}; do \ + ${INSTALL_DATA} ${WRKSRC}/config/$${i}.cfg ${PREFIX}/etc/nagios/$${i}.cfg-sample; \ + done + @${INSTALL_DATA} ${WRKSRC}/config/nagios.cfg ${PREFIX}/etc/nagios/ndoutils.cfg-sample + @${CAT} ${PKGMESSAGE} + +.include <bsd.port.mk> diff --git a/net-mgmt/ndoutils/distinfo b/net-mgmt/ndoutils/distinfo new file mode 100644 index 000000000000..c981d3e37223 --- /dev/null +++ b/net-mgmt/ndoutils/distinfo @@ -0,0 +1,3 @@ +MD5 (ndoutils-1.4b7.tar.gz) = a454f7434f401bd48047cc42b045ff8b +SHA256 (ndoutils-1.4b7.tar.gz) = 76053576fa55f0231917733fc8e7a95d93e013cdb693fadbd8e8a7aa9ac8162c +SIZE (ndoutils-1.4b7.tar.gz) = 1553879 diff --git a/net-mgmt/ndoutils/files/ndo2db.in b/net-mgmt/ndoutils/files/ndo2db.in new file mode 100644 index 000000000000..3f0634bdee59 --- /dev/null +++ b/net-mgmt/ndoutils/files/ndo2db.in @@ -0,0 +1,29 @@ +#!/bin/sh +# +# $FreeBSD$ +# +# PROVIDE: ndo2db +# REQUIRE: DAEMON nagios +# BEFORE: LOGIN +# KEYWORD: shutdown + +# Add the following lines to /etc/rc.conf to enable ndo2db: +# ndo2db_enable (bool): Set to "NO" by default. +# ndo2db_flags (str): Set to "" by default. +# ndo2db_configfile (str): Set to "%%PREFIX%%/etc/nagios/nagios.cfg" by default. + +. %%RC_SUBR%% + +name="ndo2db" +rcvar=${name}_enable + +command="%%PREFIX%%/bin/${name}" +required_files="${ndo2db_configfile}" +command_args="-c ${ndo2db_configfile}" + +load_rc_config $name + +: ${ndo2db_enable=-NO} +: ${ndo2db_configfile=-%%PREFIX%%/etc/nagios/nagios.cfg} + +run_rc_command "$1" diff --git a/net-mgmt/ndoutils/files/patch-config__misccommands.cfg b/net-mgmt/ndoutils/files/patch-config__misccommands.cfg new file mode 100644 index 000000000000..3f774fae4eba --- /dev/null +++ b/net-mgmt/ndoutils/files/patch-config__misccommands.cfg @@ -0,0 +1,13 @@ +--- ./config/misccommands.cfg.orig 2008-02-21 18:38:53.000000000 -0500 ++++ ./config/misccommands.cfg 2008-02-21 18:41:56.000000000 -0500 +@@ -5,7 +5,7 @@ + # to suit your needs. This definition will need to be included in your + # Nagios config files if you want to use it. + +-define command{ ++define command { + command_name rotate_ndo_log +- command_line /bin/mv /usr/local/nagios/var/ndo.dat /usr/local/nagios/var/ndo.`date +%s` +- } ++ command_line /bin/mv /var/spool/nagios/ndo.dat /var/spool/ndo.`date +%s` ++} diff --git a/net-mgmt/ndoutils/files/patch-config__nagios.cfg b/net-mgmt/ndoutils/files/patch-config__nagios.cfg new file mode 100644 index 000000000000..3f4c7e79af5c --- /dev/null +++ b/net-mgmt/ndoutils/files/patch-config__nagios.cfg @@ -0,0 +1,12 @@ +--- ./config/nagios.cfg.orig 2008-02-21 18:38:58.000000000 -0500 ++++ ./config/nagios.cfg 2008-02-21 18:42:02.000000000 -0500 +@@ -5,7 +5,7 @@ + # configuration file (nagios.cfg). Adjust the paths, etc. to suit your needs. + + # Uncomment the line below if you're running Nagios 2.x +-broker_module=/usr/local/nagios/bin/ndomod-2x.o config_file=/usr/local/nagios/etc/ndomod.cfg ++#broker_module=/usr/local/nagios/bin/ndomod-2x.o config_file=/usr/local/nagios/etc/ndomod.cfg + + # Uncomment the line below if you're running Nagios 3.x +-#broker_module=/usr/local/nagios/bin/ndomod-3x.o config_file=/usr/local/nagios/etc/ndomod.cfg ++broker_module=/usr/local/nagios/bin/ndomod-3x.o config_file=/usr/local/nagios/etc/ndomod.cfg diff --git a/net-mgmt/ndoutils/files/patch-config__ndo2db.cfg b/net-mgmt/ndoutils/files/patch-config__ndo2db.cfg new file mode 100644 index 000000000000..5aeb1c7c360f --- /dev/null +++ b/net-mgmt/ndoutils/files/patch-config__ndo2db.cfg @@ -0,0 +1,11 @@ +--- ./config/ndo2db.cfg.orig 2008-02-21 18:39:05.000000000 -0500 ++++ ./config/ndo2db.cfg 2008-02-21 18:43:39.000000000 -0500 +@@ -32,7 +32,7 @@ + # This option is only valid if the socket type specified above + # is "unix". + +-socket_name=/usr/local/nagios/var/ndo.sock ++socket_name=/var/run/ndo.sock + + + diff --git a/net-mgmt/ndoutils/files/patch-config__ndomod.cfg b/net-mgmt/ndoutils/files/patch-config__ndomod.cfg new file mode 100644 index 000000000000..d686f34db617 --- /dev/null +++ b/net-mgmt/ndoutils/files/patch-config__ndomod.cfg @@ -0,0 +1,23 @@ +--- ./config/ndomod.cfg.orig 2008-02-21 18:39:10.000000000 -0500 ++++ ./config/ndomod.cfg 2008-02-21 18:45:07.000000000 -0500 +@@ -35,9 +35,9 @@ + # of fully qualified domain name of the host that the module should + # connect to for sending output. + +-#output=/usr/local/nagios/var/ndo.dat ++#output=/var/spool/nagios/ndo.dat + #output=127.0.0.1 +-output=/usr/local/nagios/var/ndo.sock ++output=/var/run/ndo.sock + + + +@@ -68,7 +68,7 @@ + # Nagios (re)starts, the NDO NEB module will read the contents of this + # file and send it to the NDO2DB daemon for processing. + +-buffer_file=/usr/local/nagios/var/ndomod.tmp ++buffer_file=/var/spool/nagios/ndomod.tmp + + + diff --git a/net-mgmt/ndoutils/files/pkg-message.in b/net-mgmt/ndoutils/files/pkg-message.in new file mode 100644 index 000000000000..24cb933d82d3 --- /dev/null +++ b/net-mgmt/ndoutils/files/pkg-message.in @@ -0,0 +1,10 @@ + +****************************************************************************** +* $ mysqladmin -uroot -pXXXX create nagios +* +* $ mysql -uroot -pXXXX -e \ +* "GRANT SELECT,INSERT,UPDATE,DELETE TO 'nagios'@'%' IDENTIFIED BY 'YYYYY' +* +* $ cd %%DATADIR%%/db +* $ ./installdb +****************************************************************************** diff --git a/net-mgmt/ndoutils/pkg-descr b/net-mgmt/ndoutils/pkg-descr new file mode 100644 index 000000000000..2d935ea805c0 --- /dev/null +++ b/net-mgmt/ndoutils/pkg-descr @@ -0,0 +1,6 @@ +The NDOUTILS addon is designed to store all configuration and event data from +Nagios in a database. Storing information from Nagios in a database will allow +for quicker retrieval and processing of that data and will help serve as a +foundation for the development of a new PHP-based web interface in Nagios 3.0. + +WWW: http://www.nagios.org diff --git a/net-mgmt/ndoutils/pkg-plist b/net-mgmt/ndoutils/pkg-plist new file mode 100644 index 000000000000..b475c4494e7f --- /dev/null +++ b/net-mgmt/ndoutils/pkg-plist @@ -0,0 +1,64 @@ +@stopdaemon ndo2db +bin/file2sock +bin/log2ndo +bin/ndo2db-3x +bin/ndomod-3x.o +bin/sockdebug +etc/nagios/misccommands.cfg-sample +etc/nagios/ndo2db.cfg-sample +etc/nagios/ndomod.cfg-sample +etc/nagios/ndoutils.cfg-sample +%%PORTDOCS%%%%DOCSDIR%%/NDOUTILS DB Model.odt +%%PORTDOCS%%%%DOCSDIR%%/NDOUTILS DB Model.pdf +%%PORTDOCS%%%%DOCSDIR%%/NDOUtils Documentation.odt +%%PORTDOCS%%%%DOCSDIR%%/NDOUtils Documentation.pdf +%%DATADIR%%/README +%%DATADIR%%/installdb +%%DATADIR%%/mysql-mods-1.4b5.sql +%%DATADIR%%/mysql-mods-1.4b7.sql +%%DATADIR%%/mysql-upgrade-1.3.sql +%%DATADIR%%/mysql-upgrade-1.4b1.sql +%%DATADIR%%/mysql-upgrade-1.4b2.sql +%%DATADIR%%/mysql-upgrade-1.4b3.sql +%%DATADIR%%/mysql-upgrade-1.4b4.sql +%%DATADIR%%/mysql-upgrade-1.4b5.sql +%%DATADIR%%/mysql-upgrade-1.4b6.sql +%%DATADIR%%/mysql.sql +%%DATADIR%%/prepsql +%%DATADIR%%/queries/comment_history.sql +%%DATADIR%%/queries/comments.sql +%%DATADIR%%/queries/contact_notification_methods.sql +%%DATADIR%%/queries/contact_notifications.sql +%%DATADIR%%/queries/contact_status.sql +%%DATADIR%%/queries/contactgroup_membership.sql +%%DATADIR%%/queries/contacts.sql +%%DATADIR%%/queries/downtime_history.sql +%%DATADIR%%/queries/event_handlers.sql +%%DATADIR%%/queries/flapping_history.sql +%%DATADIR%%/queries/host_comments.sql +%%DATADIR%%/queries/host_downtime_history.sql +%%DATADIR%%/queries/host_event_handlers.sql +%%DATADIR%%/queries/host_flapping_history.sql +%%DATADIR%%/queries/host_notifications.sql +%%DATADIR%%/queries/host_state_history.sql +%%DATADIR%%/queries/host_status.sql +%%DATADIR%%/queries/hostgroup_membership.sql +%%DATADIR%%/queries/hosts.sql +%%DATADIR%%/queries/notifications.sql +%%DATADIR%%/queries/scheduled_downtime.sql +%%DATADIR%%/queries/service_comments.sql +%%DATADIR%%/queries/service_downtime_history.sql +%%DATADIR%%/queries/service_event_handlers.sql +%%DATADIR%%/queries/service_flapping_history.sql +%%DATADIR%%/queries/service_notifications.sql +%%DATADIR%%/queries/service_state_history.sql +%%DATADIR%%/queries/service_status.sql +%%DATADIR%%/queries/servicegroup_membership.sql +%%DATADIR%%/queries/services.sql +%%DATADIR%%/queries/state_history.sql +%%DATADIR%%/queries/timed_event_queue.sql +%%DATADIR%%/queries/timed_events.sql +%%DATADIR%%/upgradedb +@dirrm %%DATADIR%%/queries +@dirrm %%DATADIR%% +%%PORTDOCS%%@dirrm %%DOCSDIR%% |