aboutsummaryrefslogtreecommitdiff
path: root/net-mgmt/mysql-snmp
diff options
context:
space:
mode:
authorMateusz Piotrowski <0mp@FreeBSD.org>2019-11-23 11:35:41 +0000
committerMateusz Piotrowski <0mp@FreeBSD.org>2019-11-23 11:35:41 +0000
commit9cc982b6bd148ff75ccb26d71ff2006bfbea60c2 (patch)
tree51bc2c46f195608447f277ee4a818418760623f2 /net-mgmt/mysql-snmp
parent551fa8d028a33d93be386623f65ff5ecc4adac91 (diff)
downloadports-9cc982b6bd148ff75ccb26d71ff2006bfbea60c2.tar.gz
ports-9cc982b6bd148ff75ccb26d71ff2006bfbea60c2.zip
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
Notes
Notes: svn path=/head/; revision=518221
Diffstat (limited to 'net-mgmt/mysql-snmp')
-rw-r--r--net-mgmt/mysql-snmp/Makefile54
-rw-r--r--net-mgmt/mysql-snmp/distinfo3
-rw-r--r--net-mgmt/mysql-snmp/files/mysql-snmp.in33
-rw-r--r--net-mgmt/mysql-snmp/pkg-descr7
-rw-r--r--net-mgmt/mysql-snmp/pkg-plist11
5 files changed, 108 insertions, 0 deletions
diff --git a/net-mgmt/mysql-snmp/Makefile b/net-mgmt/mysql-snmp/Makefile
new file mode 100644
index 000000000000..6b5f78cca21f
--- /dev/null
+++ b/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 <bsd.port.mk>
diff --git a/net-mgmt/mysql-snmp/distinfo b/net-mgmt/mysql-snmp/distinfo
new file mode 100644
index 000000000000..0e2b2b529a7c
--- /dev/null
+++ b/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
diff --git a/net-mgmt/mysql-snmp/files/mysql-snmp.in b/net-mgmt/mysql-snmp/files/mysql-snmp.in
new file mode 100644
index 000000000000..e9120c18df0b
--- /dev/null
+++ b/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"
diff --git a/net-mgmt/mysql-snmp/pkg-descr b/net-mgmt/mysql-snmp/pkg-descr
new file mode 100644
index 000000000000..3f9de372461e
--- /dev/null
+++ b/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
diff --git a/net-mgmt/mysql-snmp/pkg-plist b/net-mgmt/mysql-snmp/pkg-plist
new file mode 100644
index 000000000000..8893d1da8e02
--- /dev/null
+++ b/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