Skip to content

Commit 967c22e

Browse files
authored
Merge pull request #221 from wangzhen127/readonly-fs
Detect readonly filesystem
2 parents a23a4e4 + ecaa61e commit 967c22e

File tree

3 files changed

+27
-10
lines changed

3 files changed

+27
-10
lines changed

config/kernel-monitor.json

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
{
2-
"plugin": "journald",
3-
"pluginConfig": {
4-
"source": "kernel"
5-
},
6-
"logPath": "/var/log/journal",
2+
"plugin": "kmsg",
3+
"logPath": "/dev/kmsg",
74
"lookback": "5m",
85
"bufferSize": 10,
96
"source": "kernel-monitor",
@@ -12,6 +9,11 @@
129
"type": "KernelDeadlock",
1310
"reason": "KernelHasNoDeadlock",
1411
"message": "kernel has no deadlock"
12+
},
13+
{
14+
"type": "ReadonlyFilesystem",
15+
"reason": "FilesystemIsNotReadOnly",
16+
"message": "Filesystem is not read-only"
1517
}
1618
],
1719
"rules": [
@@ -51,6 +53,12 @@
5153
"condition": "KernelDeadlock",
5254
"reason": "DockerHung",
5355
"pattern": "task docker:\\w+ blocked for more than \\w+ seconds\\."
56+
},
57+
{
58+
"type": "permanent",
59+
"condition": "ReadonlyFilesystem",
60+
"reason": "FilesystemIsReadOnly",
61+
"pattern": "Remounting filesystem read-only"
5462
}
5563
]
5664
}

deployment/node-problem-detector-config.yaml

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,8 @@ apiVersion: v1
22
data:
33
kernel-monitor.json: |
44
{
5-
"plugin": "journald",
6-
"pluginConfig": {
7-
"source": "kernel"
8-
},
9-
"logPath": "/var/log/journal",
5+
"plugin": "kmsg",
6+
"logPath": "/dev/kmsg",
107
"lookback": "5m",
118
"bufferSize": 10,
129
"source": "kernel-monitor",
@@ -15,6 +12,11 @@ data:
1512
"type": "KernelDeadlock",
1613
"reason": "KernelHasNoDeadlock",
1714
"message": "kernel has no deadlock"
15+
},
16+
{
17+
"type": "ReadonlyFilesystem",
18+
"reason": "FilesystemIsReadOnly",
19+
"message": "Filesystem is read-only"
1820
}
1921
],
2022
"rules": [
@@ -54,6 +56,12 @@ data:
5456
"condition": "KernelDeadlock",
5557
"reason": "DockerHung",
5658
"pattern": "task docker:\\w+ blocked for more than \\w+ seconds\\."
59+
},
60+
{
61+
"type": "permanent",
62+
"condition": "ReadonlyFilesystem",
63+
"reason": "FilesystemIsReadOnly",
64+
"pattern": "Remounting filesystem read-only"
5765
}
5866
]
5967
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
EXT4-fs (sda1): Remounting filesystem read-only

0 commit comments

Comments
 (0)