├── .gitignore ├── zabbixagent-installer-for-mac2.pmdoc ├── 04zabbix-contents.xml ├── 02zabbix-contents.xml ├── 01zabbix-contents.xml ├── 03zabbix-contents.xml ├── 05zabbix-contents.xml ├── 06com-contents.xml ├── 01zabbix.xml ├── 04zabbix.xml ├── 02zabbix.xml ├── 03zabbix.xml ├── 05zabbix.xml ├── 06com.xml └── index.xml ├── Library └── LaunchDaemons │ └── com.zabbix.zabbix_agentd.plist ├── README.md ├── Rakefile └── postinstall.sh /.gitignore: -------------------------------------------------------------------------------- 1 | TRASH 2 | .DS_Store 3 | source 4 | fakeroot 5 | *.pkg 6 | -------------------------------------------------------------------------------- /zabbixagent-installer-for-mac2.pmdoc/04zabbix-contents.xml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /zabbixagent-installer-for-mac2.pmdoc/02zabbix-contents.xml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /zabbixagent-installer-for-mac2.pmdoc/01zabbix-contents.xml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /zabbixagent-installer-for-mac2.pmdoc/03zabbix-contents.xml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /zabbixagent-installer-for-mac2.pmdoc/05zabbix-contents.xml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /zabbixagent-installer-for-mac2.pmdoc/06com-contents.xml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Library/LaunchDaemons/com.zabbix.zabbix_agentd.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Label 6 | com.zabbix.zabbix_agentd 7 | RunAtLoad 8 | 9 | KeepAlive 10 | 11 | SuccessfulExit 12 | 13 | 14 | UserName 15 | zabbix 16 | GroupName 17 | zabbix 18 | ProgramArguments 19 | 20 | /usr/local/sbin/zabbix_agentd 21 | -c 22 | /usr/local/etc/zabbix/zabbix_agentd.conf 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /zabbixagent-installer-for-mac2.pmdoc/01zabbix.xml: -------------------------------------------------------------------------------- 1 | com.lingewoud.zabbixAgentdForOsx.zabbix_agentd-1.pkg1.0fakeroot/sbin/zabbix_agentd/usr/local/sbininstallTo.pathinstallFrom.pathparentinstallTo01zabbix-contents.xml/CVS$/\.svn$/\.cvsignore$/\.cvspass$/\.DS_Store$ -------------------------------------------------------------------------------- /zabbixagent-installer-for-mac2.pmdoc/04zabbix.xml: -------------------------------------------------------------------------------- 1 | com.lingewoud.zabbixAgentdForOsx.zabbix_get.pkg1.0fakeroot/bin/zabbix_get/usr/local/bininstallTo.pathinstallFrom.isRelativeTypeinstallFrom.pathparentinstallTo04zabbix-contents.xml/CVS$/\.svn$/\.cvsignore$/\.cvspass$/\.DS_Store$ -------------------------------------------------------------------------------- /zabbixagent-installer-for-mac2.pmdoc/02zabbix.xml: -------------------------------------------------------------------------------- 1 | com.lingewoud.zabbixAgentdForOsx.zabbix_agent.pkg1.0fakeroot/sbin/zabbix_agent/usr/local/sbininstallTo.pathinstallFrom.isRelativeTypeinstallFrom.pathparentinstallTo02zabbix-contents.xml/CVS$/\.svn$/\.cvsignore$/\.cvspass$/\.DS_Store$ -------------------------------------------------------------------------------- /zabbixagent-installer-for-mac2.pmdoc/03zabbix.xml: -------------------------------------------------------------------------------- 1 | com.lingewoud.zabbixAgentdForOsx.zabbix_sender.pkg1.0fakeroot/bin/zabbix_sender/usr/local/bininstallTo.pathinstallFrom.isRelativeTypeinstallFrom.pathparentinstallTo03zabbix-contents.xml/CVS$/\.svn$/\.cvsignore$/\.cvspass$/\.DS_Store$ -------------------------------------------------------------------------------- /zabbixagent-installer-for-mac2.pmdoc/05zabbix.xml: -------------------------------------------------------------------------------- 1 | com.lingewoud.zabbixAgentdForOsx.zabbix_agentd.pkg1.0fakeroot/etc/zabbix_agentd.conf/usr/local/etc/zabbixinstallTo.pathinstallFrom.isRelativeTypeinstallFrom.pathparentinstallTo05zabbix-contents.xml/CVS$/\.svn$/\.cvsignore$/\.cvspass$/\.DS_Store$ -------------------------------------------------------------------------------- /zabbixagent-installer-for-mac2.pmdoc/06com.xml: -------------------------------------------------------------------------------- 1 | com.lingewoud.zabbixAgentdForOsx.com.zabbix.zabbix_agentd.pkg1.1Library/LaunchDaemons/com.zabbix.zabbix_agentd.plist/Library/LaunchDaemonsinstallToscripts.postinstall.pathscripts.preinstall.isRelativeTypescripts.preinstall.pathparentversioninstallTo.pathinstallFrom.isRelativeTypescripts.postinstall.isRelativeTypepostinstall.sh06com-contents.xml/CVS$/\.svn$/\.cvsignore$/\.cvspass$/\.DS_Store$ -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Zabbix_agentd installer for Mac OS X 2 | 3 | These are the source files for packaging a binary zabbix_agentd. The installer itself can be downloaded at the 4 | releases: https://github.com/mipmip/zabbix_agentd_osx_installer/releases 5 | 6 | ![image](http://picdrop.t3lab.com/iWcWUQmdaq.png) 7 | 8 | ## Requirements 9 | 10 | * x64 processor 11 | * Mac OS X version = 10.6, 10.7, 10.8, 10.9 12 | 13 | ## Configuration 14 | 15 | Make sure to replace the variables in ```/usr/local/etc/zabbix/etc/zabbix/zabbix_agentd.conf``` after installing and before 16 | starting the agent deamon. 17 | 18 | ``` 19 | Server=0.0.0.0 20 | Hostname=yourhostname 21 | ``` 22 | 23 | ## Usage 24 | 25 | The agent starts automaticly at boot time. To start is manually enter: 26 | 27 | ``` 28 | sudo launchctl load /Library/LaunchDaemons/com.zabbix.zabbix_agentd.plist 29 | ``` 30 | 31 | Launchctl unload does not work. Use the command below. 32 | ``` 33 | sudo kill -9 `ps -aef | grep zabbix_agentd | grep -v grep | awk '{print $2}'` 34 | ``` 35 | 36 | ## Build a new zabbix agentd installer 37 | 38 | Before you can build an installer pkg you shoud have **xcode command line tools** and **PackageMaker.app** installed. 39 | 40 | 1. Download the source code from http://zabbix.com tarball 41 | 2. Clone this repository 42 | 3. Cd to the installer source code 43 | 4. Execute ```rake create[/path/to/zabbix_source_code.tar.bz]``` 44 | -------------------------------------------------------------------------------- /Rakefile: -------------------------------------------------------------------------------- 1 | 2 | task :default => :help 3 | 4 | desc 'desc: show main tasks' 5 | task :help do 6 | system 'rake -T' 7 | end 8 | 9 | desc 'desc: show main tasks' 10 | task :clean do 11 | system 'rm -fr fakeroot' 12 | system 'rm -fr source' 13 | end 14 | 15 | task :build do 16 | sourcedir = "./source/#{`ls ./source`}".strip 17 | version = sourcedir[-5..-1] 18 | p sourcedir 19 | p version 20 | 21 | system 'rm -fr fakeroot' 22 | system "mkdir fakeroot" 23 | system "cd #{sourcedir} && ./configure --enable-agent --prefix=`pwd`/../../fakeroot" 24 | system "cd #{sourcedir} && make install" 25 | end 26 | 27 | task :package do 28 | sourcedir = "./source/#{`ls ./source`}".strip 29 | version = sourcedir.split('-')[1] 30 | 31 | system "/Applications/PackageMaker.app/Contents/MacOS/PackageMaker --doc #{pwd}/zabbixagent-installer-for-mac2.pmdoc --out zabbix_agentd-#{version}-OSX-64bit.pkg" 32 | print "If all went well, you should now have a functional pkg located in this directory." 33 | 34 | end 35 | 36 | desc 'desc: build zabbix agent installer version, git tarball as argument' 37 | task :create, :zabbix_tarball_path do |t, args| 38 | if (File.exist? args[:zabbix_tarball_path].to_s) 39 | system 'rm -fr source' 40 | system "mkdir source" 41 | system "tar xzvf #{args[:zabbix_tarball_path].to_s} -C ./source" 42 | Rake::Task['build'].invoke 43 | Rake::Task['package'].invoke 44 | else 45 | print "Usage: rake create[/path/to/source/tarball.tar.gz]\n" 46 | end 47 | end 48 | 49 | task :killzab do 50 | system "sudo kill -9 `ps -aef | grep zabbix_agentd | grep -v grep | awk '{print $2}'`" 51 | end 52 | task :pszab do 53 | system "ps aux | grep zab" 54 | end 55 | 56 | 57 | -------------------------------------------------------------------------------- /postinstall.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | #To create a group: 4 | sudo dscl /Local/Default -create /Groups/zabbix 5 | sudo dscl /Local/Default -create /Groups/zabbix PrimaryGroupID 113 6 | sudo dscl /Local/Default -create /Groups/zabbix Password \* 7 | 8 | #To create a user: 9 | sudo dscl /Local/Default -create /Users/zabbix 10 | sudo dscl /Local/Default -create /Users/zabbix UniqueID 113 11 | sudo dscl /Local/Default -create /Users/zabbix UserShell /usr/bin/false 12 | sudo dscl /Local/Default -create /Users/zabbix RealName 'Zabbix user' 13 | sudo dscl /Local/Default -create /Users/zabbix NFSHomeDirectory /var/empty 14 | sudo dscl /Local/Default -create /Users/zabbix PrimaryGroupID 113 15 | sudo dscl /Local/Default -create /Users/zabbix Password \* 16 | 17 | #Create needed directories 18 | sudo mkdir -p /var/run/zabbix-agent 19 | sudo mkdir -p /var/log/zabbix-agent 20 | sudo mkdir -p /usr/local/bin 21 | sudo mkdir -p /usr/local/sbin 22 | sudo mkdir -p /usr/local/etc/zabbix 23 | 24 | sudo chown -Rf zabbix:zabbix /var/run/zabbix-agent 25 | sudo chown -Rf zabbix:zabbix /var/log/zabbix-agent 26 | 27 | sudo chown root:wheel /Library/LaunchDaemons/com.zabbix.zabbix_agentd.plist 28 | sudo chown root:wheel /usr/local/etc/zabbix/zabbix_agentd.conf 29 | sudo chown root:wheel /usr/local/etc/zabbix_agentd.conf 30 | 31 | sudo chown -Rf root:wheel /usr/local/sbin 32 | sudo chown -Rf root:wheel /usr/local/bin 33 | sudo chmod -Rf 755 /usr/local/bin 34 | sudo chmod -Rf 755 /usr/local/sbin 35 | 36 | sudo chmod 755 /usr/local/etc/zabbix 37 | #sudo kill -9 `ps aux | grep zabbix_agentd | cut -f11 -d" "` 38 | #sudo kill -9 `ps -aef | grep zabbix_agentd | grep -v grep | awk '{print $2}'` 39 | #sudo rm -Rf /tmp/zabbix* 40 | -------------------------------------------------------------------------------- /zabbixagent-installer-for-mac2.pmdoc/index.xml: -------------------------------------------------------------------------------- 1 | Zabbix Agentd for OSX/Users/pim/Desktop/Zabbix Agentd installer.pkgcom.lingewoud\ 307 | Copyright (C) \ 308 | \ 309 | This program is free software; you can redistribute it and/or modify\ 310 | it under the terms of the GNU General Public License as published by\ 311 | the Free Software Foundation; either version 2 of the License, or\ 312 | (at your option) any later version.\ 313 | \ 314 | This program is distributed in the hope that it will be useful,\ 315 | but WITHOUT ANY WARRANTY; without even the implied warranty of\ 316 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\ 317 | GNU General Public License for more details.\ 318 | \ 319 | You should have received a copy of the GNU General Public License along\ 320 | with this program; if not, write to the Free Software Foundation, Inc.,\ 321 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.\ 322 | \ 323 | Also add information on how to contact you by electronic and paper mail.\ 324 | \ 325 | If the program is interactive, make it output a short notice like this\ 326 | when it starts in an interactive mode:\ 327 | \ 328 | Gnomovision version 69, Copyright (C) year name of author\ 329 | Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.\ 330 | This is free software, and you are welcome to redistribute it\ 331 | under certain conditions; type `show c' for details.\ 332 | \ 333 | The hypothetical commands `show w' and `show c' should show the appropriate\ 334 | parts of the General Public License. Of course, the commands you use may\ 335 | be called something other than `show w' and `show c'; they could even be\ 336 | mouse-clicks or menu items--whatever suits your program.\ 337 | \ 338 | You should also get your employer (if you work as a programmer) or your\ 339 | school, if any, to sign a "copyright disclaimer" for the program, if\ 340 | necessary. Here is a sample; alter the names:\ 341 | \ 342 | Yoyodyne, Inc., hereby disclaims all copyright interest in the program\ 343 | `Gnomovision' (which makes passes at compilers) written by James Hacker.\ 344 | \ 345 | , 1 April 1989\ 346 | Ty Coon, President of Vice\ 347 | \ 348 | This General Public License does not permit incorporating your program into\ 349 | proprietary programs. If your program is a subroutine library, you may\ 350 | consider it more useful to permit linking proprietary applications with the\ 351 | library. If this is what you want to do, use the GNU Lesser General\ 352 | Public License instead of this License.}]]>01zabbix.xml02zabbix.xml03zabbix.xml04zabbix.xml05zabbix.xml06com.xmlproperties.titleproperties.anywhereDomainproperties.systemDomain --------------------------------------------------------------------------------