Skip to content

Commit dba47bd

Browse files
committed
Update the README.md.
1 parent 10fc831 commit dba47bd

File tree

2 files changed

+43
-21
lines changed

2 files changed

+43
-21
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,12 +49,12 @@ List of supported problem daemons:
4949

5050
| Problem Daemon | NodeCondition | Description |
5151
|----------------|:---------------:|:------------|
52-
| [KernelMonitor](https://github.com/kubernetes/node-problem-detector/tree/master/pkg/logmonitor) | KernelDeadlock | A problem daemon monitors kernel log and reports problem according to predefined rules. |
52+
| [KernelMonitor](https://github.com/kubernetes/node-problem-detector/blob/master/config/kernel-monitor.json) | KernelDeadlock | A system log monitor monitors kernel log and reports problem according to predefined rules. |
5353

5454
# Usage
5555
## Flags
5656
* `--version`: Print current version of node-problem-detector.
57-
* `--kernel-monitor`: The configuration used by the kernel monitor, e.g.
57+
* `--system-log-monitor`: The configuration used by the system log monitor, e.g.
5858
[config/kernel-monitor.json](https://github.com/kubernetes/node-problem-detector/blob/master/config/kernel-monitor.json).
5959
* `--apiserver-override`: A URI parameter used to customize how node-problem-detector
6060
connects the apiserver. The format is same as the
@@ -112,7 +112,7 @@ spec:
112112
hostPath:
113113
path: /etc/localtime
114114
```
115-
* Edit node-problem-detector.yaml to fit your environment: Set `log` volume to your system log diretory. (Used by KernelMonitor)
115+
* Edit node-problem-detector.yaml to fit your environment: Set `log` volume to your system log diretory. (Used by SystemLogMonitor)
116116
* Create the DaemonSet with `kubectl create -f node-problem-detector.yaml`
117117
* If needed, you can use [ConfigMap](http://kubernetes.io/docs/user-guide/configmap/)
118118
to overwrite the `config/`.

pkg/systemlogmonitor/README.md

Lines changed: 40 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,22 @@
1-
# Kernel Monitor
1+
# System Log Monitor
22

3-
*Kernel Monitor* is a problem daemon in node problem detector. It monitors kernel log
4-
and detects known kernel issues following predefined rules.
3+
*System Log Monitor* is a problem daemon in node problem detector. It monitors
4+
specified system daemon log and detects problems following predefined rules.
55

6-
The Kernel Monitor matches kernel issues according to a set of predefined rule list in
7-
[`config/kernel-monitor.json`](https://github.com/kubernetes/node-problem-detector/blob/master/config/kernel-monitor.json).
6+
The System Log Monitor matches problems according to a set of predefined rule list in
7+
the configuration files. (
8+
[`config/kernel-monitor.json`](https://github.com/kubernetes/node-problem-detector/blob/master/config/kernel-monitor.json) as an example).
89
The rule list is extensible.
910

1011
## Limitations
1112

12-
* Kernel Monitor only supports syslog (rsyslog) and journald now, but it is easy
13+
* System Log Monitor only supports file based log and journald now, but it is easy
1314
to extend it with [new log watcher](#new-log-watcher)
1415

1516
## Add New NodeConditions
1617

1718
To support new node conditions, you can extend the `conditions` field in
18-
`config/kernel-monitor.json` with new condition definition:
19+
the configuration file with new condition definition:
1920

2021
```json
2122
{
@@ -27,35 +28,56 @@ To support new node conditions, you can extend the `conditions` field in
2728

2829
## Detect New Problems
2930

30-
To detect new problems, you can extend the `rules` field in `config/kernel-monitor.json`
31+
To detect new problems, you can extend the `rules` field in the configuration file
3132
with new rule definition:
3233

3334
```json
3435
{
3536
"type": "temporary/permanent",
3637
"condition": "NodeConditionOfPermanentIssue",
3738
"reason": "CamelCaseShortReason",
38-
"message": "regexp matching the issue in the kernel log"
39+
"message": "regexp matching the issue in the log"
3940
}
4041
```
4142

4243
## Log Watchers
4344

44-
Kernel monitor supports different log management tools with different log
45+
System log monitor supports different log management tools with different log
4546
watchers:
46-
* [syslog](https://github.com/kubernetes/node-problem-detector/blob/master/pkg/logmonitor/logwatchers/syslog)
47-
* [journald](https://github.com/kubernetes/node-problem-detector/blob/master/pkg/logmonitor/logwatchers/journald)
47+
* [filelog](https://github.com/kubernetes/node-problem-detector/blob/master/pkg/systemlogmonitor/logwatchers/filelog): Log watcher for
48+
arbitrary file based log.
49+
* [journald](https://github.com/kubernetes/node-problem-detector/blob/master/pkg/systemlogmonitor/logwatchers/journald): Log watcher for
50+
journald.
51+
Set `plugin` in the configuration file to specify log watcher.
52+
53+
### Plugin Configuration
54+
55+
Log watcher specific configurations are configured in `pluginConfig`.
56+
* **journald**
57+
* source: The [`SYSLOG_IDENTIFIER`](https://www.freedesktop.org/software/systemd/man/systemd.journal-fields.html)
58+
of the log to watch.
59+
* **filelog**:
60+
* timestamp: The regular expression used to match timestamp in the log line.
61+
Submatch is supported, but only the last result will be used as the actual
62+
timestamp.
63+
* message: The regular expression used to match message in the log line.
64+
Submatch is supported, but only the last result will be used as the actual
65+
message.
66+
* timestampFormat: The format of the timestamp. The format string is the time
67+
`2006-01-02T15:04:05Z07:00` in the expected format. (See
68+
[golang timestamp format](https://golang.org/pkg/time/#pkg-constants))
4869

4970
### Change Log Path
5071

51-
Kernel log on different OS distros may locate in different path. The `logPath`
52-
field in `config/kernel-monitor.json` is the log path inside the container.
53-
You can always configure `logPath` and volume mount to match your OS distro.
54-
* syslog: `logPath` is the kernel log path, usually `/var/log/kern.log`.
72+
Log on different OS distros may locate in different path. The `logPath`
73+
field in the configurtion file is the log path. You can always configure
74+
`logPath` to match your OS distro.
75+
* filelog: `logPath` is the path of log file, e.g. `/var/log/kern.log` for kernel
76+
log.
5577
* journald: `logPath` is the journal log directory, usually `/var/log/journal`.
5678

5779
### New Log Watcher
5880

59-
Kernel monitor uses [Log
60-
Watcher](https://github.com/kubernetes/node-problem-detector/blob/master/pkg/logmonitor/logwatchers/types/log_watcher.go) to support different log management tools.
81+
System log monitor uses [Log
82+
Watcher](https://github.com/kubernetes/node-problem-detector/blob/master/pkg/systemlogmonitor/logwatchers/types/log_watcher.go) to support different log management tools.
6183
It is easy to implement a new log watcher.

0 commit comments

Comments
 (0)