Install Zabbix Agent on Mac osx

Update as of 16/04/18

Create a  service user: zabbix

Check if the gid you will use, is still available, for users: sudo dscl . -list /Users UniqueID

Groups: sudo dscl . -list /Groups UniqueID

For zabbix clients 3.4 on mac os, we’ll also need PCRE as noted here https://www.zabbix.com/documentation/3.4/manual/installation/install

Switch to Download folder of current user and download the source package.

Extract the archive and move into the folder.

Configure, compile and install into  /etc/pcre-8.41

Create a symbolic link to /usr/local/pcre.

We’ll need xcode for zabbix to compile on a Mac osx server (so once compiled you can skip this step, until and including the line “./configure –enable-agent”. Just copy the already compiled agent from an existing mac osx)
command-line tools:

Download zabbix source code: https://sourceforge.net/projects/zabbix/files/ZABBIX%20Latest%20Stable/3.2.0/zabbix-3.2.0.tar.gz/download (http://www.zabbix.com/download.php)
Untar

Switch to the tarball directory

Make the installation directories and run the configure script with the –enable-agent switch

Copy the configuration file to the local etc directory:

Copy the daemon file to the local sbin directory

Start the agent:

To autostart the zabbix agent with a reboot of MAC OSX

Make the following file: “/Library/LaunchAgents/org.macports.zabbix_agent.plist”

Contents of the file:

test your file with: plutil /Library/LaunchAgents/org.macports.zabbix_agent.plist

Let’s create a startup script for zabbix (yes, i am aware it is “strange” to create a bash file, while i could copy paste the same command directly in the plist file, but i’ve seen, how can i say, various result with different mac os versions, it seems this works best overall on all mac os versions):

which says:

make it runnable:

Launch the launchctl file with (so you don’t need to reboot to test the plist, no sudo!): launchd /Library/LaunchAgents/org.macports.zabbix_agent.plist

Last: Make the host in zabbix and add the mac template on it.
Also don’t forget to open up port 10050 in the firewall of the mac osx server

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.