#Bash 的 wdctl 命令
wdctl [OPTION]... [DEVICE]...
功能
查看硬件看门狗的状态。
类型
可执行文件(/usr/bin/wdctl),属于 util-linux。
参数
OPTION选项:-f,--flags list- 仅显示指定的看门狗标志-F,--noflags- 不显示看门狗标志信息-I,--noident- 不显示看门狗身份信息-n,--noheadings- 不显示标题行(列名)-o,--output list- 只显示指定的列-O,--oneline- 以单行键值对格式输出所有信息-p,--setpretimeout seconds- 设置看门狗预超时时间-g,--setpregovernor governor- 设置预超时调节器-r,--raw- 以原始格式输出-s,--settimeout seconds- 设置看门狗超时时间-T,--notimeouts- 不显示看门狗超时信息-x,--flags-only- 只显示标志信息;等同于-I -T-h,--help- 显示帮助-V,--version- 显示版本
DEVICE- 设备列表
#列名
| 列名 | 说明 |
|---|---|
FLAG | 标志名 |
DESCRIPTION | 标志的描述 |
STATUS | 标志状态 |
BOOT-STATUS | 重启标志状态 |
DEVICE | 看门狗设备名 |
#示例
$ wdctl
Device: /dev/watchdog
Identity: iTCO_wdt [version 0]
Timeout: 30 seconds
Timeleft: 29 seconds
FLAG DESCRIPTION STATUS BOOT-STATUS
KEEPALIVEPING Keep alive ping reply 1 0
MAGICCLOSE Supports magic close char 0 0
#推荐阅读
#手册
WDCTL(8) System Administration WDCTL(8)
NAME
wdctl - show hardware watchdog status
SYNOPSIS
wdctl [options] [device...]
DESCRIPTION
Show hardware watchdog status. The default device is /dev/watchdog. If
more than one device is specified then the output is separated by one
blank line.
If the device is already used or user has no permissions to read from
the device, then wdctl reads data from sysfs. In this case information
about supported features (flags) might be missing.
Note that the number of supported watchdog features is hardware
specific.
OPTIONS
-f, --flags list
Print only the specified flags.
-F, --noflags
Do not print information about flags.
-I, --noident
Do not print watchdog identity information.
-n, --noheadings
Do not print a header line for flags table.
-o, --output list
Define the output columns to use in table of watchdog flags. If no
output arrangement is specified, then a default set is used. Use
--help to get list of all supported columns.
-O, --oneline
Print all wanted information on one line in key="value" output
format.
-p, --setpretimeout seconds
Set the watchdog pre-timeout in seconds. A watchdog pre-timeout is
a notification generated by the watchdog before the watchdog reset
might occur in the event the watchdog has not been serviced. This
notification is handled by the kernel and can be configured to take
an action using sysfs or by --setpregovernor.
-g, --setpregovernor governor
Set pre-timeout governor name. For available governors see default
wdctl output.
-r, --raw
Use the raw output format.
-s, --settimeout seconds
Set the watchdog timeout in seconds.
-T, --notimeouts
Do not print watchdog timeouts.
-x, --flags-only
Same as -I -T.
-h, --help
Display help text and exit.
-V, --version
Print version and exit.
AUTHORS
Karel Zak <[email protected]>, Lennart Poettering
<[email protected]>
REPORTING BUGS
For bug reports, use the issue tracker at
https://github.com/util-linux/util-linux/issues.
AVAILABILITY
The wdctl command is part of the util-linux package which can be
downloaded from Linux Kernel Archive
<https://www.kernel.org/pub/linux/utils/util-linux/>.
util-linux 2.39.3 2023-10-23 WDCTL(8)