- Support df command

- Return warnings array from ParseSyntaxFiles() in addition to potential
  error. Not being able to parse the dir is a fatal error but if a
random file cannot be read, it should be considered a warning.
This commit is contained in:
Jesse Portnoy
2023-07-18 18:46:01 +01:00
parent 57b5bfb135
commit 449702f27b
4 changed files with 48 additions and 12 deletions
+31
View File
@@ -0,0 +1,31 @@
filetype: ping
detect:
filename: "\\.df$"
header: "(^Filesystem[[:space:]]+)"
rules:
# header
- cyan: "(Filesystem|Size|1K-blocks|(I)?Use(d)?(%)?|Avail(able)?|Mounted on|IFree|Inodes)"
- blue: "(\\/[-\\w\\d.]+)+\\s"
# Ks
- green: "\\s\\d*[.,]?\\d(K|B)i?\\s|\b\\d{1,3}\b"
# Ms
- magenta: "\\s\\d*[.,]?\\dMi?\\s|\b\\d{4,6}\b"
# Gs
- cyan: "\\s\\d*[.,]?\\dGi?\\s|\b\\d{4,6}\b"
# Ts
- preproc: "\\s\\d*[.,]?\\dTi?\\s|\b\\d{4,6}\b"
# Mounted on
- green: "\\/$|(\\/[-\\w\\d. ]+)+$"
# Use% <= 60
- high.green: "\\s[1-6]?[0-9]%\\s"
# Use% <= 70 - 89
- yellow: "\\s[78][0-9]%\\s"
# Use 90-97%
- red: "\\s9[0-7]%\\s"
# Use 98-100%
- preproc: "\\s9[89]%|100%\\s"
- type: "(tmpfs|(u|/)?dev|(/)?run|shm|(/)?boot|nfs|/home|/var|/tmp|swap)"
- constant.number: "[[:space:]]+([0-9])+[[:space:]]+"
+1
View File
@@ -24,4 +24,5 @@ rules:
- red: "DUP\\!"
- red: "(Destination Host Unreachable|100(\\.0)?% packet loss)"
- red: ".+unknown\\shost\\s(.+)"
- red: "Temporary failure in name resolution"