Changeset 99497
- Timestamp:
- Nov 7, 2012, 8:49:02 PM (11 years ago)
- Location:
- trunk/dports/net/zabbix2
- Files:
-
- 1 deleted
- 1 edited
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/dports/net/zabbix2/Portfile
r91785 r99497 1 # -*- 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 1 2 # $Id$ 2 3 3 PortSystem 1.0 4 5 name zabbix 6 version 1.8.2 7 categories net 8 maintainers markd openmaintainer 9 platforms darwin 10 11 description An open source application and network monitor 12 13 long_description ${description} 14 15 homepage http://www.zabbix.com/ 16 master_sites sourceforge 17 checksums md5 fa4be4fa7ac20a33cc0aa5c27b827746 18 patchfiles patch-src-zabbix_server-poller-checks_snmp.c.diff 19 depends_lib port:fping \ 20 port:curl \ 21 port:openssl 22 23 configure.args --enable-server \ 24 --enable-agent \ 25 --with-net-snmp \ 26 --bindir=${prefix}/bin/zabbix \ 27 --sbindir=${prefix}/sbin/zabbix \ 28 --libexecdir=${prefix}/libexec/zabbix \ 29 --datadir=${prefix}/share/zabbix \ 30 --sysconfdir=${prefix}/etc/zabbix \ 31 --localstatedir=${prefix}/var/zabbix 32 33 configure.ldflags-append -lresolv 4 PortSystem 1.0 5 6 name zabbix2 7 version 2.0.3 8 revision 0 9 categories net 10 maintainers openmaintainer 11 platforms darwin 12 13 license GPL-2 14 15 description An open source application and network monitor 16 17 long_description Zabbix is the ultimate open source availability and \ 18 performance monitoring solution. Zabbix offers advanced \ 19 monitoring, alerting, and visualization features today \ 20 which are missing in other monitoring systems, even some \ 21 of the best commercial ones. 22 23 distname zabbix-${version} 24 livecheck.name zabbix 25 livecheck.regex "zabbix-(\[0-9.\]+\.\[0-9.\]+)\.tar" 26 homepage http://www.zabbix.com/ 27 master_sites sourceforge:zabbix 28 29 checksums \ 30 rmd160 f5af99ef4756ef9695248b9bc79c8fe709eec1cd \ 31 sha256 b6febeab76e6af3efdc124bce1bb51a30651babcf41f2d22fe428ff69ab3f764 32 33 depends_lib port:fping \ 34 port:curl \ 35 port:OpenIPMI 36 37 conflicts zabbix 38 39 configure.args --enable-server \ 40 --enable-agent \ 41 --with-net-snmp \ 42 --bindir=${prefix}/bin/zabbix \ 43 --sbindir=${prefix}/sbin/zabbix \ 44 --libexecdir=${prefix}/libexec/zabbix \ 45 --datadir=${prefix}/share/zabbix \ 46 --sysconfdir=${prefix}/etc/zabbix \ 47 --localstatedir=${prefix}/var/zabbix 48 49 configure.args-append --with-openipmi=${prefix} 50 51 configure.ldflags-append -lresolv 34 52 35 53 if { [variant_isset agent_only] } { 36 37 38 54 startupitem.create yes 55 startupitem.start "${prefix}/share/zabbix/zabbix_agentd.init start" 56 startupitem.stop "${prefix}/share/zabbix/zabbix_agentd.init stop" 39 57 } else { 40 41 42 58 startupitem.create yes 59 startupitem.start "${prefix}/share/zabbix/zabbix_server.init start" 60 startupitem.stop "${prefix}/share/zabbix/zabbix_server.init stop" 43 61 } 44 62 45 63 variant mysql5 conflicts pgsql81 pgsql82 pgsql83 pgsql84 sqlite3 \ 46 47 48 64 description {Use MySQL 5.x for server database} { 65 depends_lib-append path:bin/mysql_config5:mysql5 66 configure.args-append --with-mysql=${prefix}/lib/mysql5/bin/mysql_config 49 67 } 50 68 51 69 variant pgsql81 conflicts mysql5 pgsql82 pgsql83 pgsql84 sqlite3 \ 52 53 54 70 description {Use PostgreSQL 8.1.x for server database} { 71 depends_lib-append port:postgresql81 72 configure.args-append --with-pgsql=${prefix}/lib/postgresql81/bin/pg_config 55 73 } 56 74 57 75 variant pgsql82 conflicts mysql5 pgsql81 pgsql83 pgsql84 sqlite3 \ 58 59 depends_lib-appendport:postgresql8260 configure.args-append--with-pgsql=${prefix}/lib/postgresql82/bin/pg_config76 description {Use PostgreSQL 8.2.x for server database} { 77 depends_lib-append port:postgresql82 78 configure.args-append --with-pgsql=${prefix}/lib/postgresql82/bin/pg_config 61 79 } 62 80 63 81 variant pgsql83 conflicts mysql5 pgsql81 pgsql82 pgsql84 sqlite3 \ 64 65 66 82 description {Use PostgreSQL 8.3.x for server database} { 83 depends_lib-append port:postgresql83 84 configure.args-append --with-pgsql=${prefix}/lib/postgresql83/bin/pg_config 67 85 } 68 86 69 87 variant pgsql84 conflicts mysql5 pgsql81 pgsql82 pgsql83 sqlite3 \ 70 71 72 88 description {Use PostgreSQL 8.4.x for server database} { 89 depends_lib-append port:postgresql84 90 configure.args-append --with-pgsql=${prefix}/lib/postgresql84/bin/pg_config 73 91 } 74 92 75 93 variant sqlite3 conflicts mysql5 pgsql81 pgsql82 pgsql83 pgsql84 \ 76 77 78 94 description {Use SQLite 3.x for server database} { 95 depends_lib-append port:sqlite3 96 configure.args-append --with-sqlite3=${prefix} 79 97 } 80 98 81 99 variant agent_only conflicts mysql5 pgsql81 pgsql82 pgsql83 pgsql84 sqlite3 \ 82 description {Do not install the Zabbix server} { 83 depends_lib-delete port:fping \ 84 port:curl \ 85 port:openssl 86 87 configure.args-delete --enable-server \ 88 --with-net-snmp 100 description {Do not install the Zabbix server} { 101 depends_lib-delete port:fping \ 102 port:curl 103 104 configure.args-delete --enable-server \ 105 --with-net-snmp 89 106 } 90 107 91 108 if {![variant_isset pgsql81] && ![variant_isset pgsql82] && ![variant_isset pgsql83] && ![variant_isset pgsql84] && ![variant_isset sqlite3] && ![variant_isset agent_only]} { 92 93 } 94 95 post- patch{96 97 ${worksrcpath}/misc/conf/zabbix_server.conf98 99 100 ${worksrcpath}/misc/conf/zabbix_server.conf109 default_variants +mysql5 110 } 111 112 post-extract { 113 reinplace "s|#DBSocket=/tmp/mysql.sock|DBSocket=${prefix}/var/run/mysql5/mysqld.sock|g" \ 114 ${worksrcpath}/conf/zabbix_server.conf 115 116 reinplace "s|#FpingLocation=/usr/sbin/fping|FpingLocation=${prefix}/sbin/fping|g" \ 117 ${worksrcpath}/conf/zabbix_server.conf 101 118 } 102 119 103 120 pre-destroot { 104 adduser zabbix 105 addgroup zabbix 121 add_users zabbix group=zabbix 106 122 } 107 123 … … 112 128 113 129 # Copy sample agent .conf files 114 115 xinstall -m 755 ${worksrcpath}/misc/conf/zabbix_agent.conf \116 117 xinstall -m 755 ${worksrcpath}/misc/conf/zabbix_agentd.conf \118 130 xinstall -d -m 755 -d ${destroot}${prefix}/etc/zabbix 131 xinstall -m 755 ${worksrcpath}/conf/zabbix_agent.conf \ 132 ${destroot}${prefix}/etc/zabbix/zabbix_agent.conf.sample 133 xinstall -m 755 ${worksrcpath}/conf/zabbix_agentd.conf \ 134 ${destroot}${prefix}/etc/zabbix/zabbix_agentd.conf.sample 119 135 120 136 # Copy a startup script for the agent 121 122 123 124 125 137 xinstall -d -m 755 -d ${destroot}${prefix}/share/zabbix 138 xinstall -m 755 ${portpath}/${filesdir}/zabbix_agentd.init \ 139 ${destroot}${prefix}/share/zabbix 140 reinplace "s|__PREFIX__|${prefix}|g" \ 141 ${destroot}${prefix}/share/zabbix/zabbix_agentd.init 126 142 } else { 127 143 128 144 # Copy sample server and agent .conf files 129 xinstall -d -m 755 -d ${destroot}${prefix}/etc/zabbix 130 xinstall -m 755 ${worksrcpath}/misc/conf/zabbix_agent.conf \ 131 ${destroot}${prefix}/etc/zabbix/zabbix_agent.conf.sample 132 xinstall -m 755 ${worksrcpath}/misc/conf/zabbix_agentd.conf \ 133 ${destroot}${prefix}/etc/zabbix/zabbix_agentd.conf.sample 134 xinstall -m 755 ${worksrcpath}/misc/conf/zabbix_server.conf \ 135 ${destroot}${prefix}/etc/zabbix/zabbix_server.conf.sample 145 xinstall -d -m 755 -d ${destroot}${prefix}/etc/zabbix 146 xinstall -m 755 ${worksrcpath}/conf/zabbix_agent.conf \ 147 ${destroot}${prefix}/etc/zabbix/zabbix_agent.conf.sample 148 xinstall -m 755 ${worksrcpath}/conf/zabbix_agentd.conf \ 149 ${destroot}${prefix}/etc/zabbix/zabbix_agentd.conf.sample 150 xinstall -m 755 ${worksrcpath}/conf/zabbix_server.conf \ 151 ${destroot}${prefix}/etc/zabbix/zabbix_server.conf.sample 152 delete ${destroot}${prefix}/etc/zabbix/zabbix_server.conf 153 delete ${destroot}${prefix}/etc/zabbix/zabbix_agentd.conf 154 delete ${destroot}${prefix}/etc/zabbix/zabbix_agent.conf 136 155 137 156 # Copy database data and schemas 138 xinstall -d -m 755 -d ${destroot}${prefix}/share/zabbix/data 139 xinstall -d -m 755 -d ${destroot}${prefix}/share/zabbix/schema 140 141 eval xinstall -m 755 [glob ${worksrcpath}/create/data/*.*] \ 142 ${destroot}${prefix}/share/zabbix/data 143 eval xinstall -m 755 [glob ${worksrcpath}/create/schema/*] \ 144 ${destroot}${prefix}/share/zabbix/schema 157 xinstall -d -m 755 -d ${destroot}${prefix}/share/zabbix/data 158 xinstall -d -m 755 -d ${destroot}${prefix}/share/zabbix/schema 159 160 eval xinstall -m 755 ${worksrcpath}/database/mysql/data.sql \ 161 ${destroot}${prefix}/share/zabbix/data 162 eval xinstall -m 755 ${worksrcpath}/database/mysql/images.sql \ 163 ${destroot}${prefix}/share/zabbix/data 164 eval xinstall -m 755 ${worksrcpath}/database/mysql/schema.sql \ 165 ${destroot}${prefix}/share/zabbix/schema 166 167 file copy ${worksrcpath}/upgrades \ 168 ${destroot}${prefix}/share/zabbix/ 145 169 146 170 # Copy the front end files 147 171 148 149 150 172 file mkdir ${destroot}${prefix}/share/zabbix/frontends/ 173 file copy ${worksrcpath}/frontends/php/ \ 174 ${destroot}${prefix}/share/zabbix/frontends/ 151 175 152 176 # Create a startup script for the server 153 154 155 156 177 xinstall -m 755 ${portpath}/${filesdir}/zabbix_server.init \ 178 ${destroot}${prefix}/share/zabbix 179 reinplace "s|__PREFIX__|${prefix}|g" \ 180 ${destroot}${prefix}/share/zabbix/zabbix_server.init 157 181 158 182 # Create a startup script for the agent 159 160 161 162 183 xinstall -m 755 ${portpath}/${filesdir}/zabbix_agentd.init \ 184 ${destroot}${prefix}/share/zabbix 185 reinplace "s|__PREFIX__|${prefix}|g" \ 186 ${destroot}${prefix}/share/zabbix/zabbix_agentd.init 163 187 164 188 # Set permissions for etc (protect passwords) and the frontend 165 166 167 189 system "chmod 660 ${destroot}${prefix}/etc/zabbix/*" 190 system "chown zabbix:zabbix ${destroot}${prefix}/etc/zabbix/*" 191 system "chown -R www:www ${destroot}${prefix}/share/zabbix/frontends/*" 168 192 169 193 # End else clause - Done with server stuff … … 171 195 172 196 # Copy Win32 agent for normal and agent_only installs 173 xinstall -d -m 755 -d ${destroot}${prefix}/share/zabbix/zabbix_agent_win32 174 xinstall -m 755 ${worksrcpath}/bin/win32/zabbix_agentd.exe \ 175 ${destroot}${prefix}/share/zabbix/zabbix_agent_win32 176 } 177 178 179 notes " 180 #### ZABBIX agent installation section (steps 1 - 3 only) #### 181 182 1) Edit the sample .conf file ${prefix}/etc/zabbix/zabbix_agentd.conf (rename & omit .sample) 197 xinstall -d -m 755 -d ${destroot}${prefix}/share/zabbix/zabbix_agent_win32 198 xinstall -m 755 ${worksrcpath}/bin/win32/zabbix_agentd.exe \ 199 ${destroot}${prefix}/share/zabbix/zabbix_agent_win32 200 } 201 202 if {[variant_isset agent_only]} { 203 notes " 204 #### #### 205 #### ZABBIX2 agent installation section #### 206 207 1) Edit the sample .conf file ${prefix}/etc/zabbix/zabbix_agentd.conf 208 (rename & omit .sample) 183 209 184 210 Set the following variable to the ip address of your ZABBIX server to\ 185 211 allow it access to the agent. 186 212 187 213 Server=x.x.x.x 188 214 189 215 190 216 2) Set zabbix_agentd to run at system boot 191 217 192 sudo launchctl load -w /Library/LaunchDaemons/org.macports.zabbix.plist 193 194 To start Zabbix manually, use: ${prefix}/share/zabbix/zabbix_agentd.init start (stop|status) 218 sudo port load zabbix2 219 220 To start Zabbix manually, use: 221 ${prefix}/share/zabbix/zabbix_agentd.init start (stop|status) 195 222 196 223 … … 198 225 installation on Windows NT 4.0, Windows 2000, and Windows XP. 199 226 200 201 #### End ZABBIX agent installation section #### 202 #### #### 203 204 205 #### #### 206 #### Begin ZABBIX server installation section #### 207 227 #### End ZABBIX2 agent installation section #### 228 #### #### 229 " 230 } else { 231 notes " 232 #### #### 233 #### Begin ZABBIX2 server installation section #### 208 234 209 235 1) Setup MySQL, i.e. via MacPorts: 210 236 211 237 sudo port install mysql5-server 212 238 213 239 … … 215 241 216 242 -Create the ZABBIX database 217 218 219 243 mysql5 -u root -p (enter password at prompt) 244 mysql> create database zabbix character set utf8; 245 mysql> quit; 220 246 221 247 -Import the ZABBIX Schema 222 223 224 225 cat data.sql | mysql5 -u root -p zabbix226 cat images_mysql.sql | mysql5 -u root -p zabbix248 cd ${prefix}/share/zabbix/schema 249 cat mysql.sql | mysql5 -u root -p zabbix 250 cd ${prefix}/share/zabbix/data 251 cat images.sql | mysql5 -u root -p zabbix 252 cat data.sql | mysql5 -u root -p zabbix 227 253 228 254 -Create a MySQL 'zabbix' user and password 229 mysql5 -u root -p 230 mysql> grant all privileges on zabbix.* to zabbix@localhost identified by '<zabbix-mysql-password>'; 231 mysql> grant all privileges on zabbix.* to zabbix identified by '<zabbix-mysql-password>'; 232 mysql> quit; 233 234 235 3) Edit the sample .conf file ${prefix}/etc/zabbix/zabbix_server.conf (rename & omit .sample) 255 mysql5 -u root -p 256 mysql> grant all privileges on zabbix.* to zabbix@localhost identified by '<zabbix-mysql-password>'; 257 mysql> grant all privileges on zabbix.* to zabbix identified by '<zabbix-mysql-password>'; 258 mysql> quit; 259 260 261 3) Edit the sample .conf file ${prefix}/etc/zabbix/zabbix_server.conf 262 (rename & omit .sample) 236 263 237 264 Modify these variables at the very least: 238 265 239 240 241 266 DBName=zabbix 267 DBUser=zabbix 268 DBPassword=<zabbix-mysql-password> 242 269 243 270 244 271 4) Install PHP 5, i.e. via MacPorts: 245 272 246 sudo port install php5 php5-gd php5-mbstring php5-mysql php5-sockets 247 248 249 5) Set a symbolic link in your Apache document root pointing to the PHP frontend files 250 251 sudo ln -s ${prefix}/share/zabbix/frontends/php <Apache-docroot>/zabbix 273 sudo port install php5 php5-gd php5-mbstring php5-mysql php5-sockets 274 275 276 5) Set a symbolic link in your Apache document root pointing to the PHP 277 frontend files 278 279 sudo ln -s ${prefix}/share/zabbix/frontends/php <Apache-docroot>/zabbix 252 280 253 281 254 282 6) Set zabbix_server to run at system boot, then start it 255 283 256 sudo launchctl load -w /Library/LaunchDaemons/org.macports.zabbix.plist 257 258 To start Zabbix manually, use: ${prefix}/share/zabbix/zabbix_server.init start (stop|status) 259 260 Note: Eventually your shared memory has to be increased (see http://www.zabbix.org/forum/showthread.php?p=64232)! 261 284 sudo port load zabbix2 285 286 To start Zabbix manually, use: 287 ${prefix}/share/zabbix/zabbix_server.init start (stop|status) 288 289 Note: Your shared memory will likely need to be increased 290 (see http://support.apple.com/kb/HT4022) 262 291 263 292 7) A Win32 agent is in ${prefix}/share/zabbix/zabbix_agent_win32 for\ … … 266 295 267 296 268 8) Open http://localhost/zabbix/ in your browser and walk through the setup, then login with default user 'Admin' and password 'zabbix'. 297 8) Open http://localhost/zabbix/ in your browser and walk through the setup, 298 then login with default user 'Admin' and password 'zabbix'. 269 299 270 300 271 301 9) Read the fine manual at http://www.zabbix.com/documentation/ 302 303 304 #### End ZABBIX2 server installation section #### 305 #### #### 306 307 308 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 309 !! ZABBIX -> ZABBIX2 Server Upgrade process !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 310 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 311 !! 0) BACK UP YOUR DATABASE !! 312 !! !! 313 !! 1) Be sure to use 'sudo port unload zabbix' to stop the background !! 314 !! server before deactivating zabbix, and then use !! 315 !! 'sudo port load zabbix2' **AFTER UPGRADING THE DATABASE** as !! 316 !! described below. !! 317 !! !! 318 !! 2) For upgrading from 1.8 (zabbix -> zabbix2), upgrade scripts are !! 319 !! located in ${prefix}/share/zabbix/upgrades !! 320 !! !! 321 !! For upgrade procedure, please see !! 322 !! http://www.zabbix.com/documentation/2.0/manual/installation/upgrade !! 323 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 324 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 272 325 " 326 }
Note: See TracChangeset
for help on using the changeset viewer.