improve_http_message: Change error message to be nearest possible RFC2616 (#9887)
thiagoftsm committed
Sep 8, 2020 at 11:01 UTC
e08738e5a340c13da74b4e6e60f5c98fb342e352
1 file changed
+18
-18
health/notifications/alarm-notify.sh.in
+18
-18
@@ -890,7 +890,7 @@ send_pushover() {
890
info "sent pushover notification for: ${host} ${chart}.${name} is ${status} to '${user}'"
891
sent=$((sent + 1))
892
else
893
- error "failed to send pushover notification for: ${host} ${chart}.${name} is ${status} to '${user}' with HTTP error code ${httpcode}."
893
+ error "failed to send pushover notification for: ${host} ${chart}.${name} is ${status} to '${user}' with HTTP response status code ${httpcode}."
894
fi
895
done
896
@@ -926,7 +926,7 @@ EOF
926
info "sent pushbullet notification for: ${host} ${chart}.${name} is ${status} to '${user}'"
927
sent=$((sent + 1))
928
else
929
- error "failed to send pushbullet notification for: ${host} ${chart}.${name} is ${status} to '${user}' with HTTP error code ${httpcode}."
929
+ error "failed to send pushbullet notification for: ${host} ${chart}.${name} is ${status} to '${user}' with HTTP response status code ${httpcode}."
930
fi
931
done
932
@@ -950,7 +950,7 @@ send_kafka() {
950
info "sent kafka data for: ${host} ${chart}.${name} is ${status} and ip '${KAFKA_SENDER_IP}'"
951
sent=$((sent + 1))
952
else
953
- error "failed to send kafka data for: ${host} ${chart}.${name} is ${status} and ip '${KAFKA_SENDER_IP}' with HTTP error code ${httpcode}."
953
+ error "failed to send kafka data for: ${host} ${chart}.${name} is ${status} and ip '${KAFKA_SENDER_IP}' with HTTP response status code ${httpcode}."
954
fi
955
956
[ ${sent} -gt 0 ] && return 0
@@ -1007,7 +1007,7 @@ EOF
1007
info "sent pagerduty notification for: ${host} ${chart}.${name} is ${status}'"
1008
sent=$((sent + 1))
1009
else
1010
- error "failed to send pagerduty notification for: ${host} ${chart}.${name} is ${status}, with HTTP error code ${httpcode}."
1010
+ error "failed to send pagerduty notification for: ${host} ${chart}.${name} is ${status}, with HTTP response status code ${httpcode}."
1011
fi
1012
done
1013
@@ -1036,7 +1036,7 @@ send_twilio() {
1036
info "sent Twilio SMS for: ${host} ${chart}.${name} is ${status} to '${user}'"
1037
sent=$((sent + 1))
1038
else
1039
- error "failed to send Twilio SMS for: ${host} ${chart}.${name} is ${status} to '${user}' with HTTP error code ${httpcode}."
1039
+ error "failed to send Twilio SMS for: ${host} ${chart}.${name} is ${status} to '${user}' with HTTP response status code ${httpcode}."
1040
fi
1041
done
1042
@@ -1085,7 +1085,7 @@ send_hipchat() {
1085
info "sent HipChat notification for: ${host} ${chart}.${name} is ${status} to '${room}'"
1086
sent=$((sent + 1))
1087
else
1088
- error "failed to send HipChat notification for: ${host} ${chart}.${name} is ${status} to '${room}' with HTTP error code ${httpcode}."
1088
+ error "failed to send HipChat notification for: ${host} ${chart}.${name} is ${status} to '${room}' with HTTP response status code ${httpcode}."
1089
fi
1090
done
1091
@@ -1115,7 +1115,7 @@ send_messagebird() {
1115
info "sent Messagebird SMS for: ${host} ${chart}.${name} is ${status} to '${user}'"
1116
sent=$((sent + 1))
1117
else
1118
- error "failed to send Messagebird SMS for: ${host} ${chart}.${name} is ${status} to '${user}' with HTTP error code ${httpcode}."
1118
+ error "failed to send Messagebird SMS for: ${host} ${chart}.${name} is ${status} to '${user}' with HTTP response status code ${httpcode}."
1119
fi
1120
done
1121
@@ -1142,7 +1142,7 @@ send_kavenegar() {
1142
info "sent Kavenegar SMS for: ${host} ${chart}.${name} is ${status} to '${user}'"
1143
sent=$((sent + 1))
1144
else
1145
- error "failed to send Kavenegar SMS for: ${host} ${chart}.${name} is ${status} to '${user}' with HTTP error code ${httpcode}."
1145
+ error "failed to send Kavenegar SMS for: ${host} ${chart}.${name} is ${status} to '${user}' with HTTP response status code ${httpcode}."
1146
fi
1147
done
1148
@@ -1182,7 +1182,7 @@ send_telegram() {
1182
elif [ "${httpcode}" = "401" ]; then
1183
error "failed to send telegram notification for: ${host} ${chart}.${name} is ${status} to '${chatid}': Wrong bot token."
1184
else
1185
- error "failed to send telegram notification for: ${host} ${chart}.${name} is ${status} to '${chatid}' with HTTP error code ${httpcode}."
1185
+ error "failed to send telegram notification for: ${host} ${chart}.${name} is ${status} to '${chatid}' with HTTP response status code ${httpcode}."
1186
fi
1187
done
1188
@@ -1241,7 +1241,7 @@ EOF
1241
info "sent Microsoft team notification for: ${host} ${chart}.${name} is ${status} to '${webhook}'"
1242
sent=$((sent + 1))
1243
else
1244
- error "failed to send Microsoft team notification for: ${host} ${chart}.${name} is ${status} to '${webhook}', with HTTP error code ${httpcode}."
1244
+ error "failed to send Microsoft team notification for: ${host} ${chart}.${name} is ${status} to '${webhook}', with HTTP response status code ${httpcode}."
1245
fi
1246
done
1247
@@ -1315,7 +1315,7 @@ EOF
1315
info "sent slack notification for: ${host} ${chart}.${name} is ${status} ${chstr}"
1316
sent=$((sent + 1))
1317
else
1318
- error "failed to send slack notification for: ${host} ${chart}.${name} is ${status} ${chstr}, with HTTP error code ${httpcode}."
1318
+ error "failed to send slack notification for: ${host} ${chart}.${name} is ${status} ${chstr}, with HTTP response status code ${httpcode}."
1319
fi
1320
done
1321
@@ -1378,7 +1378,7 @@ EOF
1378
info "sent rocketchat notification for: ${host} ${chart}.${name} is ${status} to '${channel}'"
1379
sent=$((sent + 1))
1380
else
1381
- error "failed to send rocketchat notification for: ${host} ${chart}.${name} is ${status} to '${channel}', with HTTP error code ${httpcode}."
1381
+ error "failed to send rocketchat notification for: ${host} ${chart}.${name} is ${status} to '${channel}', with HTTP response status code ${httpcode}."
1382
fi
1383
done
1384
@@ -1450,7 +1450,7 @@ EOF
1450
elif [ "${httpcode}" = "202" ]; then
1451
info "suppressed alerta notification for: ${host} ${chart}.${name} is ${status} to '${channel}'"
1452
else
1453
- error "failed to send alerta notification for: ${host} ${chart}.${name} is ${status} to '${channel}', with HTTP error code ${httpcode}."
1453
+ error "failed to send alerta notification for: ${host} ${chart}.${name} is ${status} to '${channel}', with HTTP response status code ${httpcode}."
1454
fi
1455
done
1456
@@ -1503,7 +1503,7 @@ send_flock() {
1503
info "sent flock notification for: ${host} ${chart}.${name} is ${status} to '${channel}'"
1504
sent=$((sent + 1))
1505
else
1506
- error "failed to send flock notification for: ${host} ${chart}.${name} is ${status} to '${channel}', with HTTP error code ${httpcode}."
1506
+ error "failed to send flock notification for: ${host} ${chart}.${name} is ${status} to '${channel}', with HTTP response status code ${httpcode}."
1507
fi
1508
done
1509
@@ -1565,7 +1565,7 @@ EOF
1565
info "sent discord notification for: ${host} ${chart}.${name} is ${status} to '${channel}'"
1566
sent=$((sent + 1))
1567
else
1568
- error "failed to send discord notification for: ${host} ${chart}.${name} is ${status} to '${channel}', with HTTP error code ${httpcode}."
1568
+ error "failed to send discord notification for: ${host} ${chart}.${name} is ${status} to '${channel}', with HTTP response status code ${httpcode}."
1569
fi
1570
done
1571
@@ -1594,7 +1594,7 @@ send_fleep() {
1594
info "sent fleep data for: ${host} ${chart}.${name} is ${status} and user '${FLEEP_SENDER}'"
1595
sent=$((sent + 1))
1596
else
1597
- error "failed to send fleep data for: ${host} ${chart}.${name} is ${status} and user '${FLEEP_SENDER}' with HTTP error code ${httpcode}."
1597
+ error "failed to send fleep data for: ${host} ${chart}.${name} is ${status} and user '${FLEEP_SENDER}' with HTTP response status code ${httpcode}."
1598
fi
1599
done
1600
@@ -1751,7 +1751,7 @@ EOF
1751
info "sent Matrix notification for: ${host} ${chart}.${name} is ${status} to '${room}'"
1752
sent=$((sent + 1))
1753
else
1754
- error "failed to send Matrix notification for: ${host} ${chart}.${name} is ${status} to '${room}', with HTTP error code ${httpcode}."
1754
+ error "failed to send Matrix notification for: ${host} ${chart}.${name} is ${status} to '${room}', with HTTP response status code ${httpcode}."
1755
fi
1756
done
1757
@@ -1959,7 +1959,7 @@ EOF
1959
info "sent hangouts notification for: ${host} ${chart}.${name} is ${status} to '${room}'"
1960
sent=$((sent + 1))
1961
else
1962
- error "failed to send hangouts notification for: ${host} ${chart}.${name} is ${status} to '${room}', with HTTP error code ${httpcode}."
1962
+ error "failed to send hangouts notification for: ${host} ${chart}.${name} is ${status} to '${room}', with HTTP response status code ${httpcode}."
1963
fi
1964
fi
1965
done