[Pkg-nagios-changes] [pkg-nagios-plugins-contrib] 02/05: Revert "Remove check_shutdown."

Bernd Zeimetz bernd at bzed.de
Mon Jan 30 09:15:26 UTC 2017


This is an automated email from the git hooks/post-receive script.

bzed pushed a commit to branch wheezy-backports-sloppy
in repository pkg-nagios-plugins-contrib.

commit b30847e4e535e41d0590496cc2f6c2e9c14d67e9
Author: Bernd Zeimetz <bernd at bzed.de>
Date:   Mon Jan 30 10:02:04 2017 +0100

    Revert "Remove check_shutdown."
    
    This reverts commit f84c6a0e18a0f74c4e876e8fca93dd2a4cfa3d0e.
---
 check_shutdown/Makefile       |  5 +++++
 check_shutdown/check_shutdown | 30 ++++++++++++++++++++++++++++++
 check_shutdown/control        |  6 ++++++
 check_shutdown/copyright      | 14 ++++++++++++++
 4 files changed, 55 insertions(+)

diff --git a/check_shutdown/Makefile b/check_shutdown/Makefile
new file mode 100644
index 0000000..a347ae5
--- /dev/null
+++ b/check_shutdown/Makefile
@@ -0,0 +1,5 @@
+#/usr/bin/make -f
+
+PLUGIN = check_shutdown
+
+include ../common.mk
diff --git a/check_shutdown/check_shutdown b/check_shutdown/check_shutdown
new file mode 100755
index 0000000..cd27db6
--- /dev/null
+++ b/check_shutdown/check_shutdown
@@ -0,0 +1,30 @@
+#!/bin/sh
+#
+# Author: Petter Reinholdtsen <pere at hungry.com>
+# Date: 2011-02-03
+# License: GNU GPL v2 or later
+#
+# Report when a reboot is in progress.  Useful to detect if
+# reboot-when-idle have been used on a server.
+
+set -e
+
+PATH=/bin:/sbin:/usr/sbin:/usr/bin
+
+shutdownpid="`pgrep '^shutdown$'|head -1`"
+
+if [ "$shutdownpid" ] ; then
+    case "`uname -s`" in
+	Linux)
+	    cmd="`ps --no-headers --pid $shutdownpid -o command`"
+	    echo "REBOOT IN PROGRESS: $cmd"
+	    ;;
+	*)
+	    echo "REBOOT IN PROGRESS"
+	    ;;
+    esac
+    exit 1
+fi
+
+echo "OK - no shutdown running"
+exit 0
diff --git a/check_shutdown/control b/check_shutdown/control
new file mode 100644
index 0000000..390b8b5
--- /dev/null
+++ b/check_shutdown/control
@@ -0,0 +1,6 @@
+Uploaders: Petter Reinholdtsen <pere at hungry.com>
+Description: plugin to detect shutdown in progress
+ Report when a reboot is in progress.  This is useful to detect if
+ reboot-when-idle or similar have been used on a server.
+Recommends: procps
+Version: 0.0.20110203
diff --git a/check_shutdown/copyright b/check_shutdown/copyright
new file mode 100644
index 0000000..08d8906
--- /dev/null
+++ b/check_shutdown/copyright
@@ -0,0 +1,14 @@
+Copyright (C) 2011 Petter Reinholdtsen <pere at hungry.com>
+
+This program 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 program 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/>.

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-nagios/pkg-nagios-plugins-contrib.git



More information about the Pkg-nagios-changes mailing list