1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-12-25 04:43:33 +00:00

NOC Project is an Operation Support System (OSS) for the Telco,

Service provider and Enterprise Network Operation Centers (NOC).

Areas covered by NOC:
    * Fault Management
    * Service Activation/Provisioning
    * Knowledge Base
    * Multi-VRF Address space management
    * Virtual Circuits management (VLAN, DLCI, etc)
    * Configuration Management
    * DNS provisioning
    * Peering management, RPSL and BGP filters generator, integrated
      looking glass
    * Reporting

NOC Project is distributed under the term of BSD-like LICENSE.

Enjoy!
The NOC Project Team

WWW: http://www.nocproject.org/

PR:		ports/137489
Submitted by:	Stanislav Svirid <count at 211.ru>
This commit is contained in:
Boris Samorodov 2009-08-18 09:07:12 +00:00
parent d82a472a41
commit caac3bfcb3
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=239847
10 changed files with 2490 additions and 0 deletions

View File

@ -154,6 +154,7 @@
SUBDIR += ng_ipacct
SUBDIR += nipper
SUBDIR += nitpicker
SUBDIR += noc
SUBDIR += nocol
SUBDIR += nrg
SUBDIR += nrpe2

91
net-mgmt/noc/Makefile Normal file
View File

@ -0,0 +1,91 @@
# New ports collection makefile for: noc
# Date created: 27.08.2009
# Whom: Stanislav Svirid <count@211.ru>
#
# $FreeBSD$
#
PORTNAME= noc
PORTVERSION= 0.2.7
CATEGORIES= net-mgmt python
MASTER_SITES= http://trac.nocproject.org/trac/downloads/
DISTNAME= noc-${PORTVERSION}
MAINTAINER= count@211.ru
COMMENT= Operation Support System (OSS) for the Telco, SP and Enterprise NOC
LIB_DEPENDS= smi.2:${PORTSDIR}/net-mgmt/libsmi
BUILD_DEPENDS= easy_install:${PORTSDIR}/devel/py-setuptools \
${PYTHON_PKGNAMEPREFIX}sphinx>0:${PORTSDIR}/textproc/py-sphinx \
${PYTHON_PKGNAMEPREFIX}flup>0:${PORTSDIR}/www/py-flup
RUN_DEPENDS= django-admin.py:${PORTSDIR}/www/py-django \
${PYTHON_SITELIBDIR}/psycopg2/_psycopg.so:${PORTSDIR}/databases/py-psycopg2 \
${PYTHON_SITELIBDIR}/pysnmp/v4/__init__.py:${PORTSDIR}/net-mgmt/py-snmp4 \
${PYTHON_PKGNAMEPREFIX}south>0:${PORTSDIR}/databases/py-south \
${PYTHON_PKGNAMEPREFIX}creole>0:${PORTSDIR}/textproc/py-creole \
${PYTHON_PKGNAMEPREFIX}netifaces>0:${PORTSDIR}/net/py-netifaces \
${PYTHON_PKGNAMEPREFIX}protobuf>0:${PORTSDIR}/devel/py-protobuf
USE_PYTHON= 2.6+
USE_PYDISTUTILS= yes
PYDISTUTILS_EGGINFODIR= ${NOCDIR}
CONFLICTS= noc-devel-[0-9].*
NOCUSER?= noc
NOCGROUP?= noc
NOCDIR?= ${PREFIX}/noc
NOCDBDIR?= /var/db/noc
LOCALSTATE_DIR?=/var/run/noc
NOCUID= 182
NOCGID= ${NOCUID}
.include <bsd.port.pre.mk>
PLIST_SUB= NOCDIR=${NOCDIR} \
NOCDBDIR=${NOCDBDIR} \
NOCUSER=${NOCUSER} \
NOCGROUP=${NOCGROUP} \
NOCUID=${NOCUID} \
NOCGID=${NOCGID} \
LOCALSTATE_DIR=${LOCALSTATE_DIR}
SUB_FILES= pkg-install \
pkg-deinstall \
pkg-message
SUB_LIST= PREFIX=${PREFIX} \
${PLIST_SUB}
USE_RC_SUBR= noc.sh
NOC_CONF_FILES= etc/noc-activator.defaults \
etc/noc-classifier.defaults \
etc/noc-correlator.defaults \
etc/noc-fcgi.defaults \
etc/noc-launcher.defaults \
etc/noc-notifier.defaults \
etc/noc-sae.defaults \
etc/noc.defaults
post-patch:
@(cd ${WRKSRC}; \
${REINPLACE_CMD} -e "s@^\(pidfile *=\).*/\([^/]*.pid\)@\1 ${LOCALSTATE_DIR}/\2@" ${NOC_CONF_FILES}; \
${REINPLACE_CMD} -e "s@^\(repo *=\).*@\1 ${NOCDBDIR}/repo@" -e "s@^\(backup_dir *=\).*@\1 ${NOCDBDIR}/backup@" etc/noc.defaults; \
${REINPLACE_CMD} -e "s@^\(PREFIX=\"\).*@\1${NOCDIR}\"@" setup.py; \
_sed_script=`${MKTEMP} tmp.XXXXXX`; \
for cmd in telnet ssh rsync pg_dump tar gzip smidump smilint fping dig; do \
${ECHO} "s@^\\($${cmd} *\\)=.*\$$@\\1 = "`${WHICH} $${cmd}`'@' >> $${_sed_script} ; \
done; \
${REINPLACE_CMD} -f $${_sed_script} ${NOC_CONF_FILES}; \
${RM} $${_sed_script}; )
pre-install:
@${SH} ${PKGINSTALL} ${DISTNAME} PRE-INSTALL
post-install:
@${SH} ${PKGINSTALL} ${DISTNAME} POST-INSTALL
@${CAT} ${PKGMESSAGE}
.include <bsd.port.post.mk>

3
net-mgmt/noc/distinfo Normal file
View File

@ -0,0 +1,3 @@
MD5 (noc-0.2.7.tar.gz) = fdeadb104be5ec5906deb8b6776e1f9d
SHA256 (noc-0.2.7.tar.gz) = 010f7721c98fef6c22de8873610cdd4a23b3cf1c710464bff05196ba73256413
SIZE (noc-0.2.7.tar.gz) = 1024056

View File

@ -0,0 +1,57 @@
#!/bin/sh
#
# $FreeBSD$
#
# PROVIDE: noc
# REQUIRE: DAEMON %%RCLDCONFIG%%
# BEFORE: LOGIN
# KEYWORD: shutdown
#
# Add the following lines to /etc/rc.conf to enable noc:
# noc_enable (bool): Set to "NO" by default.
# Set it to "YES" to enable noc.
#
# You may also wish to use the following variables to fine-tune startup:
# noc_daemons="activator classifier correlator fcgi sae"
#
. %%RC_SUBR%%
name="noc"
rcvar=`set_rcvar`
# set defaults
load_rc_config $name
: ${noc_enable="NO"}
: ${noc_config="%%NOCDIR%%/etc/noc-launcher.conf"}
: ${noc_flags="-c ${noc_config}"}
noc_chdir=%%NOCDIR%%
command=%%NOCDIR%%/scripts/noc-launcher.py
command_interpreter=python
pidfile=%%LOCALSTATE_DIR%%/noc-launcher.pid
required_files=${noc_config}
command_args=$1
case "$command_args" in
force*)
command_args=${command_args#force};
;;
fast*)
command_args=${command_args#fast};
;;
restart)
command_args="stop"
run_rc_command "stop"
command_args="start"
run_rc_command "start"
exit 0
;;
esac
run_rc_command "$1"

View File

@ -0,0 +1,33 @@
--- scripts/post-install.orig 2009-07-29 18:22:59.000000000 +0700
+++ scripts/post-install 2009-07-29 18:25:16.000000000 +0700
@@ -5,7 +5,7 @@
## Copyright (C) 2007-2009 The NOC Project
## See LICENSE for details
##----------------------------------------------------------------------
-PREFIX=/opt/noc
+PREFIX=/usr/local/noc
cd $PREFIX
@@ -15,7 +15,7 @@ cd $PREFIX
sed_script=`mktemp tmp.XXXXXX`
rm $sed_script
for cmd in telnet ssh rsync pg_dump tar gzip smidump smilint fping dig; do
- echo 's@^\\($cmd *\\)=.*\$@\\1 = '`which $cmd`'@' >> $sed_script
+ echo "s@^\\($cmd *\\)=.*\$@\\1 = "`which $cmd`'@' >> $sed_script
done
##
@@ -30,10 +30,11 @@ done
rm $sed_script
chmod 640 etc/*.conf
chown noc:noc etc/*.conf
+chmod -R +r share/mibs/
##
## Create required directories
##
-for d in local static/doc /var/repo /var/backup /var/log/noc; do
+for d in local static/doc /var/db/noc /var/db/noc/repo /var/db/noc/backup /var/log/noc; do
[ ! -d $d ] && mkdir $d
chown noc:noc $d
done

View File

@ -0,0 +1,28 @@
#!/bin/sh
#
# $FreeBSD$
#
NOCDIR=%%NOCDIR%%
NOCDBDIR=%%NOCDBDIR%%
NOCUSER=%%NOCUSER%%
NOCGROUP=%%NOCGROUP%%
if [ "$2" = "POST-DEINSTALL" ]; then
if /usr/sbin/pw group show "${NOCGROUP}" 2>&1 >/dev/null; then
echo "You should manually remove the \"${NOCGROUP}\" group."
fi
if /usr/sbin/pw user show "${NOCUSER}" 2>&1 >/dev/null; then
echo "You should manually remove the \"${NOCUSER}\" user."
fi
##
## Remove created directories
##
for d in ${NOCDIR}/local ${NOCDIR}/static/doc ${NOCDIR} ${NOCDBDIR}/repo ${NOCDBDIR}/backup ${NOCDBDIR} /var/log/noc; do
if [ -e $d ]; then
echo "You should manually remove the \"${d}\" directory."
fi
done
fi

View File

@ -0,0 +1,114 @@
#!/bin/sh
#
# $FreeBSD$
#
NOCDIR=%%NOCDIR%%
NOCDBDIR=%%NOCDBDIR%%
NOCUSER=%%NOCUSER%%
NOCGROUP=%%NOCGROUP%%
NOCUID=%%NOCUID%%
NOCGID=%%NOCGID%%
LOCALSTATE_DIR=%%LOCALSTATE_DIR%%
ask() {
local question default answer
question=$1
default=$2
if [ -z "${PACKAGE_BUILDING}" ]; then
read -p "${question} [${default}]? " answer
fi
if [ "x${answer}" = "x" ]; then
answer=${default}
fi
echo ${answer}
}
yesno() {
local default question answer
question=$1
default=$2
while :; do
answer=$(ask "${question}" "${default}")
case "${answer}" in
[Yy][Ee][Ss]|[Yy])
return 0
;;
[Nn][Oo]|[Nn])
return 1
;;
esac
echo "Please answer yes or no."
done
}
if [ "$2" = "PRE-INSTALL" ]; then
if /usr/sbin/pw group show "${NOCGROUP}" 2>&1 >/dev/null; then
echo "You already have a \"${NOCGROUP}\" group, so I will use it."
else
echo "You need a \"${NOCGROUP}\" group."
if yesno "Would you like me to create it" "YES"; then
/usr/sbin/pw groupadd "${NOCGROUP}" -g "${NOCGID}" -h - || \
/usr/sbin/pw groupadd "${NOCGROUP}" -h - || exit
echo "Done."
else
echo "Please create the \"${NOCGROUP}\" group manually and try again."
exit 1
fi
fi
if /usr/sbin/pw user show "${NOCUSER}" 2>&1 >/dev/null; then
echo "You already have a \"${NOCUSER}\" user, so I will use it."
else
echo "You need a \"${NOCUSER}\" user."
if yesno "Would you like me to create it" "YES"; then
/usr/sbin/pw useradd "${NOCUSER}" -u "${NOCUID}" -g "${NOCGROUP}" -h - -d "${NOCDIR}" \
-c "NOC pseudo-user" || \
/usr/sbin/pw useradd "${NOCUSER}" -g "${NOCGROUP}" -h - -d "${NOCDIR}" \
-c "NOC pseudo-user" || exit
else
echo "Please create the \"${NOCUSER}\" user manually and try again."
exit 1
fi
fi
if ! [ -x ${NOCDIR} ] ; then
mkdir -p ${NOCDIR};
chown ${NOCUSER}:${NOCGROUP} ${NOCDIR}
fi
mkdir -p ${LOCALSTATE_DIR}
if [ ! -d ${LOCALSTATE_DIR} ] ; then
echo "Creating \"${LOCALSTATE_DIR}\" failed."
exit 1
fi
chown -R ${NOCUSER}:${NOCGROUP} ${LOCALSTATE_DIR}
fi
if [ "$2" = "POST-INSTALL" ]; then
##
## Copy default config files
##
for d in ${NOCDIR}/etc/*.defaults; do
conf=${d%%.defaults}.conf
if [ ! -f $conf ]; then
cp $d $conf
fi
done
##
## Fix privileges
##
chmod 640 ${NOCDIR}/etc/*.conf
chown ${NOCUSER}:${NOCGROUP} ${NOCDIR}/etc/*.conf
chmod -R +r ${NOCDIR}/share/mibs/
##
## Create required directories
##
for d in ${NOCDIR}/local ${NOCDIR}/static/doc ${NOCDBDIR}/repo ${NOCDBDIR}/backup /var/log/noc; do
[ ! -d $d ] && mkdir -p $d
chown -R ${NOCUSER}:${NOCGROUP} $d
done
fi

View File

@ -0,0 +1,20 @@
**********************************************************************
Enable NOC in /etc/rc.conf with the following line:
noc_enable="YES"
Configuration defaults are available in %%NOCDIR%%/etc as *.defaults
files. Copy them to *.cfg files where required and
edit to suit your needs.
Don't forget create DB in postgresql (see Documentation for NOC).
and run createlang after createdb:
createlang plpgsql noc
After create db (or if you updating from previous version) please
don't forget run following commnds under user '%%NOCUSER%%':
cd %%NOCDIR%%
./scripts/post-update
**********************************************************************

21
net-mgmt/noc/pkg-descr Normal file
View File

@ -0,0 +1,21 @@
NOC Project is an Operation Support System (OSS) for the Telco,
Service provider and Enterprise Network Operation Centers (NOC).
Areas covered by NOC:
* Fault Management
* Service Activation/Provisioning
* Knowledge Base
* Multi-VRF Address space management
* Virtual Circuits management (VLAN, DLCI, etc)
* Configuration Management
* DNS provisioning
* Peering management, RPSL and BGP filters generator, integrated
looking glass
* Reporting
NOC Project is distributed under the term of BSD-like LICENSE.
Enjoy!
The NOC Project Team
WWW: http://www.nocproject.org/

2122
net-mgmt/noc/pkg-plist Normal file

File diff suppressed because it is too large Load Diff