[22348] trunk/dports/net

source_changes at macosforge.org source_changes at macosforge.org
Mon Feb 26 21:01:34 PST 2007


Revision: 22348
          http://trac.macosforge.org/projects/macports/changeset/22348
Author:   markd at macports.org
Date:     2007-02-26 21:01:34 -0800 (Mon, 26 Feb 2007)

Log Message:
-----------
New port.  zabbix agent was originally a part of the zabbix port.  I am splitting
it off into a separate port.

Added Paths:
-----------
    trunk/dports/net/zabbix-agent/
    trunk/dports/net/zabbix-agent/Portfile
    trunk/dports/net/zabbix-agent/files/
    trunk/dports/net/zabbix-agent/files/patch-configure
    trunk/dports/net/zabbix-agent/files/zabbix_agentd.init

Added: trunk/dports/net/zabbix-agent/Portfile
===================================================================
--- trunk/dports/net/zabbix-agent/Portfile	                        (rev 0)
+++ trunk/dports/net/zabbix-agent/Portfile	2007-02-27 05:01:34 UTC (rev 22348)
@@ -0,0 +1,91 @@
+# $Id: Portfile 20351 2006-11-02 01:58:50Z blair at macports.org $
+
+PortSystem	1.0
+
+name			zabbix-agent
+version			1.1.6
+categories		net
+maintainers		markd at macports.org
+platforms		darwin
+
+description		An open source application and network monitor
+long_description	${description}
+
+homepage		http://www.zabbix.com
+master_sites		sourceforge
+checksums		md5 baa6896c5f41ed286bca3c40e419e1cf
+
+configure.pre_args     --prefix=${prefix}
+
+configure.args		--enable-agent \
+			--bindir=${prefix}/bin/zabbix \
+			--sbindir=${prefix}/sbin/zabbix \
+			--libexecdir=${prefix}/libexec/zabbix \
+			--datadir=${prefix}/share/zabbix \
+			--sysconfdir=${prefix}/etc/zabbix \
+			--localstatedir=${prefix}/var/zabbix \
+			--mandir=${prefix}/man
+
+	startupitem.create      yes
+	startupitem.start       "${prefix}/share/zabbix/zabbix_agentd.init start"
+	startupitem.stop        "${prefix}/share/zabbix/zabbix_agentd.init stop"
+
+build {}
+        
+pre-destroot {
+        adduser zabbix
+        addgroup zabbix
+}
+
+post-destroot {
+# Copy sample agent .conf files
+	xinstall -d -m 755 -d ${destroot}${prefix}/etc/zabbix
+	xinstall -m 755  ${worksrcpath}/misc/conf/zabbix_agent.conf \
+		${destroot}${prefix}/etc/zabbix/zabbix_agent.conf.sample
+        xinstall -m 755  ${worksrcpath}/misc/conf/zabbix_agentd.conf \
+                ${destroot}${prefix}/etc/zabbix/zabbix_agentd.conf.sample
+
+# Copy a startup script for the agent
+		xinstall -d -m 755 -d ${destroot}${prefix}/share/zabbix
+		xinstall -m 755 ${portpath}/${filesdir}/zabbix_agentd.init \
+			${destroot}${prefix}/share/zabbix
+		reinplace "s|__PREFIX__|${prefix}|g" \
+                ${destroot}${prefix}/share/zabbix/zabbix_agentd.init
+
+# Copy Win32 agent
+		xinstall -d -m 755 -d ${destroot}${prefix}/share/zabbix/zabbix_agent_win32
+		xinstall -m 755 ${worksrcpath}/src/zabbix_agent_win32/Release/ZabbixW32.exe \
+			${destroot}${prefix}/share/zabbix/zabbix_agent_win32
+		xinstall -m 755 ${worksrcpath}/src/zabbix_agent_win32/doc/ReadMe.txt \
+			${destroot}${prefix}/share/zabbix/zabbix_agent_win32
+}
+
+post-activate {
+ui_msg "\n#### To complete the ZABBIX agent installation ####
+
+
+1) Edit the sample .conf file ${prefix}/etc/zabbix/zabbix_agentd.conf (rename & omit .sample)
+
+   Set the following variable to the ip address of your ZABBIX server to
+   allow it access to the agent.
+
+	Server=x.x.x.x
+   
+   
+2) Set zabbix_agentd to run at system boot, then start it
+
+	OS X 10.4 - Run launchctl so ZABBIX will start at system boot
+	sudo launchctl load -w /Library/LaunchDaemons/org.macports.zabbix.plist
+
+	OS X 10.3 and previous - A startup item was created in /Library/StartupItems
+	Add \"ZABBIX=-YES-\" to the /etc/hostconfig file to run ZABBIX at system boot
+	        
+	${prefix}/share/zabbix/zabbix_agentd.init start (stop|status)
+
+
+3) A Win32 agent is in ${prefix}/share/zabbix/zabbix_agent_win32 for
+   installation on Windows NT 4.0, Windows 2000, and Windows XP.  See
+   the ReadMe.txt for instructions.
+
+\n"
+

Added: trunk/dports/net/zabbix-agent/files/patch-configure
===================================================================
--- trunk/dports/net/zabbix-agent/files/patch-configure	                        (rev 0)
+++ trunk/dports/net/zabbix-agent/files/patch-configure	2007-02-27 05:01:34 UTC (rev 22348)
@@ -0,0 +1,22 @@
+--- configure	2007-02-26 20:29:48.000000000 -0800
++++ configure.new	2007-02-26 20:33:14.000000000 -0800
+@@ -275,6 +275,9 @@
+ # Factoring default headers for most tests.
+ ac_includes_default="\
+ #include <stdio.h>
++#include <sys/socket.h>
++#include <sys/param.h>
++#include <netinet/in.h>
+ #if HAVE_SYS_TYPES_H
+ # include <sys/types.h>
+ #endif
+@@ -6666,6 +6669,9 @@
+ 			elif test -f $withval/include/mysql.h; then
+ 				MYSQL_INCDIR=$withval/include
+ 				MYSQL_LIBDIR=$withval/lib
++			elif test -f $withval/include/mysql5/mysql/mysql.h; then
++				MYSQL_INCDIR=$withval/include/mysql5/mysql
++				MYSQL_LIBDIR=$withval/lib/mysql5/mysql
+ 			else
+ 			echo "$as_me:$LINENO: result: no" >&5
+ echo "${ECHO_T}no" >&6

Added: trunk/dports/net/zabbix-agent/files/zabbix_agentd.init
===================================================================
--- trunk/dports/net/zabbix-agent/files/zabbix_agentd.init	                        (rev 0)
+++ trunk/dports/net/zabbix-agent/files/zabbix_agentd.init	2007-02-27 05:01:34 UTC (rev 22348)
@@ -0,0 +1,26 @@
+#!/bin/sh
+
+case "$1" in
+    start)
+        echo -n "Starting zabbix_agentd "
+        sudo -u zabbix __PREFIX__/bin/zabbix/zabbix_agentd -c __PREFIX__/etc/zabbix/zabbix_agentd.conf
+        ;;
+
+    stop)
+        echo -n "Shutting down zabbix_agentd"
+        pid=`ps axc|awk "{if (\\$5==\"zabbix_agent\") print \\$1}"`
+        /bin/kill $pid
+       rm /var/tmp/zabbix_agentd.pid
+        ;;
+    restart)
+        $0 stop
+        $0 start
+        ;;
+    status)
+        /bin/ps -ax |/usr/bin/grep zabbix_agentd
+        ;;
+        *)
+        echo "Usage: $0 {start|stop|restart|status}"
+        exit 1
+esac
+

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.macosforge.org/pipermail/macports-changes/attachments/20070226/369fa9e1/attachment.html


More information about the macports-changes mailing list