Refactoring: Changed all check parameters starting with an 'o' to the new rulespec...
[check_mk.git] / checks / ibm_svc_eventlog
blob9e0fcda6df4d4243684672bedcc6859721c747d6
1 #!/usr/bin/python
2 # -*- encoding: utf-8; py-indent-offset: 4 -*-
3 # +------------------------------------------------------------------+
4 # | ____ _ _ __ __ _ __ |
5 # | / ___| |__ ___ ___| | __ | \/ | |/ / |
6 # | | | | '_ \ / _ \/ __| |/ / | |\/| | ' / |
7 # | | |___| | | | __/ (__| < | | | | . \ |
8 # | \____|_| |_|\___|\___|_|\_\___|_| |_|_|\_\ |
9 # | |
10 # | Copyright Mathias Kettner 2014 mk@mathias-kettner.de |
11 # +------------------------------------------------------------------+
13 # This file is part of Check_MK.
14 # The official homepage is at http://mathias-kettner.de/check_mk.
16 # check_mk is free software; you can redistribute it and/or modify it
17 # under the terms of the GNU General Public License as published by
18 # the Free Software Foundation in version 2. check_mk is distributed
19 # in the hope that it will be useful, but WITHOUT ANY WARRANTY; with-
20 # out even the implied warranty of MERCHANTABILITY or FITNESS FOR A
21 # PARTICULAR PURPOSE. See the GNU General Public License for more de-
22 # tails. You should have received a copy of the GNU General Public
23 # License along with GNU Make; see the file COPYING. If not, write
24 # to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
25 # Boston, MA 02110-1301 USA.
27 # Example output from agent:
28 # <<<ibm_svc_eventlog:sep(58)>>>
29 # 588:120404112526:mdiskgrp:6:md07_sas10k::alert:no:989001::Managed Disk Group space warning
30 # 589:120404112851:mdiskgrp:7:md08_nlsas7k_1t::alert:no:989001::Managed Disk Group space warning
31 # 590:120404112931:mdiskgrp:8:md09_nlsas7k_1t::alert:no:989001::Managed Disk Group space warning
32 # 591:120404113001:mdiskgrp:9:md10_nlsas7k_1t::alert:no:989001::Managed Disk Group space warning
33 # 592:120404113026:mdiskgrp:10:md11_nlsas7k_1t::alert:no:989001::Managed Disk Group space warning
34 # 593:120404113111:mdiskgrp:11:md12_nlsas7k_1t::alert:no:989001::Managed Disk Group space warning
35 # 1690:130801070656:drive:59:::alert:no:981020::Managed Disk error count warning threshold met
36 # 2058:131030112416:drive:42:::alert:no:981020::Managed Disk error count warning threshold met
39 def inventory_ibm_svc_eventlog(info):
40 return [(None, None)]
43 def check_ibm_svc_eventlog(item, _no_params, info):
44 messagecount = 0
45 last_err = ""
47 for _sequence_number, _last_timestamp, _object_type, _object_id, _object_name, _copy_id, _status, _fixed, _event_id, _error_code, description in info:
48 messagecount += 1
49 last_err = description
51 if messagecount > 0:
52 return 1, "%d messages not expired and not yet fixed found in event log, last was: %s" % \
53 (messagecount, last_err)
55 return 0, "No messages not expired and not yet fixed found in event log"
58 check_info["ibm_svc_eventlog"] = {
59 "check_function": check_ibm_svc_eventlog,
60 "inventory_function": inventory_ibm_svc_eventlog,
61 "service_description": "Eventlog",