Module: check_mk
Branch: master
Commit: b3a7ca48b7892ea677e9d2cc563b7ca7a50ec4bb
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=b3a7ca48b7892e…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Tue Dec 22 16:05:54 2015 +0100
GUI-Tests: new option -E for adding artificial reschedule step
---
doc/helpers/guitest | 52 ++++++++++++++++++++++++++++++++++++---------------
1 file changed, 37 insertions(+), 15 deletions(-)
diff --git a/doc/helpers/guitest b/doc/helpers/guitest
index 706efcf..1009f23 100755
--- a/doc/helpers/guitest
+++ b/doc/helpers/guitest
@@ -320,8 +320,26 @@ def add_wait_step(args):
wait_seconds = int(args[1]) / 1000.0
guitest[step_number+1:step_number+1] = [ { "wait" : wait_seconds } ]
save_guitest(test_name, guitest)
+ add_special_step("wait", args)
+def add_reschedule_step(args):
+ if len(args) != 2:
+ bail_out("Please specify the test and the step number to add the reschdule after")
+ test_name = args[1]
+ guitest = load_guitest(test_name)
+ step_number = int(args[0])
+ guitest[step_number+1:step_number+1] = [{
+ 'elapsed_time': 0.01,
+ 'filename': 'guitest_reschedule_all',
+ 'output': {'message': [('message', 'All hosts are checked.\n'),
+ ('message', 'All services are checked.\n')],
+ 'page_title': ['Rescheduling and waiting for check results']},
+ 'user': u'omdadmin',
+ 'variables': {},
+ }]
+ save_guitest(test_name, guitest)
+
#.
# .-Helpers--------------------------------------------------------------.
# | _ _ _ |
@@ -390,23 +408,24 @@ Usage: cmk-guitest [OPTIONS] MODE [ARGS...]
OPERATION MODES
- (no option) [TESTS...] Run some or all tests
- -R, --repair Run a test and at the same time rerecord it
- -r, --record Start/stop recording test TEST
- -l, --list-tests [TEST] List one or all tests
- -x, --extract RANGE TEST [OUTPUT] Extract a range of steps from a test to stdout
- -D, --delete RANGE TEST Remove a range of steps from a test
- -W, --add-wait-step STEP MS TEST Insert and artificial wait phase into the test
- -h, --help Show this crufty help
+ (no option) [TESTS...] Run some or all tests
+ -R, --repair Run a test and at the same time rerecord it
+ -r, --record Start/stop recording test TEST
+ -l, --list-tests [TEST] List one or all tests
+ -x, --extract RANGE TEST [OUTPUT] Extract a range of steps from a test to stdout
+ -D, --delete RANGE TEST Remove a range of steps from a test
+ -W, --add-wait-step STEP MS TEST Insert and artificial wait phase into the test
+ -E, --add-reschedule-step STEP TEST Insert and artificial "reschedule all checks"
+ -h, --help Show this crufty help
OPTIONS
- -v, --verbose Output debug information on stderr
- --debug Do not catch Python exceptions
- -S, --steps RANGE Just run steps START...END (1st step is 0)
- -i, --interactive When tests fail ask for automatic repair
- -c, --continue Continue after errors
+ -v, --verbose Output debug information on stderr
+ --debug Do not catch Python exceptions
+ -S, --steps RANGE Just run steps START...END (1st step is 0)
+ -i, --interactive When tests fail ask for automatic repair
+ -c, --continue Continue after errors
RANGES
@@ -430,9 +449,10 @@ Usage: cmk-guitest [OPTIONS] MODE [ARGS...]
# | Main entry point, getopt, etc. |
# '----------------------------------------------------------------------'
-short_options = 'hvrslRS:x:D:icW'
+short_options = 'hvrslRS:x:D:icWE'
long_options = [ "help", "debug", "verbose", "list-tests=", "record", "repair",
- "steps=", "extract=", "delete=", "interactive", "continue", "add-wait-step" ]
+ "steps=", "extract=", "delete=", "interactive", "continue",
+ "add-wait-step", "add-reschedule-step" ]
opt_verbose = False
opt_debug = False
@@ -467,6 +487,8 @@ for o,a in opts:
mode_function = delete_steps_from_test
elif o in [ '-W', '--add-wait-step' ]:
mode_function = add_wait_step
+ elif o in [ '-E', '--add-reschedule-step' ]:
+ mode_function = add_reschedule_step
# Modifiers
elif o in [ '-S', '--steps' ]:
Module: check_mk
Branch: master
Commit: 5188e8cf8ce06b4ff3dba61f9f751e0b4b260259
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=5188e8cf8ce06b…
Author: Simon Betz <si(a)mathias-kettner.de>
Date: Mon Dec 21 11:25:05 2015 +0100
#2886 solaris_fmadm: new check monitors the severity and name of the fault class on Solaris systems using the 'fmadm faulty' command
---
.werks/2886 | 8 +++
ChangeLog | 1 +
agents/check_mk_agent.solaris | 7 +++
checkman/solaris_fmadm | 18 ++++++
checks/solaris_fmadm | 126 +++++++++++++++++++++++++++++++++++++++++
5 files changed, 160 insertions(+)
diff --git a/.werks/2886 b/.werks/2886
new file mode 100644
index 0000000..d46d040
--- /dev/null
+++ b/.werks/2886
@@ -0,0 +1,8 @@
+Title: solaris_fmadm: new check monitors the severity and name of the fault class on Solaris systems using the 'fmadm faulty' command
+Level: 1
+Component: checks
+Compatible: compat
+Version: 1.2.7i4
+Date: 1450693400
+Class: feature
+
diff --git a/ChangeLog b/ChangeLog
index dcf7160..624b45b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -70,6 +70,7 @@
* 2817 cmc_temp: New temperature check for Rittal devices using the CMC MIB
* 1600 check_mk_agent.linux: Diskstat Sektion now supports s390 DASDs (zLinux on IBM Mainframes)
* 1318 cisco_asa_svcsessions: New Check to monitor VPN Connections on Cisco ASA devices
+ * 2886 solaris_fmadm: new check monitors the severity and name of the fault class on Solaris systems using the 'fmadm faulty' command
* 2660 FIX: fixed windows agent using the wrong working directory...
* 2664 FIX: ps: Speedup in situation with many matching processes...
* 2661 FIX: windows agent: fixed incomplete process list...
diff --git a/agents/check_mk_agent.solaris b/agents/check_mk_agent.solaris
index 579c41c..499ead4 100755
--- a/agents/check_mk_agent.solaris
+++ b/agents/check_mk_agent.solaris
@@ -293,6 +293,13 @@ then
trd -s
fi
+# Displaying Information About Faults or Defects
+# If there are no faults the output of this command will be empty.
+if type fmadm faulty > /dev/null 2>&1
+then
+ echo '<<<solaris_fmadm:sep(58)>>>'
+ fmadm faulty
+fi
# MK's Remote Plugin Executor
if test -f "$MK_CONFDIR/mrpe.cfg"
diff --git a/checkman/solaris_fmadm b/checkman/solaris_fmadm
new file mode 100644
index 0000000..74615f2
--- /dev/null
+++ b/checkman/solaris_fmadm
@@ -0,0 +1,18 @@
+title: Fault Class on Solaris
+agents: solaris
+catalog: os/solaris
+license: GPL
+distribution: check_mk
+description:
+ This check monitors the name and severity of the fault class on Solaris systems using
+ the 'fmadm faulty' command.
+ For more information see https://docs.oracle.com/cd/E23824_01/html/821-1451/glisy.html
+
+ The check is OK if there are no faults. Otherwise there are three types of
+ faults: minor will be WARN, major and critical will be CRIT.
+
+item:
+ No item.
+
+inventory:
+ One service is created.
diff --git a/checks/solaris_fmadm b/checks/solaris_fmadm
new file mode 100644
index 0000000..5693e01
--- /dev/null
+++ b/checks/solaris_fmadm
@@ -0,0 +1,126 @@
+#!/usr/bin/python
+# -*- encoding: utf-8; py-indent-offset: 4 -*-
+# +------------------------------------------------------------------+
+# | ____ _ _ __ __ _ __ |
+# | / ___| |__ ___ ___| | __ | \/ | |/ / |
+# | | | | '_ \ / _ \/ __| |/ / | |\/| | ' / |
+# | | |___| | | | __/ (__| < | | | | . \ |
+# | \____|_| |_|\___|\___|_|\_\___|_| |_|_|\_\ |
+# | |
+# | Copyright Mathias Kettner 2015 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.
+
+
+# No faults:
+# Agent section is empty
+
+# From https://docs.oracle.com/cd/E23824_01/html/821-1451/glisy.html
+# One fault:
+# --------------- ------------------------------------ -------------- ---------
+# TIME EVENT-ID MSG-ID SEVERITY
+# --------------- ------------------------------------ -------------- ---------
+# Aug 24 17:56:03 7b83c87c-78f6-6a8e-fa2b-d0cf16834049 SUN4V-8001-8H Minor
+#
+# Host : bur419-61
+# Platform : SUNW,T5440 Chassis_id : BEL07524BN
+# Product_sn : BEL07524BN
+#
+# Fault class : fault.cpu.ultraSPARC-T2plus.ireg
+# Affects : cpu:///cpuid=0/serial=1F95806CD1421929
+# faulted and taken out of service
+# FRU : "MB/CPU0" (hc://:product-id=SUNW,T5440:server-id=bur419-61:\
+# serial=3529:part=541255304/motherboard=0/cpuboard=0)
+# faulty
+# Serial ID. : 3529
+# 1F95806CD1421929
+#
+# Description : The number of integer register errors associated with this thread
+# has exceeded acceptable levels.
+#
+# Response : The fault manager will attempt to remove the affected thread from
+# service.
+#
+# Impact : System performance may be affected.
+#
+# Action : Use 'fmadm faulty' to provide a more detailed view of this event.
+# Please refer to the associated reference document at
+# http://sun.com/msg/SUN4V-8001-8H for the latest service
+# procedures and policies regarding this diagnosis.
+
+# Multiple faults:
+# --------------- ------------------------------------ -------------- -------
+# TIME EVENT-ID MSG-ID SEVERITY
+# --------------- ------------------------------------ -------------- -------
+# Sep 21 10:01:36 d482f935-5c8f-e9ab-9f25-d0aaafec1e6c PCIEX-8000-5Y Major
+#
+# Fault class : fault.io.pci.device-invreq
+# Affects : dev:///pci@0,0/pci1022,7458@11/pci1000,3060@0
+# dev:///pci@0,0/pci1022,7458@11/pci1000,3060@1
+# ok and in service
+# dev:///pci@0,0/pci1022,7458@11/pci1000,3060@2
+# dev:///pci@0,0/pci1022,7458@11/pci1000,3060@3
+# faulty and taken out of service
+# FRU : "SLOT 2" (hc://.../pciexrc=3/pciexbus=4/pciexdev=0)
+# repair attempted
+# "SLOT 3" (hc://.../pciexrc=3/pciexbus=4/pciexdev=1)
+# acquitted
+# "SLOT 4" (hc://.../pciexrc=3/pciexbus=4/pciexdev=2)
+# not present
+# "SLOT 5" (hc://.../pciexrc=3/pciexbus=4/pciexdev=3)
+# faulty
+#
+# Description : The transmitting device sent an invalid request.
+#
+# Response : One or more device instances may be disabled
+#
+# Impact : Possible loss of services provided by the device instances
+# associated with this fault
+#
+# Action : Use 'fmadm faulty' to provide a more detailed view of this event.
+# Please refer to the associated reference document at
+# http://sun.com/msg/PCIEX-8000-5Y for the latest service
+# procedures and policies regarding this diagnosis.
+
+
+def inventory_solaris_fmadm(info):
+ return [ (None, None) ]
+
+
+def check_solaris_fmadm(item, params, info):
+ if not info:
+ return 0, "No faults detected"
+
+ map_state = {
+ "minor" : (1, "minor"),
+ "major" : (2, "major"),
+ "critical" : (2, "critical"),
+ }
+
+ infotext = ""
+ state, state_readable = map_state.get(info[3][-1].split(" ")[-1].lower(), (3, "unknown"))
+ for line in info[4:]:
+ if line[0].strip().lower() == "fault class":
+ infotext += "Status: %s, Name: %s" % (state_readable, line[1].strip())
+
+ return state, infotext
+
+
+check_info['solaris_fmadm'] = {
+ 'inventory_function' : inventory_solaris_fmadm,
+ 'check_function' : check_solaris_fmadm,
+ 'service_description' : 'Fault class',
+}