Index: net-mgmt/mysql-snmp/Makefile =================================================================== --- /dev/null +++ net-mgmt/mysql-snmp/Makefile @@ -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 Index: net-mgmt/mysql-snmp/distinfo =================================================================== --- /dev/null +++ net-mgmt/mysql-snmp/distinfo @@ -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 Index: net-mgmt/mysql-snmp/files/mysql-snmp.in =================================================================== --- /dev/null +++ net-mgmt/mysql-snmp/files/mysql-snmp.in @@ -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" Index: net-mgmt/mysql-snmp/pkg-descr =================================================================== --- /dev/null +++ net-mgmt/mysql-snmp/pkg-descr @@ -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 Index: net-mgmt/mysql-snmp/pkg-plist =================================================================== --- /dev/null +++ net-mgmt/mysql-snmp/pkg-plist @@ -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