diff options
-rw-r--r-- | GIDs | 2 | ||||
-rw-r--r-- | UIDs | 2 | ||||
-rw-r--r-- | net-mgmt/Makefile | 1 | ||||
-rw-r--r-- | net-mgmt/prometheus/Makefile | 39 | ||||
-rw-r--r-- | net-mgmt/prometheus/distinfo | 3 | ||||
-rw-r--r-- | net-mgmt/prometheus/files/prometheus.in | 65 | ||||
-rw-r--r-- | net-mgmt/prometheus/pkg-descr | 19 |
7 files changed, 129 insertions, 2 deletions
@@ -419,7 +419,7 @@ nomad:*:472: # free: 475 # free: 476 # free: 477 -# free: 478 +prometheus:*:478: # free: 479 # free: 480 # free: 481 @@ -424,7 +424,7 @@ nomad:*:472:472::0:0:Nomad Daemon:/var/tmp/nomad:/usr/sbin/nologin # free: 475 # free: 476 # free: 477 -# free: 478 +prometheus:*:478:478::0:0:Prometheus Daemon:/var/tmp/prometheus:/usr/sbin/nologin # free: 479 # free: 480 # free: 481 diff --git a/net-mgmt/Makefile b/net-mgmt/Makefile index 73edcc854a32..3e8896415136 100644 --- a/net-mgmt/Makefile +++ b/net-mgmt/Makefile @@ -271,6 +271,7 @@ SUBDIR += pnp-icinga SUBDIR += pnp-icinga2 SUBDIR += portmon + SUBDIR += prometheus SUBDIR += py-flowtools SUBDIR += py-ipcalc SUBDIR += py-ipy diff --git a/net-mgmt/prometheus/Makefile b/net-mgmt/prometheus/Makefile new file mode 100644 index 000000000000..1b763ef39035 --- /dev/null +++ b/net-mgmt/prometheus/Makefile @@ -0,0 +1,39 @@ +# Created by: Jev Björsell <ports@ecadlabs.com> +# $FreeBSD$ + +PORTNAME= prometheus +PORTVERSION= 1.2.1 +DISTVERSIONPREFIX= v +CATEGORIES= net-mgmt + +MAINTAINER= ports@ecadlabs.com +COMMENT= Systems monitoring and alerting toolkit + +LICENSE= APACHE20 + +USES= go gmake +USE_GITHUB= yes + +GO_PKGNAME= github.com/${PORTNAME}/${PORTNAME} + +PLIST_FILES= bin/prometheus \ + bin/promtool \ + etc/prometheus.yml + +USE_RC_SUBR= prometheus + +USERS= prometheus +GROUPS= prometheus + +STRIP= # stripping can break go binaries + +do-build: + (cd ${GO_WRKSRC}/cmd/prometheus ; ${SETENV} ${GO_ENV} go install) + (cd ${GO_WRKSRC}/cmd/promtool ; ${SETENV} ${GO_ENV} go install) + +do-install: + ${INSTALL_PROGRAM} ${GO_WRKDIR_BIN}/prometheus ${STAGEDIR}${PREFIX}/bin + ${INSTALL_PROGRAM} ${GO_WRKDIR_BIN}/promtool ${STAGEDIR}${PREFIX}/bin + ${INSTALL_DATA} ${WRKSRC}/documentation/examples/prometheus.yml ${STAGEDIR}${LOCALBASE}/etc + +.include <bsd.port.mk> diff --git a/net-mgmt/prometheus/distinfo b/net-mgmt/prometheus/distinfo new file mode 100644 index 000000000000..0b5c9f835773 --- /dev/null +++ b/net-mgmt/prometheus/distinfo @@ -0,0 +1,3 @@ +TIMESTAMP = 1476506739 +SHA256 (prometheus-prometheus-v1.2.1_GH0.tar.gz) = d94b0904fde618ab1c9a2e1bec98da00bb9a29faf621db55dfa313346526f91a +SIZE (prometheus-prometheus-v1.2.1_GH0.tar.gz) = 2638657 diff --git a/net-mgmt/prometheus/files/prometheus.in b/net-mgmt/prometheus/files/prometheus.in new file mode 100644 index 000000000000..70c824e4984c --- /dev/null +++ b/net-mgmt/prometheus/files/prometheus.in @@ -0,0 +1,65 @@ +#!/bin/sh + +# PROVIDE: prometheus +# REQUIRE: LOGIN +# KEYWORD: shutdown +# +# Add the following lines to /etc/rc.conf.local or /etc/rc.conf +# to enable this service: +# +# prometheus_enable (bool): Set to NO by default +# Set it to YES to enable prometheus +# prometheus_user (string): Set user to run prometheus +# Default is "prometheus" +# prometheus_group (string): Set group to run prometheus +# Default is "prometheus" +# prometheus_data_dir (string): Set dir to run prometheus in +# Default is "/var/tmp/prometheus" +# prometheus_log_file (string): Set file that prometheus will log to +# Default is "/var/log/prometheus.log" +# prometheus_args (string): Set additional command line arguments +# Default is "" + +. /etc/rc.subr + +name=prometheus +rcvar=prometheus_enable + +load_rc_config $name + +: ${prometheus_enable:="NO"} +: ${prometheus_user:="prometheus"} +: ${prometheus_group:="prometheus"} +: ${prometheus_config:="%%PREFIX%%/etc/prometheus.yml"} +: ${prometheus_data_dir:="/var/db/prometheus"} +: ${prometheus_log_file:="/var/log/prometheus.log"} +: ${prometheus_args:=""} + +pidfile=/var/run/prometheus.pid +required_files="${prometheus_config}" +command="/usr/sbin/daemon" +procname="%%PREFIX%%/bin/prometheus" +sig_reload=HUP +extra_commands="reload" +command_args="-p ${pidfile} /usr/bin/env ${procname} \ + -config.file=${prometheus_config} \ + -storage.local.path=${prometheus_data_dir} \ + ${prometheus_args} > ${prometheus_log_file} 2>&1" + +start_precmd=prometheus_startprecmd + +prometheus_startprecmd() +{ + if [ ! -e ${pidfile} ]; then + install -o ${prometheus_user} -g ${prometheus_group} /dev/null ${pidfile}; + fi + if [ ! -f "${prometheus_log_file}" ]; then + install -o ${prometheus_user} -g ${prometheus_group} -m 640 /dev/null ${prometheus_log_file}; + fi + if [ ! -d ${prometheus_data_dir} ]; then + install -d -o ${prometheus_user} -g ${prometheus_group} -m 750 ${prometheus_data_dir} + fi +} + +load_rc_config $name +run_rc_command "$1" diff --git a/net-mgmt/prometheus/pkg-descr b/net-mgmt/prometheus/pkg-descr new file mode 100644 index 000000000000..6a5c6ed1d6b3 --- /dev/null +++ b/net-mgmt/prometheus/pkg-descr @@ -0,0 +1,19 @@ +Prometheus is a systems and service monitoring system. It collects metrics +from configured targets at given intervals, evaluates rule expressions, +displays the results, and can trigger alerts if some condition is observed +to be true. + +Prometheus' main distinguishing features as compared to other monitoring +systems are: + +- a multi-dimensional data model (timeseries defined by metric name and + set of key/value dimensions) +- a flexible query language to leverage this dimensionality +- no dependency on distributed storage; single server nodes are autonomous +- timeseries collection happens via a pull model over HTTP +- pushing timeseries is supported via an intermediary gateway +- targets are discovered via service discovery or static configuration +- multiple modes of graphing and dashboarding support +- support for hierarchical and horizontal federation + +WWW: https://prometheus.io/ |