Date: Mon, 17 Jul 2017 22:10:39 +0000 (UTC) From: Boris Samorodov <bsam@FreeBSD.org> To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r446120 - in head/net-mgmt: . mysqld_exporter mysqld_exporter/files Message-ID: <201707172210.v6HMAdar081246@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: bsam Date: Mon Jul 17 22:10:38 2017 New Revision: 446120 URL: https://svnweb.freebsd.org/changeset/ports/446120 Log: 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> Added: head/net-mgmt/mysqld_exporter/ head/net-mgmt/mysqld_exporter/Makefile (contents, props changed) head/net-mgmt/mysqld_exporter/distinfo (contents, props changed) head/net-mgmt/mysqld_exporter/files/ head/net-mgmt/mysqld_exporter/files/mysqld_exporter.in (contents, props changed) head/net-mgmt/mysqld_exporter/pkg-descr (contents, props changed) Modified: head/net-mgmt/Makefile Modified: head/net-mgmt/Makefile ============================================================================== --- head/net-mgmt/Makefile Mon Jul 17 21:47:58 2017 (r446119) +++ head/net-mgmt/Makefile Mon Jul 17 22:10:38 2017 (r446120) @@ -122,6 +122,7 @@ SUBDIR += mrtg SUBDIR += mrtg-ping-probe SUBDIR += mtrace + SUBDIR += mysqld_exporter SUBDIR += nagcon SUBDIR += nagios SUBDIR += nagios-certexp-plugin Added: head/net-mgmt/mysqld_exporter/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/net-mgmt/mysqld_exporter/Makefile Mon Jul 17 22:10:38 2017 (r446120) @@ -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> Added: head/net-mgmt/mysqld_exporter/distinfo ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/net-mgmt/mysqld_exporter/distinfo Mon Jul 17 22:10:38 2017 (r446120) @@ -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 Added: head/net-mgmt/mysqld_exporter/files/mysqld_exporter.in ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/net-mgmt/mysqld_exporter/files/mysqld_exporter.in Mon Jul 17 22:10:38 2017 (r446120) @@ -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" Added: head/net-mgmt/mysqld_exporter/pkg-descr ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/net-mgmt/mysqld_exporter/pkg-descr Mon Jul 17 22:10:38 2017 (r446120) @@ -0,0 +1,3 @@ +node_exporter is a prometheus exporter for MySQL server metrics + +WWW: https://github.com/prometheus/mysqld_exporter
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201707172210.v6HMAdar081246>