Joke Collection Website - Blessing messages - Zabbix remote execution command window

Zabbix remote execution command window

1. Find zabbix_agentd.conf in the zabbix proxy client configuration file and modify #EnableRomoteCommands=0 to EnableRomoteCommands= 1.

2. If the zabbix agent is windows, just go directly to zabbix to create a new action, and then add a remote command to the action.

Step 1-2 lasts 60 seconds.

Execute the command every 60 seconds until the fault is recovered (it ends after the fault is recovered). If it is not recovered, perform step 2 until the fault is recovered (ending when the fault is recovered). If not, go to step 3.

Steps 3-3 start from 120 seconds and last for 60 seconds.

At the 60th second, step 3 will be executed until the fault is recovered. If the fault is not recovered, no alarm will be sent. Unless the fault is recovered, the next round of monitoring will be resumed.

Recommended settings:

Step 1-2 Run the script command for 60 seconds.

It is enough for the script to run 1-2 times, but it is useless if it cannot be recovered n times, which also delays the time.

Step 3-0 starts from 120 seconds and runs the email alert for 60 seconds.

E-mail alerts suggest setting countless alerts, because the fault should be alerted until it is fixed.

3. If the zabbix agent is a Linux system, you need to modify the visudo file:

Enter visudo (or vim /etc/sudoers file) and add any of the following methods at the end:

1) If the following is added, it means that all commands will run by default without a password.

zabbix ALL=NOPASSWD: ALL

2) If you add the following, it means that you don't need a password to execute the command.

Zabbix all = nopasswd:/bin/bash/usr/local/clean/clean.sh3) Modify defaults requiretty to # defaults requiretty? Indicates that the control terminal is not needed.

4) Create a new shell script in linux, such as? restart_mysqld.sh

chmod +x? /zabbix _ scripts/restart _ mysqld . sh