Module: check_mk
Branch: master
Commit: a19011bb5904d804bb1a7b3864d69c8d40c17168
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=a19011bb5904d8…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Thu Jul 24 11:40:25 2014 +0200
FIX SMS notifications: correctly handling spaces in phone numbers
A user might add a phone number with spaces, because the input is
not validated (formalized). This is a quick fix to prevent sendsms
to send messages to wrong numbers.
---
.werks/1061 | 10 ++++++++++
ChangeLog | 3 ++-
notifications/sms | 2 +-
3 files changed, 13 insertions(+), 2 deletions(-)
diff --git a/.werks/1061 b/.werks/1061
new file mode 100644
index 0000000..7da0ce0
--- /dev/null
+++ b/.werks/1061
@@ -0,0 +1,10 @@
+Title: SMS notifications: correctly handling spaces in phone numbers
+Level: 1
+Component: notifications
+Version: 1.2.5i5
+Date: 1406194717
+Class: fix
+
+A user might add a phone number with spaces, because the input is
+not validated (formalized). This is a quick fix to prevent sendsms
+to send messages to wrong numbers.
diff --git a/ChangeLog b/ChangeLog
index 4f05f54..cb4a500 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -38,8 +38,8 @@
* 1133 qlogic_sanbox_fabric_element: New Check for Fabric Elements in QLogic SANbox
Fibre Channel Switches
* 1134 bintec_sensors.fan: New Check for Fan Speed of Bintec Routers
* 1135 bintec_sensors.voltage, bintec_sensors.temp: New Checks for Voltage and
Temperature Sensors of Bintec Routers
- * 1136 bintec_brrp_status: New Check for BRRP States on Bintec Routers
* 1048 mem.win: support predictive levels...
+ * 1136 bintec_brrp_status: New Check for BRRP States on Bintec Routers
* 0994 FIX: agent plugin smart: fixed syntax error
* 0989 FIX: logwatch.ec: Fix forwarding multiple messages via syslog/TCP...
* 0943 FIX: if.include: fixed incorrect traffic percentage values in the check output
of if checks...
@@ -94,6 +94,7 @@
Notifications:
* 1042 Rule based notifications: allow matching on host groups...
* 0828 FIX: Mails sent with mail/asciimail plugin now really set the from address
+ * 1061 FIX: SMS notifications: correctly handling spaces in phone numbers...
Reporting & Availability:
* 0991 FIX: Availability: optionally show time stamps as UNIX epoch time...
diff --git a/notifications/sms b/notifications/sms
index 0a1dc82..ba310f2 100755
--- a/notifications/sms
+++ b/notifications/sms
@@ -54,7 +54,7 @@ if os.environ['NOTIFY_WHAT'] == 'SERVICE':
else:
message += "is " + os.environ['NOTIFY_HOSTSTATE']
-empf = os.environ['NOTIFY_CONTACTPAGER']
+empf = os.environ['NOTIFY_CONTACTPAGER'].replace( " ", "")
if 0 == os.system("%s %s '%s'" % (send_path, empf, message[:160])):
sys.exit(0)
else: