Installing the Zabbix Agent on Mac OS X for Monitoring

Installing the Zabbix agent on Mac OS X and monitoring the machine

* This page contains promotional content

Downloading and installing the Zabbix Agent

  1. From the Zabbix official site, go to Download Zabbix agents (in Japanese), specify macOS and the zabbix version, and download it

  2. Open the pkg file you downloaded and install it

By the way, it is set up so that it runs automatically when MacOS starts

# file location
/Library/LaunchDaemons/com.zabbix.zabbix_agentd.plist

# startup script
/usr/local/sbin/zabbix_agentd -c /usr/local/etc/zabbix/zabbix_agentd.conf -f

# log
/var/log/zabbix/zabbix_agentd-out.log
/var/log/zabbix/zabbix_agentd-err.log

Configuration

Change Hostname as appropriate, and change the Server field to the IP of the Zabbix Server

# vim /usr/local/etc/zabbix/zabbix_agentd.conf
...
# Server 127.0.0.1
Server 111.222.33.4

# Hostname Zabbix Server
Hostname MyMac

Restarting the Zabbix Agent

$ sudo launchctl unload /Library/LaunchDaemons/com.zabbix.zabbix_agentd.plist
$ sudo launchctl load /Library/LaunchDaemons/com.zabbix.zabbix_agentd.plist
$ sudo launchctl start /Library/LaunchDaemons/com.zabbix.zabbix_agentd.plist

It does not start?

It would not start, so I looked at the syslog

zabbix_agentd[76466]: dyld: Symbol not found: ____chkstk_darwin Referenced from: /usr/local/sbin/zabbix_agentd Expected in: /usr/lib/libSystem.B.dylib

The cause seems to be that I used the encrypted build when I downloaded and installed it, and when I used 4.4.0 without encryption instead, it started up without trouble.

Adding the host on the Zabbix Server side

After confirming that the Zabbix Agent is running, create the host on the Zabbix Server side and link it to the “Template OS Mac OS X” template, and you are done


References

mac