非常感谢楼主,提供了非常好的思路。
试用了下你的脚本,有两个问题:
1、发送的Warning信息代码顺序不对,正确的信息代码描述如下:
0x11600035 The server was shut down due to an AC power failure or low battery of the local UPS.
0x11600036 Server was on battery of the local UPS due to an AC power failure of the local UPS.
0x11600037 AC power of local UPS was restored.
脚本中最后两条synologset1 sys warn 位置互换就行了。
2、ping $MonitorIP -W 2 -w 2 -c 2 | grep '^[0-9].*ms$'中-W和-w在群晖系统ping命令中无此参数,我在实际使用中将这两个参数删除了。