author | Sven Velt <sven@velt.de> | |
Thu, 3 Mar 2011 08:03:56 +0000 (09:03 +0100) | ||
committer | Sven Velt <sven@velt.de> | |
Thu, 3 Mar 2011 08:03:56 +0000 (09:03 +0100) |
13 files changed:
debian/README.Debian | [new file with mode: 0644] | patch | blob |
debian/changelog | [new file with mode: 0644] | patch | blob |
debian/compat | [new file with mode: 0644] | patch | blob |
debian/control | [new file with mode: 0644] | patch | blob |
debian/copyright | [new file with mode: 0644] | patch | blob |
debian/dirs | [new file with mode: 0644] | patch | blob |
debian/docs | [new file with mode: 0644] | patch | blob |
debian/etc/init.d/nagixsc_conf2http | [new file with mode: 0755] | patch | blob |
debian/etc/init.d/nagixsc_http2nagios | [new file with mode: 0755] | patch | blob |
debian/etc/nagixsc/conf/localhost.conf | [new file with mode: 0644] | patch | blob |
debian/etc/nagixsc/conf2http.cfg | [new file with mode: 0644] | patch | blob |
debian/etc/nagixsc/http2nagios.cfg | [new file with mode: 0644] | patch | blob |
debian/rules | [new file with mode: 0755] | patch | blob |
diff --git a/debian/README.Debian b/debian/README.Debian
--- /dev/null
+++ b/debian/README.Debian
@@ -0,0 +1,6 @@
+nagixsc for Debian
+------------------
+
+All configurations put in /etc/nagixsc/
+
+ -- Sven Velt <sven@velt.de> Thu, 04 Mar 2010 10:24:12 +0100
diff --git a/debian/changelog b/debian/changelog
--- /dev/null
+++ b/debian/changelog
@@ -0,0 +1,23 @@
+nagixsc (0.0.20101222-1) UNRELEASED; urgency=low
+
+ * New upstream version
+
+ -- Sven Velt <sven@velt.de> Wed, 22 Dec 2010 15:59:32 +0200
+
+nagixsc (0.0.20101015-1) unstable; urgency=low
+
+ * New upstream version
+
+ -- Sven Velt <sven@velt.de> Fri, 15 Oct 2010 10:34:37 +0200
+
+nagixsc (0.0.20100906-1) unstable; urgency=low
+
+ * New upstream version
+
+ -- Sven Velt <sven@velt.de> Mon, 06 Sep 2010 11:48:34 +0200
+
+nagixsc (0.0.20100304-1) unstable; urgency=low
+
+ * Initial release
+
+ -- Sven Velt <sven@velt.de> Thu, 04 Mar 2010 10:21:52 +0100
diff --git a/debian/control b/debian/control
--- /dev/null
+++ b/debian/control
@@ -0,0 +1,15 @@
+Source: nagixsc
+Section: net
+Priority: optional
+Maintainer: Sven Velt <sven@velt.de>
+Build-Depends: debhelper (>= 7.0.50~)
+Standards-Version: 3.8.0
+Homepage: http://github.com/wAmpIre/nagixsc
+
+Package: nagixsc
+Architecture: all
+Depends: ${misc:Depends}, ${python:Depends}, python-libxml2
+Suggests: python-openssl
+Provides: ${python:Provides}
+Description: Transport Nagios check results via HTTP
+ Nag(ix)SC is a replacement for NRPE and NSCA
diff --git a/debian/copyright b/debian/copyright
--- /dev/null
+++ b/debian/copyright
@@ -0,0 +1,43 @@
+This work was packaged for Debian by:
+
+ Sven Velt <sven@velt.de> on Thu, 04 Mar 2010 10:24:12 +0100
+
+It was downloaded from:
+
+ http://github.com/wAmpIre/nagixsc
+
+Upstream Author:
+
+ Sven Velt <sven@velt.de>
+
+Copyright:
+
+ Copyright (C) 2009-2010 Sven Velt
+
+License:
+
+ This package is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This package is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>
+
+On Debian systems, the complete text of the GNU General
+Public License version 2 can be found in "/usr/share/common-licenses/GPL-2".
+
+The Debian packaging is:
+
+ Copyright (C) 2010 Sven Velt <sven@velt.de>
+
+you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
diff --git a/debian/dirs b/debian/dirs
--- /dev/null
+++ b/debian/dirs
@@ -0,0 +1,4 @@
+etc/nagixsc
+usr/bin
+usr/sbin
+usr/share/python-support/nagixsc
diff --git a/debian/docs b/debian/docs
--- /dev/null
+++ b/debian/docs
@@ -0,0 +1 @@
+QUICKSTART.de.txt
diff --git a/debian/etc/init.d/nagixsc_conf2http b/debian/etc/init.d/nagixsc_conf2http
--- /dev/null
@@ -0,0 +1,104 @@
+#! /bin/sh
+### BEGIN INIT INFO
+# Provides: nagixsc_conf2http
+# Required-Start: $local_fs $remote_fs
+# Required-Stop: $local_fs $remote_fs
+# Default-Start: 2 3 4 5
+# Default-Stop: 0 1 6
+# Short-Description: Nag(IX)SC HTTP Pull
+# Description: Nag(IX)SC HTTP Pull
+### END INIT INFO
+
+# Author: Sven Velt <sven@velt.de>
+
+# PATH should only include /usr/* if it runs after the mountnfs.sh script
+PATH=/usr/sbin:/usr/bin:/sbin:/bin
+DESC="Nag(IX)SC Conf2HTTP"
+NAME=nagixsc_conf2http
+DAEMONPATH=/usr/sbin
+DAEMON=$DAEMONPATH/$NAME
+DAEMON_ARGS="-c /etc/nagixsc/conf2http.cfg --daemon"
+PIDFILE=/var/run/$NAME.pid
+SCRIPTNAME=/etc/init.d/$NAME
+
+# Exit if the package is not installed
+[ -x "$DAEMON" ] || exit 0
+
+# Read configuration variable file if it is present
+# [ -r /etc/default/$NAME ] && . /etc/default/$NAME
+
+# Load the VERBOSE setting and other rcS variables
+[ -f /etc/default/rcS ] && . /etc/default/rcS
+
+# Define LSB log_* functions.
+# Depend on lsb-base (>= 3.0-6) to ensure that this file is present.
+. /lib/lsb/init-functions
+
+is_running()
+{
+ [ -f "$PIDFILE" ] || return 1
+ ps ax | grep "`cat $PIDFILE`" | grep $NAME | grep -qv grep
+ return $?
+}
+
+do_start()
+{
+ is_running && return 1
+ start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON --test > /dev/null || return 1
+ start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON -- $DAEMON_ARGS || return 2
+}
+
+do_stop()
+{
+ start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 --pidfile $PIDFILE
+ RETVAL="$?"
+ [ "$RETVAL" = 2 ] && return 2
+ start-stop-daemon --stop --quiet --oknodo --retry=0/30/KILL/5 --exec $DAEMON
+ [ "$?" = 2 ] && return 2
+ rm -f $PIDFILE
+ return "$RETVAL"
+}
+
+
+
+case "$1" in
+ start)
+ [ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC" "$NAME"
+ do_start
+ case "$?" in
+ 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
+ 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
+ esac
+ ;;
+ stop)
+ [ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME"
+ do_stop
+ case "$?" in
+ 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
+ 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
+ esac
+ ;;
+ restart|force-reload)
+ log_daemon_msg "Restarting $DESC" "$NAME"
+ do_stop
+ case "$?" in
+ 0|1)
+ do_start
+ case "$?" in
+ 0) log_end_msg 0 ;;
+ 1) log_end_msg 1 ;; # Old process is still running
+ *) log_end_msg 1 ;; # Failed to start
+ esac
+ ;;
+ *)
+ # Failed to stop
+ log_end_msg 1
+ ;;
+ esac
+ ;;
+ *)
+ echo "Usage: $SCRIPTNAME {start|stop|restart|force-reload}" >&2
+ exit 3
+ ;;
+esac
+
diff --git a/debian/etc/init.d/nagixsc_http2nagios b/debian/etc/init.d/nagixsc_http2nagios
--- /dev/null
@@ -0,0 +1,104 @@
+#! /bin/sh
+### BEGIN INIT INFO
+# Provides: nagixsc_http2nagios
+# Required-Start: $local_fs $remote_fs
+# Required-Stop: $local_fs $remote_fs
+# Default-Start: 2 3 4 5
+# Default-Stop: 0 1 6
+# Short-Description: Nag(IX)SC HTTP Pull
+# Description: Nag(IX)SC HTTP Pull
+### END INIT INFO
+
+# Author: Sven Velt <sven@velt.de>
+
+# PATH should only include /usr/* if it runs after the mountnfs.sh script
+PATH=/usr/sbin:/usr/bin:/sbin:/bin
+DESC="Nag(IX)SC HTTP2Nagios"
+NAME=nagixsc_http2nagios
+DAEMONPATH=/usr/sbin
+DAEMON=$DAEMONPATH/$NAME
+DAEMON_ARGS="-c /etc/nagixsc/http2nagios.cfg --daemon"
+PIDFILE=/var/run/$NAME.pid
+SCRIPTNAME=/etc/init.d/$NAME
+
+# Exit if the package is not installed
+[ -x "$DAEMON" ] || exit 0
+
+# Read configuration variable file if it is present
+# [ -r /etc/default/$NAME ] && . /etc/default/$NAME
+
+# Load the VERBOSE setting and other rcS variables
+[ -f /etc/default/rcS ] && . /etc/default/rcS
+
+# Define LSB log_* functions.
+# Depend on lsb-base (>= 3.0-6) to ensure that this file is present.
+. /lib/lsb/init-functions
+
+is_running()
+{
+ [ -f "$PIDFILE" ] || return 1
+ ps ax | grep "`cat $PIDFILE`" | grep $NAME | grep -qv grep
+ return $?
+}
+
+do_start()
+{
+ is_running && return 1
+ start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON --test > /dev/null || return 1
+ start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON -- $DAEMON_ARGS || return 2
+}
+
+do_stop()
+{
+ start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 --pidfile $PIDFILE
+ RETVAL="$?"
+ [ "$RETVAL" = 2 ] && return 2
+ start-stop-daemon --stop --quiet --oknodo --retry=0/30/KILL/5 --exec $DAEMON
+ [ "$?" = 2 ] && return 2
+ rm -f $PIDFILE
+ return "$RETVAL"
+}
+
+
+
+case "$1" in
+ start)
+ [ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC" "$NAME"
+ do_start
+ case "$?" in
+ 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
+ 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
+ esac
+ ;;
+ stop)
+ [ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME"
+ do_stop
+ case "$?" in
+ 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
+ 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
+ esac
+ ;;
+ restart|force-reload)
+ log_daemon_msg "Restarting $DESC" "$NAME"
+ do_stop
+ case "$?" in
+ 0|1)
+ do_start
+ case "$?" in
+ 0) log_end_msg 0 ;;
+ 1) log_end_msg 1 ;; # Old process is still running
+ *) log_end_msg 1 ;; # Failed to start
+ esac
+ ;;
+ *)
+ # Failed to stop
+ log_end_msg 1
+ ;;
+ esac
+ ;;
+ *)
+ echo "Usage: $SCRIPTNAME {start|stop|restart|force-reload}" >&2
+ exit 3
+ ;;
+esac
+
diff --git a/debian/etc/nagixsc/conf/localhost.conf b/debian/etc/nagixsc/conf/localhost.conf
--- /dev/null
@@ -0,0 +1,19 @@
+[nagixsc]
+
+[localhost]
+_host_check: /usr/lib/nagios/plugins/check_host -H 127.0.0.1
+
+[localhost-disk]
+_host_name: localhost
+_host_check: /usr/lib/nagios/plugins/check_host -H 127.0.0.1
+Disk_Home: /usr/lib/nagios/plugins/check_disk -w 10% -c 5% -m -p /home
+Disk_Root: /usr/lib/nagios/plugins/check_disk -w 10% -c 5% -m -p /
+
+[localhost-other]
+_host_name: localhost
+_host_check: /usr/lib/nagios/plugins/check_host -H 127.0.0.1
+Load: /usr/lib/nagios/plugins/check_load -w 5,5,5 -c 10,10,10
+Procs_Total: /usr/lib/nagios/plugins/check_procs -w 200 -c 250
+Swap: /usr/lib/nagios/plugins/check_swap -w 50% -c 25%
+Users: /usr/lib/nagios/plugins/check_users -w 10 -c 15
+
diff --git a/debian/etc/nagixsc/conf2http.cfg b/debian/etc/nagixsc/conf2http.cfg
--- /dev/null
@@ -0,0 +1,47 @@
+; Lines starting with "#" are defaults
+
+[server]
+; ### ip (0.0.0.0) ###
+; IP to bind server
+#ip: 0.0.0.0
+
+; ### port (15666) ###
+; Port to bind server
+#port: 15666
+
+; ### ssl (false) ###
+; Use SSL for server communication
+#ssl: false
+
+; ### sslcert (no default) ###
+; Read server key and certificate from this file
+;sslcert: server.pem
+
+; ### conf_dir (no default) ###
+; Directory where your config files are stored
+;
+; Absolute file names recommended, but for quick start it is set relative
+; to the source directory
+conf_dir: /etc/nagixsc/conf
+
+; ### pidfile (/var/run/nagixsc_conf2http.pid) ###
+; Where to store pid file if daemonizing
+#pidfile: /var/run/nagixsc_conf2http.pid
+
+; ### livestatus_socket (no default) ###
+; Query mk-livestatus (http://mathias-kettner.de/checkmk_livestatus.html)
+; "livestatus_socket" could be
+; - local path and filename of socket ("/var/lib/nagios3/rw/live.sock")
+; - IPv4 address and port ("127.0.0.1:6557")
+; - IPv6 address and port ("[::1]:6557" or "::1:6557")
+; - DNS resolvable name and port ("localhost:6557") - could be IPv4 *or* IPv6!
+;
+; Path for Debian:
+;livestatus_socket: /var/lib/nagios3/rw/live.sock
+
+[users]
+; All users who are allowed to connect and request informations are stored here.
+; Passwords must be md5 encrypted, for example in shell use:
+; echo -n "Password" | md5sum -
+nagixsc: 019b0966d98fb71d1a4bc4ca0c81d5cc ; PW: nagixsc
+
diff --git a/debian/etc/nagixsc/http2nagios.cfg b/debian/etc/nagixsc/http2nagios.cfg
--- /dev/null
@@ -0,0 +1,49 @@
+; Lines starting with "#" are defaults
+
+[server]
+; ### ip (0.0.0.0) ###
+; IP to bind server
+#ip: 0.0.0.0
+
+; ### port (15667) ###
+; Port to bind server
+#port: 15667
+
+; ### ssl (false) ###
+; Use SSL for server communication
+#ssl: false
+
+; ### sslcert (no default) ###
+; Read server key and certificate from this file
+;sslcert: server.pem
+
+; ### pidfile (/var/run/nagixsc_http2nagios.pid) ###
+; Where to store pid file if daemonizing
+#pidfile: /var/run/nagixsc_http2nagios.pid
+
+; ### mode (no default) ###
+; Write checkresult files ("checkresult") or
+; write passive checks to command file ("passive")
+mode: checkresult
+
+[mode_passive]
+; ### pipe ###
+; File and path of Nagios command pipe
+pipe: /var/lib/nagios3/rw/nagios.cmd
+
+[mode_checkresult]
+; ### dir ###
+; Path to Nagios checkresult dir
+;
+; For Debian packages set to "/var/lib/nagios3/spool/checkresults"
+; For local compiled Nagios set to "/usr/local/nagios/var/spool/checkresults"
+;
+; For quick start set to "/tmp/cr"
+dir: /var/lib/nagios3/spool/checkresults
+
+[users]
+; All users who are allowed to connect and post informations are stored here.
+; Passwords must be md5 encrypted, for example in shell use:
+; echo -n "Password" | md5sum -
+nagixsc: 019b0966d98fb71d1a4bc4ca0c81d5cc ; PW: nagixsc
+
diff --git a/debian/rules b/debian/rules
--- /dev/null
+++ b/debian/rules
@@ -0,0 +1,30 @@
+#!/usr/bin/make -f
+
+# Uncomment this to turn on verbose mode.
+export DH_VERBOSE=1
+
+%:
+ dh $@
+
+override_dh_install:
+
+ cp -a $(CURDIR)/nagixsc $(CURDIR)/debian/nagixsc/usr/share/python-support/nagixsc/
+
+ cp -a $(CURDIR)/nagixsc_conf2http.py $(CURDIR)/debian/nagixsc/usr/sbin/
+ cp -a $(CURDIR)/nagixsc_http2nagios.py* $(CURDIR)/debian/nagixsc/usr/sbin/
+ find $(CURDIR)/debian/nagixsc/usr/sbin/ -name '*.py' -print0 | xargs -0r chmod 755
+ @for F in $(CURDIR)/debian/nagixsc/usr/sbin/*.py; do mv $${F} $${F/.py/}; done
+
+ cp -a $(CURDIR)/nagixsc_conf2xml.py $(CURDIR)/debian/nagixsc/usr/bin/
+ cp -a $(CURDIR)/nagixsc_live2xml.py $(CURDIR)/debian/nagixsc/usr/bin/
+ cp -a $(CURDIR)/nagixsc_read_xml.py $(CURDIR)/debian/nagixsc/usr/bin/
+ cp -a $(CURDIR)/nagixsc_write_xml.py $(CURDIR)/debian/nagixsc/usr/bin/
+ cp -a $(CURDIR)/nagixsc_xml2cfg.py $(CURDIR)/debian/nagixsc/usr/bin/
+ cp -a $(CURDIR)/nagixsc_xml2nagios.py $(CURDIR)/debian/nagixsc/usr/bin/
+ find $(CURDIR)/debian/nagixsc/usr/bin/ -name '*.py' -print0 | xargs -0r chmod 755
+ @for F in $(CURDIR)/debian/nagixsc/usr/bin/*.py; do mv $${F} $${F/.py/}; done
+
+ cp -a $(CURDIR)/debian/etc/* $(CURDIR)/debian/nagixsc/etc/
+
+ find $(CURDIR)/debian/nagixsc/etc/init.d/ -print0 | xargs -0r chmod 755
+