Add dsa-check-port-closed
authorPeter Palfrader <peter@palfrader.org>
Sun, 3 Oct 2010 11:12:50 +0000 (13:12 +0200)
committerPeter Palfrader <peter@palfrader.org>
Sun, 3 Oct 2010 11:12:50 +0000 (13:12 +0200)
dsa-nagios-checks/checks/dsa-check-port-closed [new file with mode: 0755]
dsa-nagios-checks/debian/changelog

diff --git a/dsa-nagios-checks/checks/dsa-check-port-closed b/dsa-nagios-checks/checks/dsa-check-port-closed
new file mode 100755 (executable)
index 0000000..b3000d0
--- /dev/null
@@ -0,0 +1,15 @@
+#!/bin/bash
+
+/usr/lib/nagios/plugins/check_tcp "$@" > /dev/null
+rc="$?"
+
+if [ "$rc" -eq 0 ]; then
+       echo "Warning: port is open"
+       exit 1
+elif [ "$rc" -eq 2 ]; then
+       echo "OK: port is closed"
+       exit 0
+else
+       echo "Unknown exit code from check_tcp"
+       exit 3
+fi
index 616d692..b7cd103 100644 (file)
@@ -8,8 +8,9 @@ dsa-nagios-checks (8x) xnstable; urgency=low
   * dsa-check-running-kernel: check if 'strings' is installed and
     complain nicely if it isn't instead of falling over. [Uli Martens]
   * dsa-check-afs-*: add checks from Russ Allbery for monitoring our AFS
+  * Add dsa-check-port-closed.
 
- -- Peter Palfrader <weasel@debian.org>  Sun, 05 Sep 2010 11:33:10 +0200
+ -- Peter Palfrader <weasel@debian.org>  Sun, 03 Oct 2010 13:12:31 +0200
 
 dsa-nagios-checks (87) unstable; urgency=low