我有一个在windows server 2019和Zabbix上运行的应用程序来监控这个过程。我有一个powershell脚本,如果应用程序崩溃但不工作,Zabbix会运行该脚本,我收到错误消息"This command not be run be the error: Access is run“。
我的脚本需要发送一个数字并按ENTER键来运行应用程序。
Start-Process "c:\my_app.exe"
Start-Sleep -s 1
$obj = new-object -ComObject WScript.Shell
$obj.SendKeys(
我想确保一个脚本只能运行在一个良好的水平以下。我四处搜寻,找不到一个很好的方法,所以我想出了一个方法:
#!/usr/bin/env bash
set -euo pipefail
IFS=$'\n\t'
# use ps to get the niceness of the current process
# only look at the last line of output
# remove whitespace
readonly PRIORITY=$(ps -o '%n' $$ | tail -n 1 | tr -d '[[:space:]]