Skip to content

Commit 2a6d383

Browse files
meni2029anthonyh209
authored andcommitted
18574: check_disk_smb: additional results handling
Prior to this werk, 'timeout' and 'No logon servers' were treated with the default UNKNOWN state. This werk adds handlings for these two results. CMK-25428 Closes: #848 Change-Id: I51ea1ea5963c81621f4c114c9b273a25973a11a5
1 parent 3731422 commit 2a6d383

File tree

2 files changed

+27
-0
lines changed

2 files changed

+27
-0
lines changed

.werks/18574.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
[//]: # (werk v2)
2+
# check_disk_smb: additional results handling
3+
4+
key | value
5+
---------- | ---
6+
date | 2025-09-16T09:35:44+00:00
7+
version | 2.5.0b1
8+
class | feature
9+
edition | cre
10+
component | checks
11+
level | 1
12+
compatible | yes
13+
14+
Prior to this werk, 'timeout' and 'No logon servers' were treated with the default UNKNOWN state.
15+
This werk adds handlings for these two results.

cmk/plugins/smb/lib/check_disk_smb.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -312,6 +312,10 @@ def _extract_data_from_not_matching_lines(
312312
ErrorResult(state=2, summary='Connection to 192.168.0.11 failed')
313313
>>> _extract_data_from_not_matching_lines(["tree connect failed: NT_STATUS_BAD_NETWORK_NAME"], "hostname", "share")
314314
ErrorResult(state=2, summary='Invalid share name \\\\\\\\hostname\\\\share')
315+
>>> _extract_data_from_not_matching_lines(["session setup failed: NT_STATUS_NO_LOGON_SERVERS"], "hostname", "share")
316+
ErrorResult(state=2, summary='No logon server')
317+
>>> _extract_data_from_not_matching_lines(["session setup failed: NT_STATUS_IO_TIMEOUT"], "hostname", "share")
318+
ErrorResult(state=2, summary='Timeout')
315319
>>> _extract_data_from_not_matching_lines(["some other error"], "hostname", "share")
316320
ErrorResult(state=3, summary='Result from smbclient not suitable')
317321
"""
@@ -331,6 +335,14 @@ def _extract_data_from_not_matching_lines(
331335
if re.search(r"(You specified an invalid share name|NT_STATUS_BAD_NETWORK_NAME)", line):
332336
return ErrorResult(2, f"Invalid share name \\\\{hostname}\\{share}")
333337

338+
# no logon server
339+
if re.search(r"(No logon servers|NT_STATUS_NO_LOGON_SERVERS)", line):
340+
return ErrorResult(2, "No logon server")
341+
342+
# time out
343+
if re.search(r"(Timeout|NT_STATUS_IO_TIMEOUT)", line):
344+
return ErrorResult(2, "Timeout")
345+
334346
return ErrorResult(state, summary)
335347

336348

0 commit comments

Comments
 (0)