diff options
author | Ryan Steinmetz <zi@FreeBSD.org> | 2014-02-20 21:06:43 +0000 |
---|---|---|
committer | Ryan Steinmetz <zi@FreeBSD.org> | 2014-02-20 21:06:43 +0000 |
commit | 5ef19f08db0658e2e64d26c3fa5f675774a00085 (patch) | |
tree | 95888d8b271b7c8f407010de392021f0559c0177 /net/exaddos/files | |
parent | 368b76e735a9fe5a89184d482e8e64184647aec0 (diff) |
Notes
Diffstat (limited to 'net/exaddos/files')
-rw-r--r-- | net/exaddos/files/exaddos.conf.sample.in | 75 | ||||
-rw-r--r-- | net/exaddos/files/exaddos.in | 58 | ||||
-rw-r--r-- | net/exaddos/files/exaddos.sh.in | 16 | ||||
-rw-r--r-- | net/exaddos/files/pkg-message.in | 4 |
4 files changed, 153 insertions, 0 deletions
diff --git a/net/exaddos/files/exaddos.conf.sample.in b/net/exaddos/files/exaddos.conf.sample.in new file mode 100644 index 000000000000..9b17f16024f3 --- /dev/null +++ b/net/exaddos/files/exaddos.conf.sample.in @@ -0,0 +1,75 @@ +[exaddos.daemon] +daemonize = true +user = 'exaddos' +pidfile = '/var/run/exaddos/exaddos.pid' + +[exaddos.http] +host = '127.0.0.1' +port = 8080 + +[exaddos.ipfix] +host = '127.0.0.1' +port = 29300 + + +[exaddos.location] +database = '/var/db/exaddos/exaddos.sqlite3' +html = '%%PREFIX%%/www/exaddos/html' + +[exaddos.profile] +destination = 'stdout' +enable = false + +# threshold: expressed in pps + +[exaddos.PEER1] +router = '127.0.0.2' +snmp_version = 2 +snmp_password = 'secret' +snmp_frequency = 10 +snmp_index_port = 120 +snmp_index_vlan = 100 +threshold_bandwidth = 104857600 +threshold_unicast = 120000 +threshold_notunicast = 1500 + + +[exaddos.PEER2] +router = '127.0.0.2' +snmp_version = 2 +snmp_password = 'secret' +snmp_frequency = 10 +snmp_index_port = 120 +snmp_index_vlan = 110 +threshold_bandwidth = 104857600 +threshold_unicast = 120000 +threshold_notunicast = 1500 + + +[exaddos.TRANSIT1] +router = '127.0.0.3' +location = 'datacenter' +snmp_version = 2 +snmp_password = 'secret' +snmp_frequency = 10 +snmp_index_port = 220 +snmp_index_vlan = 140 +threshold_bandwidth = 104857600 +threshold_unicast = 120000 +threshold_notunicast = 1500 + + +[exaddos.router] +router = '192.0.2.123' +snmp_version = 3 +snmp_user = 'exaddos' +snmp_auth_method = 'SHA' +snmp_auth_key = 'pass7faYDFagREF6DasdG' +snmp_privacy_method = 'AES-128' +snmp_privacy_key = 'privTasvRT3gfg4GFsGHV' +snmp_frequency = 10 +snmp_index_port = 520 +snmp_index_vlan = 573 +threshold_bandwidth = 524288000 +threshold_unicast = 120000 +threshold_notunicast = 1500 diff --git a/net/exaddos/files/exaddos.in b/net/exaddos/files/exaddos.in new file mode 100644 index 000000000000..48bdc4f99ec1 --- /dev/null +++ b/net/exaddos/files/exaddos.in @@ -0,0 +1,58 @@ +#!/bin/sh + +# $FreeBSD$ +# +# PROVIDE: exaddos +# REQUIRE: LOGIN +# KEYWORD: shutdown +# +# Add the following line(s) to /etc/rc.conf to enable exaddos: +# +# exaddos_enable="YES" + +. /etc/rc.subr + +name=exaddos +rcvar=exaddos_enable + +load_rc_config $name + +exaddos_enable=${exaddos_enable:-"NO"} +exaddos_conf=${exaddos_conf:-"%%ETCDIR%%/exaddos.conf"} + +pidfile=/var/run/${name}/${name}.pid + +required_files=${exaddos_conf} + +command="%%PYTHON_SITELIBDIR%%/${name}/application.py" +procname="%%PYTHON_CMD%%" + +start_cmd="exaddos_start" +reload_all_cmd="exaddos_reload_all" +extra_commands="reload reload_all" +sig_reload="USR1" + +exaddos_start() +{ + if [ -z "$rc_fast" -a -n "$rc_pid" ]; then + echo 1>&2 "${name} already running? (pid=$rc_pid)." + return 1 + fi + + echo "Starting ${name}." + + install -d -o exaddos -g exaddos -m 755 /var/run/${name} + install -d -o exaddos -g exaddos -m 750 /var/db/${name} + rm -f ${pidfile} + + ${procname} -m exaddos.debug ${command} -c ${exaddos_conf} +} + +exaddos_reload_all() +{ + echo "Reloading exaddos configuration and processes." + kill -USR2 $rc_pid +} + + +run_rc_command "$1" diff --git a/net/exaddos/files/exaddos.sh.in b/net/exaddos/files/exaddos.sh.in new file mode 100644 index 000000000000..990fe482c39a --- /dev/null +++ b/net/exaddos/files/exaddos.sh.in @@ -0,0 +1,16 @@ +#!/bin/sh + +export PYTHONPATH=%%PYTHON_LIBDIR%%:%%PYTHON_SITELIBDIR%%/exaddos:%%PYTHON_SITELIBDIR%%/exaddos/lib + +INTERPRETER=%%PYTHON_CMD%% + +APPLICATIONS=`$INTERPRETER -c "import sys,os; print ' '.join(os.path.join(_,'exaddos','application.py') for _ in sys.path if os.path.isfile('/'.join((_,'exaddos','application.py'))))"` +APPLICATION=`echo $APPLICATIONS | awk '{ print $1; }'` + +if [ $# -eq 0 ]; then + $INTERPRETER -m exaddos.debug $APPLICATION -c %%PREFIX%%/etc/exaddos.conf --help + echo "===> To start exaddos, you should use:" + echo "===> service exaddos start" +else + exec $INTERPRETER -m exaddos.debug $APPLICATION -c %%PREFIX%%/etc/exaddos.conf $* +fi diff --git a/net/exaddos/files/pkg-message.in b/net/exaddos/files/pkg-message.in new file mode 100644 index 000000000000..e23edfad6935 --- /dev/null +++ b/net/exaddos/files/pkg-message.in @@ -0,0 +1,4 @@ +=========================================================================== +Please edit %%ETCDIR%%/exaddos.conf based on one of the examples and +add exaddos_enable="YES" to /etc/rc.conf +=========================================================================== |