Package: nagios-statd-server
Version: 3.12-1.1
Severity: wishlist
Tags: patch

I've made a minor change to allow you to use globs when ignoring disks. With an 
automount setup any accesses to remote samba servers result in warnings as for 
local disks with issues. While you can specifically ignore disks its not 
remotely practical for even a small sized network.

With the change you can specify:
   -D '//*'
   -M '/mnt/my_automounts/*'
to ignore all samba mounts.

Disclaimer: It seems to work here, but I've not tested it widely and I don't 
actually know python!

--- nagios-stat.orig    2011-02-26 00:06:38.000000000 +0000
+++ nagios-stat 2011-02-26 00:29:46.000000000 +0000
@@ -1,6 +1,6 @@
 #!/usr/bin/python2.5
 
-import getopt, re, socket, sys
+import getopt, re, socket, sys, fnmatch
 
 class Functions:
        "This class determines the commands to use for your operating system, 
and executes them." 
@@ -46,14 +46,16 @@
 
                # Clean out ignored disks/mounts:
                if self.options.has_key("ignoredisk"):
-                       for i in disks[:]:
-                               if i[0] in self.options['ignoredisk']:
-                                       disks.remove(i)
+                       for pattern in self.options['ignoredisk']:
+                               for i in disks[:]:
+                                       if fnmatch.fnmatchcase(i[0], pattern):
+                                               disks.remove(i);
 
                if self.options.has_key("ignoremount"):
-                       for i in disks[:]:
-                               if i[2] in self.options['ignoremount']:
-                                       disks.remove(i)
+                       for pattern in self.options['ignoremount']:
+                               for i in disks[:]:
+                                       if fnmatch.fnmatchcase(i[2], pattern):
+                                               disks.remove(i);
 
                # Make sure that disk is found
                if (self.options.has_key("disk") and (len(disks) > 0)):
@@ -418,10 +420,10 @@
                print "Available checks are: disk, load, proc, swap, user and 
version.\n"
                print "-c, --critical=LEVEL       Level to issue critical at."
                print "-d, --disk=DISK            Disk to check in disk check."
-               print "-D, --ignoredisk=DISK      Comma delimited list of disks 
to ignore."
+               print "-D, --ignoredisk=DISK      Comma delimited list of disk 
globs to ignore."
                print "-l, --lt                   Used for process check, 
reverse warn/critical."
                print "-m, --mount=MOUNT          Mount point to check in disk 
check."
-               print "-M, --ignoremount=MOUNT    Comma delimited list of mount 
points to ignore."
+               print "-M, --ignoremount=MOUNT    Comma delimited list of mount 
points globs to ignore."
                print "-n, --processname=NAME     Name of process to search 
for."
                print "-p, --port=PORT            Port to connect to."
                print "-P, --perfdata             Print out performance data."



-- System Information:
Debian Release: 6.0
Architecture: i386 (i686)

Kernel: Linux 2.6.26-2-686 (SMP w/4 CPU cores)
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages nagios-statd-server depends on:
ii  python2.5                     2.5.5-11   An interactive high-level object-o

nagios-statd-server recommends no packages.

nagios-statd-server suggests no packages.

-- no debconf information



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to