This is the documentation page for an unsupported version of Zabbix.
Is this not what you were looking for? Switch to the current version or choose one from the drop-down menu.
Table of Contents

3 Remote commands

Remote commands is a powerful mechanism for smart pro-active monitoring. Zabbix can execute a command on a monitored host in case of any pre-defined conditions.

Here is the list of some of the most obvious uses of the feature:

  • Automatically restart application (WEB server, middleware, CRM) if it does not respond
  • Using IPMI 'reboot' command reboot remote server if it does not answer requests
  • Try to automatically free disk space (remove older files, clean /tmp) if we are running out of disk space
  • Migrate one VM from one physical box to another depending on CPU load
  • Add new nodes to the cloud environment if we have insufficient CPU (disk, memory, whatever) resources

Configuration of action for remote commands is similar to messaging, the only difference is that Zabbix will execute a command instead of sending a message.

The action condition is defined so that it will be activated in case of any disaster problems with one of Apache applications.

As a reaction to the disaster problem Zabbix will try to restart Apache process:

Note use of the macro {HOSTNAME} here.

User 'zabbix' must have enough permissions to execute this script. Also Zabbix agent should run on a remote host and accept incoming connections. Remote commands are disabled by default and can be enabled in Zabbix agent daemon configuration file on Unix-like or Windows systems.

Remote commands do not work with active Zabbix agents.

See remote command tutorial for more information.