--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/.hgignore Tue Jun 07 12:55:47 2011 +0200
@@ -0,0 +1,8 @@
+syntax: glob
+*.swp
+debian/files
+check_smb
+
+syntax: regexp
+(build|configure)-stamp$
+debian/nagios-plugin-smb[./]
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/.perltitdy Tue Jun 07 12:55:47 2011 +0200
@@ -0,0 +1,2 @@
+--paren-tightness=2
+--square-bracket-tightness=2
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/Makefile Tue Jun 07 12:55:47 2011 +0200
@@ -0,0 +1,21 @@
+SCRIPTS = check_smb
+CLEANFILES = ${SCRIPTS}
+DESTDIR =
+prefix = /usr
+
+plugindir = ${prefix}/lib/nagios/plugins/ius
+
+.PHONY: all clean install
+
+all: ${SCRIPTS}
+
+clean:
+ -rm -f ${CLEANFILES}
+
+install: all
+ install -d -m 0755 ${DESTDIR}/${plugindir}
+ install -m 0755 $(SCRIPTS) ${DESTDIR}/${plugindir}/
+
+%: %.sh
+ @cp -f $< $@
+ @chmod +x $@
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/check_smb.sh Tue Jun 07 12:55:47 2011 +0200
@@ -0,0 +1,69 @@
+#!/bin/sh
+
+REVISION=0.1
+PROGNAME=$(/usr/bin/basename $0)
+
+STATE_OK=0
+STATE_WARNING=1
+STATE_CRITICAL=2
+STATE_UNKNOWN=3
+STATE_DEPENDENT=4
+
+print_revision() {
+ echo "$1 v$2 (nagios-plugins 1.4.15)"
+ echo "The nagios plugins come with ABSOLUTELY NO WARRANTY. You may redistribute\ncopies of the plugins under the terms of the GNU General Public License.\nFor more information about these matters, see the file named COPYING.\n"
+}
+
+support() {
+ echo "Send email to nagios-users@lists.sourceforge.net if you have questions\nregarding use of this software. To submit patches or suggest improvements,\nsend email to nagiosplug-devel@lists.sourceforge.net.\nPlease include version information with all correspondence (when possible,\nuse output from the --version option of the plugin itself).\n"
+}
+
+usage () {
+ echo "\
+Nagios plugin to check if (anonymous) access to SMB on host works.
+
+Usage:
+ $PROGNAME -H <host>
+ $PROGNAME --help
+ $PROGNAME --version
+"
+}
+
+help () {
+ print_revision $PROGNAME $REVISION
+ echo; usage; echo; support
+}
+
+if [ $# -lt 1 ] || [ $# -gt 2 ]; then
+ usage
+ exit $STATE_UNKNOWN
+fi
+
+while test -n "$1"; do
+ case "$1" in
+ --help | -h)
+ help
+ exit $STATE_OK;;
+ --version | -V)
+ print_revision $PROGNAME $REVISION
+ exit $STATE_OK;;
+ -H)
+ shift
+ host=$1;;
+ *)
+ usage; exit $STATE_UNKNOWN;;
+ esac
+ shift
+done
+
+stdout=$(/usr/bin/smbclient -U guest -N -L "$host" 2>&1)
+
+if [ $? -eq 0 ]; then
+ header=$(echo "$stdout" | grep Server= | head -n 1)
+ echo "OK $header"
+ exit $STATE_OK
+else
+ err=$(echo "$stdout" | head -n 1)
+ echo "CRITICAL SMB anon access: $err"
+ exit $STATE_CRITICAL
+fi
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/debian/changelog Tue Jun 07 12:55:47 2011 +0200
@@ -0,0 +1,5 @@
+nagios-plugin-smb (0.1) lenny squeeze; urgency=low
+
+ * Initial Release.
+
+ -- Christian Arnold <arnold@schlittermann.de> Tue, 07 Jun 2011 12:33:19 +0200
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/debian/compat Tue Jun 07 12:55:47 2011 +0200
@@ -0,0 +1,1 @@
+7
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/debian/control Tue Jun 07 12:55:47 2011 +0200
@@ -0,0 +1,13 @@
+Source: nagios-plugin-smb
+Section: net
+Priority: extra
+Maintainer: Christian Arnold <arnold@schlittermann.de>
+Build-Depends: debhelper (>= 7.0.50~)
+Standards-Version: 3.8.4
+Homepage: https://keller.schlittermann.de/hg/ius/nagios/nagios-plugin-smb
+
+Package: nagios-plugin-smb
+Architecture: all
+Depends: smbclient
+Description: nagios plugin to check samba status
+ Nagios plugin to check if (anonymous) access to SMB on host works.
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/debian/copyright Tue Jun 07 12:55:47 2011 +0200
@@ -0,0 +1,39 @@
+This work was packaged for Debian by:
+
+ Christian Arnold <arnold@schlittermann.de> on Tue, 07 Jun 2011 12:33:19 +0200
+
+It was downloaded from:
+
+ https://keller.schlittermann.de/hg/ius/nagios/nagios-plugin-smb/
+
+Upstream Author(s):
+
+ Christian Arnold <arnold@schlittermann.de>
+
+Copyright:
+
+ Copyright (C) 2011 Schlittermann internet & unix support
+
+License:
+
+ 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 3 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 3 can be found in "/usr/share/common-licenses/GPL-3".
+
+The Debian packaging is:
+
+ Copyright (C) 2011 Christian Arnold <arnold@schlittermann.de>
+
+and is licensed under the GPL version 3, see above.
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/debian/rules Tue Jun 07 12:55:47 2011 +0200
@@ -0,0 +1,13 @@
+#!/usr/bin/make -f
+# -*- makefile -*-
+# Sample debian/rules that uses debhelper.
+# This file was originally written by Joey Hess and Craig Small.
+# As a special exception, when this file is copied by dh-make into a
+# dh-make output file, you may use that output file without restriction.
+# This special exception was added by Craig Small in version 0.37 of dh-make.
+
+# Uncomment this to turn on verbose mode.
+#export DH_VERBOSE=1
+
+%:
+ dh $@
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/debian/source/format Tue Jun 07 12:55:47 2011 +0200
@@ -0,0 +1,1 @@
+3.0 (native)