FreeBSD Bugzilla – Attachment 145453 Details for
Bug 191383
New port: net-mgmt/victorops-nagios Nagios integration for VictorOps incident notification service
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
Updtaed SHAR with pkg-plist fixed and pkg-message added.
victorops-nagios.shar (text/plain), 13.63 KB, created by
Douglas K. Rand
on 2014-08-07 16:24:50 UTC
(
hide
)
Description:
Updtaed SHAR with pkg-plist fixed and pkg-message added.
Filename:
MIME Type:
Creator:
Douglas K. Rand
Created:
2014-08-07 16:24:50 UTC
Size:
13.63 KB
patch
obsolete
># This is a shell archive. Save it in a file, remove anything before ># this line, and then unpack it by entering "sh file". Note, it may ># create directories; files and directories will be owned by you and ># have default permissions. ># ># This archive contains: ># ># victorops-nagios ># victorops-nagios/pkg-plist ># victorops-nagios/files ># victorops-nagios/files/patch-check_victorops_cmds ># victorops-nagios/files/qpage-patch ># victorops-nagios/files/patch-do_victorops_heartbeat ># victorops-nagios/files/patch-forward_alerts ># victorops-nagios/files/patch-utils ># victorops-nagios/files/patch-check_victorops_forwarder ># victorops-nagios/files/patch-support_collect.sh ># victorops-nagios/files/patch-enqueue_alert ># victorops-nagios/files/patch-victorops.cron ># victorops-nagios/distinfo ># victorops-nagios/pkg-message ># victorops-nagios/Makefile ># victorops-nagios/pkg-descr ># >echo c - victorops-nagios >mkdir -p victorops-nagios > /dev/null 2>&1 >echo x - victorops-nagios/pkg-plist >sed 's/^X//' >victorops-nagios/pkg-plist << 'a4f4b4ab85550293c810453b6c629c6d' >Xetc/nagios/victorops.cfg-sample >Xetc/nagios/victorops_email.cfg-sample >Xetc/nagios/vo_test_svc.cfg-sample >Xetc/nagios/vo_test_svc_cmd.cfg-sample >Xetc/periodic/daily/400.victorops >Xlibexec/victorops/check_test_svc >Xlibexec/victorops/check_victorops_cmds >Xlibexec/victorops/check_victorops_forwarder >Xlibexec/victorops/do_victorops_heartbeat >Xlibexec/victorops/enqueue_alert >Xlibexec/victorops/forward_alert_file >Xlibexec/victorops/forward_alerts >Xlibexec/victorops/send_email_alert >Xlibexec/victorops/send_status >Xlibexec/victorops/stop_forwarder >Xlibexec/victorops/support_collect.sh >Xlibexec/victorops/url_encode.sed >Xlibexec/victorops/utils >X@dirrmtry etc/nagios >X@dirrmtry libexec/victorops >X@dirrmtry etc/periodic/daily >X@dirrmtry etc/periodic >a4f4b4ab85550293c810453b6c629c6d >echo c - victorops-nagios/files >mkdir -p victorops-nagios/files > /dev/null 2>&1 >echo x - victorops-nagios/files/patch-check_victorops_cmds >sed 's/^X//' >victorops-nagios/files/patch-check_victorops_cmds << 'e2c5d640819a0973d8897ac3810cba13' >X--- opt/victorops/nagios_plugin/bin/check_victorops_cmds.orig 2014-06-11 10:22:45.587219788 -0500 >X+++ opt/victorops/nagios_plugin/bin/check_victorops_cmds 2014-06-11 12:37:39.711662512 -0500 >X@@ -46,7 +46,7 @@ >X TMP_FILE=$(mktemp) >X >X # Get the commands from VictorOps >X- wget -T $TIMEOUT -t $TRIES --no-verbose -O $TMP_FILE "$URL" >X+ $WGET -T $TIMEOUT -t $TRIES --no-verbose -O $TMP_FILE "$URL" >X >X # Check the result, and if OK, send them to the command file >X grep $RESULT_OK $TMP_FILE >e2c5d640819a0973d8897ac3810cba13 >echo x - victorops-nagios/files/qpage-patch >sed 's/^X//' >victorops-nagios/files/qpage-patch << 'e8f1393660b729bdedaf8659484f4bd1' >X--- opt/victorops/nagios_plugin/bin/send_email_alert.orig 2014-06-11 10:39:13.918151547 -0500 >X+++ opt/victorops/nagios_plugin/bin/send_email_alert 2014-06-11 11:20:43.930977406 -0500 >X@@ -31,6 +31,7 @@ >X # Build the contact email list >X ORG_SLUG="$(getVal _CONTACTVO_ORGANIZATION_ID unkonwn_org)" >X CONTACTEMAIL="$(getVal _CONTACTVO_CONTACTEMAIL)" >X+CONTACTPAGER="$(getVal CONTACTPAGER)" >X VO_CONTACT="failsafe+$ORG_SLUG@victorops.net" >X WGET_LOG=/tmp/victorops_forward_wget.out >X STDERR_LOG=/tmp/victorops_forward_wget.err >X@@ -42,10 +43,16 @@ >X if [ "$CONTACTEMAIL" != "" ]; then >X $PRINTF "%b" "***** Alert *****\n\nNotification Type: $(getVal NOTIFICATIONTYPE)\n\nService: $(getVal SERVICEDESC)\nHost: $(getVal HOSTALIAS)\nAddress: $(getVal HOSTADDRESS)\nState: $(getVal SERVICESTATE)\n\nDate/Time: $(getVal LONGDATETIME)\n\nAdditional Info:\n\n$(getVal SERVICEOUTPUT)\n\n" | $MAIL -s "** $(getVal NOTIFICATIONTYPE) Service Alert: $(getVal HOSTALIAS)/$(getVal SERVICEDESC) is $(getVal SERVICESTATE) **" $CONTACTEMAIL >X fi >X+ if [ "$CONTACTPAGER" != "" ]; then >X+ $PRINTF "%b" "$(getVal SERVICEDESC) $(getVal NOTIFICATIONTYPE) for $(getVal HOSTNAME) is $(getVal SERVICESTATE) at $(getVal TIME) $(getVal SERVICEOUTPUT)" | $QPAGE -f icinga $CONTACTPAGER >X+ fi >X else >X if [ "$CONTACTEMAIL" != "" ]; then >X $PRINTF "%b" "***** Alert *****\n\nNotification Type: $(getVal NOTIFICATIONTYPE)\nHost: $(getVal HOSTNAME)\nState: $(getVal HOSTSTATE)\nAddress: $(getVal HOSTADDRESS)\nInfo: $(getVal HOSTOUTPUT)\n\nDate/Time: $(getVal LONGDATETIME)\n" | $MAIL -s "** $(getVal NOTIFICATIONTYPE) Host Alert: $(getVal HOSTNAME) is $(getVal HOSTSTATE) **" $CONTACTEMAIL >X fi >X+ if [ "$CONTACTPAGER" != "" ]; then >X+ $PRINTF "%b" "$(getVal HOSTNAME) is $(getVal HOSTSTATE) at $(getVal TIME) -- $(getVal HOSTOUTPUT)" | $QPAGE -f icinga $CONTACTPAGER >X+ fi >X fi >X # *** >X # *** Make sure the mail command is the last thing in this file so the including file can check the exit code >X--- opt/victorops/nagios_plugin/bin/utils.orig 2014-06-16 20:12:16.713013963 -0500 >X+++ opt/victorops/nagios_plugin/bin/utils 2014-06-16 20:12:58.533005832 -0500 >X@@ -110,6 +110,7 @@ >X MV=$(findApp mv) >X PRINTF=$(findApp printf) >X PS=$(findApp ps) >X+QPAGE=$(findApp qpage) >X SED=$(findApp sed) >X SLEEP=$(findApp sleep) >X TAR=$(findApp tar) >X >e8f1393660b729bdedaf8659484f4bd1 >echo x - victorops-nagios/files/patch-do_victorops_heartbeat >sed 's/^X//' >victorops-nagios/files/patch-do_victorops_heartbeat << 'dba9bbdc49dd6db08ac4b1abb88fbd14' >X--- opt/victorops/nagios_plugin/bin/do_victorops_heartbeat.orig 2014-06-11 10:25:17.252208492 -0500 >X+++ opt/victorops/nagios_plugin/bin/do_victorops_heartbeat 2014-06-11 10:29:51.392206330 -0500 >X@@ -44,7 +44,7 @@ >X fi >X >X # guess Distro >X-DISTRO=$(/usr/bin/lsb_release -d 2>/dev/null | $SED 's/.*:[[:space:]]*//') >X+DISTRO=$(/usr/bin/uname -or 2>/dev/null | $SED 's/.*:[[:space:]]*//') >X if [ "$DISTRO" = "" ]; then >X DISTRO=$($CAT /etc/*release | $HEAD -1) >X fi >dba9bbdc49dd6db08ac4b1abb88fbd14 >echo x - victorops-nagios/files/patch-forward_alerts >sed 's/^X//' >victorops-nagios/files/patch-forward_alerts << '8d78ed1e5af921c124423483a67bc2ff' >X--- opt/victorops/nagios_plugin/bin/forward_alerts.orig 2014-06-11 10:38:17.374154833 -0500 >X+++ opt/victorops/nagios_plugin/bin/forward_alerts 2014-06-11 10:38:59.844409788 -0500 >X@@ -18,7 +18,7 @@ >X QUEUE_DIR=$1 >X fi >X if [ -z "$QUEUE_DIR" ]; then >X- QUEUE_DIR=/var/nagios >X+ QUEUE_DIR=/var/spool/nagios/victorops/alerts >X fi >X DONE_DIR=$QUEUE_DIR/forwarded >X EMAILED_DIR=$QUEUE_DIR/emailed >8d78ed1e5af921c124423483a67bc2ff >echo x - victorops-nagios/files/patch-utils >sed 's/^X//' >victorops-nagios/files/patch-utils << '36d791677e34275cdb4124b2114855df' >X--- opt/victorops/nagios_plugin/bin/utils.orig 2014-06-11 11:25:07.834962605 -0500 >X+++ opt/victorops/nagios_plugin/bin/utils 2014-06-11 11:26:48.367951852 -0500 >X@@ -46,7 +46,8 @@ >X function findStatusFile { >X local f="$1" >X if [ -z "$f" ]; then >X- echo "STATUSDATAFILE is empty" >> $DEBUG_FILE >X+ echo "STATUSDATAFILE($f) is empty" >> $DEBUG_FILE >X+ echo "Looking for STATUS file in $2" >> $DEBUG_FILE >X f=$($GREP "^status_file=" $2 | $SED 's/.*=//') >X fi >X if [ -z "$f" ]; then >X@@ -82,6 +83,8 @@ >X APP=/bin/$1 >X elif [ -x /usr/bin/$1 ]; then >X APP=/usr/bin/$1 >X+ elif [ -x /usr/local/bin/$1 ]; then >X+ APP=/usr/local/bin/$1 >X else >X APP=$1 >X fi >36d791677e34275cdb4124b2114855df >echo x - victorops-nagios/files/patch-check_victorops_forwarder >sed 's/^X//' >victorops-nagios/files/patch-check_victorops_forwarder << '44e5fce8bd07f3fa92ca275b803ec454' >X--- opt/victorops/nagios_plugin/bin/check_victorops_forwarder.orig 2014-04-02 15:36:08.000000000 -0500 >X+++ opt/victorops/nagios_plugin/bin/check_victorops_forwarder 2014-06-15 16:34:11.635114340 -0500 >X@@ -1,4 +1,4 @@ >X-#!/bin/bash >X+#!/usr/local/bin/bash >X >X if [ -x /usr/bin/dirname ]; then >X . $(/usr/bin/dirname $0)/utils >X@@ -10,7 +10,7 @@ >X >X verifyEnvironment >X >X-QUEUE=/var/nagios >X+QUEUE=/var/spool/nagios/victorops/alerts >X LOG=/var/log/victorops/forward_alerts.log >X DEBUG_FILE=/dev/null >X while getopts "l:q:" flag >X@@ -27,7 +27,13 @@ >X FORWARDER=$($DIRNAME $BASH_SOURCE)/forward_alerts >X PID_FILE=/tmp/victorops_forward_alerts.pid >X >X-FORWARDER_COUNT=$($PS -eaf | $GREP -v grep | $GREP "$FORWARDER" | $WC -l 2>/dev/null) >X+if [ ! -e $PID_FILE ]; then >X+ PID=9999999999 >X+else >X+ PID=$($CAT $PID_FILE) >X+fi >X+ >X+FORWARDER_COUNT=$($PS -ww -p $PID | $GREP "$FORWARDER" | $WC -l 2>/dev/null) >X if (( $FORWARDER_COUNT == 0 )); then >X echo "$($DATE) Starting $FORWARDER" >> "$LOG" >X $FORWARDER "$QUEUE" >> "$LOG" 2>&1 & >44e5fce8bd07f3fa92ca275b803ec454 >echo x - victorops-nagios/files/patch-support_collect.sh >sed 's/^X//' >victorops-nagios/files/patch-support_collect.sh << 'cf9b74c552a041670a232dc67533a052' >X--- opt/victorops/nagios_plugin/bin/support_collect.sh.orig 2014-06-11 11:24:28.858964094 -0500 >X+++ opt/victorops/nagios_plugin/bin/support_collect.sh 2014-06-11 11:25:03.784958472 -0500 >X@@ -11,8 +11,8 @@ >X TARBALL=$($DATE +%Y%m%d-%H%M)-victorops.tgz >X SUPPORT=support@victorops.com >X >X-echo $TAR -cz -f $TARBALL /var/log/victorops /var/nagios >X-$TAR -cz -f $TARBALL /var/log/victorops /var/nagios >X+echo $TAR -cz -f $TARBALL /var/log/victorops /var/spool/nagios/victorops/alerts >X+$TAR -cz -f $TARBALL /var/log/victorops /var/spool/nagios/victorops/alerts >X >X if [ -e "$MUTT" ]; then >X echo >cf9b74c552a041670a232dc67533a052 >echo x - victorops-nagios/files/patch-enqueue_alert >sed 's/^X//' >victorops-nagios/files/patch-enqueue_alert << 'e85e1fced363d5dc77273c3c5e2052cd' >X--- opt/victorops/nagios_plugin/bin/enqueue_alert.orig 2014-06-11 10:34:56.607169001 -0500 >X+++ opt/victorops/nagios_plugin/bin/enqueue_alert 2014-06-11 10:35:58.757671279 -0500 >X@@ -15,9 +15,9 @@ >X # Get the queue dir from the alert info in the environment vars. >X # If it's empty, use a default. >X # The queue dir can also be given on the command line. >X-QUEUE_DIR="$(getVal _CONTACTVO_QUEUE_DIR /var/nagios)" >X+QUEUE_DIR="$(getVal _CONTACTVO_QUEUE_DIR /var/spool/nagios/victorops/alerts)" >X if [ -z "$QUEUE_DIR" ]; then >X- QUEUE_DIR=/var/nagios >X+ QUEUE_DIR=/var/spool/nagios/victorops/alerts >X fi >X if [ ! -z "$1" ]; then >X QUEUE_DIR=$1 >e85e1fced363d5dc77273c3c5e2052cd >echo x - victorops-nagios/files/patch-victorops.cron >sed 's/^X//' >victorops-nagios/files/patch-victorops.cron << '6807ebf6fa52c9b2dc5b6a2f19f0b93e' >X--- etc/cron.daily/victorops.orig 2014-06-11 12:49:42.035618811 -0500 >X+++ etc/cron.daily/victorops 2014-06-11 12:50:57.241605821 -0500 >X@@ -1,5 +1,5 @@ >X #!/bin/sh >X >X # Clean up old alerts >X-/usr/bin/find /var/nagios/emailed/ -mtime +7 -type f -delete >X-/usr/bin/find /var/nagios/forwarded/ -mtime +7 -type f -delete >X+/usr/bin/find /var/spool/nagios/victorops/alerts/emailed/ -mtime +7 -type f -delete >X+/usr/bin/find /var/spool/nagios/victorops/alerts/forwarded/ -mtime +7 -type f -delete >6807ebf6fa52c9b2dc5b6a2f19f0b93e >echo x - victorops-nagios/distinfo >sed 's/^X//' >victorops-nagios/distinfo << '567178b75b5f1ef1cf17e9b165f3575f' >XSHA256 (victorops-nagios_1.1.8.tar.gz) = 796e146552e27b45d0339c9c74883ba8048125887461f9e69a1e36cbd752e1a2 >XSIZE (victorops-nagios_1.1.8.tar.gz) = 12838 >567178b75b5f1ef1cf17e9b165f3575f >echo x - victorops-nagios/pkg-message >sed 's/^X//' >victorops-nagios/pkg-message << '3d9cb623cef4f9733bb35393d2ed3601' >X======================================================================== >X >Xvictorops-nagios requires that ca_root_nss be built with the option >X >X ETCSYMLINK Add symlink to /etc/ssl/cert.pem >X >Xenabled. With out that option, wget will complain that VictorOps' >XGoDaddy SSL certificate is a self-signed certificate, which will >Xprevent VictorOps from working. >X >X======================================================================== >3d9cb623cef4f9733bb35393d2ed3601 >echo x - victorops-nagios/Makefile >sed 's/^X//' >victorops-nagios/Makefile << '9d9812fc8125ba153214653fbd5575f0' >X# Created by: Douglas K. Rand <rand@iteris.com> >X# $FreeBSD$ >X >XPORTNAME= victorops-nagios >XPORTVERSION= 1.1.8 >XCATEGORIES= net-mgmt >XMASTER_SITES= http://software.victorops.com/ >XDISTNAME= ${PORTNAME}_${DISTVERSIONPREFIX}${DISTVERSION}${DISTVERSIONSUFFIX} >X >XMAINTAINER= rand@iteris.com >XCOMMENT= Nagios integration for VictorOps incident notification service >X >XNO_WRKSUBDIR= YES >XNO_BUILD= YES >X >XRESTRICTED= Redistribution of software prohibited by VictorOps >X >XOPTIONS_DEFINE= QPAGE >XOPTIONS_DEFAULT= >XQPAGE_DESC= Integrate qpage for victorops server problems >X >XRUN_DEPENDS+= bash:${PORTSDIR}/shells/bash >X >X.include <bsd.port.options.mk> >X.if ${PORT_OPTIONS:MQPAGE} >XRUN_DEPENDS+= qpage:${PORTSDIR}/comms/qpage >XEXTRA_PATCHES+= ${FILESDIR}/qpage-patch >X.endif >X >Xpost-patch: >X @${FIND} ${WRKSRC} -type f | ${XARGS} ${REINPLACE_CMD} \ >X -e '1s|#!/bin/bash|#!/usr/local/bin/bash|' >X >Xdo-install: >X ${MKDIR} ${STAGEDIR}${PREFIX}/etc/periodic/daily >X ${INSTALL_DATA} ${WRKSRC}/etc/cron.daily/victorops ${STAGEDIR}${PREFIX}/etc/periodic/daily/400.victorops >X ${MKDIR} ${STAGEDIR}${PREFIX}/etc/nagios >X.for i in victorops victorops_email vo_test_svc vo_test_svc_cmd >X ${INSTALL_DATA} ${WRKSRC}/opt/victorops/nagios_plugin/nagios_conf/${i}.cfg ${STAGEDIR}${PREFIX}/etc/nagios/${i}.cfg-sample >X.endfor >X ${MKDIR} ${STAGEDIR}${PREFIX}/libexec/victorops >X.for i in check_test_svc check_victorops_cmds check_victorops_forwarder \ >X do_victorops_heartbeat enqueue_alert forward_alert_file forward_alerts \ >X send_email_alert send_status stop_forwarder support_collect.sh \ >X url_encode.sed utils >X ${INSTALL_SCRIPT} ${WRKSRC}/opt/victorops/nagios_plugin/bin/${i} ${STAGEDIR}${PREFIX}/libexec/victorops/${i} >X.endfor >X >X.include <bsd.port.mk> >9d9812fc8125ba153214653fbd5575f0 >echo x - victorops-nagios/pkg-descr >sed 's/^X//' >victorops-nagios/pkg-descr << '3646d7014a5c3660b454163b795f24ad' >XVictorOps is an on-call management and incident notification service. >XThis is the Nagios/Icinga integration package for VictorOps. >X >XWWW: http://www.victorops.com >3646d7014a5c3660b454163b795f24ad >exit >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 191383
:
144132
|
145188
|
145452
| 145453