From owner-svn-ports-all@freebsd.org Thu Oct 5 18:35:53 2017 Return-Path: Delivered-To: svn-ports-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DA73AE3F3B1; Thu, 5 Oct 2017 18:35:53 +0000 (UTC) (envelope-from feld@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B166B80AF9; Thu, 5 Oct 2017 18:35:53 +0000 (UTC) (envelope-from feld@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v95IZqV2097758; Thu, 5 Oct 2017 18:35:52 GMT (envelope-from feld@FreeBSD.org) Received: (from feld@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v95IZpKf097750; Thu, 5 Oct 2017 18:35:51 GMT (envelope-from feld@FreeBSD.org) Message-Id: <201710051835.v95IZpKf097750@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: feld set sender to feld@FreeBSD.org using -f From: Mark Felder Date: Thu, 5 Oct 2017 18:35:51 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r451330 - in head/net-mgmt: . pdagent-integrations pdagent-integrations/files X-SVN-Group: ports-head X-SVN-Commit-Author: feld X-SVN-Commit-Paths: in head/net-mgmt: . pdagent-integrations pdagent-integrations/files X-SVN-Commit-Revision: 451330 X-SVN-Commit-Repository: ports MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the ports tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Oct 2017 18:35:54 -0000 Author: feld Date: Thu Oct 5 18:35:51 2017 New Revision: 451330 URL: https://svnweb.freebsd.org/changeset/ports/451330 Log: This project contains integrations for various monitoring tools with the PagerDuty Agent. It currently includes support for: Nagios Sensu Zabbix WWW: https://github.com/PagerDuty/pdagent-integrations Added: head/net-mgmt/pdagent-integrations/ head/net-mgmt/pdagent-integrations/Makefile (contents, props changed) head/net-mgmt/pdagent-integrations/distinfo (contents, props changed) head/net-mgmt/pdagent-integrations/files/ head/net-mgmt/pdagent-integrations/files/pagerduty-icinga2.conf.in (contents, props changed) head/net-mgmt/pdagent-integrations/files/patch-bin_pd-nagios (contents, props changed) head/net-mgmt/pdagent-integrations/files/pkg-message.in (contents, props changed) head/net-mgmt/pdagent-integrations/pkg-descr (contents, props changed) head/net-mgmt/pdagent-integrations/pkg-plist (contents, props changed) Modified: head/net-mgmt/Makefile Modified: head/net-mgmt/Makefile ============================================================================== --- head/net-mgmt/Makefile Thu Oct 5 18:19:09 2017 (r451329) +++ head/net-mgmt/Makefile Thu Oct 5 18:35:51 2017 (r451330) @@ -277,6 +277,7 @@ SUBDIR += pandorafms_agent SUBDIR += pandorafms_console SUBDIR += pandorafms_server + SUBDIR += pdagent-integrations SUBDIR += percona-monitoring-plugins SUBDIR += pftabled SUBDIR += php56-snmp Added: head/net-mgmt/pdagent-integrations/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/net-mgmt/pdagent-integrations/Makefile Thu Oct 5 18:35:51 2017 (r451330) @@ -0,0 +1,40 @@ +# Created by: Mark Felder +# $FreeBSD$ + +PORTNAME= pdagent-integrations +PORTVERSION= 1.4 +DISTVERSIONPREFIX=v +CATEGORIES= net-mgmt python + +MAINTAINER= feld@FreeBSD.org +COMMENT= PagerDuty integrations for monitoring monitoring tools + +LICENSE= BSD3CLAUSE + +RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}pdagent>0:net-mgmt/py-pdagent + +USES= python shebangfix + +USE_GITHUB= yes +GH_ACCOUNT= PagerDuty + +SHEBANG_FILES= bin/* + +SUB_FILES= pagerduty-icinga2.conf pkg-message + +NO_ARCH= yes +NO_BUILD= yes + +post-patch: + ${REINPLACE_CMD} 's|/usr/share/pdagent-integrations/bin|${PREFIX}/bin|g' ${WRKSRC}/pagerduty_nagios.cfg ${WRKSRC}/conf.d/sensu_pagerduty_handler.json + +do-install: + ${MKDIR} ${STAGEDIR}${EXAMPLESDIR} + ${INSTALL_SCRIPT} ${WRKSRC}/bin/pd-nagios ${STAGEDIR}${LOCALBASE}/bin + ${INSTALL_SCRIPT} ${WRKSRC}/bin/pd-sensu ${STAGEDIR}${LOCALBASE}/bin + ${INSTALL_SCRIPT} ${WRKSRC}/bin/pd-zabbix ${STAGEDIR}${LOCALBASE}/bin + ${INSTALL_DATA} ${WRKSRC}/conf.d/sensu_pagerduty_handler.json ${STAGEDIR}${EXAMPLESDIR} + ${INSTALL_DATA} ${WRKSRC}/pagerduty_nagios.cfg ${STAGEDIR}${EXAMPLESDIR} + ${INSTALL_DATA} ${WRKDIR}/pagerduty-icinga2.conf ${STAGEDIR}${EXAMPLESDIR} + +.include Added: head/net-mgmt/pdagent-integrations/distinfo ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/net-mgmt/pdagent-integrations/distinfo Thu Oct 5 18:35:51 2017 (r451330) @@ -0,0 +1,3 @@ +TIMESTAMP = 1507219750 +SHA256 (PagerDuty-pdagent-integrations-v1.4_GH0.tar.gz) = f4d18b1759ee0dfdcff4dd10f73c2bd3dd5d1ef0e2629141edd5f07f32c6e4f1 +SIZE (PagerDuty-pdagent-integrations-v1.4_GH0.tar.gz) = 17643 Added: head/net-mgmt/pdagent-integrations/files/pagerduty-icinga2.conf.in ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/net-mgmt/pdagent-integrations/files/pagerduty-icinga2.conf.in Thu Oct 5 18:35:51 2017 (r451330) @@ -0,0 +1,91 @@ +object User "pagerduty" { + pager = "YOUR-INTEGRATION-KEY-HERE" + groups = [ "icingaadmins" ] + display_name = "PagerDuty Notification User" + states = [ OK, Warning, Critical, Unknown, Up, Down ] + types = [ Problem, Acknowledgement, Recovery ] +} + +object NotificationCommand "notify-service-by-pagerduty" { + import "plugin-notification-command" + command = [ "%%PREFIX%%/bin/pd-nagios" ] + arguments = { + "-n" = { + order = 0 + value = "service" + } + "-k" = { + order = 1 + value = "$user.pager$" + } + "-t" = { + order = 2 + value = "$notification.type$" + } + "-f" = { + order = 3 + repeat_key = true + value = "$f_args$" + } + } + + vars.f_args = [ + "SERVICEDESC=$service.name$", + "SERVICEDISPLAYNAME=$service.display_name$", + "HOSTNAME=$host.name$", + "HOSTSTATE=$host.state$", + "HOSTDISPLAYNAME=$host.display_name$", + "SERVICESTATE=$service.state$", + "SERVICEPROBLEMID=$service.state_id$", + "SERVICEOUTPUT=$service.output$" + ] +} + +object NotificationCommand "notify-host-by-pagerduty" { + import "plugin-notification-command" + command = [ "%%PREFIX%%/bin/pd-nagios" ] + arguments = { + "-n" = { + order = 0 + value = "host" + } + "-k" = { + order = 1 + value = "$user.pager$" + } + "-t" = { + order = 2 + value = "$notification.type$" + } + "-f" = { + order = 3 + repeat_key = true + value = "$f_args$" + } + } + + vars.f_args = [ + "HOSTNAME=$host.name$", + "HOSTSTATE=$host.state$", + "HOSTPROBLEMID=$host.state_id$", + "HOSTOUTPUT=$host.output$" + ] +} + +apply Notification "pagerduty-service" to Service { + command = "notify-service-by-pagerduty" + states = [ OK, Warning, Critical, Unknown ] + types = [ Problem, Acknowledgement, Recovery ] + period = "24x7" + users = [ "pagerduty" ] + assign where service.vars.enable_pagerduty == true +} + +apply Notification "pagerduty-host" to Host { + command = "notify-host-by-pagerduty" + states = [ Up, Down ] + types = [ Problem, Acknowledgement, Recovery ] + period = "24x7" + users = [ "pagerduty" ] + assign where host.vars.enable_pagerduty == true +} Added: head/net-mgmt/pdagent-integrations/files/patch-bin_pd-nagios ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/net-mgmt/pdagent-integrations/files/patch-bin_pd-nagios Thu Oct 5 18:35:51 2017 (r451330) @@ -0,0 +1,11 @@ +--- bin/pd-nagios.orig 2017-10-05 18:21:38 UTC ++++ bin/pd-nagios +@@ -101,7 +101,7 @@ class NagiosEvent: + if not NagiosEvent.REQUIRED_FIELDS[self._notification_type].issubset(self._details.keys()): + msg = "Missing fields for type '{0}'. {1} required".format( + self._notification_type, +- ", ".join(self._required_fields()) ++ ", ".join(NagiosEvent.REQUIRED_FIELDS[self._notification_type]) + ) + raise ValueError(msg) + Added: head/net-mgmt/pdagent-integrations/files/pkg-message.in ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/net-mgmt/pdagent-integrations/files/pkg-message.in Thu Oct 5 18:35:51 2017 (r451330) @@ -0,0 +1,2 @@ +Sample configuration files for Nagios, Icinga and Sensu can be found in the +%%EXAMPLESDIR%% directory. Added: head/net-mgmt/pdagent-integrations/pkg-descr ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/net-mgmt/pdagent-integrations/pkg-descr Thu Oct 5 18:35:51 2017 (r451330) @@ -0,0 +1,10 @@ +This project contains integrations for various monitoring tools with +the PagerDuty Agent. + +It currently includes support for: + + Nagios + Sensu + Zabbix + +WWW: https://github.com/PagerDuty/pdagent-integrations Added: head/net-mgmt/pdagent-integrations/pkg-plist ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/net-mgmt/pdagent-integrations/pkg-plist Thu Oct 5 18:35:51 2017 (r451330) @@ -0,0 +1,6 @@ +bin/pd-nagios +bin/pd-sensu +bin/pd-zabbix +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/pagerduty_nagios.cfg +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/pagerduty-icinga2.conf +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/sensu_pagerduty_handler.json