2 # -*- encoding: utf-8; py-indent-offset: 4 -*-
3 # +------------------------------------------------------------------+
4 # | ____ _ _ __ __ _ __ |
5 # | / ___| |__ ___ ___| | __ | \/ | |/ / |
6 # | | | | '_ \ / _ \/ __| |/ / | |\/| | ' / |
7 # | | |___| | | | __/ (__| < | | | | . \ |
8 # | \____|_| |_|\___|\___|_|\_\___|_| |_|_|\_\ |
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.
28 # <<<msexch_dag:sep(58)>>>
29 # RunspaceId : d58353f4-f868-43b2-8404-25875841a47b
30 # Identity : Mailbox Database 1\S0141KL
31 # Name : Mailbox Database 1\S0141KL
32 # DatabaseName : Mailbox Database 1
34 # MailboxServer : S0141KL
35 # ActiveDatabaseCopy : s0141kl
36 # ActivationSuspended : False
37 # ActionInitiator : Unknown
42 # SinglePageRestore : 0
43 # ContentIndexState : Healthy
44 # ContentIndexErrorMessage :
46 # ReplayQueueLength : 0
47 # LatestAvailableLogTime :
48 # LastCopyNotificationedLogTime :
50 # LastInspectedLogTime :
51 # LastReplayedLogTime :
52 # LastLogGenerated : 0
53 # LastLogCopyNotified : 0
55 # LastLogInspected : 0
57 # LogsReplayedSinceInstanceStart : 0
58 # LogsCopiedSinceInstanceStart : 0
59 # LatestFullBackupTime : 22.10.2014 21:55:12
60 # LatestIncrementalBackupTime :
61 # LatestDifferentialBackupTime :
62 # LatestCopyBackupTime :
63 # SnapshotBackup : True
64 # SnapshotLatestFullBackup : True
65 # SnapshotLatestIncrementalBackup :
66 # SnapshotLatestDifferentialBackup :
67 # SnapshotLatestCopyBackup :
68 # LogReplayQueueIncreasing : False
69 # LogCopyQueueIncreasing : False
70 # OutstandingDumpsterRequests : {}
71 # OutgoingConnections :
72 # IncomingLogCopyingNetwork :
76 # RunspaceId : d58353f4-f868-43b2-8404-25875841a47b
77 # Identity : Mailbox Database 2\S0141KL
78 # Name : Mailbox Database 2\S0141KL
79 # DatabaseName : Mailbox Database 2
81 # MailboxServer : S0141KL
82 # ActiveDatabaseCopy : s0142kl
83 # ActivationSuspended : False
84 # ActionInitiator : Unknown
89 # SinglePageRestore : 0
90 # ContentIndexState : Healthy
91 # ContentIndexErrorMessage :
93 # ReplayQueueLength : 0
94 # LatestAvailableLogTime : 15.12.2014 13:26:34
95 # LastCopyNotificationedLogTime : 15.12.2014 13:26:34
96 # LastCopiedLogTime : 15.12.2014 13:26:34
97 # LastInspectedLogTime : 15.12.2014 13:26:34
98 # LastReplayedLogTime : 15.12.2014 13:26:34
99 # LastLogGenerated : 2527253
100 # LastLogCopyNotified : 2527253
101 # LastLogCopied : 2527253
102 # LastLogInspected : 2527253
103 # LastLogReplayed : 2527253
104 # LogsReplayedSinceInstanceStart : 15949
105 # LogsCopiedSinceInstanceStart : 15945
106 # LatestFullBackupTime : 13.12.2014 19:06:54
107 # LatestIncrementalBackupTime :
108 # LatestDifferentialBackupTime :
109 # LatestCopyBackupTime :
110 # SnapshotBackup : True
111 # SnapshotLatestFullBackup : True
112 # SnapshotLatestIncrementalBackup :
113 # SnapshotLatestDifferentialBackup :
114 # SnapshotLatestCopyBackup :
115 # LogReplayQueueIncreasing : False
116 # LogCopyQueueIncreasing : False
117 # OutstandingDumpsterRequests : {}
118 # OutgoingConnections :
119 # IncomingLogCopyingNetwork :
123 # .--dbcopy--------------------------------------------------------------.
125 # | __| | |__ ___ ___ _ __ _ _ |
126 # | / _` | '_ \ / __/ _ \| '_ \| | | | |
127 # | | (_| | |_) | (_| (_) | |_) | |_| | |
128 # | \__,_|_.__/ \___\___/| .__/ \__, | |
130 # +----------------------------------------------------------------------+
133 def inventory_msexch_dag_dbcopy(info
):
138 if line
[0].strip() == "DatabaseName":
139 dbname
= line
[1].strip()
141 elif getit
and line
[0].strip() == key
:
142 yield dbname
, (key
, line
[1].strip())
146 def check_msexch_dag_dbcopy(item
, params
, info
):
148 inv_key
, inv_val
= params
151 key
, val
= [i
.strip() for i
in line
]
152 if key
== "DatabaseName" and val
== item
:
154 elif getit
and key
== inv_key
:
157 infotxt
= "%s is %s" % (inv_key
, val
)
160 infotxt
= "%s changed from %s to %s" % (inv_key
, inv_val
, val
)
161 return state
, infotxt
164 check_info
['msexch_dag.dbcopy'] = {
165 "inventory_function": inventory_msexch_dag_dbcopy
,
166 "check_function": check_msexch_dag_dbcopy
,
167 "service_description": "Exchange DAG DBCopy for %s",
171 # .--contentindex--------------------------------------------------------.
173 # | ___ ___ _ __ | |_ ___ _ __ | |_(_)_ __ __| | _____ __ |
174 # | / __/ _ \| '_ \| __/ _ \ '_ \| __| | '_ \ / _` |/ _ \ \/ / |
175 # | | (_| (_) | | | | || __/ | | | |_| | | | | (_| | __/> < |
176 # | \___\___/|_| |_|\__\___|_| |_|\__|_|_| |_|\__,_|\___/_/\_\ |
178 # +----------------------------------------------------------------------+
181 def inventory_msexch_dag_contentindex(info
):
183 if line
[0].strip() == "DatabaseName":
184 yield line
[1].strip(), None
187 def check_msexch_dag_contentindex(item
, _no_params
, info
):
191 key
, val
= [i
.strip() for i
in line
]
192 if key
== "DatabaseName" and val
== item
:
194 elif getit
and key
== "ContentIndexState":
199 return state
, "Status: %s" % val
202 check_info
['msexch_dag.contentindex'] = {
203 "inventory_function": inventory_msexch_dag_contentindex
,
204 "check_function": check_msexch_dag_contentindex
,
205 "service_description": "Exchange DAG ContentIndex of %s",
209 # .--copyqueue-----------------------------------------------------------.
211 # | ___ ___ _ __ _ _ __ _ _ _ ___ _ _ ___ |
212 # | / __/ _ \| '_ \| | | |/ _` | | | |/ _ \ | | |/ _ \ |
213 # | | (_| (_) | |_) | |_| | (_| | |_| | __/ |_| | __/ |
214 # | \___\___/| .__/ \__, |\__, |\__,_|\___|\__,_|\___| |
216 # +----------------------------------------------------------------------+
218 msexch_dag_copyqueue_default_levels
= (100, 200)
221 def inventory_msexch_dag_copyqueue(info
):
223 if line
[0].strip() == "DatabaseName":
224 yield line
[1].strip(), 'msexch_dag_copyqueue_default_levels'
227 def check_msexch_dag_copyqueue(item
, params
, info
):
232 key
, val
= [i
.strip() for i
in line
]
233 if key
== "DatabaseName" and val
== item
:
235 elif getit
and key
== "CopyQueueLength":
236 infotxt
= "Queue length is %d" % int(val
)
239 elif int(val
) >= warn
:
244 infotxt
+= " (warn/crit at %d/%d)" % (warn
, crit
)
245 perfdata
= [("length", int(val
), warn
, crit
, 0)]
246 return state
, infotxt
, perfdata
249 check_info
['msexch_dag.copyqueue'] = {
250 "inventory_function": inventory_msexch_dag_copyqueue
,
251 "check_function": check_msexch_dag_copyqueue
,
252 "service_description": "Exchange DAG CopyQueue of %s",
253 "has_perfdata": True,
254 "group": "msexch_copyqueue",