Module: check_mk
Branch: master
Commit: 3ca0536afe587cc71b113d7beaa489aca7b1dad1
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=3ca0536afe587c…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Wed Dec 18 16:25:58 2013 +0100
check-spaces / healspaces now handles windows newlins correctly
---
Makefile | 4 +-
checks/moxa_iologik_register | 144 +++++++++++++++++++++---------------------
2 files changed, 74 insertions(+), 74 deletions(-)
diff --git a/Makefile b/Makefile
index 7a810ae..4ac633a 100644
--- a/Makefile
+++ b/Makefile
@@ -59,7 +59,7 @@ check-spaces:
@if grep -q '[[:space:]]$$' $(SOURCE_FILES) ; then echo $$? ; figlet "Space
error" \
; echo "Aborting due to trailing spaces. Please use 'make
healspaces' to repair." \
; echo "Affected files: " \
- ; grep -l '[ ]$$' $(SOURCE_FILES) \
+ ; grep -l '[[:space:]]$$' $(SOURCE_FILES) \
; exit 1 ; fi
@echo OK
@@ -234,7 +234,7 @@ SOURCE_FILES = checkman/* modules/* checks/* notifications/* $$(find
-name Makef
healspaces:
@echo "Removing trailing spaces from code lines..."
- @sed -ri 's/[ ]+$$//g' $(SOURCE_FILES)
+ @sed -ri 's/[[:space:]]+$$//g' $(SOURCE_FILES)
setup:
diff --git a/checks/moxa_iologik_register b/checks/moxa_iologik_register
index 067cd30..7fa4d35 100644
--- a/checks/moxa_iologik_register
+++ b/checks/moxa_iologik_register
@@ -1,72 +1,72 @@
-#!/usr/bin/python
-# -*- encoding: utf-8; py-indent-offset: 4 -*-
-# +------------------------------------------------------------------+
-# | ____ _ _ __ __ _ __ |
-# | / ___| |__ ___ ___| | __ | \/ | |/ / |
-# | | | | '_ \ / _ \/ __| |/ / | |\/| | ' / |
-# | | |___| | | | __/ (__| < | | | | . \ |
-# | \____|_| |_|\___|\___|_|\_\___|_| |_|_|\_\ |
-# | |
-# | Copyright Mathias Kettner 2013 mk(a)mathias-kettner.de |
-# +------------------------------------------------------------------+
-#
-# This file is part of Check_MK.
-# The official homepage is at
http://mathias-kettner.de/check_mk.
-#
-# check_mk 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 in version 2. check_mk is distributed
-# in the hope that it will be useful, but WITHOUT ANY WARRANTY; with-
-# out even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-# PARTICULAR PURPOSE. See the GNU General Public License for more de-
-# ails. You should have received a copy of the GNU General Public
-# License along with GNU Make; see the file COPYING. If not, write
-# to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
-# Boston, MA 02110-1301 USA.
-
-# "0=Off, 1=On in DI/DO mode or N=Count in DO counter mode"
-
-def inventory_iologik_register(info):
- inventory = []
- for line in info:
- if line[2]:
- inventory.append((line[0], None ))
- return inventory
-
-
-def check_iologik_register(item, params, info):
- for line in info:
- if line[0] == item:
- if int(line[2]) in range(0, 2):
- return (int(line[2]), line[1])
- else:
- return (3, "Invalid value %s for register" % line[2])
-
- return (3, "Register not found")
-
-
-check_info['moxa_iologik_register'] = {
- "check_function" : check_iologik_register,
- "inventory_function" : inventory_iologik_register,
- "service_description" : "Moxa Register",
- "has_perfdata" : False,
- "group" : "iologik_register",
- "snmp_scan_function" : lambda oid:
oid(".1.3.6.1.4.1.8691.10.2242.2.0").startswith("E2242-T"),
- "snmp_info" :
(".1.3.6.1.4.1.8691.10.2242.10.4.1.1",
- [ "1", # index
- "2", # Name
- "3", # Value
- ])
-}
-
-# DIOEntry
-# dioIndex Integer32 (0..11) "The channel dio index."
-# dioType Integer32 (0..1) "The channel dio type. 0=DI, DO=1, AI=2"
-# dioMode Integer32 (0..1) "The channel dio mode. 0=DI, 1=Event Counter"
-# dioStatus Unsigned32 (0..4294967295) "The channel dio(di/do) status. 0=Off, 1=On
in DI/DO mode or N=Count in DO counter mode
-# dioFilter Integer32 (1..65535) "The channel dio(di) counter filter.
unit=0.5ms"
-# dioTrigger Integer32 (0..1) "The channel dio(di) counter trigger level. 0=L2H,
1=H2L"
-# dioCntStart Integer32 (0..1) "The channel dio(do) counter start/stop. 0=stop,
1=start"
-# dioPulseStart Integer32 (0..1) "The channel dio(do) pulse start/stop. 0=stop,
1=start"
-# dioPulseONWidth Unsigned32 (1..4294967295) "The channel dio(do) signal ON width.
unit=0.5ms"
-# dioPulseOFFWidth Unsigned32 (1..4294967295) "The channel dio(do) signal OFF width.
unit=0.5ms"
+#!/usr/bin/python
+# -*- encoding: utf-8; py-indent-offset: 4 -*-
+# +------------------------------------------------------------------+
+# | ____ _ _ __ __ _ __ |
+# | / ___| |__ ___ ___| | __ | \/ | |/ / |
+# | | | | '_ \ / _ \/ __| |/ / | |\/| | ' / |
+# | | |___| | | | __/ (__| < | | | | . \ |
+# | \____|_| |_|\___|\___|_|\_\___|_| |_|_|\_\ |
+# | |
+# | Copyright Mathias Kettner 2013 mk(a)mathias-kettner.de |
+# +------------------------------------------------------------------+
+#
+# This file is part of Check_MK.
+# The official homepage is at
http://mathias-kettner.de/check_mk.
+#
+# check_mk 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 in version 2. check_mk is distributed
+# in the hope that it will be useful, but WITHOUT ANY WARRANTY; with-
+# out even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE. See the GNU General Public License for more de-
+# ails. You should have received a copy of the GNU General Public
+# License along with GNU Make; see the file COPYING. If not, write
+# to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
+# Boston, MA 02110-1301 USA.
+
+# "0=Off, 1=On in DI/DO mode or N=Count in DO counter mode"
+
+def inventory_iologik_register(info):
+ inventory = []
+ for line in info:
+ if line[2]:
+ inventory.append((line[0], None ))
+ return inventory
+
+
+def check_iologik_register(item, params, info):
+ for line in info:
+ if line[0] == item:
+ if int(line[2]) in range(0, 2):
+ return (int(line[2]), line[1])
+ else:
+ return (3, "Invalid value %s for register" % line[2])
+
+ return (3, "Register not found")
+
+
+check_info['moxa_iologik_register'] = {
+ "check_function" : check_iologik_register,
+ "inventory_function" : inventory_iologik_register,
+ "service_description" : "Moxa Register",
+ "has_perfdata" : False,
+ "group" : "iologik_register",
+ "snmp_scan_function" : lambda oid:
oid(".1.3.6.1.4.1.8691.10.2242.2.0").startswith("E2242-T"),
+ "snmp_info" : (".1.3.6.1.4.1.8691.10.2242.10.4.1.1",
+ [ "1", # index
+ "2", # Name
+ "3", # Value
+ ])
+}
+
+# DIOEntry
+# dioIndex Integer32 (0..11) "The channel dio index."
+# dioType Integer32 (0..1) "The channel dio type. 0=DI, DO=1, AI=2"
+# dioMode Integer32 (0..1) "The channel dio mode. 0=DI, 1=Event Counter"
+# dioStatus Unsigned32 (0..4294967295) "The channel dio(di/do) status. 0=Off, 1=On
in DI/DO mode or N=Count in DO counter mode
+# dioFilter Integer32 (1..65535) "The channel dio(di) counter filter.
unit=0.5ms"
+# dioTrigger Integer32 (0..1) "The channel dio(di) counter trigger level. 0=L2H,
1=H2L"
+# dioCntStart Integer32 (0..1) "The channel dio(do) counter start/stop. 0=stop,
1=start"
+# dioPulseStart Integer32 (0..1) "The channel dio(do) pulse start/stop. 0=stop,
1=start"
+# dioPulseONWidth Unsigned32 (1..4294967295) "The channel dio(do) signal ON width.
unit=0.5ms"
+# dioPulseOFFWidth Unsigned32 (1..4294967295) "The channel dio(do) signal OFF width.
unit=0.5ms"