aboutsummaryrefslogtreecommitdiff
path: root/net-mgmt/pandorafms_server
diff options
context:
space:
mode:
authorMotoyuki Konno <motoyuki@FreeBSD.org>2012-04-21 12:27:40 +0000
committerMotoyuki Konno <motoyuki@FreeBSD.org>2012-04-21 12:27:40 +0000
commitc679424d1752dd4aa64d1f82b2e88214fc7364d1 (patch)
tree44b1b2129b0416abbaaba16b0b253378bbd9e8f2 /net-mgmt/pandorafms_server
parent9a915cc5a2b7476fb468a56d7b254ddcab299118 (diff)
downloadports-c679424d1752dd4aa64d1f82b2e88214fc7364d1.tar.gz
ports-c679424d1752dd4aa64d1f82b2e88214fc7364d1.zip
Notes
Diffstat (limited to 'net-mgmt/pandorafms_server')
-rw-r--r--net-mgmt/pandorafms_server/Makefile148
-rw-r--r--net-mgmt/pandorafms_server/bsd.pandora.mk60
-rw-r--r--net-mgmt/pandorafms_server/distinfo2
-rw-r--r--net-mgmt/pandorafms_server/files/199.clean-pandoradb.in28
-rw-r--r--net-mgmt/pandorafms_server/files/pandora_server.in29
-rw-r--r--net-mgmt/pandorafms_server/files/patch-pandora_server_installer149
-rw-r--r--net-mgmt/pandorafms_server/files/pkg-message.in26
-rw-r--r--net-mgmt/pandorafms_server/files/tentacle_server.in44
-rw-r--r--net-mgmt/pandorafms_server/pkg-descr23
-rw-r--r--net-mgmt/pandorafms_server/pkg-plist98
-rw-r--r--net-mgmt/pandorafms_server/pkg-plist.spool15
11 files changed, 622 insertions, 0 deletions
diff --git a/net-mgmt/pandorafms_server/Makefile b/net-mgmt/pandorafms_server/Makefile
new file mode 100644
index 000000000000..a34a6e8c2052
--- /dev/null
+++ b/net-mgmt/pandorafms_server/Makefile
@@ -0,0 +1,148 @@
+# New ports collection makefile for: pandorafms_server
+# Date created: 2011-11-22
+# Whom: KIKUCHI Koichiro <koichiro@rworks.jp>
+#
+# $FreeBSD$
+#
+
+PORTNAME= pandora_server
+PORTVERSION= ${PANDORA_VERSION}
+CATEGORIES= net-mgmt
+
+MAINTAINER= koichiro@rworks.jp
+COMMENT= Pandora FMS server
+
+LICENSE= ${PANDORA_LICENSE}
+LICENSE_FILE= ${PANDORA_LICENSE_FILE}
+
+BUILD_DEPENDS= p5-DBI>=0:${PORTSDIR}/databases/p5-DBI \
+ p5-HTML-Parser>=0:${PORTSDIR}/www/p5-HTML-Parser \
+ p5-IO-Socket-INET6>=0:${PORTSDIR}/net/p5-IO-Socket-INET6 \
+ p5-NetAddr-IP>=0:${PORTSDIR}/net-mgmt/p5-NetAddr-IP \
+ ${SITE_PERL}/${PERL_ARCH}/SNMP.pm:${PORTSDIR}/net-mgmt/net-snmp \
+ p5-Socket6>=0:${PORTSDIR}/net/p5-Socket6 \
+ p5-XML-Simple>=0:${PORTSDIR}/textproc/p5-XML-Simple \
+ p5-XML-Twig>=0:${PORTSDIR}/textproc/p5-XML-Twig
+RUN_DEPENDS= p5-DBI>=0:${PORTSDIR}/databases/p5-DBI \
+ p5-HTML-Parser>=0:${PORTSDIR}/www/p5-HTML-Parser \
+ p5-IO-Socket-INET6>=0:${PORTSDIR}/net/p5-IO-Socket-INET6 \
+ p5-NetAddr-IP>=0:${PORTSDIR}/net-mgmt/p5-NetAddr-IP \
+ ${SITE_PERL}/${PERL_ARCH}/SNMP.pm:${PORTSDIR}/net-mgmt/net-snmp \
+ p5-Socket6>=0:${PORTSDIR}/net/p5-Socket6 \
+ p5-XML-Simple>=0:${PORTSDIR}/textproc/p5-XML-Simple \
+ p5-XML-Twig>=0:${PORTSDIR}/textproc/p5-XML-Twig \
+ p5-libwww>=0:${PORTSDIR}/www/p5-libwww \
+ p5-DBD-mysql>=4:${PORTSDIR}/databases/p5-DBD-mysql \
+ ${LOCALBASE}/bin/wmic:${PORTSDIR}/net-mgmt/wmi-client \
+ ${LOCALBASE}/bin/nmap:${PORTSDIR}/security/nmap \
+ p5-Storable>=0:${PORTSDIR}/devel/p5-Storable
+
+OPTIONS= TENTACLE "Install tentacle_server" on \
+ XPROBE "Install xprobe" on \
+ PGSQL "Use PostgreSQL backend (experimental)" off \
+ ORACLE "Use Oracle backend (experimental)" off \
+ EXTRAS "Extra dependencies for util scripts" on
+
+USE_PERL5= 5.8+
+PERL_CONFIGURE= yes
+SUB_LIST+= PERL="${PERL}"
+
+MAN1= pandora_server.1
+MAN3= PandoraFMS::Core.3 \
+ PandoraFMS::GIS.3 \
+ PandoraFMS::GeoIP.3 \
+ PandoraFMS::NmapParser.3 \
+ PandoraFMS::Sendmail.3 \
+ PandoraFMS::Tools.3 \
+ PandoraFMS::Traceroute::PurePerl.3 \
+ PandoraFMS::Traceroute.3
+
+SUB_FILES= pkg-message 199.clean-pandoradb
+USE_RC_SUBR= ${PORTNAME}
+
+.include "${.CURDIR}/bsd.pandora.mk"
+
+PORTDOCS+= README
+
+.include <bsd.port.pre.mk>
+
+.if defined(WITHOUT_TENTACLE)
+PLIST_SUB+= TENTACLE="@comment "
+.else
+PLIST_SUB+= TENTACLE=""
+USE_RC_SUBR+= tentacle_server
+MAN1+= tentacle_server.1
+.endif
+.if defined(WITH_XPROBE)
+RUN_DEPENDS+= ${LOCALBASE}/bin/xprobe2:${PORTSDIR}/net/xprobe
+.endif
+.if defined(WITH_PGSQL)
+RUN_DEPENDS+= p5-DBD-Pg>=0:${PORTSDIR}/databases/p5-DBD-Pg
+.endif
+.if defined(WITH_ORACLE)
+RUN_DEPENDS+= p5-DBD-Oracle>=0:${PORTSDIR}/databases/p5-DBD-Oracle
+.endif
+.if defined(WITH_EXTRAS)
+# plugin/bgp_pluin.pl
+RUN_DEPENDS+= p5-Net-SNMP>=0:${PORTSDIR}/net-mgmt/p5-Net-SNMP
+# plugin/multicast.pl
+RUN_DEPENDS+= p5-IO-Socket-Multicast>=0:${PORTSDIR}/net/p5-IO-Socket-Multicast
+# plugin/openvpn_pandoraplugin.pl
+RUN_DEPENDS+= p5-Net-Telnet>=0:${PORTSDIR}/net/p5-Net-Telnet
+# plugin/integria_plugin/integria_plugin.sh, plugin/webcheck_plugin.sh,
+# plugin/babel_plugin/babel_plugin.sh, plugin/create_integria_incident.sh
+RUN_DEPENDS+= ${LOCALBASE}/bin/wget:${PORTSDIR}/ftp/wget
+# plugin/ipmi-plugin.pl, recon_scripts/ipmi-recon.pl
+RUN_DEPENDS+= ${LOCALBASE}/sbin/ipmi-sensors:${PORTSDIR}/sysutils/freeipmi
+.endif
+
+.if exists(${PERL})
+PERL_THREADS!= ${PERL} -V::usethreads
+. if ${PERL_THREADS}!="'define';"
+IGNORE= needs a threaded Perl, build with WITH_THREADS=yes flag and try again
+. endif
+.else
+IGNORE= needs an existing installation of Perl built with WITH_THREADS=yes
+.endif
+
+post-patch:
+.if defined(NO_INSTALL_MANPAGES)
+ @${REINPLACE_CMD} -e \
+ -e '/%%MAN/s/^/#/ \
+ ${WRKSRC}/pandora_server_installer
+.endif
+ @${REINPLACE_CMD} \
+ -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_LOGDIR%%|${PANDORA_LOGDIR}|g' \
+ -e 's|%%PANDORA_SPOOLDIR%%|${PANDORA_SPOOLDIR}|g' \
+ ${WRKSRC}/pandora_server_installer
+ @${REINPLACE_CMD} -i "" \
+ -e 's,/usr/bin/perl,${PERL},g' \
+ `${GREP} -rl /usr/bin/perl ${WRKSRC} | ${GREP} -v pandora_server_installer`
+
+post-install:
+.if defined(WITH_TENTACLE)
+ @cd ${WRKSRC} && ${SH} pandora_server_installer --install
+.else
+ @cd ${WRKSRC} && ${SH} pandora_server_installer --install --no-tentacle
+.endif
+ @${RM} -f ${PREFIX}/lib/perl5/${PERL_VERSION}/${PERL_ARCH}/perllocal.pod
+.if !defined(NOPORTDOC)
+ @${MKDIR} ${DOCSDIR}
+.for x in ${PORTDOCS}
+ @${INSTALL_DATA} ${WRKSRC}/${x} ${DOCSDIR}
+.endfor
+.endif
+ @if [ ! -e ${ETCDIR}/pandora_server.conf ]; then \
+ ${CP} -p ${ETCDIR}/pandora_server.conf.sample \
+ ${ETCDIR}/pandora_server.conf; \
+ fi
+ @${FIND} ${DATADIR} -type l -name PandoraFMS -delete
+ @${MKDIR} ${PREFIX}/etc/periodic/daily
+ @${INSTALL_SCRIPT} ${WRKDIR}/199.clean-pandoradb ${PREFIX}/etc/periodic/daily/
+ @${CAT} ${PKGMESSAGE}
+
+.include <bsd.port.post.mk>
diff --git a/net-mgmt/pandorafms_server/bsd.pandora.mk b/net-mgmt/pandorafms_server/bsd.pandora.mk
new file mode 100644
index 000000000000..d8469e9604a4
--- /dev/null
+++ b/net-mgmt/pandorafms_server/bsd.pandora.mk
@@ -0,0 +1,60 @@
+# $FreeBSD$
+
+PANDORA_VERSION= 4.0.1
+PANDORA_LICENSE= GPLv2
+PANDORA_LICENSE_FILE= ${WRKSRC}/COPYING
+
+PANDORA_SPOOLDIR?= /var/spool/pandora
+PANDORA_LOGDIR?= /var/log/pandora
+PANDORA_ETCDIR?= ${PREFIX}/etc/pandora
+PANDORA_HOMEDIR?= ${PANDORA_ETCDIR}/home
+
+MASTER_SITES?= SF/pandora/Pandora%20FMS%20${PANDORA_VERSION}/Tarball
+.if ${PORTNAME} == "pandora_agent"
+DISTNAME= pandorafms_agent_unix-${PORTVERSION}
+.else
+DISTNAME= ${PORTNAME:S/pandora_/pandorafms_/}-${PORTVERSION}
+.endif
+DIST_SUBDIR= pandora
+
+NO_BUILD?= yes
+
+USERS= pandora
+GROUPS= pandora
+
+ETCDIR?= ${PANDORA_ETCDIR}
+SPOOLDIR?= ${PANDORA_SPOOLDIR}
+LOGDIR?= ${PANDORA_LOGDIR}
+
+PLIST_SUB+= SPOOLDIR="${PANDORA_SPOOLDIR}" LOGDIR="${PANDORA_LOGDIR}" \
+ USE_SPOOL_IN=${USE_SPOOL_IN} USE_SPOOL_OUT=${USE_SPOOL_OUT} \
+ USE_LOGDIR=${USE_LOGDIR}
+PLIST= ${WRKDIR}/PLIST
+
+PORTDOCS?= AUTHORS ChangeLog
+
+.if ${PORTNAME} == "pandora_server"
+USE_LOGDIR= ""
+USE_SPOOL_IN= ""
+USE_SPOOL_OUT= "@comment "
+.elif ${PORTNAME} == "pandora_console"
+USE_LOGDIR= "@comment "
+USE_SPOOL_IN= ""
+USE_SPOOL_OUT= "@comment "
+.elif ${PORTNAME} == "pandora_agent"
+USE_LOGDIR= ""
+USE_SPOOL_IN= "@comment "
+USE_SPOOL_OUT= ""
+.endif
+
+.if ${PORTNAME} == "pandora_agent"
+post-extract:
+ @${MV} ${WRKDIR}/unix ${WRKSRC}
+.else
+post-extract:
+ @${MV} ${WRKDIR}/${PORTNAME} ${WRKSRC}
+.endif
+
+pre-install:
+ @${CAT} ${PKGDIR}/../pandorafms_server/pkg-plist.spool > ${PLIST}
+ @${CAT} ${PKGDIR}/pkg-plist >> ${PLIST}
diff --git a/net-mgmt/pandorafms_server/distinfo b/net-mgmt/pandorafms_server/distinfo
new file mode 100644
index 000000000000..d79e6dcf3bf0
--- /dev/null
+++ b/net-mgmt/pandorafms_server/distinfo
@@ -0,0 +1,2 @@
+SHA256 (pandora/pandorafms_server-4.0.1.tar.gz) = f877d1a6dfc3fd181e55e8243aa335573a703d05c1ba248786cf0d93256e8d83
+SIZE (pandora/pandorafms_server-4.0.1.tar.gz) = 283237
diff --git a/net-mgmt/pandorafms_server/files/199.clean-pandoradb.in b/net-mgmt/pandorafms_server/files/199.clean-pandoradb.in
new file mode 100644
index 000000000000..820519716fd4
--- /dev/null
+++ b/net-mgmt/pandorafms_server/files/199.clean-pandoradb.in
@@ -0,0 +1,28 @@
+#! /bin/sh
+#
+# $FreeBSD$
+#
+# Run the Pandora FMS database maintenace script.
+#
+
+# If there is a global system configuration file, suck it in.
+#
+if [ -r /etc/defaults/periodic.conf ]; then
+ . /etc/defaults/periodic.conf
+ source_periodic_confs
+fi
+
+rc=0
+
+case "$daily_clean_pandoradb_enable" in
+ [Nn][Oo])
+ ;;
+ *)
+ echo ""
+ echo "Running Pandora FMS DB maintenace script:"
+
+ %%PERL%% %%DATADIR%%/util/pandora_db.pl %%ETCDIR%%/pandora_server.conf || rc=3
+ ;;
+esac
+
+exit $rc
diff --git a/net-mgmt/pandorafms_server/files/pandora_server.in b/net-mgmt/pandorafms_server/files/pandora_server.in
new file mode 100644
index 000000000000..c3ddc4e43d01
--- /dev/null
+++ b/net-mgmt/pandorafms_server/files/pandora_server.in
@@ -0,0 +1,29 @@
+#!/bin/sh
+
+# PROVIDE: pandora_server
+# REQUIRE: LOGIN mysql
+# KEYWORD: shutdown
+
+# Add the following line to /etc/rc.conf to enable `pandora_server':
+#
+# pandora_server_enable="YES"
+#
+
+. "/etc/rc.subr"
+
+name="pandora_server"
+rcvar=`set_rcvar`
+load_rc_config $name
+
+# set defaults
+: ${pandora_server_enable:=NO}
+
+pidfile=/var/run/$name.pid
+
+required_files="%%ETCDIR%%/pandora_server.conf"
+
+command="%%PREFIX%%/bin/${name}"
+command_args="-D -P ${pidfile} %%ETCDIR%%/pandora_server.conf"
+procname="%%PERL%%"
+
+run_rc_command "$1"
diff --git a/net-mgmt/pandorafms_server/files/patch-pandora_server_installer b/net-mgmt/pandorafms_server/files/patch-pandora_server_installer
new file mode 100644
index 000000000000..7f3f6159656a
--- /dev/null
+++ b/net-mgmt/pandorafms_server/files/patch-pandora_server_installer
@@ -0,0 +1,149 @@
+--- pandora_server_installer.orig 2011-09-24 00:16:47.000000000 +0900
++++ pandora_server_installer 2011-12-07 13:57:23.238651664 +0900
+@@ -83,7 +83,6 @@ get_distro () {
+
+ install () {
+
+- perl Makefile.PL > output 2>&1 #&& sleep 2 && cat output | grep "found" | wc -l
+ DEPENDENCIAS=`cat output | grep "found" | wc -l`
+ if [ $DEPENDENCIAS -gt 0 ]
+ then
+@@ -143,10 +142,10 @@ perl-TimeDate perl-XML-Simple perl-XML-T
+ elif [ "$DISTRO" = "FreeBSD" ]
+ then
+ echo "FreeBSD detected"
+- PANDORA_SPOOL=/var/spool/pandora
+- PANDORA_HOME=/usr/local/share/pandora_server
+- PANDORA_CFG_DIR=/usr/local/etc/pandora
+- PANDORA_LOG=/var/log/pandora
++ PANDORA_SPOOL=%%PANDORA_SPOOLDIR%%
++ PANDORA_HOME=%%DATADIR%%
++ PANDORA_CFG_DIR=%%PANDORA_ETCDIR%%
++ PANDORA_LOG=%%PANDORA_LOGDIR%%
+ PANDORA_SERVER=/usr/local/etc/rc.d/pandora_server
+ TENTACLE_SERVER=/usr/local/etc/rc.d/tentacle_server
+ PANDORA_CFG_FILE=/usr/local/etc/pandora/pandora_server.conf
+@@ -159,7 +158,7 @@ perl-TimeDate perl-XML-Simple perl-XML-T
+ echo "Checking binaries at /usr/local/bin -> /usr/bin"
+ if [ ! -e "/usr/bin/pandora_server" ]
+ then
+- if [ ! -e "/usr/local/bin/pandora_server" ]
++ if [ ! -e "%%PREFIX%%/bin/pandora_server" ]
+ then
+ echo "ERROR compiling Pandora FMS Server from sources. Aborting"
+ exit 1
+@@ -182,7 +181,7 @@ perl-TimeDate perl-XML-Simple perl-XML-T
+ if [ "$AREYOUSURE" = "y" ]; then
+ if [ "$DISTRO" = "FreeBSD" ]
+ then
+- echo "pandora:41121:::::Pandora FMS:/home/pandora:/usr/sbin/nologin:" | adduser -f - -w no 2> /dev/null
++ :
+ else
+ useradd pandora
+ mkdir /home/pandora 2> /dev/null
+@@ -238,16 +237,10 @@ perl-TimeDate perl-XML-Simple perl-XML-T
+
+ echo "Creating setup directory in $PANDORA_CFG_DIR"
+ mkdir $PANDORA_CFG_DIR 2> /dev/null
+- if [ -e $PANDORA_CFG_FILE ]
+- then
+- OLDFILENAMETMP=`date +"%Y-%m-%d"`
+- echo "Old installation detected, backing up pandora_server.conf.$ODFILENAMETMP"
+- mv $PANDORA_CFG_FILE $PANDORA_CFG_FILE.$OLDFILENAMETMP
+- fi
+ if [ "$DISTRO" = "FreeBSD" ]
+ then
+ echo cp FreeBSD/pandora_server.conf $PANDORA_CFG_DIR
+- cp FreeBSD/pandora_server.conf $PANDORA_CFG_DIR
++ cp FreeBSD/pandora_server.conf $PANDORA_CFG_DIR/pandora_server.conf.sample
+ else
+ echo cp conf/pandora_server.conf $PANDORA_CFG_DIR
+ cp conf/pandora_server.conf $PANDORA_CFG_DIR
+@@ -257,7 +250,7 @@ perl-TimeDate perl-XML-Simple perl-XML-T
+ echo "Installing Pandora Server manual"
+ if [ "$DISTRO" = "FreeBSD" ]
+ then
+- cp man/man1/pandora_server.1.gz /usr/local/man/man1
++ zcat man/man1/pandora_server.1.gz > %%MAN1PREFIX%%/man/man1/pandora_server.1
+ else
+ cp man/man1/pandora_server.1.gz /usr/share/man/man1
+ fi
+@@ -288,22 +281,9 @@ perl-TimeDate perl-XML-Simple perl-XML-T
+ ln -s $PANDORA_SERVER /etc/rc.d/rc$INITLV.d/S90pandora_server
+ fi
+ fi
+- else
+- if [ "$DISTRO" = "FreeBSD" ]
+- then
+- echo "Copying the daemon script into $PANDORA_SERVER"
+- cp FreeBSD/pandora_server $PANDORA_SERVER
+- chmod 555 $PANDORA_SERVER
+- fi
+ fi
+
+- if [ -d /etc/logrotate.d ]; then
+- echo "Creating logrotate.d entry for Pandora FMS log management"
+- cp util/pandora_logrotate /etc/logrotate.d/pandora
+- else
+ echo "Please add a log rotation schedule manually to your log rotation daemon (if any)"
+- fi
+-
+ if [ "$LINUX" = "YES" ]
+ then
+ if [ "$SECOPT" != "--no-tentacle" ]
+@@ -343,12 +323,10 @@ perl-TimeDate perl-XML-Simple perl-XML-T
+ if [ "$DISTRO" = "FreeBSD" ]
+ then
+ echo "Installing tentacle server"
+- cp bin/tentacle_server /usr/local/bin
+- chown pandora /usr/local/bin/tentacle_server
+- cp FreeBSD/tentacle_server $TENTACLE_SERVER
+- chmod 555 $TENTACLE_SERVER
++ cp bin/tentacle_server %%PREFIX%%/bin
++ chown pandora %%PREFIX%%/bin/tentacle_server
+ echo "Installing Tentacle Server manual"
+- cp man/man1/tentacle_server.1.gz /usr/local/man/man1
++ zcat man/man1/tentacle_server.1.gz > %%MAN1PREFIX%%/man/man1/tentacle_server.1
+ fi
+ fi
+ fi
+@@ -357,39 +335,11 @@ perl-TimeDate perl-XML-Simple perl-XML-T
+ mkdir $PANDORA_HOME 2> /dev/null
+ cp -R util $PANDORA_HOME
+
+- if [ -d /etc/cron.daily ]
+- then
+- echo "Creating the Cron script to run daily Pandora DB tool"
+- echo "#!/bin/bash" > /etc/cron.daily/pandora_db
+- echo "perl /usr/share/pandora_server/util/pandora_db.pl /etc/pandora/pandora_server.conf" >> /etc/cron.daily/pandora_db
+- chmod +x /etc/cron.daily/pandora_db
+- else
+- if [ "$DISTRO" = "FreeBSD" ]
+- then
+- grep pandora_db.pl /etc/crontab > /dev/null 2>&1
+- if [ $? -ne 0 ]
+- then
+- echo "# Pandora FMS" >> /etc/crontab
+- echo "2 0 * * * root perl /usr/local/share/pandora_server/util/pandora_db.pl /usr/local/etc/pandora/pandora_server.conf" >> /etc/crontab
+- else
+- echo "The crontab for pandora_db.pl is already configured."
+- fi
+- else
+- echo "You're probably not using cron for automatic scheduling. You should schedule the following command to run frequently (daily) on your master server:"
+- echo " perl /usr/share/pandora_server/util/pandora_db.pl /etc/pandora/pandora_server.conf"
+- fi
+- fi
+ echo
+ echo "Now you have to edit your $PANDORA_CFG_FILE file to change the database password (default is pandora) with the one set in include/config.php of your Pandora FMS Console."
+ echo "After setting password you can start your Pandora FMS Server!!"
+ rm output
+
+- if [ -d "/etc/logrotate.d" ]
+- then
+- echo "Managing Pandora FMS logs with logrotate (Distro independent)"
+- cp -aRf util/pandora_logrotate /etc/logrotate.d/pandora
+- fi
+-
+ if [ "$DISTRO" = "FreeBSD" ]
+ then
+ echo " "
diff --git a/net-mgmt/pandorafms_server/files/pkg-message.in b/net-mgmt/pandorafms_server/files/pkg-message.in
new file mode 100644
index 000000000000..836ab8b53c08
--- /dev/null
+++ b/net-mgmt/pandorafms_server/files/pkg-message.in
@@ -0,0 +1,26 @@
+**********************************************************************
+
+Pandora FMS server has been installed
+
+In order to run the Pandora FMS server, you need to edit
+%%ETCDIR%%/pandora_server.conf
+at least to change the database password with the one set in
+include/config.php of your Pandora FMS Console and add the
+following line to /etc/rc.conf or /etc/rc.conf.local:
+
+ pandora_server_enable="YES"
+
+If you intalled tentacle_server, you also need to add the
+following line to /etc/rc.conf or /etc/rc.conf.local:
+
+ tentacle_server_enable="YES"
+
+
+By default pandora_db.pl script will run daily to purge old data
+stored in the Pandora FMS database, and maintain the database
+compacted. If you don't want this behavior please set the following
+in your /etc/periodic.conf or /etc/periodic.conf.local:
+
+ daily_clean_pandoradb_enable="NO"
+
+**********************************************************************
diff --git a/net-mgmt/pandorafms_server/files/tentacle_server.in b/net-mgmt/pandorafms_server/files/tentacle_server.in
new file mode 100644
index 000000000000..e097105af5ec
--- /dev/null
+++ b/net-mgmt/pandorafms_server/files/tentacle_server.in
@@ -0,0 +1,44 @@
+#!/bin/sh
+
+# PROVIDE: tentacle_server
+# REQUIRE: LOGIN
+# KEYWORD: shutdown
+
+# Add the following line to /etc/rc.conf to enable `tentacle_server':
+#
+# tentacle_server_enable="YES"
+#
+
+. "/etc/rc.subr"
+
+name="tentacle_server"
+rcvar=`set_rcvar`
+load_rc_config $name
+
+# set defaults
+: ${tentacle_server_enable:=NO}
+: ${tentacle_server_flags:="-a 0.0.0.0 -p 41121 -s /var/spool/pandora/data_in -i.*\.conf:conf\;.*\.md5:md5\;.*\.zip:collections"}
+: ${tentacle_server_user:=pandora}
+
+pidfile=/var/run/$name.pid
+
+command="/usr/sbin/daemon"
+command_args="-cf -p ${pidfile} -u ${tentacle_server_user} %%PREFIX%%/bin/${name} ${tentacle_server_flags}"
+procname="%%PERL%%"
+start_cmd=start_cmd
+stop_postcmd=stop_postcmd
+
+start_cmd() {
+ check_startmsgs && echo "Starting ${name}."
+
+ touch $pidfile
+ chown $tentacle_server_user $pidfile
+
+ $command $command_args
+}
+
+stop_postcmd() {
+ rm -f $pidfile
+}
+
+run_rc_command "$1"
diff --git a/net-mgmt/pandorafms_server/pkg-descr b/net-mgmt/pandorafms_server/pkg-descr
new file mode 100644
index 000000000000..90f45b65f55e
--- /dev/null
+++ b/net-mgmt/pandorafms_server/pkg-descr
@@ -0,0 +1,23 @@
+Pandora FMS is a monitoring Open Source software. It watches your systems and
+applications, and allows you to know the status of any element of those systems.
+
+Pandora FMS could detect a network interface down, a defacement in your
+website, a memory leak in one of your server application, or the movement of
+any value of the NASDAQ new technology market. Pandora FMS could send out SMS
+message when your systems fails... or when Google's value drop below US348.60?
+
+Pandora FMS runs on any operating system, with specific agents for each
+platform, gathering data and sending it to a server, it has specific agents for
+GNU/Linux, AIX, Solaris, HP-UX, BSD/IPSO, and Windows 2000, XP and 2003.
+
+Pandora FMS can also monitor any kind of TCP/IP service, without the need to
+install agents, and monitor network systems such as load balancers, routers,
+switches, operating systems, applications, or simply printers if you need.
+Pandora FMS also supports SNMP for collecting data and for receiving traps.
+
+A few examples of common resources monitored by Pandora FMS could be processor
+load, disk and memory usage, running processes, log files, environmental
+factors such as temperature, or application values like strings contained in
+web pages or any possible way to collect data in an automatic way.
+
+WWW: http://www.pandorafms.org/
diff --git a/net-mgmt/pandorafms_server/pkg-plist b/net-mgmt/pandorafms_server/pkg-plist
new file mode 100644
index 000000000000..d7fcdf01f856
--- /dev/null
+++ b/net-mgmt/pandorafms_server/pkg-plist
@@ -0,0 +1,98 @@
+@comment $FreeBSD$
+bin/pandora_exec
+bin/pandora_server
+%%TENTACLE%%bin/tentacle_server
+@unexec if cmp -s %D/%%ETCDIR%%/pandora_server.conf.sample %D/%%ETCDIR%%/pandora_server.conf;then rm -f %D/%%ETCDIR%%/pandora_server.conf;fi
+%%ETCDIR%%/pandora_server.conf.sample
+@exec [ -e %D/%F ] || cp -p %D/%F %B/pandora_server.conf
+%%SITE_PERL%%/%%PERL_ARCH%%/auto/PandoraFMS/.packlist
+%%SITE_PERL%%/PandoraFMS/Config.pm
+%%SITE_PERL%%/PandoraFMS/Core.pm
+%%SITE_PERL%%/PandoraFMS/DB.pm
+%%SITE_PERL%%/PandoraFMS/DataServer.pm
+%%SITE_PERL%%/PandoraFMS/GIS.pm
+%%SITE_PERL%%/PandoraFMS/GeoIP.pm
+%%SITE_PERL%%/PandoraFMS/NetworkServer.pm
+%%SITE_PERL%%/PandoraFMS/NmapParser.pm
+%%SITE_PERL%%/PandoraFMS/PluginServer.pm
+%%SITE_PERL%%/PandoraFMS/PredictionServer.pm
+%%SITE_PERL%%/PandoraFMS/ProducerConsumerServer.pm
+%%SITE_PERL%%/PandoraFMS/ReconServer.pm
+%%SITE_PERL%%/PandoraFMS/SNMPServer.pm
+%%SITE_PERL%%/PandoraFMS/Sendmail.pm
+%%SITE_PERL%%/PandoraFMS/Server.pm
+%%SITE_PERL%%/PandoraFMS/Tools.pm
+%%SITE_PERL%%/PandoraFMS/Traceroute.pm
+%%SITE_PERL%%/PandoraFMS/Traceroute/PurePerl.pm
+%%SITE_PERL%%/PandoraFMS/WMIServer.pm
+%%DATADIR%%/util/alert_multicast.pl
+%%DATADIR%%/util/change_remoteconfig.pl
+%%DATADIR%%/util/compaq_chassis_trap_manager.pl
+%%DATADIR%%/util/compaq_chassis_trap_manager2.pl
+%%DATADIR%%/util/esx_trap_manager.pl
+%%DATADIR%%/util/gis.README
+%%DATADIR%%/util/gpx2pandora_agent_data.pl
+%%DATADIR%%/util/n2p.README
+%%DATADIR%%/util/n2p.pl
+%%DATADIR%%/util/pandora2ast/GPL
+%%DATADIR%%/util/pandora2ast/README
+%%DATADIR%%/util/pandora2ast/channelcommands
+%%DATADIR%%/util/pandora2ast/extensions.conf.add
+%%DATADIR%%/util/pandora2ast/pandora2ast.pl
+%%DATADIR%%/util/pandora2ast/text2speech.php
+%%DATADIR%%/util/pandora_DBI_test.pl
+%%DATADIR%%/util/pandora_backup.sh
+%%DATADIR%%/util/pandora_count.sh
+%%DATADIR%%/util/pandora_db.pl
+%%DATADIR%%/util/pandora_dbstress.README
+%%DATADIR%%/util/pandora_dbstress.pl
+%%DATADIR%%/util/pandora_diagnostic.sh
+%%DATADIR%%/util/pandora_logrotate
+%%DATADIR%%/util/pandora_manage.pl
+%%DATADIR%%/util/pandora_recode_db.pl
+%%DATADIR%%/util/pandora_remote_agent.sh
+%%DATADIR%%/util/pandora_server
+%%DATADIR%%/util/pandora_snmp.README
+%%DATADIR%%/util/pandora_sync_db.pl
+%%DATADIR%%/util/pandora_xml_stress.README
+%%DATADIR%%/util/pandora_xml_stress.conf
+%%DATADIR%%/util/pandora_xml_stress.pl
+%%DATADIR%%/util/plugin/babel_plugin/README
+%%DATADIR%%/util/plugin/babel_plugin/babel_plugin.sh
+%%DATADIR%%/util/plugin/babel_plugin/plugin_definition.ini
+%%DATADIR%%/util/plugin/bgp_plugin.pl
+%%DATADIR%%/util/plugin/create_integria_incident.sh
+%%DATADIR%%/util/plugin/dns_plugin.sh
+%%DATADIR%%/util/plugin/integria_plugin/README
+%%DATADIR%%/util/plugin/integria_plugin/integria_plugin.sh
+%%DATADIR%%/util/plugin/integria_plugin/plugin_definition.ini
+%%DATADIR%%/util/plugin/ipmi-plugin.pl
+%%DATADIR%%/util/plugin/multicast.pl
+%%DATADIR%%/util/plugin/mysql_plugin.sh
+%%DATADIR%%/util/plugin/openvpn_pandoraplugin.pl
+%%DATADIR%%/util/plugin/pandora_inventory_change.README
+%%DATADIR%%/util/plugin/pandora_inventory_change.pl
+%%DATADIR%%/util/plugin/pandora_loadgen.pl
+%%DATADIR%%/util/plugin/pandora_server_status.pl
+%%DATADIR%%/util/plugin/snmp_process.pl
+%%DATADIR%%/util/plugin/ssh_pandoraplugin.sh
+%%DATADIR%%/util/plugin/udp_nmap_plugin.sh
+%%DATADIR%%/util/plugin/webcheck_plugin.sh
+%%DATADIR%%/util/recon_scripts/snmpdevices.pl
+%%DATADIR%%/util/recon_scripts/ipmi-recon.pl
+%%DATADIR%%/util/tentacle_serverd
+%%DATADIR%%/util/udp_client.pl
+%%DATADIR%%/util/windows.README
+etc/periodic/daily/199.clean-pandoradb
+@dirrm %%SITE_PERL%%/PandoraFMS/Traceroute
+@dirrm %%SITE_PERL%%/PandoraFMS
+@dirrm %%DATADIR%%/util/plugin/babel_plugin
+@dirrm %%DATADIR%%/util/plugin/integria_plugin
+@dirrm %%DATADIR%%/util/pandora2ast
+@dirrmtry %%DATADIR%%/util/plugin
+@dirrmtry %%DATADIR%%/util/recon_scripts
+@dirrmtry %%DATADIR%%/util
+@dirrmtry %%DATADIR%%
+@dirrmtry %%PREFIX%%/etc/periodic/daily
+@dirrmtry %%PREFIX%%/etc/periodic
+@dirrmtry %%ETCDIR%%
diff --git a/net-mgmt/pandorafms_server/pkg-plist.spool b/net-mgmt/pandorafms_server/pkg-plist.spool
new file mode 100644
index 000000000000..969cb21cb556
--- /dev/null
+++ b/net-mgmt/pandorafms_server/pkg-plist.spool
@@ -0,0 +1,15 @@
+@comment $FreeBSD$
+%%USE_LOGDIR%%@exec if [ ! -d %%LOGDIR%% ];then mkdir %%LOGDIR%%; chown pandora:www %%LOGDIR%%;fi
+%%USE_LOGDIR%%@unexec rmdir %%LOGDIR%% 2>/dev/null || true
+@exec if [ ! -d %%SPOOLDIR%% ];then mkdir -pm 770 %%SPOOLDIR%%; chown pandora:www %%SPOOLDIR%%;fi
+%%USE_SPOOL_OUT%%@exec if [ ! -d %%SPOOLDIR%%/data_out ];then mkdir -pm 755 %%SPOOLDIR%%/data_out; chown pandora:daemon %%SPOOLDIR%%/data_out;fi
+%%USE_SPOOL_OUT%%@unexec rmdir %%SPOOLDIR%%/data_out 2>/dev/null || true
+%%USE_SPOOL_IN%%@exec if [ ! -d %%SPOOLDIR%%/data_in ];then mkdir -pm 770 %%SPOOLDIR%%/data_in; chown pandora:www %%SPOOLDIR%%/data_in;fi
+%%USE_SPOOL_IN%%@exec if [ ! -d %%SPOOLDIR%%/data_in/collections ];then mkdir %%SPOOLDIR%%/data_in/collections; chown pandora:www %%SPOOLDIR%%/data_in/collections;fi
+%%USE_SPOOL_IN%%@exec if [ ! -d %%SPOOLDIR%%/data_in/conf ];then mkdir %%SPOOLDIR%%/data_in/conf; chown pandora:www %%SPOOLDIR%%/data_in/conf;fi
+%%USE_SPOOL_IN%%@exec if [ ! -d %%SPOOLDIR%%/data_in/md5 ];then mkdir %%SPOOLDIR%%/data_in/md5; chown pandora:www %%SPOOLDIR%%/data_in/md5;fi
+%%USE_SPOOL_IN%%@unexec rmdir %%SPOOLDIR%%/data_in/collections 2>/dev/null || true
+%%USE_SPOOL_IN%%@unexec rmdir %%SPOOLDIR%%/data_in/conf 2>/dev/null || true
+%%USE_SPOOL_IN%%@unexec rmdir %%SPOOLDIR%%/data_in/md5 2>/dev/null || true
+%%USE_SPOOL_IN%%@unexec rmdir %%SPOOLDIR%%/data_in 2>/dev/null || true
+@unexec rmdir %%SPOOLDIR%% 2>/dev/null || true