diff options
author | Boris Samorodov <bsam@FreeBSD.org> | 2017-07-17 22:10:38 +0000 |
---|---|---|
committer | Boris Samorodov <bsam@FreeBSD.org> | 2017-07-17 22:10:38 +0000 |
commit | 948534935c446d9a11adcc95cba59aceb8666368 (patch) | |
tree | 2e1a207dd901197186ce7f0ea64ba44b0f2da508 /net-mgmt | |
parent | emulators/rpcs3: update to 0.0.2.463 (diff) |
node_exporter is a prometheus exporter for MySQL server metrics
WWW: https://github.com/prometheus/mysqld_exporter
PR: 219742
Submitted by: Alexey Bobkov <mr.deadlystorm@gmail.com>
Notes
Notes:
svn path=/head/; revision=446120
Diffstat (limited to 'net-mgmt')
-rw-r--r-- | net-mgmt/Makefile | 1 | ||||
-rw-r--r-- | net-mgmt/mysqld_exporter/Makefile | 31 | ||||
-rw-r--r-- | net-mgmt/mysqld_exporter/distinfo | 3 | ||||
-rw-r--r-- | net-mgmt/mysqld_exporter/files/mysqld_exporter.in | 65 | ||||
-rw-r--r-- | net-mgmt/mysqld_exporter/pkg-descr | 3 |
5 files changed, 103 insertions, 0 deletions
diff --git a/net-mgmt/Makefile b/net-mgmt/Makefile index 48d418f49dfc..7dda9bb23ac5 100644 --- a/net-mgmt/Makefile +++ b/net-mgmt/Makefile @@ -122,6 +122,7 @@ SUBDIR += mrtg SUBDIR += mrtg-ping-probe SUBDIR += mtrace + SUBDIR += mysqld_exporter SUBDIR += nagcon SUBDIR += nagios SUBDIR += nagios-certexp-plugin diff --git a/net-mgmt/mysqld_exporter/Makefile b/net-mgmt/mysqld_exporter/Makefile new file mode 100644 index 000000000000..7b9db9b1e75f --- /dev/null +++ b/net-mgmt/mysqld_exporter/Makefile @@ -0,0 +1,31 @@ +# Created by: Alexey Bobkov <mr.deadlystorm@gmail.com> +# $FreeBSD$ + +PORTNAME= mysqld_exporter +PORTVERSION= 0.10.0 +DISTVERSIONPREFIX=v +CATEGORIES= net-mgmt + +MAINTAINER= mr.deadlystorm@gmail.com +COMMENT= Prometheus exporter for MySQL server metrics + +LICENSE= APACHE20 + +USES= go +USE_GITHUB= yes + +GH_ACCOUNT= prometheus + +GO_PKGNAME= github.com/${GH_ACCOUNT}/${PORTNAME} +GO_TARGET= github.com/${GH_ACCOUNT}/${PORTNAME} + +PLIST_FILES= bin/mysqld_exporter + +USE_RC_SUBR= mysqld_exporter + +STRIP= # stripping can break go binaries + +do-install: + ${INSTALL_PROGRAM} ${WRKDIR}/bin/mysqld_exporter ${STAGEDIR}${PREFIX}/bin + +.include <bsd.port.mk> diff --git a/net-mgmt/mysqld_exporter/distinfo b/net-mgmt/mysqld_exporter/distinfo new file mode 100644 index 000000000000..428c9d474b0e --- /dev/null +++ b/net-mgmt/mysqld_exporter/distinfo @@ -0,0 +1,3 @@ +TIMESTAMP = 1495846408 +SHA256 (prometheus-mysqld_exporter-v0.10.0_GH0.tar.gz) = e32779c8dc0880784599d855310496f1a53641f008efb3be4332c46b12810f53 +SIZE (prometheus-mysqld_exporter-v0.10.0_GH0.tar.gz) = 971604 diff --git a/net-mgmt/mysqld_exporter/files/mysqld_exporter.in b/net-mgmt/mysqld_exporter/files/mysqld_exporter.in new file mode 100644 index 000000000000..512b65f91cd3 --- /dev/null +++ b/net-mgmt/mysqld_exporter/files/mysqld_exporter.in @@ -0,0 +1,65 @@ +#!/bin/sh + +# PROVIDE: mysqld_exporter +# REQUIRE: LOGIN +# KEYWORD: shutdown +# +# Add the following lines to /etc/rc.conf.local or /etc/rc.conf +# to enable this service: +# +# mysqld_exporter_enable (bool): Set to NO by default. +# Set it to YES to enable mysqld_exporter. +# mysqld_exporter_user (string): Set user that mysqld_exporter will run under +# Default is "nobody". +# mysqld_exporter_group (string): Set group that mysqld_exporter will run under +# Default is "nobody". +# mysqld_exporter_args (string): Set extra arguments to pass to mysqld_exporter +# Default is "". +# mysqld_exporter_listen_address (string):Set ip:port that mysqld_exporter will listen on +# Default is ":9100". +# mysqld_exporter_conffile (string): Set configuration file path for mysqld_exporter +# Default is "". + +. /etc/rc.subr + +name=mysqld_exporter +rcvar=mysqld_exporter_enable + +load_rc_config $name + +: ${mysqld_exporter_enable:="NO"} +: ${mysqld_exporter_user:="nobody"} +: ${mysqld_exporter_group:="nobody"} +: ${mysqld_exporter_args:=""} +: ${mysqld_exporter_listen_address:=":9104"} +if [ -f "%%ETCDIR%%/my.cnf" ]; then +: ${mysqld_exporter_conffile:="%%ETCDIR%%/my.cnf"} +else +: ${mysqld_exporter_conffile:=""} +fi + +if [ -z ${mysqld_exporter_conffile} ]; then +conf_arg="" +else +conf_arg="-config.my-cnf=${mysqld_exporter_conffile}" +fi + +pidfile=/var/run/mysqld_exporter.pid +command="/usr/sbin/daemon" +procname="%%PREFIX%%/bin/mysqld_exporter" +command_args="-p ${pidfile} /usr/bin/env ${procname} \ + -web.listen-address=${mysqld_exporter_listen_address} \ + ${conf_arg} \ + ${mysqld_exporter_args}" + +start_precmd=mysqld_exporter_startprecmd + +mysqld_exporter_startprecmd() +{ + if [ ! -e ${pidfile} ]; then + install -o ${mysqld_exporter_user} -g ${mysqld_exporter_group} /dev/null ${pidfile}; + fi +} + +load_rc_config $name +run_rc_command "$1" diff --git a/net-mgmt/mysqld_exporter/pkg-descr b/net-mgmt/mysqld_exporter/pkg-descr new file mode 100644 index 000000000000..2f4970de8152 --- /dev/null +++ b/net-mgmt/mysqld_exporter/pkg-descr @@ -0,0 +1,3 @@ +node_exporter is a prometheus exporter for MySQL server metrics + +WWW: https://github.com/prometheus/mysqld_exporter |