Lines 1-38
Link Here
|
1 |
--- opt/victorops/nagios_plugin/bin/send_email_alert.orig 2014-06-11 10:39:13.918151547 -0500 |
1 |
--- opt/victorops/nagios_plugin/bin/send_email_alert.orig 2016-01-16 21:20:46 UTC |
2 |
+++ opt/victorops/nagios_plugin/bin/send_email_alert 2014-06-11 11:20:43.930977406 -0500 |
2 |
+++ opt/victorops/nagios_plugin/bin/send_email_alert |
3 |
@@ -31,6 +31,7 @@ |
3 |
@@ -34,6 +34,7 @@ fi |
4 |
# Build the contact email list |
4 |
# Build the contact email list |
5 |
ORG_SLUG="$(getVal _CONTACTVO_ORGANIZATION_ID unkonwn_org)" |
5 |
ORG_SLUG="$(getVal _CONTACTVO_ORGANIZATION_ID unkonwn_org)" |
6 |
CONTACTEMAIL="$(getVal _CONTACTVO_CONTACTEMAIL)" |
6 |
CONTACTEMAIL="$(getVal _CONTACTVO_CONTACTEMAIL)" |
7 |
+CONTACTPAGER="$(getVal CONTACTPAGER)" |
7 |
+CONTACTPAGER="$(getVal CONTACTPAGER)" |
8 |
VO_CONTACT="failsafe+$ORG_SLUG@victorops.net" |
8 |
VO_CONTACT="failsafe+$ORG_SLUG@victorops.net" |
9 |
WGET_LOG=/tmp/victorops_forward_wget.out |
9 |
WGET_LOG=$LOG_DIR/victorops_forward_wget.out |
10 |
STDERR_LOG=/tmp/victorops_forward_wget.err |
10 |
STDERR_LOG=$LOG_DIR/victorops_forward_wget.err |
11 |
@@ -42,10 +43,16 @@ |
11 |
@@ -45,10 +46,16 @@ if (( $IS_SERVICE )); then |
12 |
if [ "$CONTACTEMAIL" != "" ]; then |
12 |
if [ "$CONTACTEMAIL" != "" ]; then |
13 |
$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 |
13 |
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 |
14 |
fi |
14 |
fi |
15 |
+ if [ "$CONTACTPAGER" != "" ]; then |
15 |
+ if [ "$CONTACTPAGER" != "" ]; then |
16 |
+ $PRINTF "%b" "$(getVal SERVICEDESC) $(getVal NOTIFICATIONTYPE) for $(getVal HOSTNAME) is $(getVal SERVICESTATE) at $(getVal TIME) $(getVal SERVICEOUTPUT)" | $QPAGE -f icinga $CONTACTPAGER |
16 |
+ printf "%b" "$(getVal SERVICEDESC) $(getVal NOTIFICATIONTYPE) for $(getVal HOSTNAME) is $(getVal SERVICESTATE) at $(getVal TIME) $(getVal SERVICEOUTPUT)" | qpage -f icinga $CONTACTPAGER |
17 |
+ fi |
17 |
+ fi |
18 |
else |
18 |
else |
19 |
if [ "$CONTACTEMAIL" != "" ]; then |
19 |
if [ "$CONTACTEMAIL" != "" ]; then |
20 |
$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 |
20 |
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 |
21 |
fi |
21 |
fi |
22 |
+ if [ "$CONTACTPAGER" != "" ]; then |
22 |
+ if [ "$CONTACTPAGER" != "" ]; then |
23 |
+ $PRINTF "%b" "$(getVal HOSTNAME) is $(getVal HOSTSTATE) at $(getVal TIME) -- $(getVal HOSTOUTPUT)" | $QPAGE -f icinga $CONTACTPAGER |
23 |
+ printf "%b" "$(getVal HOSTNAME) is $(getVal HOSTSTATE) at $(getVal TIME) -- $(getVal HOSTOUTPUT)" | qpage -f icinga $CONTACTPAGER |
24 |
+ fi |
24 |
+ fi |
25 |
fi |
25 |
fi |
26 |
# *** |
26 |
# *** |
27 |
# *** Make sure the mail command is the last thing in this file so the including file can check the exit code |
27 |
# *** Make sure the mail command is the last thing in this file so the including file can check the exit code |
28 |
--- opt/victorops/nagios_plugin/bin/utils.orig 2014-06-16 20:12:16.713013963 -0500 |
|
|
29 |
+++ opt/victorops/nagios_plugin/bin/utils 2014-06-16 20:12:58.533005832 -0500 |
30 |
@@ -110,6 +110,7 @@ |
31 |
MV=$(findApp mv) |
32 |
PRINTF=$(findApp printf) |
33 |
PS=$(findApp ps) |
34 |
+QPAGE=$(findApp qpage) |
35 |
SED=$(findApp sed) |
36 |
SLEEP=$(findApp sleep) |
37 |
TAR=$(findApp tar) |
38 |
|