diff options
author | Yen-Ming Lee <leeym@FreeBSD.org> | 2003-10-25 23:36:31 +0000 |
---|---|---|
committer | Yen-Ming Lee <leeym@FreeBSD.org> | 2003-10-25 23:36:31 +0000 |
commit | 66f6985027467f49a030c0662f398193bc5b9a7d (patch) | |
tree | 128b99e3467d2aa995231a383c3a9d8e99f63fb0 /net-mgmt/zabbix2 | |
parent | 79cdb91c86733c158f5f22577c03e3ee622d27a3 (diff) |
Notes
Diffstat (limited to 'net-mgmt/zabbix2')
-rw-r--r-- | net-mgmt/zabbix2/Makefile | 28 | ||||
-rw-r--r-- | net-mgmt/zabbix2/pkg-message | 10 | ||||
-rw-r--r-- | net-mgmt/zabbix2/pkg-plist | 1 | ||||
-rw-r--r-- | net-mgmt/zabbix2/pkg-plist.agent | 2 | ||||
-rw-r--r-- | net-mgmt/zabbix2/scripts/dbsetup.sh | 7 | ||||
-rw-r--r-- | net-mgmt/zabbix2/scripts/zabbix-agent.sh.sample | 24 | ||||
-rw-r--r-- | net-mgmt/zabbix2/scripts/zabbix.sh.sample | 26 |
7 files changed, 56 insertions, 42 deletions
diff --git a/net-mgmt/zabbix2/Makefile b/net-mgmt/zabbix2/Makefile index c9b833ac1abf..5a544ab50cb7 100644 --- a/net-mgmt/zabbix2/Makefile +++ b/net-mgmt/zabbix2/Makefile @@ -7,6 +7,7 @@ PORTNAME= zabbix PORTVERSION= 1.0b10 +PORTREVISION= 1 CATEGORIES= net MASTER_SITES= ${MASTER_SITE_SOURCEFORGE} MASTER_SITE_SUBDIR=${PORTNAME} @@ -20,14 +21,15 @@ PKGNAMESUFFIX= -agent PLIST= ${MASTERDIR}/pkg-plist.agent PKGMESSAGE= nonexistent .else -CONFIGURE_ARGS= --with-mysql --with-net-snmp +LIB_DEPENDS= netsnmp.5:${PORTSDIR}/net/net-snmp +RUN_DEPENDS= php:${PORTSDIR}/lang/php4-nms -LIB_DEPENDS= netsnmp.5:${PORTSDIR}/net/net-snmp \ - mysqlclient.10:${PORTSDIR}/databases/mysql323-client -BUILD_DEPENDS= mysql:${PORTSDIR}/databases/mysql323-client -RUN_DEPENDS= safe_mysqld:${PORTSDIR}/databases/mysql323-server +USE_MYSQL= yes +CONFIGURE_ARGS= --with-mysql --with-net-snmp +PKGMESSAGE= ${WRKDIR}/pkg-message .endif +USE_RC_SUBR= yes GNU_CONFIGURE= yes CONFIGURE_ENV= CPPFLAGS=-I${LOCALBASE}/include @@ -38,6 +40,17 @@ ZABBIX_BINARIES+=zabbix_suckerd zabbix_trapper zabbix_trapperd ZABBIX_CONFIGS+=zabbix_suckerd.conf zabbix_trapper.conf zabbix_trapperd.conf .endif +SCRIPT_REGEX= -e 's|%PREFIX%|${PREFIX}|g' -e 's|%LOCALBASE%|${LOCALBASE}|g' + +pre-patch: +.if !defined(ZABBIX_AGENT_ONLY) + @${SED} ${SCRIPT_REGEX} ${PKGDIR}/pkg-message > ${PKGMESSAGE} + @${SED} ${SCRIPT_REGEX} ${PKGDIR}/scripts/zabbix.sh.sample > \ + ${WRKDIR}/zabbix.sh.sample +.endif + @${SED} ${SCRIPT_REGEX} ${PKGDIR}/scripts/zabbix-agent.sh.sample > \ + ${WRKDIR}/zabbix-agent.sh.sample + do-install: .for FILE in ${ZABBIX_BINARIES} ${INSTALL_PROGRAM} ${WRKSRC}/bin/${FILE} ${PREFIX}/bin @@ -63,6 +76,9 @@ do-install: .endif ${INSTALL_SCRIPT} ${MASTERDIR}/scripts/zabbix-agent.sh.sample \ ${PREFIX}/etc/rc.d - ${SH} ${PKGINSTALL} + ${SH} ${PKGINSTALL} ${PKGNAME} PRE-INSTALL +.ifndef(ZABBIX_AGENT_ONLY) + ${CAT} ${PKGMESSAGE} +.endif .include <bsd.port.mk> diff --git a/net-mgmt/zabbix2/pkg-message b/net-mgmt/zabbix2/pkg-message index 9e3c2a8e3e21..13c338ed4d4d 100644 --- a/net-mgmt/zabbix2/pkg-message +++ b/net-mgmt/zabbix2/pkg-message @@ -1,10 +1,8 @@ ==================================================== ACHTUNG!!! -1) Run dbsetup.sh from ${PREFIX}/share/zabbix/create -to setup database tables - -2) Install apache with mod_php (it should be -GD-enabled for graphs to work) and point it -to serve from ${PREFIX}/share/zabbix/php +Run dbsetup.sh from %PREFIX%/share/zabbix/create +to setup database tables. Arguments, given to +it will be passed to mysql client, allowing +connection do non-local MySQL server ==================================================== diff --git a/net-mgmt/zabbix2/pkg-plist b/net-mgmt/zabbix2/pkg-plist index 12adb76a47ca..87768f013212 100644 --- a/net-mgmt/zabbix2/pkg-plist +++ b/net-mgmt/zabbix2/pkg-plist @@ -65,6 +65,7 @@ bin/zabbix_trapperd %%DATADIR%%/php/images/sysmaps/Server.png %%DATADIR%%/php/images/sysmaps/Workstation.png %%DATADIR%%/php/include/.htaccess +%%DATADIR%%/php/include/classes.inc.php %%DATADIR%%/php/include/config.inc.php %%DATADIR%%/php/include/db.inc.php %%DATADIR%%/php/include/defines.inc.php diff --git a/net-mgmt/zabbix2/pkg-plist.agent b/net-mgmt/zabbix2/pkg-plist.agent index d24cc6db18d4..2e5a1980939c 100644 --- a/net-mgmt/zabbix2/pkg-plist.agent +++ b/net-mgmt/zabbix2/pkg-plist.agent @@ -3,6 +3,6 @@ bin/zabbix_agentd bin/zabbix_sender etc/zabbix/zabbix_agent.conf.sample etc/zabbix/zabbix_agentd.conf.sample -@dirrm /etc/zabbix +@dirrm etc/zabbix @exec ln -sf %D/etc/zabbix /etc/zabbix @unexec rm /etc/zabbix diff --git a/net-mgmt/zabbix2/scripts/dbsetup.sh b/net-mgmt/zabbix2/scripts/dbsetup.sh index 4ae8e4381893..240f46157640 100644 --- a/net-mgmt/zabbix2/scripts/dbsetup.sh +++ b/net-mgmt/zabbix2/scripts/dbsetup.sh @@ -1,5 +1,6 @@ #!/bin/sh -echo "create database zabbix;" | mysql -cat mysql/schema.sql | mysql zabbix -cat data/data.sql | mysql zabbix +{ + echo "create database zabbix; use zabbix;" + cat mysql/schema.sql data/data.sql +} | mysql ${*} diff --git a/net-mgmt/zabbix2/scripts/zabbix-agent.sh.sample b/net-mgmt/zabbix2/scripts/zabbix-agent.sh.sample index e5728bd24051..1001c6cb694f 100644 --- a/net-mgmt/zabbix2/scripts/zabbix-agent.sh.sample +++ b/net-mgmt/zabbix2/scripts/zabbix-agent.sh.sample @@ -1,14 +1,14 @@ #!/bin/sh -case "${1}" in - start) - echo -n "zabbix-agent " - zabbix_agentd - ;; - stop) - killall zabbix_agentd - ;; - *) - echo Usage: `basename ${0}` "{start|stop}" - ;; -esac +prefix=%PREFIX% + +zabbix_agentd_enable="YES" + +. %LOCALBASE%/etc/rc.subr + +name="zabbix_agentd" +rcvar=`set_rcvar` +command="${prefix}/bin/${name}" +required_files="/etc/zabbix/${name}.conf" + +run_rc_command "$1" diff --git a/net-mgmt/zabbix2/scripts/zabbix.sh.sample b/net-mgmt/zabbix2/scripts/zabbix.sh.sample index 58c0529b4099..01a0fbce27ef 100644 --- a/net-mgmt/zabbix2/scripts/zabbix.sh.sample +++ b/net-mgmt/zabbix2/scripts/zabbix.sh.sample @@ -1,16 +1,14 @@ #!/bin/sh -case "${1}" in - start) - echo -n "zabbix " - zabbix_suckerd - zabbix_trapperd - ;; - stop) - killall zabbix_suckerd - killall zabbix_trapperd - ;; - *) - echo Usage: `basename ${0}` "{start|stop}" - ;; -esac +prefix=%PREFIX% + +zabbix_suckerd_enable="YES" + +. %LOCALBASE%/etc/rc.subr + +name="zabbix_suckerd" +rcvar=`set_rcvar` +command="${prefix}/bin/${name}" +required_files="/etc/zabbix/${name}.conf" + +run_rc_command "$1" |