我写了process_watcher.py
process_watcher --pid 1234 --to me@gmail.com
目前,电子邮件正文如下所示:
PID 18851:/usr/lib/libreoffice/program/soffice.bin --writer --splash-pipe = 5
开始:3月10日星期四18:33:37结束:3月10日星期四18:34:26(持续时间0 :00:49)
内存(当前/峰值)-驻留:155,280 / 155,304 kB虚拟:1,166,968 / 1,188,216 kB
[+] indicates the argument may be specified multiple times, for example:
process-watcher -p 1234 -p 4258 -c myapp -c "exec\d+" --to person1@domain.com --to person2@someplace.com
optional arguments:
-h, --help show this help message and exit
-p PID, --pid PID process ID(s) to watch [+]
-c COMMAND_PATTERN, --command COMMAND_PATTERN
watch all processes matching the command name. (RegEx pattern) [+]
-w, --watch-new watch for new processes that match --command. (run forever)
--to EMAIL_ADDRESS email address to send to [+]
-n, --notify send DBUS Desktop notification
-i SECONDS, --interval SECONDS
how often to check on processes. (default: 15.0 seconds)
-q, --quiet don't print anything to stdout
如果需要任何改进,请停止GitHub问题。