diff options
-rw-r--r-- | GIDs | 1 | ||||
-rw-r--r-- | UIDs | 1 | ||||
-rw-r--r-- | net-mgmt/Makefile | 1 | ||||
-rw-r--r-- | net-mgmt/statsd/Makefile | 40 | ||||
-rw-r--r-- | net-mgmt/statsd/distinfo | 2 | ||||
-rw-r--r-- | net-mgmt/statsd/files/statsd.in | 40 | ||||
-rw-r--r-- | net-mgmt/statsd/pkg-descr | 5 | ||||
-rw-r--r-- | net-mgmt/statsd/pkg-plist | 19 |
8 files changed, 109 insertions, 0 deletions
@@ -199,6 +199,7 @@ jenkins:*:818: openacs:*:820: dotlrn:*:821: polw:*:825: +statsd:*:826: netdisco:*:840: munin:*:842: dahdi:*:843:asterisk @@ -206,6 +206,7 @@ jenkins:*:818:818::0:0:Jenkins CI:/usr/local/jenkins:/bin/sh openacs:*:820:820::0:0:OpenACS Daemon User:/nonexistent:/usr/sbin/nologin dotlrn:*:821:821::0:0:.LRN Daemon User:/nonexistent:/usr/sbin/nologin polw:*:825:825::0:0:Policyd-weight Cache Owner:/nonexistent:/sbin/nologin +statsd:*:826:826::0:0:Statsd Daemon:/nonexistent:/sbin/nologin netdisco:*:840:840::0:0:netdisco daemon:/nonexistent:/usr/sbin/nologin munin:*:842:842::0:0:Munin:/var/munin:/usr/sbin/nologin fossy:*:901:901::0:0:FOSSology user:/usr/local/share/fossology:/usr/local/bin/bash diff --git a/net-mgmt/Makefile b/net-mgmt/Makefile index ab5fb0e2de5b..60bc8cf0d80a 100644 --- a/net-mgmt/Makefile +++ b/net-mgmt/Makefile @@ -307,6 +307,7 @@ SUBDIR += softflowd SUBDIR += spectools SUBDIR += ssgless + SUBDIR += statsd SUBDIR += subcalc SUBDIR += sysmon SUBDIR += tcpreplay diff --git a/net-mgmt/statsd/Makefile b/net-mgmt/statsd/Makefile new file mode 100644 index 000000000000..14d5a69c5135 --- /dev/null +++ b/net-mgmt/statsd/Makefile @@ -0,0 +1,40 @@ +# $FreeBSD$ + +PORTNAME= statsd +PORTVERSION= 0.7.0 +CATEGORIES= net-mgmt +MASTER_SITES= https://github.com/etsy/${PORTNAME}/archive/v${PORTVERSION}.tar.gz?dummy=/ + +MAINTAINER= kimor79@yahoo.com +COMMENT= Simple daemon for easy stats aggregation + +RUN_DEPENDS= node:${PORTSDIR}/www/node + +NO_BUILD= yes +FETCH_ARGS= -Fpr + +USERS= statsd +GROUPS= statsd +USE_RC_SUBR= statsd +SUB_FILES+= statsd +SUB_LIST+= USERS=${USERS} GROUPS=${GROUPS} + +post-patch: + @${REINPLACE_CMD} \ + -e 's;\./;${DATADIR}/;' \ + ${WRKSRC}/stats.js + +do-install: + ${MKDIR} ${STAGEDIR}${DATADIR}/backends + (cd ${WRKSRC}/backends/ && ${COPYTREE_SHARE} \* ${STAGEDIR}${DATADIR}/backends) + ${MKDIR} ${STAGEDIR}${DATADIR}/lib + (cd ${WRKSRC}/lib/ && ${COPYTREE_SHARE} \* ${STAGEDIR}${DATADIR}/lib) + ${CP} ${WRKSRC}/exampleConfig.js ${STAGEDIR}${DATADIR}/exampleConfig.js + ${CP} ${WRKSRC}/exampleProxyConfig.js ${STAGEDIR}${DATADIR}/exampleProxyConfig.js + ${CP} ${WRKSRC}/stats.js ${STAGEDIR}${DATADIR}/stats.js + +post-install: + @${INSTALL_DATA} ${WRKSRC}/exampleConfig.js \ + ${STAGEDIR}${PREFIX}/etc/statsd.js.sample + +.include <bsd.port.mk> diff --git a/net-mgmt/statsd/distinfo b/net-mgmt/statsd/distinfo new file mode 100644 index 000000000000..8b23bfc02333 --- /dev/null +++ b/net-mgmt/statsd/distinfo @@ -0,0 +1,2 @@ +SHA256 (statsd-0.7.0.tar.gz) = a398f08eac233e5d58b11d22febd2afee7d27f89112d97fe0035eda77aee065e +SIZE (statsd-0.7.0.tar.gz) = 51073 diff --git a/net-mgmt/statsd/files/statsd.in b/net-mgmt/statsd/files/statsd.in new file mode 100644 index 000000000000..73d791e2cc17 --- /dev/null +++ b/net-mgmt/statsd/files/statsd.in @@ -0,0 +1,40 @@ +#!/bin/sh +# +# $FreeBSD$ +# + +# PROVIDE: statsd +# REQUIRE: NETWORK +# KEYWORD: shutdown + +# +# Add the following line to /etc/rc.conf to enable mysql: +# statsd_enable (bool): Set to "NO" by default. +# Set it to "YES" to enable statsd. +# statsd_config (str): Default to "%%PREFIX%%/etc/statsd.js" +# Statsd configuration file. +# statsd_user (str): Default to "statsd". +# User to run as. + +. /etc/rc.subr + +name=statsd +rcvar=statsd_enable +load_rc_config $name + +# set defaults +: ${statsd_enable:=NO} +: ${statsd_config="%%PREFIX%%/etc/statsd.js"} +: ${statsd_user="%%USERS%%"} + +pidfile="/var/run/statsd/${name}.pid" + +required_files="${statsd_config}" + +command=/usr/sbin/daemon +command_args="-cf -p ${pidfile} %%PREFIX%%/bin/node %%DATADIR%%/stats.js ${statsd_config}" +procname="${name}" +stop_postcmd="rm -f $pidfile" +start_precmd="install -d -o statsd -g statsd ${pidfile%/*}" + +run_rc_command "$1" diff --git a/net-mgmt/statsd/pkg-descr b/net-mgmt/statsd/pkg-descr new file mode 100644 index 000000000000..45801be007d0 --- /dev/null +++ b/net-mgmt/statsd/pkg-descr @@ -0,0 +1,5 @@ +A network daemon that runs on the Node.js platform and listens for statistics, +like counters and timers, sent over UDP and sends aggregates to one or more +pluggable backend services (e.g., Graphite). + +WWW: https://github.com/etsy/statsd diff --git a/net-mgmt/statsd/pkg-plist b/net-mgmt/statsd/pkg-plist new file mode 100644 index 000000000000..980e97d9249f --- /dev/null +++ b/net-mgmt/statsd/pkg-plist @@ -0,0 +1,19 @@ +%%DATADIR%%/backends/console.js +%%DATADIR%%/backends/graphite.js +%%DATADIR%%/backends/repeater.js +%%DATADIR%%/exampleConfig.js +%%DATADIR%%/exampleProxyConfig.js +%%DATADIR%%/lib/config.js +%%DATADIR%%/lib/helpers.js +%%DATADIR%%/lib/logger.js +%%DATADIR%%/lib/mgmt_console.js +%%DATADIR%%/lib/process_metrics.js +%%DATADIR%%/lib/process_mgmt.js +%%DATADIR%%/lib/set.js +%%DATADIR%%/stats.js +@unexec if cmp -s %D/etc/statsd.js.sample %D/etc/statsd.js; then rm -f %D/etc/statsd.js; fi +etc/statsd.js.sample +@exec [ -f %B/statsd.js ] || cp %B/%f %B/statsd.js +@dirrmtry %%DATADIR%%/lib +@dirrmtry %%DATADIR%%/backends +@dirrmtry %%DATADIR%% |