diff options
author | Motoyuki Konno <motoyuki@FreeBSD.org> | 2012-04-21 12:27:40 +0000 |
---|---|---|
committer | Motoyuki Konno <motoyuki@FreeBSD.org> | 2012-04-21 12:27:40 +0000 |
commit | c679424d1752dd4aa64d1f82b2e88214fc7364d1 (patch) | |
tree | 44b1b2129b0416abbaaba16b0b253378bbd9e8f2 /net-mgmt/pandorafms_agent | |
parent | 9a915cc5a2b7476fb468a56d7b254ddcab299118 (diff) | |
download | ports-c679424d1752dd4aa64d1f82b2e88214fc7364d1.tar.gz ports-c679424d1752dd4aa64d1f82b2e88214fc7364d1.zip |
Notes
Diffstat (limited to 'net-mgmt/pandorafms_agent')
-rw-r--r-- | net-mgmt/pandorafms_agent/Makefile | 90 | ||||
-rw-r--r-- | net-mgmt/pandorafms_agent/distinfo | 2 | ||||
-rw-r--r-- | net-mgmt/pandorafms_agent/files/pandora_agent.in | 34 | ||||
-rw-r--r-- | net-mgmt/pandorafms_agent/files/patch-pandora_agent_installer | 105 | ||||
-rw-r--r-- | net-mgmt/pandorafms_agent/files/pkg-message.in | 14 | ||||
-rw-r--r-- | net-mgmt/pandorafms_agent/pkg-descr | 5 | ||||
-rw-r--r-- | net-mgmt/pandorafms_agent/pkg-plist | 28 | ||||
-rw-r--r-- | net-mgmt/pandorafms_agent/plist | 26 |
8 files changed, 304 insertions, 0 deletions
diff --git a/net-mgmt/pandorafms_agent/Makefile b/net-mgmt/pandorafms_agent/Makefile new file mode 100644 index 000000000000..54fb48795987 --- /dev/null +++ b/net-mgmt/pandorafms_agent/Makefile @@ -0,0 +1,90 @@ +# New ports collection makefile for: pandorafms_agent +# Date created: 2011-11-22 +# Whom: KIKUCHI Koichiro <koichiro@rworks.jp> +# +# $FreeBSD$ +# + +PORTNAME= pandora_agent +PORTVERSION= ${PANDORA_VERSION} +CATEGORIES= net-mgmt + +MAINTAINER= koichiro@rworks.jp +COMMENT= Pandora FMS agent, Perl version + +LICENSE= ${PANDORA_LICENSE} +LICENSE_FILE= ${PANDORA_LICENSE_FILE} + +OPTIONS= TENTACLE_SERVER "Install tentalce_server" on + +USE_PERL5= 5.8+ +SUB_LIST+= PERL="${PERL}" + +MAN1= pandora_agent.1 tentacle_client.1 +MANCOMPRESSED= yes + +SUB_FILES= pkg-message +USE_RC_SUBR= ${PORTNAME} + +.include "${.CURDIR}/../pandorafms_server/bsd.pandora.mk" + +PORTDOCS+= README + +.include <bsd.port.pre.mk> + +.if defined(WITH_TENTACLE_SERVER) +CONFLICTS= pandora_server-4* +PLIST_SUB+= TENTACLE_SERVER="" +.else +PLIST_SUB+= TENTACLE_SERVER="@comment " +.endif + +post-patch: +.if !defined(WITH_TENTACLE_SERVER) + @${REINPLACE_CMD} \ + -e '/TENTACLE_SERVER/s/^/#/' \ + ${WRKSRC}/pandora_agent_installer +.endif +.if defined(NO_INSTALL_MANPAGES) + @${REINPLACE_CMD} \ + -e '/PANDORA_MAN/s/^/#/' \ + ${WRKSRC}/pandora_agent_installer +.endif + @${REINPLACE_CMD} -E \ + -e 's|%%PREFIX%%|${PREFIX}|g' \ + -e 's|%%DATADIR%%|${DATADIR}|g' \ + -e 's|%%MAN1PREFIX%%|${MAN1PREFIX}|g' \ + -e 's|%%PANDORA_ETCDIR%%|${PANDORA_ETCDIR}|g' \ + -e 's|%%PANDORA_HOMEDIR%%|${PANDORA_HOMEDIR}|g' \ + ${WRKSRC}/pandora_agent_installer + @${REINPLACE_CMD} -i "" \ + -e 's,/bin/bash,/bin/sh,' \ + -e 's,md5sum,md5 -r,' \ + ${WRKSRC}/plugins/files_indir + @${REINPLACE_CMD} -i "" \ + -e 's,/usr/bin/perl,${PERL},g' \ + `${GREP} -lr /usr/bin/perl ${WRKSRC} | ${GREP} -v pandora_agent_installer` + @${REINPLACE_CMD} -i "" \ + -e 's,/usr/local,${PREFIX},g' \ + ${WRKSRC}/plugins/pandora_update + @${REINPLACE_CMD} \ + -e 's,`ifconfig ,`/sbin/ifconfig ,g' \ + -e 's,tentacle_client ,${PREFIX}/bin/tentacle_client ,g' \ + ${WRKSRC}/pandora_agent + +do-install: + @cd ${WRKSRC} && ${SH} pandora_agent_installer --force-install + +post-install: +.if !defined(NOPORTDOCS) + @${MKDIR} ${DOCSDIR} +.for x in ${PORTDOCS} + @${INSTALL_DATA} ${WRKSRC}/${x} ${DOCSDIR} +.endfor +.endif + @if [ ! -e ${ETCDIR}/pandora_agent.conf ]; then \ + cd ${ETCDIR} && ${CP} -p pandora_agent.conf.sample pandora_agent.conf; \ + fi + @${CAT} ${PKGMESSAGE} + +.include <bsd.port.post.mk> diff --git a/net-mgmt/pandorafms_agent/distinfo b/net-mgmt/pandorafms_agent/distinfo new file mode 100644 index 000000000000..3293e25ddea3 --- /dev/null +++ b/net-mgmt/pandorafms_agent/distinfo @@ -0,0 +1,2 @@ +SHA256 (pandora/pandorafms_agent_unix-4.0.1.tar.gz) = 0bae97d97f0fe628c7cd601d5d0304057a45b49a1277d63d9f30ae957173ed56 +SIZE (pandora/pandorafms_agent_unix-4.0.1.tar.gz) = 65952 diff --git a/net-mgmt/pandorafms_agent/files/pandora_agent.in b/net-mgmt/pandorafms_agent/files/pandora_agent.in new file mode 100644 index 000000000000..0caa3bee658e --- /dev/null +++ b/net-mgmt/pandorafms_agent/files/pandora_agent.in @@ -0,0 +1,34 @@ +#!/bin/sh + +# PROVIDE: pandora_agent +# REQUIRE: LOGIN +# KEYWORD: shutdown + +# Add the following line to /etc/rc.conf to enable `pandora_agent': +# +# pandora_agent_enable="YES" +# + +. "/etc/rc.subr" + +name="pandora_agent" +rcvar=`set_rcvar` +load_rc_config "$name" + +# set defaults +: ${pandora_agent_enable:=NO} + +pidfile="/var/run/$name.pid" + +required_files="%%ETCDIR%%/pandora_agent.conf" + +command="/usr/sbin/daemon" +command_args="-cf -p ${pidfile} %%PREFIX%%/bin/pandora_agent %%ETCDIR%%" +procname="%%PERL%%" +stop_postcmd=stop_postcmd + +stop_postcmd() { + rm -f $pidfile +} + +run_rc_command "$1" diff --git a/net-mgmt/pandorafms_agent/files/patch-pandora_agent_installer b/net-mgmt/pandorafms_agent/files/patch-pandora_agent_installer new file mode 100644 index 000000000000..e888b1798e62 --- /dev/null +++ b/net-mgmt/pandorafms_agent/files/patch-pandora_agent_installer @@ -0,0 +1,105 @@ +--- pandora_agent_installer.orig 2011-12-07 16:18:47.219413617 +0900 ++++ pandora_agent_installer 2011-12-07 16:31:35.483681456 +0900 +@@ -180,13 +159,13 @@ install () { + + if [ "$OS_NAME" = "FreeBSD" ] + then +- PANDORA_HOME=/usr/local/share/pandora_agent +- PANDORA_BIN=/usr/local/bin/pandora_agent +- PANDORA_EXEC_BIN=/usr/local/bin/pandora_agent_exec +- PANDORA_CFG=/usr/local/etc/pandora +- TENTACLE=/usr/local/bin/tentacle_client +- TENTACLE_SERVER=/usr/local/bin/tentacle_server +- PANDORA_MAN=/usr/local/man ++ PANDORA_HOME=%%DATADIR%% ++ PANDORA_BIN=%%PREFIX%%/bin/pandora_agent ++ PANDORA_EXEC_BIN=%%PREFIX%%/bin/pandora_agent_exec ++ PANDORA_CFG=%%PANDORA_ETCDIR%% ++ TENTACLE=%%PREFIX%%/bin/tentacle_client ++ TENTACLE_SERVER=%%PREFIX%%/bin/tentacle_server ++ PANDORA_MAN=%%MAN1PREFIX%%/man + fi + + echo "Detecting Unix distribution: $OS_NAME version $OS_VERSION" +@@ -302,15 +281,6 @@ install () { + PANDORA_USER="root" + fi + +- # Create logfile +- if [ ! -z "`touch $PANDORA_BASE$PANDORA_LOG_DIR/$PANDORA_LOG`" ] +- then +- echo "Seems to be a problem generating logfile ($PANDORA_BASE$PANDORA_LOG_DIR/$PANDORA_LOG) please check it"; +- else +- echo "Created logfile at $PANDORA_BASE$PANDORA_LOG_DIR/$PANDORA_LOG..." +- fi +- echo "$LOG_TIMESTAMP Pandora FMS installer has created this file at startup" > $PANDORA_BASE$PANDORA_LOG_DIR/$PANDORA_LOG +- + # Copying agent and securing it + echo "Copying Pandora FMS Agent to $PANDORA_BASE$PANDORA_BIN..." + cp pandora_agent $PANDORA_BASE$PANDORA_BIN +@@ -326,22 +296,23 @@ install () { + chown $PANDORA_USER:0 $PANDORA_BASE$PANDORA_EXEC_BIN + fi + +- echo "Copying Pandora FMS Agent configuration file to $PANDORA_BASE$PANDORA_CFG/pandora_agent.conf..." +- if [ -f $PANDORA_BASE/$PANDORA_CFG/pandora_agent.conf ] +- then +- cp $PANDORA_BASE/$PANDORA_CFG/pandora_agent.conf $PANDORA_BASE/$PANDORA_CFG/pandora_agent.conf.$OLDFILENAMETMP +- echo "Backing up old configuration file to $PANDORA_BASE/$PANDORA_CFG/pandora_agent.conf.$OLDFILENAMETMP" +- fi +- + echo "Copying Pandora FMS Agent plugins to $PANDORA_BASE$PANDORA_HOME/plugins..." + cp -r plugins $PANDORA_BASE$PANDORA_HOME + chmod -R 700 $PANDORA_BASE$PANDORA_HOME/plugins +- ln -s $PANDORA_BASE$PANDORA_HOME/plugins $PANDORA_BASE$PANDORA_CFG ++ mkdir -p $PANDORA_BASE$PANDORA_CFG/plugins ++ for _p in `find $PANDORA_BASE$PANDORA_HOME/plugins -mindepth 1 -maxdepth 1 -type f ! -name "*.bak"` ++ do ++ ln -s $_p $PANDORA_BASE$PANDORA_CFG/plugins/ || exit 1 ++ done + + echo "Copying Pandora FMS Agent collections to $PANDORA_BASE$PANDORA_HOME/collections..." + cp -r collections $PANDORA_BASE$PANDORA_HOME + chmod -R 700 $PANDORA_BASE$PANDORA_HOME/collections +- ln -s $PANDORA_BASE$PANDORA_HOME/collections $PANDORA_BASE$PANDORA_CFG ++ mkdir -p $PANDORA_BASE$PANDORA_CFG/collections ++ for _p in `find $PANDORA_BASE$PANDORA_HOME/collections -mindepth 1 -maxdepth 1 -type f ! -name "*.bak"` ++ do ++ ln -s $_p $PANDORA_BASE$PANDORA_CFG/collections/ || exit 1 ++ done + + echo "Copying tentacle server to $PANDORA_BASE$TENTACLE_SERVER" + cp tentacle_server $PANDORA_BASE$TENTACLE_SERVER +@@ -386,7 +357,7 @@ install () { + + echo "Copying default agent configuration to $PANDORA_BASE$PANDORA_CFG/pandora_agent.conf" + +- cp $OS_NAME/pandora_agent.conf $PANDORA_BASE$PANDORA_CFG/pandora_agent.conf ++ cp $OS_NAME/pandora_agent.conf $PANDORA_BASE$PANDORA_CFG/pandora_agent.conf.sample + chmod 600 $PANDORA_BASE$PANDORA_CFG/pandora_agent.conf + chown $PANDORA_USER $PANDORA_BASE$PANDORA_CFG/pandora_agent.conf + chmod 711 $PANDORA_BASE$PANDORA_LOG_DIR +@@ -445,14 +416,6 @@ install () { + chown root:0 $PANDORA_STARTUP + fi + +- if [ "$OS_NAME" = "FreeBSD" ] +- then +- PANDORA_STARTUP=/usr/local/etc/rc.d/pandora_agent +- cp FreeBSD/pandora_agent $PANDORA_STARTUP +- chmod 555 $PANDORA_STARTUP +- chown root:wheel $PANDORA_STARTUP +- fi +- + echo "Done." + echo " " + echo "You have your startup script ready at $PANDORA_STARTUP" +@@ -466,7 +423,7 @@ install () { + echo "Tentacle is the default transfer mode since 2.0 version." + echo " " + echo "If you want to use SSH, firstly you need to copy your public SSH keys " +- echo " ($HOME/.ssh/id_dsa) under /home/pandora/.ssh/authorized_keys " ++ echo " ($HOME/.ssh/id_dsa) under %%PANDORA_HOMEDIR%%/.ssh/authorized_keys " + echo "on your Pandora FMS Server host" + echo " " + echo "You also need to setup your $PANDORA_BASE$PANDORA_CFG/pandora_agent.conf config file" diff --git a/net-mgmt/pandorafms_agent/files/pkg-message.in b/net-mgmt/pandorafms_agent/files/pkg-message.in new file mode 100644 index 000000000000..358bed2c98b7 --- /dev/null +++ b/net-mgmt/pandorafms_agent/files/pkg-message.in @@ -0,0 +1,14 @@ +********************************************************************** + +Pandora FMS agent has been installed + +To setup Pandora FMS agent, you may have to edit +%%ETCDIR%%/pandora_agent.conf +to suit your needs. + +To start Pandora FMS agent at boot time, put following +line in your /etc/rc.conf or /etc/rc.conf.local: + + pandora_agent_enable="YES" + +********************************************************************** diff --git a/net-mgmt/pandorafms_agent/pkg-descr b/net-mgmt/pandorafms_agent/pkg-descr new file mode 100644 index 000000000000..47067cf88d27 --- /dev/null +++ b/net-mgmt/pandorafms_agent/pkg-descr @@ -0,0 +1,5 @@ +This is the PERL 5.8 version of Pandora FMS agent. This includes all the +advanced features included in 3.0 version, and will be the default agent +in future versions. + +WWW: http://www.pandorafms.org/ diff --git a/net-mgmt/pandorafms_agent/pkg-plist b/net-mgmt/pandorafms_agent/pkg-plist new file mode 100644 index 000000000000..4599d9d5fff1 --- /dev/null +++ b/net-mgmt/pandorafms_agent/pkg-plist @@ -0,0 +1,28 @@ +@comment $FreeBSD$ +@unexec if cmp -s %D/%%ETCDIR%%/pandora_agent.conf.sample %D/%%ETCDIR%%/pandora_agent.conf;then rm -f %D/%%ETCDIR%%/pandora_agent.conf; fi +%%ETCDIR%%/pandora_agent.conf.sample +@exec [ -e %D/%F ] || cp -p %D/%F %B/pandora_agent.conf +bin/pandora_agent +@exec mkdir -p %D/%%ETCDIR%%/collections +%%ETCDIR%%/plugins/files_indir +%%ETCDIR%%/plugins/grep_log +%%ETCDIR%%/plugins/inventory +%%ETCDIR%%/plugins/nagios_plugin_wrapper +%%ETCDIR%%/plugins/pandora_df +%%ETCDIR%%/plugins/pandora_update +bin/pandora_agent_exec +bin/tentacle_client +%%TENTACLE_SERVER%%bin/tentacle_server +@exec mkdir -p %D/%%DATADIR%%/collections +%%DATADIR%%/plugins/files_indir +%%DATADIR%%/plugins/grep_log +%%DATADIR%%/plugins/inventory +%%DATADIR%%/plugins/nagios_plugin_wrapper +%%DATADIR%%/plugins/pandora_df +%%DATADIR%%/plugins/pandora_update +@dirrmtry %%DATADIR%%/collections +@dirrmtry %%DATADIR%%/plugins +@dirrmtry %%DATADIR%% +@dirrmtry %%ETCDIR%%/collections +@dirrmtry %%ETCDIR%%/plugins +@dirrmtry %%ETCDIR%% diff --git a/net-mgmt/pandorafms_agent/plist b/net-mgmt/pandorafms_agent/plist new file mode 100644 index 000000000000..0f659340a407 --- /dev/null +++ b/net-mgmt/pandorafms_agent/plist @@ -0,0 +1,26 @@ +/usr/local/share/licenses/pandora_agent-4.0/catalog.mk +/usr/local/share/licenses/pandora_agent-4.0/LICENSE +/usr/local/share/licenses/pandora_agent-4.0/GPLv2 +/usr/local/man/man1/tentacle_client.1.gz +/usr/local/man/man1/pandora_agent.1.gz +/usr/local/etc/pandora/plugins/files_indir +/usr/local/etc/pandora/plugins/grep_log +/usr/local/etc/pandora/plugins/inventory +/usr/local/etc/pandora/plugins/nagios_plugin_wrapper +/usr/local/etc/pandora/plugins/pandora_df +/usr/local/etc/pandora/plugins/pandora_update +/usr/local/etc/pandora/pandora_agent.conf.sample +/usr/local/bin/pandora_agent +/usr/local/bin/pandora_agent_exec +/usr/local/bin/tentacle_client +/usr/local/bin/tentacle_server +/usr/local/share/pandora_agent/plugins/files_indir +/usr/local/share/pandora_agent/plugins/grep_log +/usr/local/share/pandora_agent/plugins/inventory +/usr/local/share/pandora_agent/plugins/nagios_plugin_wrapper +/usr/local/share/pandora_agent/plugins/pandora_df +/usr/local/share/pandora_agent/plugins/pandora_update +/usr/local/etc/rc.d/pandora_agent +/usr/local/share/doc/pandora_agent/AUTHORS +/usr/local/share/doc/pandora_agent/ChangeLog +/usr/local/share/doc/pandora_agent/README |