Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 23 Nov 2019 11:35:41 +0000 (UTC)
From:      Mateusz Piotrowski <0mp@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r518221 - in head/net-mgmt: . mysql-snmp mysql-snmp/files
Message-ID:  <201911231135.xANBZgH0062444@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: 0mp
Date: Sat Nov 23 11:35:41 2019
New Revision: 518221
URL: https://svnweb.freebsd.org/changeset/ports/518221

Log:
  New port: net-mgmt/mysql-snmp: Net-SNMP Perl agent for monitoring MySQL servers
  
  mysql-snmp is a MySQL Net-SNMP agent written in Perl, and using the
  Net-SNMP Perl bindings.
  
  It connects to a MySQL server and returns information to Net-SNMP when
  needed.  It parses SHOW INNODB STATUS and other MySQL status variables.
  
  WWW: https://github.com/masterzen/mysql-snmp
  
  Reported by:	mwlucas
  Reviewed by:	danfe
  Differential Revision:	https://reviews.freebsd.org/D22480

Added:
  head/net-mgmt/mysql-snmp/
  head/net-mgmt/mysql-snmp/Makefile   (contents, props changed)
  head/net-mgmt/mysql-snmp/distinfo   (contents, props changed)
  head/net-mgmt/mysql-snmp/files/
  head/net-mgmt/mysql-snmp/files/mysql-snmp.in   (contents, props changed)
  head/net-mgmt/mysql-snmp/pkg-descr   (contents, props changed)
  head/net-mgmt/mysql-snmp/pkg-plist   (contents, props changed)
Modified:
  head/net-mgmt/Makefile

Modified: head/net-mgmt/Makefile
==============================================================================
--- head/net-mgmt/Makefile	Sat Nov 23 11:08:06 2019	(r518220)
+++ head/net-mgmt/Makefile	Sat Nov 23 11:35:41 2019	(r518221)
@@ -132,6 +132,7 @@
     SUBDIR += mrtg
     SUBDIR += mrtg-ping-probe
     SUBDIR += mtrace
+    SUBDIR += mysql-snmp
     SUBDIR += mysqld_exporter
     SUBDIR += nagcon
     SUBDIR += nagios

Added: head/net-mgmt/mysql-snmp/Makefile
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/net-mgmt/mysql-snmp/Makefile	Sat Nov 23 11:35:41 2019	(r518221)
@@ -0,0 +1,54 @@
+# $FreeBSD$
+
+PORTNAME=	mysql-snmp
+DISTVERSIONPREFIX=	v
+DISTVERSION=	1.2-17
+DISTVERSIONSUFFIX=	-g1d0b409
+CATEGORIES=	net-mgmt perl5
+
+MAINTAINER=	0mp@FreeBSD.org
+COMMENT=	Net-SNMP Perl agent for monitoring MySQL servers
+
+LICENSE=	GPLv2+
+LICENSE_FILE=	${WRKSRC}/COPYING
+
+RUN_DEPENDS=	net-snmp>=0:net-mgmt/net-snmp \
+		p5-DBD-mysql>=0:databases/p5-DBD-mysql \
+		p5-DBI>=0:databases/p5-DBI \
+		p5-Math-BigInt-GMP>=0:math/p5-Math-BigInt-GMP \
+		p5-Net-SNMP>=5.4.3:net-mgmt/p5-Net-SNMP \
+		p5-Unix-Syslog>=0:sysutils/p5-Unix-Syslog
+
+USES=		perl5 shebangfix
+USE_GITHUB=	yes
+GH_ACCOUNT=	masterzen
+USE_PERL5=	run test
+USE_RC_SUBR=	mysql-snmp
+SHEBANG_FILES=	mysql-snmp opennms/* tests/test.pl
+
+NO_ARCH=	yes
+NO_BUILD=	yes
+SUB_LIST=	PERL=${PERL}
+
+OPTIONS_DEFINE=	DOCS
+
+do-install:
+	${INSTALL_SCRIPT} ${WRKSRC}/mysql-snmp ${STAGEDIR}${PREFIX}/sbin
+	@${MKDIR} ${STAGEDIR}${PREFIX}/share/snmp/mibs
+	${INSTALL_DATA} ${WRKSRC}/MYSQL-SERVER-MIB.txt \
+		${STAGEDIR}${PREFIX}/share/snmp/mibs
+	${INSTALL_MAN} ${WRKSRC}/mysql-snmp.1 ${STAGEDIR}${MAN1PREFIX}/man/man1
+	@${MKDIR} ${STAGEDIR}${DATADIR}
+	(cd ${WRKSRC} && ${COPYTREE_SHARE} opennms ${STAGEDIR}/${DATADIR})
+	@${MKDIR} ${STAGEDIR}${ETCDIR}
+	${INSTALL_DATA} ${WRKSRC}/my.cnf ${STAGEDIR}${ETCDIR}/my.cnf.sample
+
+post-install-DOCS-on:
+	@${MKDIR} ${STAGEDIR}${DOCSDIR}
+	${INSTALL_DATA} ${WRKSRC}/README ${STAGEDIR}${DOCSDIR}
+
+do-test:
+	@(cd ${WRKSRC} && \
+		${SETENV} ${TEST_ENV} ${PERL5} -I ${STAGEDIR}${PREFIX}/sbin ./tests/test.pl)
+
+.include <bsd.port.mk>

Added: head/net-mgmt/mysql-snmp/distinfo
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/net-mgmt/mysql-snmp/distinfo	Sat Nov 23 11:35:41 2019	(r518221)
@@ -0,0 +1,3 @@
+TIMESTAMP = 1574345554
+SHA256 (masterzen-mysql-snmp-v1.2-17-g1d0b409_GH0.tar.gz) = ade77cefeb835650bfc3859bcb91c341f83394e38c5434f0fc4b4e5fab47585d
+SIZE (masterzen-mysql-snmp-v1.2-17-g1d0b409_GH0.tar.gz) = 59825

Added: head/net-mgmt/mysql-snmp/files/mysql-snmp.in
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/net-mgmt/mysql-snmp/files/mysql-snmp.in	Sat Nov 23 11:35:41 2019	(r518221)
@@ -0,0 +1,33 @@
+#! /bin/sh -
+
+# $FreeBSD$
+#
+# PROVIDE: mysql-snmp
+# REQUIRE: DAEMON mysql
+# KEYWORD: shutdown
+#
+# Add these lines to /etc/rc.conf.local or /etc/rc.conf
+# to enable this service:
+#
+# mysql_snmp_enable (bool):	Set to NO by default.
+#				Set it to YES to enable mysql_snmp.
+# mysql_snmp_config (path):	Set to %%ETCDIR%%/my.cnf
+#				by default.
+
+. /etc/rc.subr
+
+name="mysql_snmp"
+rcvar="mysql_snmp_enable"
+
+load_rc_config "$name"
+
+: ${mysql_snmp_enable:="NO"}
+: ${mysql_snmp_config="%%ETCDIR%%/my.cnf"}
+
+command_interpreter="%%PERL%%"
+command="%%PREFIX%%/sbin/mysql-snmp"
+pidfile="/var/run/mysql-snmp.pid"
+
+command_args="--config $mysql_snmp_config"
+
+run_rc_command "$1"

Added: head/net-mgmt/mysql-snmp/pkg-descr
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/net-mgmt/mysql-snmp/pkg-descr	Sat Nov 23 11:35:41 2019	(r518221)
@@ -0,0 +1,7 @@
+mysql-snmp is a MySQL Net-SNMP agent written in Perl, and using the Net-SNMP
+Perl bindings.
+
+It connects to a MySQL server and returns information to Net-SNMP when needed.
+It parses SHOW INNODB STATUS and other MySQL status variables.
+
+WWW: https://github.com/masterzen/mysql-snmp

Added: head/net-mgmt/mysql-snmp/pkg-plist
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/net-mgmt/mysql-snmp/pkg-plist	Sat Nov 23 11:35:41 2019	(r518221)
@@ -0,0 +1,11 @@
+@mode 600
+@sample %%ETCDIR%%/my.cnf.sample
+@mode
+man/man1/mysql-snmp.1.gz
+sbin/mysql-snmp
+%%PORTDOCS%%%%DOCSDIR%%/README
+%%DATADIR%%/opennms/mysql.datacollection-config.xml
+%%DATADIR%%/opennms/mysql.snmp-graph.properties
+%%DATADIR%%/opennms/tools/cacti2MIB.pl
+%%DATADIR%%/opennms/tools/cacti2opennms.pl
+share/snmp/mibs/MYSQL-SERVER-MIB.txt



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201911231135.xANBZgH0062444>