zabbix action 不被触发的几个原因:
1、条件没配置好
例如匹配选项like
2、权限问题
action step中的用户或组 需对Trigger有可读权限
shell中的select语句 与 read 编写 出来的menu区别
select 只能选择输入数字来传递值
而menu 可以随意传递任何类型的值
相对于menu来说select更加简单
[root@localhost ~]# cat test.sh #!/bin/bashselect DAY in Mon Tue Wed Thu Fri Sat Sun quit#和for循环语法相似do if [ $DAY = "Mon" ];then echo $DAY fidone#END[root@localhost ~]# ./test.sh 1) Mon2) Tue3) Wed4) Thu5) Fri6) Sat7) Sun8) quit#? 1Mon#select 最好就是与case 结合[root@localhost ~]# cat ./test2.sh #!/bin/bashselect DAY in Mon Tue Wed Thu Fri Sat Sun quitdo case $DAY in Mon) echo "Today is Monday";; Tue) echo "Today is Tuesday";; Wed) echo "Today is Wednesday";; Thu) echo "Today is Thursday";; Fri) echo "Today is Friday";; Sat|Sun) echo "You can have a rest today";; q|quit) exit 0 ;; *) echo "Unknown input ,exit now" && break;; esacdone[root@localhost ~]# ./test2.sh 1) Mon2) Tue3) Wed4) Thu5) Fri6) Sat7) Sun8) quit#? 2Today is Tuesday#? 1Today is Monday#? 8[root@localhost ~]# echo $?0