Module: check_mk
Branch: master
Commit: 9055aca8cdded0837cf93521daaeb3fb4bec055f
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=9055aca8cdded0…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Thu Jan 26 08:15:52 2012 +0100
Updated bug entries #0417
---
.bugs/417 | 7 +++++--
1 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/.bugs/417 b/.bugs/417
index 0b0fb12..a17df5c 100644
--- a/.bugs/417
+++ b/.bugs/417
@@ -1,11 +1,11 @@
Title: Split SNMPv2 and snmpwulkwalk options
Component: core
+State: done
+Class: nastiness
Benefit: 4
-State: open
Cost: 2
Date: 2011-11-29 15:16:00
Targetversion: 1.1.13i1
-Class: nastiness
Einige Geräte können zwar SNMPv2, setzen aber snmpbulkwalks nicht korrekt um oder
antworten gar nicht auf bulkwalks. Normale snmpwalks funktionieren gut.
@@ -15,3 +15,6 @@ Das ist mir sowohl bei Switchen, als auch gerade bei einem netapp filer aufgefal
Für solch einen Fall ist es wichtig, dass man SNMPv2 und die Bulkwalk Option getrennt
schalten kann. Man könnte z.B. bei gesetztem "bulk" Implizit "snmpv2" setzen, bei
manuell gesetztem "snmpv2" aber nicht automatisch "bulk".
+
+2012-01-26 08:15:49: changed state open -> done
+Erledigt durch neue Variable snmpv2c_hosts (siehe doku).
Module: check_mk
Branch: master
Commit: f6817297dbeee3361c10abfa2d03d7cbe65f7188
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=f6817297dbeee3…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Thu Jan 26 08:11:04 2012 +0100
New config variable snmpv2c_hosts
---
ChangeLog | 3 +++
modules/check_mk.py | 10 +++++++++-
web/plugins/wato/check_mk_configuration.py | 16 ++++++++++++----
3 files changed, 24 insertions(+), 5 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index f1ccae0..66a31ab 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -11,6 +11,9 @@
display string in the multisite GUI
* FIX: Fixed encoding problems with umlauts in group aliases
* FIX: honor extra_summary_host_conf (was ignored)
+ * new config variable snmpv2c_hosts that allows to enable SNMP v2c
+ but *not* bulkwalk (for some broken devices). bulkwalk_hosts still
+ implies v2c.
Checks & Agents:
* Windows agent: output eventlog texts in UTF-8 encoding. This
diff --git a/modules/check_mk.py b/modules/check_mk.py
index 3df7ff9..5708d28 100755
--- a/modules/check_mk.py
+++ b/modules/check_mk.py
@@ -263,6 +263,7 @@ host_paths = {}
snmp_hosts = [ (['snmp'], ALL_HOSTS) ]
tcp_hosts = [ (['tcp'], ALL_HOSTS), (NEGATE, ['snmp'], ALL_HOSTS), (['!ping'], ALL_HOSTS) ]
bulkwalk_hosts = []
+snmpv2c_hosts = []
usewalk_hosts = []
dyndns_hosts = [] # use host name as ip address for these hosts
ignored_checktypes = [] # exclude from inventory
@@ -593,9 +594,12 @@ def snmp_base_command(what, hostname):
if is_bulkwalk_host(hostname):
options = '-v2c'
else:
- options = '-v1'
if what == 'walk':
command = 'snmpwalk'
+ if is_snmpv2c_host(hostname):
+ options = '-v2c'
+ else:
+ options = '-v1'
options += " -c '%s'" % credentials
# Handle V3
@@ -648,6 +652,10 @@ def is_bulkwalk_host(hostname):
else:
return False
+def is_snmpv2c_host(hostname):
+ return is_bulkwalk_host(hostname) or \
+ in_binary_hostlist(hostname, snmpv2c_hosts)
+
def is_usewalk_host(hostname):
return in_binary_hostlist(hostname, usewalk_hosts)
diff --git a/web/plugins/wato/check_mk_configuration.py b/web/plugins/wato/check_mk_configuration.py
index 858d5cb..9430add 100644
--- a/web/plugins/wato/check_mk_configuration.py
+++ b/web/plugins/wato/check_mk_configuration.py
@@ -752,14 +752,22 @@ register_rule(group,
register_rule(group,
"bulkwalk_hosts",
- title = _("Hosts using SNMP v2c (and bulk walk)"),
+ title = _("Hosts using bulk walk (and SNMP v2c)"),
help = _("Most SNMP hosts support SNMP version 2c. However, Check_MK defaults to version 1, "
"in order to support as many devices as possible. Please use this ruleset in order "
"to configure SNMP v2c for as many hosts as possible. That version has two advantages: "
- "it supports 64 bit counters, which avoid problems with wrapping counters at too "
- "much traffic. And it support bulk walk, which saves much CPU and network ressourecs. "
+ "it supports 64 bit counters, which avoids problems with wrapping counters at too "
+ "much traffic. And it support bulk walk, which saves much CPU and network ressources. "
"Please be aware, however, that there are some broken devices out there, that support "
- "v2c but behave very bad when it is used. "))
+ "bulk walk but behave very bad when it is used. When you want to enable v2c while not using "
+ "bulk walk, please use the rule set snmpv2c_hosts instead."))
+
+register_rule(group,
+ "snmpv2c_hosts",
+ title = _("Hosts using SNMP v2c (and no bulk walk)"),
+ help = _("There exist a few devices out there that behave very badly when using SNMP bulk walk. "
+ "If you want to use SNMP v2c on those devices, nevertheless, then use this rule set. "
+ "One reason is enabling 64 bit counters."))
group = _("Operation mode of Check_MK")
Module: check_mk
Branch: master
Commit: f64d34fc47c5378ac3ee2f0a4239f11aea52c7b1
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=f64d34fc47c537…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Wed Jan 25 09:50:16 2012 +0100
WATO: Only localizing non empty host tag titles
---
web/htdocs/wato.py | 8 ++++++--
1 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/web/htdocs/wato.py b/web/htdocs/wato.py
index 0bb819f..7ba93db 100644
--- a/web/htdocs/wato.py
+++ b/web/htdocs/wato.py
@@ -3580,12 +3580,16 @@ class HostTagAttribute(Attribute):
def paint(self, value, hostname):
# Localize the titles. To make the strings available in the scanned localization
# files the _() function must also be placed in the configuration files
+ # But don't localize empty strings - This empty string is connected to the header
+ # of the .mo file
if len(self._taglist) == 1:
title = self._taglist[0][1]
+ if title:
+ title = _(title)
if value:
- return "", _(title)
+ return "", title
else:
- return "", "%s %s" % (_("not"), _(title))
+ return "", "%s %s" % (_("not"), title)
for entry in self._taglist:
if value == entry[0]:
return "", _(entry[1])
Module: check_mk
Branch: master
Commit: b60bd3505ffdc7dacf0fcd84a3dc6ff128d2a5e5
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=b60bd3505ffdc7…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Wed Jan 25 10:59:00 2012 +0100
FIX: Fixed problem handling non existant languages in multisite; Fixed detection of language files
---
web/htdocs/lib.py | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/web/htdocs/lib.py b/web/htdocs/lib.py
index cd5f0e9..2b62eb9 100644
--- a/web/htdocs/lib.py
+++ b/web/htdocs/lib.py
@@ -154,7 +154,7 @@ def load_language(lang):
if lang:
locale_base = defaults.locale_dir
local_locale_path = defaults.omd_root + "/local/share/check_mk/locale"
- po_path = '/%s/LC_MESSAGES/multisite.po' % lang
+ po_path = '/%s/LC_MESSAGES/multisite.mo' % lang
# Use file in OMD local strucuture when existing
if os.path.exists(local_locale_path + po_path):
locale_base = local_locale_path
@@ -163,7 +163,8 @@ def load_language(lang):
i18n = gettext.translation('multisite', locale_base, languages = [ lang ], codeset = 'UTF-8')
i18n.install(unicode = True)
except IOError, e:
- # Fallback to hardcoded default if the given language does not exist
+ # Fallback to non localized multisite
+ # I'd prefer to fallback to multisite default language but can not import config module here
__builtin__.current_language = config.default_language
else:
# Replace the _() function to disable i18n again
Module: check_mk
Branch: master
Commit: 0bddec55d86f62024e5068956dbbeb4a47c3ae83
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=0bddec55d86f62…
Author: Florian Heigl <fh(a)mathias-kettner.de>
Date: Wed Jan 25 22:23:45 2012 +0100
Update ChangeLog
---
ChangeLog | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index f1ccae0..7136aac 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -34,6 +34,7 @@
* New check: megaraid_bbu - check existance & status of LSI MegaRaid BBU module
* HP-UX Agent: fix mrpe (remove echo -e and test -e, thanks to Philipp Lemke)
* FIX: ntp checks: output numeric data also if stratum too high
+ * Linux agent: new check for dmraid-based "bios raid" (agent part as plugin)
Multisite:
* Improve transaction handling and reload detection: user can have
Module: check_mk
Branch: master
Commit: 949d50cacfb121d0c427d43a0c2e8afe2755305c
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=949d50cacfb121…
Author: Markus Lengler <ml(a)lengler-it.de>
Date: Tue Jan 24 16:14:43 2012 +0100
new check: check for linux dmraid (bios supported)
Signed-off-by: Florian Heigl <fh(a)mathias-kettner.de>
---
agents/plugins/dmraid | 19 ++++++++++
checkman/dmraid.ldisks | 20 +++++++++++
checkman/dmraid.pdisks | 20 +++++++++++
checks/dmraid | 88 ++++++++++++++++++++++++++++++++++++++++++++++++
4 files changed, 147 insertions(+), 0 deletions(-)
diff --git a/agents/plugins/dmraid b/agents/plugins/dmraid
new file mode 100755
index 0000000..5bcec9b
--- /dev/null
+++ b/agents/plugins/dmraid
@@ -0,0 +1,19 @@
+#!/bin/sh
+echo '<<<dmraid>>>'
+
+STATUS=$(dmraid -r)
+if [ $? != 0 ]; then
+ exit 1
+fi
+
+# Name und Status ausgeben
+dmraid -s | grep -e ^name -e ^status
+
+# Diskname der Raidplatten ausgeben
+DISKS=$(echo "$STATUS" | cut -f1 -d\:)
+
+for disk in $DISKS ; do
+ device=$(cat /sys/block/$(basename $disk)/device/model )
+ status=$(echo "$STATUS" | grep ^${disk})
+ echo "$status Model: $device"
+done
diff --git a/checkman/dmraid.ldisks b/checkman/dmraid.ldisks
new file mode 100644
index 0000000..3d6fac1
--- /dev/null
+++ b/checkman/dmraid.ldisks
@@ -0,0 +1,20 @@
+title: Check state of logical disks of DMRaid
+agents: linux
+author: Markus Lengler <ml(a)lengler-it.de>
+license: GPL
+distribution: check_mk
+description:
+ This check monitors the state of logical disks (RAID arrays) of a BIOS-controlled software raid,
+ that is managed using the dmraid utility. The types of supported arrays can be listed using {dmraid -l}.
+ The Linux agent detects such array if the {dmraid} command line utility is found in the shell
+ search path.
+
+ The utility {dmraid} is available/installable in all linux distributions.
+
+ The check will return CRITICAL if the raid is inconsitent or WARNING if the array if currently rebuilding. An OK status will be returned as OK.
+
+item:
+ One item is generated per logical disk found on the system.
+
+inventory:
+ All logical disks are automatically inventorized.
diff --git a/checkman/dmraid.pdisks b/checkman/dmraid.pdisks
new file mode 100644
index 0000000..41806f9
--- /dev/null
+++ b/checkman/dmraid.pdisks
@@ -0,0 +1,20 @@
+title: Check state of phyiscal disks of DMRaid
+agents: linux
+author: Markus Lengler <ml(a)lengler-it.de>
+license: GPL
+distribution: check_mk
+description:
+ This check monitors the state of physical disks (RAID arrays) of a BIOS-controlled software raid,
+ that is managed using the dmraid utility. The types of supported arrays can be listed using {dmraid -l}.
+ The Linux agent detects such array if the {dmraid} command line utility is found in the shell
+ search path.
+
+ The utility {dmraid} is available/installable in all linux distributions.
+
+ The check will return CRITICAL if a disk is failed or missing/removed. Otherwise it will return OK.
+
+item:
+ One item is generated per physical disk found in a DM array.
+
+inventory:
+ All logical disks are automatically inventorized.
diff --git a/checks/dmraid b/checks/dmraid
new file mode 100644
index 0000000..dbdafb3
--- /dev/null
+++ b/checks/dmraid
@@ -0,0 +1,88 @@
+#!/usr/bin/python
+# -*- encoding: utf-8; py-indent-offset: 4 -*-
+# +------------------------------------------------------------------+
+# | ____ _ _ __ __ _ __ |
+# | / ___| |__ ___ ___| | __ | \/ | |/ / |
+# | | | | '_ \ / _ \/ __| |/ / | |\/| | ' / |
+# | | |___| | | | __/ (__| < | | | | . \ |
+# | \____|_| |_|\___|\___|_|\_\___|_| |_|_|\_\ |
+# | |
+# | Copyright Mathias Kettner 2012 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.
+
+
+# Author: Markus Lengler <ml(a)lengler-it.de>
+
+
+# Example outputs from agent:
+#
+#<<<dmraid>>>
+#name : isw_ebdabbedfh_system
+#status : ok
+#/dev/sda: isw, "isw_ebdabbedfh", GROUP, ok, 976773166 sectors, data@ 0 Model: WDC WD5002ABYS-5
+#/dev/sdb: isw, "isw_ebdabbedfh", GROUP, ok, 976773166 sectors, data@ 0 Model: WDC WD5002ABYS-5
+
+
+def inventory_dmraid(checkname, info):
+ inventory=[]
+ for line in info:
+ if checkname == "dmraid.ldisks" and line[0] == "name":
+ inventory.append((line[2], None))
+ elif checkname == "dmraid.pdisks" and line[0].startswith("/dev/sd"):
+ item = line[0].split(":")[0]
+ inventory.append((item, None))
+ return inventory
+
+
+def check_dmraid_pdisks(item, _no_params, info):
+ for line in info:
+ if line[0].startswith("/dev/sd"):
+ disk = line[0].split(":")[0]
+ if disk == item:
+ status = line[4].split(",")[0]
+ if status == "ok":
+ pos=line.index("Model:")
+ model=" ".join(line[pos+1:])
+ return (0, "OK - Online (%s)" % model)
+ else:
+ return (2, "CRIT - Error on disk!!")
+ return (2, "CRIT - Missing disk!!")
+
+
+def check_dmraid_ldisks(item, _no_params, info):
+ LDISK_FOUND=False
+ for line in info:
+ if LDISK_FOUND:
+ if line[0] == "status":
+ status = line[2]
+ if status == "ok":
+ return(0, "OK - state is %s" % status)
+ else:
+ return(2, "CRIT - %s" % status)
+ if line[0] == "name" and line[2] == item:
+ LDISK_FOUND=True
+
+ return (3, "UNKNOWN - incomplete data from agent")
+
+
+check_info['dmraid.pdisks'] = \
+ (check_dmraid_pdisks, "RAID PDisk %s", 0, inventory_dmraid)
+
+
+check_info['dmraid.ldisks'] = \
+ (check_dmraid_ldisks, "RAID LDisk %s", 0, inventory_dmraid)