Skip to content

Commit fa88a22

Browse files
authored
Merge pull request #748 from Icinga:doc/ikwb19
Doc: Adds IWKB000019 for RegexErrors
2 parents 7dce554 + 45514f6 commit fa88a22

File tree

2 files changed

+28
-0
lines changed

2 files changed

+28
-0
lines changed

doc/300-Knowledge-Base.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,4 @@ For this reason you will find a list of Icinga knowledge base entries below. Ent
2626
| [IWKB000016](knowledgebase/IWKB000016.md) | Checks using Performance Counter fail with various messages like `Exception of type 'System.OutOfMemoryException' was thrown` or `Icinga Invalid Configuration Error was thrown: PerfCounterCategoryMissing: Category "Memory" not found` |
2727
| [IWKB000017](knowledgebase/IWKB000017.md) | Icinga throws exception during plugin execution after uninstalling SCOM or other vendor software using PowerShell modules |
2828
| [IWKB000018](knowledgebase/IWKB000018.md) | Icinga for Windows services throws event id 1500 with error `Exception while calling AuthenticateAsServer: The credentials supplied to the package were not recognized` |
29+
| [IWKB000019](knowledgebase/IWKB000019.md) | Icinga Invalid Input Error was thrown: RegexError |

doc/knowledgebase/IWKB000019.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Icinga Knowledge Base - IWKB000019
2+
3+
## Short Message
4+
5+
Icinga Invalid Input Error was thrown: RegexError
6+
7+
## Example Exception
8+
9+
Icinga Invalid Input Error was thrown: RegexError
10+
11+
A request was not handled properly because a provided regex could not be interpreted. Please validate your regex and try again. In case you are trying to access a ressource containing [], you will have to escape each symbol by using \`. Example: myservice\`[\`]
12+
13+
## Reason
14+
15+
Icinga for Windows itself and most PowerShell Cmdlets will support to add regex expressions, like simple wildcards (`*`) or other terms into arguments for like `Path` or `Name`. Because of this behavior, a bracket `[]` will in some cases be interpreted as regex, but because of an invalid format, causing errors like the one above. This mostly happens in case you have service names or directories/files, containing such characters.
16+
17+
## Solution
18+
19+
While the directory check plugin for Icinga for Windows does the escaping in such cases automatically starting with version 1.13.0, because by providing a path regex is not really a concern for the plugin, there is a different story for examples like the service plugin.
20+
21+
In case you have a service called `mycustomservice[]`, you will run into the exception above. To mitigate this, you have to escape brackets with the backticks.
22+
23+
```powershell
24+
Invoke-IcingaCheckService -Service 'mycustomservice`[`]';
25+
```
26+
27+
Now your checks will run through as expected without any issues.

0 commit comments

Comments
 (0)