Module: check_mk
Branch: master
Commit: c96c11100572615f60c9fb437edd5cc3d4a00d29
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=c96c1110057261…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Wed Aug 27 11:05:25 2014 +0200
#1157 FIX Fixed SMS plugin on at least debian (distrs which have no sendsms/smssend)
Some distros do not provide the sendsms/smssend script with the smstools package.
In this cases the script for sending SMS did not work. This commit adds a dedection
when smssend/sendsms are not available whether the spool directory at
/var/spool/sms/outgoing is available or not. When it is available, the SMS notification
plugin drops a file to this directory which should then be processed by smsd.
---
.werks/1157 | 13 +++++++++++++
ChangeLog | 4 ++--
notifications/sms | 29 ++++++++++++++++++++++-------
3 files changed, 37 insertions(+), 9 deletions(-)
diff --git a/.werks/1157 b/.werks/1157
new file mode 100644
index 0000000..9f0e556
--- /dev/null
+++ b/.werks/1157
@@ -0,0 +1,13 @@
+Title: Fixed SMS plugin on at least debian (distrs which have no sendsms/smssend)
+Level: 1
+Component: notifications
+Compatible: compat
+Version: 1.2.5i6
+Date: 1409130157
+Class: fix
+
+Some distros do not provide the sendsms/smssend script with the smstools package.
+In this cases the script for sending SMS did not work. This commit adds a dedection
+when smssend/sendsms are not available whether the spool directory at
+/var/spool/sms/outgoing is available or not. When it is available, the SMS notification
+plugin drops a file to this directory which should then be processed by smsd.
diff --git a/ChangeLog b/ChangeLog
index 35e04df..ed8e512 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -59,9 +59,9 @@
* 1145 FIX: windows_tasks: handle case correctly where task is currently running...
* 1378 FIX: mk_logwatch: remove exceeding \n when rewriting message and using \0...
* 1147 FIX: upc_capacity, ups_socomec_capacity: Fix checking of battery left levels...
+ * 1099 FIX: tsm_scratch: now returns the variable name instead the values during inventory...
* 0650 FIX: f5_bigip_pool: limits to the number of active nodes are now correctly applied...
NOTE: Please refer to the migration notes!
- * 1099 FIX: tsm_scratch: now returns the variable name instead the values during inventory...
Multisite:
* 1066 Implemented Dashboard Designer...
@@ -70,7 +70,6 @@
* 1154 FIX: Availability: Fixed unwanted redirect to edit annotation page after editing availability options...
WATO:
- * 1095 New WATO Web-API: Now able to manage hosts via web automation calls
* 1096 New WATO webservices: manage hosts via webinterface...
* 1155 NagVis map edit/view permissions can now be set using roles...
* 1064 FIX: Fixed rare issue with WATO communication in distributed setups (different OS versions)...
@@ -83,6 +82,7 @@
Notifications:
* 1156 FIX: Graphs in HTML mails are now sent again where they where missing...
+ * 1157 FIX: Fixed SMS plugin on at least debian (distrs which have no sendsms/smssend)...
Event Console:
* 1007 FIX: check_mkevents: fix case where events contain binary zeroes
diff --git a/notifications/sms b/notifications/sms
index ba310f2..6156fa1 100755
--- a/notifications/sms
+++ b/notifications/sms
@@ -37,8 +37,13 @@ for binary in [ 'sendsms', 'smssend' ]:
if os.system('which %s >/dev/null' % binary) == 0:
send_path = binary
-if not send_path:
- sys.stderr.write('Error: SMS Tools binaries (sendsms or smssend) not found\n')
+smsd_user = 'smsd'
+spool_dir = '/var/spool/sms/outgoing'
+if not os.path.exists(spool_dir):
+ spool_dir = None
+
+if not send_path and not spool_dir:
+ sys.stderr.write('Error: SMS Tools binaries (sendsms or smssend) not found and spool dir does not exists.\n')
sys.exit(2) # Fatal error, no retry
max_len = 160
@@ -54,8 +59,18 @@ if os.environ['NOTIFY_WHAT'] == 'SERVICE':
else:
message += "is " + os.environ['NOTIFY_HOSTSTATE']
-empf = os.environ['NOTIFY_CONTACTPAGER'].replace( " ", "")
-if 0 == os.system("%s %s '%s'" % (send_path, empf, message[:160])):
- sys.exit(0)
-else:
- sys.exit(1)
+recipient = os.environ['NOTIFY_CONTACTPAGER'].replace( " ", "")
+
+if send_path:
+ if os.system("%s %s '%s'" % (send_path, recipient, message[:160])) >> 8 != 0:
+ sys.exit(1)
+elif spool_dir:
+ # On some distros, like debian, smstools does not ship with the sendsms/smssend helper
+ # script. On this distro, simply drop the SMS in the outgoing spool directory.
+ import tempfile, shutil
+ fd, path = tempfile.mkstemp(prefix = 'cmk_sms_')
+ os.write(fd, 'To: %s\n\n%s' % (recipient, message))
+ os.close(fd)
+ os.chmod(path, 0660)
+ filename = path.split('/')[-1]
+ shutil.move(path, spool_dir + '/' + filename)
Module: check_mk
Branch: master
Commit: 0bfd56189d7a9cd1cfbd76fea15f4a3e65fcd09b
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=0bfd56189d7a9c…
Author: Andreas Boesl <ab(a)mathias-kettner.de>
Date: Tue Aug 26 16:29:50 2014 +0200
#1100 FIX WATO backup domains: fixed bug were excluded files still got deleted on snapshot restore
It is possible to configure a backup domain so that certain files are not packed into the snapshot.<br>
As a result, upon restore these file should not get deleted..<br>
This mechanism did not work correctly.
---
.werks/1100 | 11 +++++++++++
ChangeLog | 3 ++-
web/htdocs/multitar.py | 4 ++--
3 files changed, 15 insertions(+), 3 deletions(-)
diff --git a/.werks/1100 b/.werks/1100
new file mode 100644
index 0000000..4a5a3c9
--- /dev/null
+++ b/.werks/1100
@@ -0,0 +1,11 @@
+Title: WATO backup domains: fixed bug were excluded files still got deleted on snapshot restore
+Level: 2
+Component: wato
+Compatible: compat
+Version: 1.2.5i6
+Date: 1409062516
+Class: fix
+
+It is possible to configure a backup domain so that certain files are not packed into the snapshot.<br>
+As a result, upon restore these file should not get deleted..<br>
+This mechanism did not work correctly.
diff --git a/ChangeLog b/ChangeLog
index 35e04df..861fd75 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -59,9 +59,9 @@
* 1145 FIX: windows_tasks: handle case correctly where task is currently running...
* 1378 FIX: mk_logwatch: remove exceeding \n when rewriting message and using \0...
* 1147 FIX: upc_capacity, ups_socomec_capacity: Fix checking of battery left levels...
+ * 1099 FIX: tsm_scratch: now returns the variable name instead the values during inventory...
* 0650 FIX: f5_bigip_pool: limits to the number of active nodes are now correctly applied...
NOTE: Please refer to the migration notes!
- * 1099 FIX: tsm_scratch: now returns the variable name instead the values during inventory...
Multisite:
* 1066 Implemented Dashboard Designer...
@@ -80,6 +80,7 @@
* 0191 FIX: Added swp files to the ignore list for the WATO git feature...
* 1153 FIX: Changed custom user attributes can now be used immediately...
* 0201 FIX: Fixed error message in Rulelist of RBN...
+ * 1100 FIX: WATO backup domains: fixed bug were excluded files still got deleted on snapshot restore...
Notifications:
* 1156 FIX: Graphs in HTML mails are now sent again where they where missing...
diff --git a/web/htdocs/multitar.py b/web/htdocs/multitar.py
index 4189097..d42d143 100644
--- a/web/htdocs/multitar.py
+++ b/web/htdocs/multitar.py
@@ -185,9 +185,9 @@ def extract_domains(tar, domains):
for pattern in domain.get("exclude", []):
if "*" in pattern:
import glob
- exclude_files.extend(glob.glob("%s/%s/%s" % (domain["prefix"], path, pattern)))
+ exclude_files.extend(glob.glob("%s/%s" % (domain["prefix"], pattern)))
else:
- exclude_files.append("%s/%s/%s" % (domain["prefix"], path, pattern))
+ exclude_files.append("%s/%s" % (domain["prefix"], pattern))
cleanup_dir(full_path, exclude_files)
else:
os.remove(full_path)