Skip to content

Commit 5d49e01

Browse files
author
github automation
committed
1 parent 71112a6 commit 5d49e01

File tree

4 files changed

+30
-3
lines changed

4 files changed

+30
-3
lines changed

content/en/docs/snclient/api/_index.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,8 @@ Returns
223223
Request a new csr, creates new private key if requested by the user or uses the already existing one.
224224
The only field that needs to be set is `CommonName` the rest of the fields is optional.
225225

226+
Optionally you can also set a `ChallengePassword` in the csr request.
227+
226228
Example:
227229

228230
```bash

content/en/docs/snclient/checks/commands/check_logfile.md

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,19 @@ title: logfile
66

77
Checks logfiles or any other text format file for errors or other general patterns
88

9+
In order to use this plugin, you need to enable 'CheckLogFile' in the '[/modules]' section of the snclient_local.ini.
10+
11+
Also, to avoid security issues, you need to set 'allowed pattern' in the '[/settings/check/logfile]'
12+
section of the snclient_local.ini to a comma separated list of allowed glob patterns.
13+
14+
Example:
15+
[/settings/check/logfile]
16+
allowed pattern = /var/log/** # This allows all files recursively in /var/log/
17+
allowed pattern += /opt/logs/*.log # This allows all files with .log extension in /opt/logs/
18+
19+
See https://github.com/bmatcuk/doublestar#patterns for details on the pattern syntax.
20+
21+
922
- [Examples](#examples)
1023
- [Argument Defaults](#argument-defaults)
1124
- [Attributes](#attributes)
@@ -18,6 +31,13 @@ Checks logfiles or any other text format file for errors or other general patter
1831

1932
## Examples
2033

34+
### Default Check
35+
36+
Alert if there are errors in the snclient log file:
37+
38+
check_files files=/var/log/snclient/snclient.log 'warn=line like Warn' 'crit=line like Error'"
39+
OK - All 1787 / 1787 Lines OK
40+
2141
### Example using NRPE and Naemon
2242

2343
Naemon Config
@@ -31,7 +51,7 @@ Naemon Config
3151
host_name testhost
3252
service_description check_logfile
3353
use generic-service
34-
check_command check_nrpe!check_logfile!
54+
check_command check_nrpe!check_logfile!'files=/var/log/snclient/snclient.log' 'warn=line like Warn'
3555
}
3656

3757
## Argument Defaults
@@ -42,7 +62,7 @@ Naemon Config
4262
| empty-syntax | %(status) - No files found |
4363
| top-syntax | %(status) - %(problem_count)/%(count) lines (%(count)) %(problem_list) |
4464
| ok-syntax | %(status) - All %(count) / %(total) Lines OK |
45-
| detail-syntax | %(line) |
65+
| detail-syntax | %(line \| chomp \| cut=200) |
4666

4767
## Check Specific Arguments
4868

content/en/docs/snclient/checks/commands/check_wmi.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ title: wmi
66

77
Check status and metrics by running wmi queries.
88

9+
In order to use this plugin, you need to enable 'CheckWMI' in the '[/modules]' section of the snclient_local.ini.
10+
11+
912
- [Examples](#examples)
1013
- [Argument Defaults](#argument-defaults)
1114

content/en/docs/snclient/configuration/_index.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ allowed hosts += , 192.168.0.2,192.168.0.3
113113
```
114114
115115
Values will simply be joined as text, so in case you want to create lists, make sure you
116-
add a comma.
116+
add a comma. (Starting with v0.38 this will be done automatically)
117117
118118
## Inheritance
119119
@@ -257,6 +257,8 @@ Support operators are:
257257
| `:fmt=<fmt>` | 123.45 -> 123.4 | apply format, ex.: $(total \| fmt=%.1f) (using GOs fmt.Sprintf) |
258258
| `:s/regexp/replace/` | C:\ % -> C | apply regexp replacement, ex.: $(name \| 's/\\W//' ) (using GOs regexp.Compile) |
259259
| `:ascii` | C:\ % -> C | remove any none-ascii characters |
260+
| `:trim` | " test " -> "test" | remove leading and trailing whitespace |
261+
| `:chomp` | " test " -> " test" | remove trailing whitespace only |
260262
261263
for example, define a dummy command which prints the hostname in lower case letters:
262264

0 commit comments

Comments
 (0)