[99497] trunk/dports/net
eborisch at macports.org
eborisch at macports.org
Wed Nov 7 12:49:02 PST 2012
Revision: 99497
http://trac.macports.org//changeset/99497
Author: eborisch at macports.org
Date: 2012-11-07 12:49:02 -0800 (Wed, 07 Nov 2012)
Log Message:
-----------
zabbix2: New port
Modified Paths:
--------------
trunk/dports/net/zabbix2/Portfile
Added Paths:
-----------
trunk/dports/net/zabbix2/
Removed Paths:
-------------
trunk/dports/net/zabbix2/files/
Modified: trunk/dports/net/zabbix2/Portfile
===================================================================
--- trunk/dports/net/zabbix/Portfile 2012-11-07 20:40:42 UTC (rev 99495)
+++ trunk/dports/net/zabbix2/Portfile 2012-11-07 20:49:02 UTC (rev 99497)
@@ -1,108 +1,124 @@
+# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
# $Id$
-PortSystem 1.0
+PortSystem 1.0
-name zabbix
-version 1.8.2
-categories net
-maintainers markd openmaintainer
-platforms darwin
+name zabbix2
+version 2.0.3
+revision 0
+categories net
+maintainers openmaintainer
+platforms darwin
-description An open source application and network monitor
+license GPL-2
-long_description ${description}
+description An open source application and network monitor
-homepage http://www.zabbix.com/
-master_sites sourceforge
-checksums md5 fa4be4fa7ac20a33cc0aa5c27b827746
-patchfiles patch-src-zabbix_server-poller-checks_snmp.c.diff
-depends_lib port:fping \
- port:curl \
- port:openssl
+long_description Zabbix is the ultimate open source availability and \
+ performance monitoring solution. Zabbix offers advanced \
+ monitoring, alerting, and visualization features today \
+ which are missing in other monitoring systems, even some \
+ of the best commercial ones.
-configure.args --enable-server \
- --enable-agent \
- --with-net-snmp \
- --bindir=${prefix}/bin/zabbix \
- --sbindir=${prefix}/sbin/zabbix \
- --libexecdir=${prefix}/libexec/zabbix \
- --datadir=${prefix}/share/zabbix \
- --sysconfdir=${prefix}/etc/zabbix \
- --localstatedir=${prefix}/var/zabbix
+distname zabbix-${version}
+livecheck.name zabbix
+livecheck.regex "zabbix-(\[0-9.\]+\.\[0-9.\]+)\.tar"
+homepage http://www.zabbix.com/
+master_sites sourceforge:zabbix
-configure.ldflags-append -lresolv
+checksums \
+ rmd160 f5af99ef4756ef9695248b9bc79c8fe709eec1cd \
+ sha256 b6febeab76e6af3efdc124bce1bb51a30651babcf41f2d22fe428ff69ab3f764
+depends_lib port:fping \
+ port:curl \
+ port:OpenIPMI
+
+conflicts zabbix
+
+configure.args --enable-server \
+ --enable-agent \
+ --with-net-snmp \
+ --bindir=${prefix}/bin/zabbix \
+ --sbindir=${prefix}/sbin/zabbix \
+ --libexecdir=${prefix}/libexec/zabbix \
+ --datadir=${prefix}/share/zabbix \
+ --sysconfdir=${prefix}/etc/zabbix \
+ --localstatedir=${prefix}/var/zabbix
+
+configure.args-append --with-openipmi=${prefix}
+
+configure.ldflags-append -lresolv
+
if { [variant_isset agent_only] } {
- startupitem.create yes
- startupitem.start "${prefix}/share/zabbix/zabbix_agentd.init start"
- startupitem.stop "${prefix}/share/zabbix/zabbix_agentd.init stop"
+ startupitem.create yes
+ startupitem.start "${prefix}/share/zabbix/zabbix_agentd.init start"
+ startupitem.stop "${prefix}/share/zabbix/zabbix_agentd.init stop"
} else {
- startupitem.create yes
- startupitem.start "${prefix}/share/zabbix/zabbix_server.init start"
- startupitem.stop "${prefix}/share/zabbix/zabbix_server.init stop"
+ startupitem.create yes
+ startupitem.start "${prefix}/share/zabbix/zabbix_server.init start"
+ startupitem.stop "${prefix}/share/zabbix/zabbix_server.init stop"
}
variant mysql5 conflicts pgsql81 pgsql82 pgsql83 pgsql84 sqlite3 \
- description {Use MySQL 5.x for server database} {
- depends_lib-append path:bin/mysql_config5:mysql5
- configure.args-append --with-mysql=${prefix}/lib/mysql5/bin/mysql_config
+ description {Use MySQL 5.x for server database} {
+ depends_lib-append path:bin/mysql_config5:mysql5
+ configure.args-append --with-mysql=${prefix}/lib/mysql5/bin/mysql_config
}
variant pgsql81 conflicts mysql5 pgsql82 pgsql83 pgsql84 sqlite3 \
- description {Use PostgreSQL 8.1.x for server database} {
- depends_lib-append port:postgresql81
- configure.args-append --with-pgsql=${prefix}/lib/postgresql81/bin/pg_config
+ description {Use PostgreSQL 8.1.x for server database} {
+ depends_lib-append port:postgresql81
+ configure.args-append --with-pgsql=${prefix}/lib/postgresql81/bin/pg_config
}
variant pgsql82 conflicts mysql5 pgsql81 pgsql83 pgsql84 sqlite3 \
- description {Use PostgreSQL 8.2.x for server database} {
- depends_lib-append port:postgresql82
- configure.args-append --with-pgsql=${prefix}/lib/postgresql82/bin/pg_config
+ description {Use PostgreSQL 8.2.x for server database} {
+ depends_lib-append port:postgresql82
+ configure.args-append --with-pgsql=${prefix}/lib/postgresql82/bin/pg_config
}
variant pgsql83 conflicts mysql5 pgsql81 pgsql82 pgsql84 sqlite3 \
- description {Use PostgreSQL 8.3.x for server database} {
- depends_lib-append port:postgresql83
- configure.args-append --with-pgsql=${prefix}/lib/postgresql83/bin/pg_config
+ description {Use PostgreSQL 8.3.x for server database} {
+ depends_lib-append port:postgresql83
+ configure.args-append --with-pgsql=${prefix}/lib/postgresql83/bin/pg_config
}
variant pgsql84 conflicts mysql5 pgsql81 pgsql82 pgsql83 sqlite3 \
- description {Use PostgreSQL 8.4.x for server database} {
- depends_lib-append port:postgresql84
- configure.args-append --with-pgsql=${prefix}/lib/postgresql84/bin/pg_config
+ description {Use PostgreSQL 8.4.x for server database} {
+ depends_lib-append port:postgresql84
+ configure.args-append --with-pgsql=${prefix}/lib/postgresql84/bin/pg_config
}
variant sqlite3 conflicts mysql5 pgsql81 pgsql82 pgsql83 pgsql84 \
- description {Use SQLite 3.x for server database} {
- depends_lib-append port:sqlite3
- configure.args-append --with-sqlite3=${prefix}
+ description {Use SQLite 3.x for server database} {
+ depends_lib-append port:sqlite3
+ configure.args-append --with-sqlite3=${prefix}
}
variant agent_only conflicts mysql5 pgsql81 pgsql82 pgsql83 pgsql84 sqlite3 \
- description {Do not install the Zabbix server} {
- depends_lib-delete port:fping \
- port:curl \
- port:openssl
+ description {Do not install the Zabbix server} {
+ depends_lib-delete port:fping \
+ port:curl
- configure.args-delete --enable-server \
- --with-net-snmp
+ configure.args-delete --enable-server \
+ --with-net-snmp
}
if {![variant_isset pgsql81] && ![variant_isset pgsql82] && ![variant_isset pgsql83] && ![variant_isset pgsql84] && ![variant_isset sqlite3] && ![variant_isset agent_only]} {
- default_variants +mysql5
+ default_variants +mysql5
}
-post-patch {
- reinplace "s|#DBSocket=/tmp/mysql.sock|DBSocket=${prefix}/var/run/mysql5/mysqld.sock|g" \
- ${worksrcpath}/misc/conf/zabbix_server.conf
+post-extract {
+ reinplace "s|#DBSocket=/tmp/mysql.sock|DBSocket=${prefix}/var/run/mysql5/mysqld.sock|g" \
+ ${worksrcpath}/conf/zabbix_server.conf
- reinplace "s|#FpingLocation=/usr/sbin/fping|FpingLocation=${prefix}/sbin/fping|g" \
- ${worksrcpath}/misc/conf/zabbix_server.conf
+ reinplace "s|#FpingLocation=/usr/sbin/fping|FpingLocation=${prefix}/sbin/fping|g" \
+ ${worksrcpath}/conf/zabbix_server.conf
}
pre-destroot {
- adduser zabbix
- addgroup zabbix
+ add_users zabbix group=zabbix
}
post-destroot {
@@ -111,162 +127,200 @@
# Don't install MySQL data and frontend stuff for agent_only
# 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
+ xinstall -d -m 755 -d ${destroot}${prefix}/etc/zabbix
+ xinstall -m 755 ${worksrcpath}/conf/zabbix_agent.conf \
+ ${destroot}${prefix}/etc/zabbix/zabbix_agent.conf.sample
+ xinstall -m 755 ${worksrcpath}/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
+ 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
} else {
# Copy sample server and 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
- xinstall -m 755 ${worksrcpath}/misc/conf/zabbix_server.conf \
- ${destroot}${prefix}/etc/zabbix/zabbix_server.conf.sample
+ xinstall -d -m 755 -d ${destroot}${prefix}/etc/zabbix
+ xinstall -m 755 ${worksrcpath}/conf/zabbix_agent.conf \
+ ${destroot}${prefix}/etc/zabbix/zabbix_agent.conf.sample
+ xinstall -m 755 ${worksrcpath}/conf/zabbix_agentd.conf \
+ ${destroot}${prefix}/etc/zabbix/zabbix_agentd.conf.sample
+ xinstall -m 755 ${worksrcpath}/conf/zabbix_server.conf \
+ ${destroot}${prefix}/etc/zabbix/zabbix_server.conf.sample
+ delete ${destroot}${prefix}/etc/zabbix/zabbix_server.conf
+ delete ${destroot}${prefix}/etc/zabbix/zabbix_agentd.conf
+ delete ${destroot}${prefix}/etc/zabbix/zabbix_agent.conf
# Copy database data and schemas
- xinstall -d -m 755 -d ${destroot}${prefix}/share/zabbix/data
- xinstall -d -m 755 -d ${destroot}${prefix}/share/zabbix/schema
+ xinstall -d -m 755 -d ${destroot}${prefix}/share/zabbix/data
+ xinstall -d -m 755 -d ${destroot}${prefix}/share/zabbix/schema
- eval xinstall -m 755 [glob ${worksrcpath}/create/data/*.*] \
- ${destroot}${prefix}/share/zabbix/data
- eval xinstall -m 755 [glob ${worksrcpath}/create/schema/*] \
- ${destroot}${prefix}/share/zabbix/schema
+ eval xinstall -m 755 ${worksrcpath}/database/mysql/data.sql \
+ ${destroot}${prefix}/share/zabbix/data
+ eval xinstall -m 755 ${worksrcpath}/database/mysql/images.sql \
+ ${destroot}${prefix}/share/zabbix/data
+ eval xinstall -m 755 ${worksrcpath}/database/mysql/schema.sql \
+ ${destroot}${prefix}/share/zabbix/schema
+ file copy ${worksrcpath}/upgrades \
+ ${destroot}${prefix}/share/zabbix/
+
# Copy the front end files
- file mkdir ${destroot}${prefix}/share/zabbix/frontends/
- file copy ${worksrcpath}/frontends/php/ \
- ${destroot}${prefix}/share/zabbix/frontends/
+ file mkdir ${destroot}${prefix}/share/zabbix/frontends/
+ file copy ${worksrcpath}/frontends/php/ \
+ ${destroot}${prefix}/share/zabbix/frontends/
# Create a startup script for the server
- xinstall -m 755 ${portpath}/${filesdir}/zabbix_server.init \
- ${destroot}${prefix}/share/zabbix
- reinplace "s|__PREFIX__|${prefix}|g" \
- ${destroot}${prefix}/share/zabbix/zabbix_server.init
+ xinstall -m 755 ${portpath}/${filesdir}/zabbix_server.init \
+ ${destroot}${prefix}/share/zabbix
+ reinplace "s|__PREFIX__|${prefix}|g" \
+ ${destroot}${prefix}/share/zabbix/zabbix_server.init
# Create a startup script for the agent
- xinstall -m 755 ${portpath}/${filesdir}/zabbix_agentd.init \
- ${destroot}${prefix}/share/zabbix
- reinplace "s|__PREFIX__|${prefix}|g" \
- ${destroot}${prefix}/share/zabbix/zabbix_agentd.init
+ xinstall -m 755 ${portpath}/${filesdir}/zabbix_agentd.init \
+ ${destroot}${prefix}/share/zabbix
+ reinplace "s|__PREFIX__|${prefix}|g" \
+ ${destroot}${prefix}/share/zabbix/zabbix_agentd.init
# Set permissions for etc (protect passwords) and the frontend
- system "chmod 660 ${destroot}${prefix}/etc/zabbix/*"
- system "chown zabbix:zabbix ${destroot}${prefix}/etc/zabbix/*"
- system "chown -R www:www ${destroot}${prefix}/share/zabbix/frontends/*"
+ system "chmod 660 ${destroot}${prefix}/etc/zabbix/*"
+ system "chown zabbix:zabbix ${destroot}${prefix}/etc/zabbix/*"
+ system "chown -R www:www ${destroot}${prefix}/share/zabbix/frontends/*"
# End else clause - Done with server stuff
}
# Copy Win32 agent for normal and agent_only installs
- xinstall -d -m 755 -d ${destroot}${prefix}/share/zabbix/zabbix_agent_win32
- xinstall -m 755 ${worksrcpath}/bin/win32/zabbix_agentd.exe \
- ${destroot}${prefix}/share/zabbix/zabbix_agent_win32
+ xinstall -d -m 755 -d ${destroot}${prefix}/share/zabbix/zabbix_agent_win32
+ xinstall -m 755 ${worksrcpath}/bin/win32/zabbix_agentd.exe \
+ ${destroot}${prefix}/share/zabbix/zabbix_agent_win32
}
+if {[variant_isset agent_only]} {
+ notes "
+#### ####
+#### ZABBIX2 agent installation section ####
-notes "
-#### ZABBIX agent installation section (steps 1 - 3 only) ####
+1) Edit the sample .conf file ${prefix}/etc/zabbix/zabbix_agentd.conf
+ (rename & omit .sample)
-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
+ Server=x.x.x.x
2) Set zabbix_agentd to run at system boot
- sudo launchctl load -w /Library/LaunchDaemons/org.macports.zabbix.plist
+ sudo port load zabbix2
- To start Zabbix manually, use: ${prefix}/share/zabbix/zabbix_agentd.init start (stop|status)
+ To start Zabbix manually, use:
+ ${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.
+#### End ZABBIX2 agent installation section ####
+#### ####
+"
+} else {
+ notes "
+#### ####
+#### Begin ZABBIX2 server installation section ####
-#### End ZABBIX agent installation section ####
-#### ####
-
-
-#### ####
-#### Begin ZABBIX server installation section ####
-
-
1) Setup MySQL, i.e. via MacPorts:
- sudo port install mysql5-server
+ sudo port install mysql5-server
2) Setup the ZABBIX MySQL database
-Create the ZABBIX database
- mysql5 -u root -p (enter password at prompt)
- mysql> create database zabbix character set utf8;
- mysql> quit;
+ mysql5 -u root -p (enter password at prompt)
+ mysql> create database zabbix character set utf8;
+ mysql> quit;
-Import the ZABBIX Schema
- cd ${prefix}/share/zabbix/schema
- cat mysql.sql | mysql5 -u root -p zabbix
- cd ${prefix}/share/zabbix/data
- cat data.sql | mysql5 -u root -p zabbix
- cat images_mysql.sql | mysql5 -u root -p zabbix
+ cd ${prefix}/share/zabbix/schema
+ cat mysql.sql | mysql5 -u root -p zabbix
+ cd ${prefix}/share/zabbix/data
+ cat images.sql | mysql5 -u root -p zabbix
+ cat data.sql | mysql5 -u root -p zabbix
-Create a MySQL 'zabbix' user and password
- mysql5 -u root -p
- mysql> grant all privileges on zabbix.* to zabbix at localhost identified by '<zabbix-mysql-password>';
- mysql> grant all privileges on zabbix.* to zabbix identified by '<zabbix-mysql-password>';
- mysql> quit;
+ mysql5 -u root -p
+ mysql> grant all privileges on zabbix.* to zabbix at localhost identified by '<zabbix-mysql-password>';
+ mysql> grant all privileges on zabbix.* to zabbix identified by '<zabbix-mysql-password>';
+ mysql> quit;
-3) Edit the sample .conf file ${prefix}/etc/zabbix/zabbix_server.conf (rename & omit .sample)
+3) Edit the sample .conf file ${prefix}/etc/zabbix/zabbix_server.conf
+ (rename & omit .sample)
Modify these variables at the very least:
- DBName=zabbix
- DBUser=zabbix
- DBPassword=<zabbix-mysql-password>
+ DBName=zabbix
+ DBUser=zabbix
+ DBPassword=<zabbix-mysql-password>
4) Install PHP 5, i.e. via MacPorts:
- sudo port install php5 php5-gd php5-mbstring php5-mysql php5-sockets
+ sudo port install php5 php5-gd php5-mbstring php5-mysql php5-sockets
-5) Set a symbolic link in your Apache document root pointing to the PHP frontend files
+5) Set a symbolic link in your Apache document root pointing to the PHP
+ frontend files
- sudo ln -s ${prefix}/share/zabbix/frontends/php <Apache-docroot>/zabbix
+ sudo ln -s ${prefix}/share/zabbix/frontends/php <Apache-docroot>/zabbix
6) Set zabbix_server to run at system boot, then start it
- sudo launchctl load -w /Library/LaunchDaemons/org.macports.zabbix.plist
+ sudo port load zabbix2
- To start Zabbix manually, use: ${prefix}/share/zabbix/zabbix_server.init start (stop|status)
+ To start Zabbix manually, use:
+ ${prefix}/share/zabbix/zabbix_server.init start (stop|status)
- Note: Eventually your shared memory has to be increased (see http://www.zabbix.org/forum/showthread.php?p=64232)!
+ Note: Your shared memory will likely need to be increased
+ (see http://support.apple.com/kb/HT4022)
-
7) 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.
-8) Open http://localhost/zabbix/ in your browser and walk through the setup, then login with default user 'Admin' and password 'zabbix'.
+8) Open http://localhost/zabbix/ in your browser and walk through the setup,
+ then login with default user 'Admin' and password 'zabbix'.
9) Read the fine manual at http://www.zabbix.com/documentation/
+
+
+#### End ZABBIX2 server installation section ####
+#### ####
+
+
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+!! ZABBIX -> ZABBIX2 Server Upgrade process !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+!! 0) BACK UP YOUR DATABASE !!
+!! !!
+!! 1) Be sure to use 'sudo port unload zabbix' to stop the background !!
+!! server before deactivating zabbix, and then use !!
+!! 'sudo port load zabbix2' **AFTER UPGRADING THE DATABASE** as !!
+!! described below. !!
+!! !!
+!! 2) For upgrading from 1.8 (zabbix -> zabbix2), upgrade scripts are !!
+!! located in ${prefix}/share/zabbix/upgrades !!
+!! !!
+!! For upgrade procedure, please see !!
+!! http://www.zabbix.com/documentation/2.0/manual/installation/upgrade !!
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
"
+}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20121107/3a133719/attachment-0001.html>
More information about the macports-changes
mailing list