Module: check_mk
Branch: master
Commit: 6d52fcfa0a38ee9a87d4807e2bd7795617b9567f
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=6d52fcfa0a38ee…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Tue Feb 12 11:49:19 2013 +0100
mknotifyd: OMD integration
---
{mknotifyd/bin => doc/treasures}/mknotifyd | 0
mknotifyd/.f12 | 22 ---------
mknotifyd/.gitignore | 4 --
mknotifyd/omd/.f12 | 34 --------------
mknotifyd/omd/MKNOTIFYD.hook | 25 ----------
mknotifyd/omd/Makefile | 18 -------
mknotifyd/omd/logrotate.conf | 7 ---
mknotifyd/omd/mknotifyd.init | 54 ----------------------
mknotifyd/web/.f12 | 8 ---
{mknotifyd/web => web}/plugins/wato/mknotifyd.py | 4 +-
10 files changed, 2 insertions(+), 174 deletions(-)
diff --git a/mknotifyd/bin/mknotifyd b/doc/treasures/mknotifyd
similarity index 100%
rename from mknotifyd/bin/mknotifyd
rename to doc/treasures/mknotifyd
diff --git a/mknotifyd/.f12 b/mknotifyd/.f12
deleted file mode 100644
index c6255e4..0000000
--- a/mknotifyd/.f12
+++ /dev/null
@@ -1,22 +0,0 @@
-SITE=${SITE:-$(omd sites --bare | sort | head -n 1)}
-OMD_ROOT=/omd/sites/${SITE}
-
-for dir in web
-do
- if [ -e "$dir" ] ; then
- sudo rsync -var $dir/ $OMD_ROOT/share/check_mk/$dir/
- fi
-done
-sudo install -m 755 bin/mknotifyd $OMD_ROOT/bin/
-sudo touch $OMD_ROOT/share/check_mk/web/htdocs/*.py
-sudo install -m 755 omd/mknotifyd.init $OMD_ROOT/etc/init.d/mknotifyd
-sudo sed -i "s@###ROOT###@$OMD_ROOT@g" $OMD_ROOT/etc/init.d/mknotifyd
-sudo ln -sfn ../init.d/mknotifyd $OMD_ROOT/etc/rc.d/10-mknotifyd
-sudo install -m 755 omd/MKNOTIFYD.hook $OMD_ROOT/lib/omd/hooks/MKNOTIFYD
-sudo touch $OMD_ROOT/etc/check_mk/mknotifyd.mk
-
-sudo chown -R $SITE.$SITE $OMD_ROOT/{etc,local,var}
-sudo omd restart $SITE apache
-# sudo omd status $SITE mknotifyd && sudo omd restart $SITE mknotifyd
-
-
diff --git a/mknotifyd/.gitignore b/mknotifyd/.gitignore
deleted file mode 100644
index 29ee6d9..0000000
--- a/mknotifyd/.gitignore
+++ /dev/null
@@ -1,4 +0,0 @@
-.*.swp
-mknotifyd-*.*.*.tar.gz
-mknotifyd-*.*.*
-
diff --git a/mknotifyd/omd/.f12 b/mknotifyd/omd/.f12
deleted file mode 100644
index 187b833..0000000
--- a/mknotifyd/omd/.f12
+++ /dev/null
@@ -1,34 +0,0 @@
-#!/bin/bash
-SITE=${SITE:-ev}
-
-# MAKE dist tarball
-cd ..
-VERSION=$(sed -rn '/^VERSION="(.*)"/s//\1/p' < bin/mknotifyd)
-DIRNAME=mknotifyd-$VERSION
-rm -rf $DIRNAME
-mkdir -p $DIRNAME
-rm -f src/mknotify
-cp -r web bin $DIRNAME
-tar cvzf $DIRNAME.tar.gz --exclude=.git* --exclude=.f12 --exclude=.*.swp $DIRNAME
-
-# Integrate into CMK+OMD
-OMD=../../cmk-omd/packages/mknotifyd
-mkdir -p $OMD
-cp -v $DIRNAME.tar.gz $OMD
-sed "s/^VERSION = .*/VERSION = $VERSION/" omd/Makefile > $OMD/Makefile
-mkdir -p $OMD/skel/etc/init.d
-install -m 755 omd/mknotifyd.init $OMD/skel/etc/init.d/mknotifyd
-install -m 755 omd/MKNOTIFYD.hook $OMD
-mkdir -p $OMD/skel/etc/check_mk/mknotifyd.d/wato
-echo '# Configuration of mknotifyd' > $OMD/skel/etc/check_mk/mknotifyd.mk
-echo 'etc/init.d/mknotifyd 755' > $OMD/skel.permissions
-mkdir -p $OMD/skel/etc/rc.d
-ln -sfn ../init.d/mknotifyd $OMD/skel/etc/rc.d/10-mknotifyd
-
-# Directly put into our test site
-if [ -n "$SITE" -a -e "/omd/sites/$SITE" ] ; then
- sudo install -o $SITE -g $SITE -v -m 755 omd/mknotifyd.init
/omd/sites/$SITE/etc/init.d/mknotifyd
- sudo install -o $SITE -g $SITE -v -m 644 omd/logrotate.conf
/omd/sites/$SITE/etc/logrotate.d/mknotifyd
- sudo sed -i "s@###ROOT###@/omd/sites/$SITE@g"
/omd/sites/$SITE/etc/logrotate.d/mknotifyd
- sudo install -d -o $SITE -g $SITE /omd/sites/$SITE/var/log/mknotifyd
-fi
diff --git a/mknotifyd/omd/MKNOTIFYD.hook b/mknotifyd/omd/MKNOTIFYD.hook
deleted file mode 100755
index 7d0409c..0000000
--- a/mknotifyd/omd/MKNOTIFYD.hook
+++ /dev/null
@@ -1,25 +0,0 @@
-#!/bin/bash
-
-# Alias: Start Check_MK Notification Spooler
-# Menu: Addons
-# Description:
-# This option enables the Check_MK notification spooler
-
-case "$1" in
- default)
- echo "off"
- ;;
- choices)
- echo "on: enable"
- echo "off: disable"
- ;;
- set)
- if [ "$2" = on ] ; then
- enabled=True
- else
- enabled=False
- fi
- echo -e "# Set by OMD hook MKNOTIFYD, do not change here!\nmknotifyd_enabled
= $enabled" \
- > $OMD_ROOT/etc/check_mk/multisite.d/mknotifyd.mk
- ;;
-esac
diff --git a/mknotifyd/omd/Makefile b/mknotifyd/omd/Makefile
deleted file mode 100644
index 4e71750..0000000
--- a/mknotifyd/omd/Makefile
+++ /dev/null
@@ -1,18 +0,0 @@
-include ../../Makefile.omd
-
-NAME = mknotifyd
-VERSION = foobar
-DIR = $(NAME)-$(VERSION)
-
-build:
- tar xzf $(DIR).tar.gz
-
-install:
- mkdir -p $(DESTDIR)$(OMD_ROOT)/bin
- install -m 755 $(DIR)/bin/* $(DESTDIR)$(OMD_ROOT)/bin
- mkdir -p $(DESTDIR)$(OMD_ROOT)/share/check_mk/web
- cp -pr $(DIR)/web/* $(DESTDIR)$(OMD_ROOT)/share/check_mk/web
-
-clean:
-# rm -rf mk-notifyd-*.*.*
-
diff --git a/mknotifyd/omd/logrotate.conf b/mknotifyd/omd/logrotate.conf
deleted file mode 100644
index bca3d9c..0000000
--- a/mknotifyd/omd/logrotate.conf
+++ /dev/null
@@ -1,7 +0,0 @@
-###ROOT###/var/log/mknotifyd.log {
- missingok
- rotate 52
- compress
- delaycompress
- notifempty
-}
diff --git a/mknotifyd/omd/mknotifyd.init b/mknotifyd/omd/mknotifyd.init
deleted file mode 100755
index 2bb814a..0000000
--- a/mknotifyd/omd/mknotifyd.init
+++ /dev/null
@@ -1,54 +0,0 @@
-#!/bin/bash
-
-unset LANG
-
-PIDFILE=$OMD_ROOT/tmp/run/mknotifyd/pid
-STATUS_SOCKET=$OMD_ROOT/tmp/run/mknotifyd/status
-DAEMON=$OMD_ROOT/bin/mknotifyd
-STATEFILE=$OMD_ROOT/var/mknotifyd/status
-THE_PID=$(cat $PIDFILE 2>/dev/null)
-# OPTS="--debug"
-OPTS=""
-
-. $OMD_ROOT/etc/omd/site.conf
-if [ "$CONFIG_MKNOTIFYD" != on ] ; then
- exit 5
-fi
-
-case "$1" in
- start)
- echo -n 'Starting mknotifyd...'
- $DAEMON $OPTS
- echo OK
- ;;
- stop)
- echo -n 'Stopping mknotifyd...'
- if [ -z "$THE_PID" ] ; then
- echo 'Not running.'
- else
- echo "killing $THE_PID..."
- kill $THE_PID
- fi
- ;;
- restart)
- $0 stop
- $0 start
- ;;
-
- status)
- echo -n 'Checking status of mknotifyd...'
- if [ -z "$THE_PID" ] ; then
- echo "not running (PID file missing)"
- exit 1
- elif ! kill -0 $THE_PID ; then
- echo "not running (PID file orphaned)"
- exit 1
- else
- echo "running"
- exit 0
- fi
- ;;
- *)
- echo "Usage: $0 {start|stop|restart|status}"
- ;;
-esac
diff --git a/mknotifyd/web/.f12 b/mknotifyd/web/.f12
deleted file mode 100644
index 2c8d957..0000000
--- a/mknotifyd/web/.f12
+++ /dev/null
@@ -1,8 +0,0 @@
-#!/bin/bash
-SITE=${SITE:-$(omd sites --bare | head -n 1)}
-C=$(sudo cp --preserve=mode -rv * /omd/versions/default/share/check_mk/web/ | wc -l)
-#C=$(sudo cp --preserve=mode -rv htdocs/*.{css,py}
/omd/versions/default/share/check_mk/web/htdocs/ | wc -l)
-echo "$C files copied"
-if [ "$SITE" != - ] ; then
- sudo omd restart $SITE apache
-fi
diff --git a/mknotifyd/web/plugins/wato/mknotifyd.py b/web/plugins/wato/mknotifyd.py
similarity index 98%
rename from mknotifyd/web/plugins/wato/mknotifyd.py
rename to web/plugins/wato/mknotifyd.py
index f7d90a1..9ee6dd5 100644
--- a/mknotifyd/web/plugins/wato/mknotifyd.py
+++ b/web/plugins/wato/mknotifyd.py
@@ -29,8 +29,8 @@ import config
try:
mknotifyd_enabled = config.mknotifyd_enabled
except:
- # Non OMD-users: always show Spooling options
- mknotifyd_enabled = True
+ # Non OMD-users: must enable this explicitely, sorry
+ mknotifyd_enabled = False
config_dir = defaults.default_config_dir + "/mknotifyd.d/wato/"