zabbix执行agent端脚本
zabbix调用agent端的脚本我暂时用2种方式
- 利用agent调用客户端的脚本
- 服务端直接调用客户端的脚本
第一种方式有个缺点就是:如果agent端挂了则不能执行客户端的脚本了,这里把两种方式的配置都说一下
第一种方式:
1、配置agent端的文件,然后重启
EnableRemoteCommands=1
2、服务器端设置:
Configuration-Action,我下图设置的是当arterybase停止的时候,执行该脚本
3、停止arterybase,过一段时间就会执行。
第二种方式:
1、服务端重新编译
添加–with-jabber=/usr/local –with-ssh2
./configure --prefix=/usr/local/zabbix --enable-server --enable-proxy --enable-agent --with-mysql --with-net-snmp --with-libcurl --enable-java --with-jabber=/usr/local --with-ssh2 make && make install
2、重启
3、服务器端配置