5 Mac OS agent installation from PKG

Overview

Zabbix Mac OS agent can be installed from PKG installer packages available for download. Versions with or without encryption are available.

Installing agent

The agent can be installed using the graphical user interface or from the command line, for example:

  1. sudo installer -pkg zabbix_agent-4.4.1-macos-amd64-openssl.pkg -target /

Make sure to use the correct Zabbix package version in the command. It must match the name of the downloaded package.

Running agent

The agent will start automatically after installation or restart.

You may edit the configuration file at /usr/local/etc/zabbix/zabbix_agentd.conf if necessary.

To start the agent manually, you may run:

  1. sudo launchctl start com.zabbix.zabbix_agentd

To stop the agent manually:

  1. sudo launchctl stop com.zabbix.zabbix_agentd

During upgrade, the existing configuration file is not overwritten. Instead a new zabbix_agentd.conf.NEW file is created to be used for reviewing and updating the existing configuration file, if necessary. Remember to restart the agent after manual changes to the configuration file.

Troubleshooting and removing agent

This section lists some useful commands that can be used for troubleshooting and removing Zabbix agent installation.

See if Zabbix agent is running:

  1. ps aux | grep zabbix_agentd

See if Zabbix agent has been installed from packages:

  1. $ pkgutil --pkgs | grep zabbix
  2. com.zabbix.pkg.ZabbixAgent

See the files that were installed from the installer package (note that the initial / is not displayed in this view):

  1. $ pkgutil --only-files --files com.zabbix.pkg.ZabbixAgent
  2. Library/LaunchDaemons/com.zabbix.zabbix_agentd.plist
  3. usr/local/bin/zabbix_get
  4. usr/local/bin/zabbix_sender
  5. usr/local/etc/zabbix/zabbix_agentd/userparameter_examples.conf.NEW
  6. usr/local/etc/zabbix/zabbix_agentd/userparameter_mysql.conf.NEW
  7. usr/local/etc/zabbix/zabbix_agentd.conf.NEW
  8. usr/local/sbin/zabbix_agentd

Stop Zabbix agent if it was launched with launchctl:

  1. sudo launchctl unload /Library/LaunchDaemons/com.zabbix.zabbix_agentd.plist

Remove files (including configuration and logs) that were installed with installer package:

  1. sudo rm -f /Library/LaunchDaemons/com.zabbix.zabbix_agentd.plist
  2. sudo rm -f /usr/local/sbin/zabbix_agentd
  3. sudo rm -f /usr/local/bin/zabbix_get
  4. sudo rm -f /usr/local/bin/zabbix_sender
  5. sudo rm -rf /usr/local/etc/zabbix
  6. sudo rm -rf /var/logs/zabbix

Forget that Zabbix agent has been installed:

  1. sudo pkgutil --forget com.zabbix.pkg.ZabbixAgent