Bring back net-mgmt/py-pdagent-integrations & net-mgmt/py-pdagent
NOTE: net-mgmt/py-pdagent-integrations was previously net-mgmt/pdagent-integrations The PagerDuty Agent is a program that lets you easily integrate your monitoring system with PagerDuty. WWW: https://github.com/PagerDuty/pdagent
This commit is contained in:
parent
60d035e91a
commit
dd4201c282
14 changed files with 286 additions and 2 deletions
2
MOVED
2
MOVED
|
@ -13856,7 +13856,6 @@ net-im/py-jabber||2020-01-27|Has expired: Unmaintained, uses EOLed python27
|
|||
net-im/py-jabberbot||2020-01-27|Has expired: Unmaintained, uses EOLed python27
|
||||
net-im/py-libturpial||2020-01-27|Has expired: Unmaintained, uses EOLed python27
|
||||
net-im/py-xmpppy-irc||2020-01-27|Has expired: Unmaintained, uses EOLed python27
|
||||
net-mgmt/pdagent-integrations||2020-01-27|Has expired: Unmaintained, uses EOLed python27
|
||||
net-p2p/tribler||2020-01-27|Has expired: Unmaintained, uses EOLed python27
|
||||
news/papercut||2020-01-27|Has expired: Unmaintained, uses EOLed python27
|
||||
print/pkipplib||2020-01-27|Has expired: Unmaintained, uses EOLed python27
|
||||
|
@ -14426,7 +14425,6 @@ databases/py-cdb||2020-03-20|Has expired: Unmaintained, uses EOLed python27
|
|||
devel/py-mwlib||2020-03-20|Has expired: Unmaintained, uses EOLed python27
|
||||
graphics/py-soya3d||2020-03-20|Has expired: Unmaintained, uses EOLed python27
|
||||
irc/py-supybot||2020-03-20|Has expired: Unmaintained, uses EOLed python27
|
||||
net-mgmt/py-pdagent||2020-03-20|Has expired: Unmaintained, uses EOLed python27
|
||||
textproc/pychm||2020-03-20|Has expired: Unmaintained, uses EOLed python27
|
||||
x11/rxvt|x11/rxvt-unicode|2020-03-20|Has expired: Abandonware: stable release 2.6.4 / November 1, 2001 and no maintainer
|
||||
x11-wm/clementine-wm||2020-03-20|Removed, unmaintained and depends on expired x11/rxvt
|
||||
|
|
|
@ -306,6 +306,8 @@
|
|||
SUBDIR += py-napalm-logs
|
||||
SUBDIR += py-ncclient
|
||||
SUBDIR += py-nxapi-plumbing
|
||||
SUBDIR += py-pdagent
|
||||
SUBDIR += py-pdagent-integrations
|
||||
SUBDIR += py-prometheus-client
|
||||
SUBDIR += py-pyIOSXR
|
||||
SUBDIR += py-pyang
|
||||
|
|
46
net-mgmt/py-pdagent-integrations/Makefile
Normal file
46
net-mgmt/py-pdagent-integrations/Makefile
Normal file
|
@ -0,0 +1,46 @@
|
|||
PORTNAME= pdagent-integrations
|
||||
PORTVERSION= 1.6.2
|
||||
DISTVERSIONPREFIX=v
|
||||
CATEGORIES= net-mgmt python
|
||||
PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX}
|
||||
|
||||
MAINTAINER= ports@FreeBSD.org
|
||||
COMMENT= PagerDuty integrations for monitoring monitoring tools
|
||||
|
||||
LICENSE= BSD3CLAUSE
|
||||
LICENSE_FILE= ${WRKSRC}/LICENSE.TXT
|
||||
|
||||
RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}pdagent>0:net-mgmt/py-pdagent@${PY_FLAVOR}
|
||||
|
||||
USES= python:3.7+ shebangfix
|
||||
|
||||
USE_GITHUB= yes
|
||||
GH_ACCOUNT= PagerDuty
|
||||
|
||||
SHEBANG_FILES= bin/*
|
||||
|
||||
SUB_FILES= pagerduty-icinga2.conf pkg-message
|
||||
|
||||
NO_ARCH= yes
|
||||
NO_BUILD= yes
|
||||
PORTDOCS= *-testing.txt
|
||||
EXAMPLES= conf.d/sensu_pagerduty_handler.json \
|
||||
pagerduty_nagios.cfg
|
||||
|
||||
OPTIONS_DEFINE= DOCS EXAMPLES
|
||||
|
||||
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:
|
||||
(cd ${WRKSRC}/bin ; ${INSTALL_SCRIPT} * ${STAGEDIR}${PREFIX}/bin)
|
||||
|
||||
do-install-DOCS-on:
|
||||
@${MKDIR} ${STAGEDIR}${DOCSDIR}
|
||||
${INSTALL_DATA} ${PORTDOCS:S|^|${WRKSRC}/|} ${STAGEDIR}${DOCSDIR}
|
||||
|
||||
do-install-EXAMPLES-on:
|
||||
${MKDIR} ${STAGEDIR}${EXAMPLESDIR}
|
||||
${INSTALL_DATA} ${EXAMPLES:S|^|${WRKSRC}/|} ${STAGEDIR}${EXAMPLESDIR}
|
||||
|
||||
.include <bsd.port.mk>
|
3
net-mgmt/py-pdagent-integrations/distinfo
Normal file
3
net-mgmt/py-pdagent-integrations/distinfo
Normal file
|
@ -0,0 +1,3 @@
|
|||
TIMESTAMP = 1617288052
|
||||
SHA256 (PagerDuty-pdagent-integrations-v1.6.2_GH0.tar.gz) = 3df3e777958c1efdb26eb6848b0952b15fbe7a9a9ff878f0a691e26629c877f2
|
||||
SIZE (PagerDuty-pdagent-integrations-v1.6.2_GH0.tar.gz) = 16051
|
|
@ -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
|
||||
}
|
8
net-mgmt/py-pdagent-integrations/files/pkg-message.in
Normal file
8
net-mgmt/py-pdagent-integrations/files/pkg-message.in
Normal file
|
@ -0,0 +1,8 @@
|
|||
[
|
||||
{ type: install
|
||||
message: <<EOM
|
||||
Sample configuration files for Nagios, Icinga and Sensu can be found in the
|
||||
%%EXAMPLESDIR%% directory.
|
||||
EOM
|
||||
}
|
||||
]
|
10
net-mgmt/py-pdagent-integrations/pkg-descr
Normal file
10
net-mgmt/py-pdagent-integrations/pkg-descr
Normal file
|
@ -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
|
5
net-mgmt/py-pdagent-integrations/pkg-plist
Normal file
5
net-mgmt/py-pdagent-integrations/pkg-plist
Normal file
|
@ -0,0 +1,5 @@
|
|||
bin/pd-nagios
|
||||
bin/pd-sensu
|
||||
bin/pd-zabbix
|
||||
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/pagerduty_nagios.cfg
|
||||
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/sensu_pagerduty_handler.json
|
39
net-mgmt/py-pdagent/Makefile
Normal file
39
net-mgmt/py-pdagent/Makefile
Normal file
|
@ -0,0 +1,39 @@
|
|||
PORTNAME= pdagent
|
||||
PORTVERSION= 1.7.2
|
||||
DISTVERSIONPREFIX=v
|
||||
CATEGORIES= net-mgmt python
|
||||
PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX}
|
||||
|
||||
MAINTAINER= ports@FreeBSD.org
|
||||
COMMENT= PagerDuty Agent software
|
||||
|
||||
LICENSE= BSD3CLAUSE
|
||||
LICENSE_FILE= ${WRKSRC}/LICENSE.TXT
|
||||
|
||||
USES= python:3.7+ shebangfix
|
||||
USE_PYTHON= flavors
|
||||
USE_RC_SUBR= pdagentd
|
||||
USE_GITHUB= yes
|
||||
|
||||
GH_ACCOUNT= PagerDuty
|
||||
SHEBANG_FILES= bin/*
|
||||
NO_ARCH= yes
|
||||
NO_BUILD= yes
|
||||
|
||||
SUB_LIST+= PYTHON_CMD="${PYTHON_CMD}"
|
||||
BINFILES= pd-queue pd-send pdagentd.py
|
||||
|
||||
USERS= pdagent
|
||||
GROUPS= pdagent
|
||||
|
||||
post-patch:
|
||||
${REINPLACE_CMD} -e 's|/var/lib/pdagent|/var/db/pdagent| ; s|/etc|${ETCDIR}|' \
|
||||
${WRKSRC}/pdagent/confdirs.py
|
||||
|
||||
do-install:
|
||||
${MKDIR} ${STAGEDIR}${PYTHON_SITELIBDIR} ${STAGEDIR}/${ETCDIR}
|
||||
(cd ${WRKSRC} && ${COPYTREE_SHARE} pdagent ${STAGEDIR}${PYTHON_SITELIBDIR})
|
||||
(cd ${WRKSRC}/bin ; ${INSTALL_SCRIPT} ${BINFILES} ${STAGEDIR}/${PREFIX}/bin)
|
||||
${INSTALL_DATA} ${WRKSRC}/conf/pdagent.conf ${STAGEDIR}/${ETCDIR}/pdagent.conf.sample
|
||||
|
||||
.include <bsd.port.mk>
|
3
net-mgmt/py-pdagent/distinfo
Normal file
3
net-mgmt/py-pdagent/distinfo
Normal file
|
@ -0,0 +1,3 @@
|
|||
TIMESTAMP = 1617288043
|
||||
SHA256 (PagerDuty-pdagent-v1.7.2_GH0.tar.gz) = 17b126e662a39540a053e22743b717bfe86e2221587536c20ca67f60365ff63a
|
||||
SIZE (PagerDuty-pdagent-v1.7.2_GH0.tar.gz) = 247883
|
46
net-mgmt/py-pdagent/files/pdagentd.in
Normal file
46
net-mgmt/py-pdagent/files/pdagentd.in
Normal file
|
@ -0,0 +1,46 @@
|
|||
#!/bin/sh
|
||||
#
|
||||
# Author: Mark Felder <feld@FreeBSD.org>
|
||||
#
|
||||
# $FreeBSD: head/net-mgmt/py-pdagent/files/pdagentd.in 466572 2018-04-05 17:11:39Z feld $
|
||||
#
|
||||
|
||||
# PROVIDE: pdagentd
|
||||
# REQUIRE: LOGIN
|
||||
# KEYWORD: shutdown
|
||||
|
||||
# Add the following lines to /etc/rc.conf to enable pdagentd:
|
||||
# pdagentd_enable="YES"
|
||||
|
||||
. /etc/rc.subr
|
||||
|
||||
name="pdagentd"
|
||||
rcvar=pdagentd_enable
|
||||
|
||||
load_rc_config $name
|
||||
|
||||
: ${pdagentd_enable="NO"}
|
||||
: ${pdagentd_user:="pdagent"}
|
||||
: ${pdagentd_group:="pdagent"}
|
||||
|
||||
pidfile="/var/run/pdagent/pdagentd.pid"
|
||||
command="%%PREFIX%%/bin/pdagentd.py"
|
||||
start_precmd=pdagentd_precmd
|
||||
procname=%%PYTHON_CMD%%
|
||||
|
||||
pdagent_mkdirs="/var/db/pdagent /var/db/pdagent/outqueue /var/db/pdagent/db /var/db/pdagent/outqueue/pdq \
|
||||
/var/db/pdagent/outqueue/tmp /var/db/pdagent/outqueue/suc /var/db/pdagent/outqueue/err"
|
||||
|
||||
pdagentd_precmd()
|
||||
{
|
||||
for i in ${pdagent_mkdirs}; do
|
||||
install -d -o ${pdagentd_user} -g ${pdagentd_group} -m 770 ${i}
|
||||
done
|
||||
|
||||
chown -R ${pdagentd_user}:${pdagentd_group} /var/db/pdagent
|
||||
|
||||
install -d -o ${pdagentd_user} /var/log/pdagent
|
||||
install -d -o ${pdagentd_user} /var/run/pdagent
|
||||
}
|
||||
|
||||
run_rc_command "$1"
|
4
net-mgmt/py-pdagent/pkg-descr
Normal file
4
net-mgmt/py-pdagent/pkg-descr
Normal file
|
@ -0,0 +1,4 @@
|
|||
The PagerDuty Agent is a program that lets you easily integrate your
|
||||
monitoring system with PagerDuty.
|
||||
|
||||
WWW: https://github.com/PagerDuty/pdagent
|
8
net-mgmt/py-pdagent/pkg-message
Normal file
8
net-mgmt/py-pdagent/pkg-message
Normal file
|
@ -0,0 +1,8 @@
|
|||
[
|
||||
{ type: install
|
||||
message: <<EOM
|
||||
You must add the required users and service accounts to the pdagent
|
||||
group to permit write access to /var/db/pdagent.
|
||||
EOM
|
||||
}
|
||||
]
|
21
net-mgmt/py-pdagent/pkg-plist
Normal file
21
net-mgmt/py-pdagent/pkg-plist
Normal file
|
@ -0,0 +1,21 @@
|
|||
bin/pd-queue
|
||||
bin/pd-send
|
||||
bin/pdagentd.py
|
||||
@sample etc/pdagent/pdagent.conf.sample
|
||||
%%PYTHON_SITELIBDIR%%/pdagent/__init__.py
|
||||
%%PYTHON_SITELIBDIR%%/pdagent/confdirs.py
|
||||
%%PYTHON_SITELIBDIR%%/pdagent/config.py
|
||||
%%PYTHON_SITELIBDIR%%/pdagent/constants.py
|
||||
%%PYTHON_SITELIBDIR%%/pdagent/heartbeat.py
|
||||
%%PYTHON_SITELIBDIR%%/pdagent/http.py
|
||||
%%PYTHON_SITELIBDIR%%/pdagent/jsonstore.py
|
||||
%%PYTHON_SITELIBDIR%%/pdagent/pdagentutil.py
|
||||
%%PYTHON_SITELIBDIR%%/pdagent/pdqueue.py
|
||||
%%PYTHON_SITELIBDIR%%/pdagent/pdthread.py
|
||||
%%PYTHON_SITELIBDIR%%/pdagent/root_certs/ca_certs.pem
|
||||
%%PYTHON_SITELIBDIR%%/pdagent/sendevent.py
|
||||
%%PYTHON_SITELIBDIR%%/pdagent/thirdparty/__init__.py
|
||||
%%PYTHON_SITELIBDIR%%/pdagent/thirdparty/argparse.py
|
||||
%%PYTHON_SITELIBDIR%%/pdagent/thirdparty/daemon.py
|
||||
%%PYTHON_SITELIBDIR%%/pdagent/thirdparty/filelock.py
|
||||
%%PYTHON_SITELIBDIR%%/pdagent/thirdparty/six.py
|
Loading…
Reference in a new issue