From 155eb4d28c4c4b2899b105249a4b0f75103fe8ab Mon Sep 17 00:00:00 2001 From: Steve Wills Date: Tue, 22 Aug 2017 16:26:13 +0000 Subject: net-mgmt/observium: multiple changes * Fix license * Improve post install message * Add Apache config PR: 214515 Submitted by: dirkx@webweaving.org (maintainer) (with slight modification) --- net-mgmt/observium/Makefile | 95 +++++++++++++---------- net-mgmt/observium/files/observium.conf.sample.in | 66 ++++++++++++++++ net-mgmt/observium/files/pkg-message.in | 13 ++++ net-mgmt/observium/pkg-plist | 1 + 4 files changed, 133 insertions(+), 42 deletions(-) create mode 100644 net-mgmt/observium/files/observium.conf.sample.in (limited to 'net-mgmt/observium') diff --git a/net-mgmt/observium/Makefile b/net-mgmt/observium/Makefile index c31103328116..2d674bacf287 100644 --- a/net-mgmt/observium/Makefile +++ b/net-mgmt/observium/Makefile @@ -3,7 +3,7 @@ PORTNAME= observium PORTVERSION= 0.16.10.8128 -PORTREVISION= 4 +PORTREVISION= 5 CATEGORIES= net-mgmt MASTER_SITES= http://www.observium.org/ DISTNAME= ${PORTNAME}-community-latest @@ -12,47 +12,55 @@ DIST_SUBDIR= ${PORTNAME}-${PORTVERSION} MAINTAINER= dirkx@webweaving.org COMMENT= Autodiscovering PHP/MySQL/SNMP based network monitoring -LICENSE= GPLv3 +LICENSE= EULA +LICENSE_NAME= "Observium License Version 1.0" +LICENSE_FILE= ${WRKSRC}/LICENSE.COMMUNITY +LICENSE_PERMS= dist-mirror dist-sell pkg-mirror pkg-sell auto-accept WRKSRC= ${WRKDIR}/${PORTNAME} USES= php:cli python shebangfix -SHEBANG_FILES= mibs/process.pl \ - scripts/agent-local/areca-hw \ - scripts/agent-local/asterisk \ - scripts/agent-local/bind \ - scripts/agent-local/crashplan \ - scripts/agent-local/edac \ - scripts/agent-local/exim-mailqueue.sh \ - scripts/agent-local/hdarray \ - scripts/agent-local/ipmitool-sensor \ - scripts/agent-local/kamailio \ - scripts/agent-local/ksm \ - scripts/agent-local/lighttpd \ - scripts/agent-local/lmsensors \ - scripts/agent-local/lvs_stats \ - scripts/agent-local/postfix_mailgraph \ - scripts/agent-local/postfix_qshape \ - scripts/agent-local/postgresql.pl \ - scripts/agent-local/proxmox-qemu \ - scripts/agent-local/sabnzbd-qstatus \ - scripts/agent-local/temperature \ - scripts/agent-local/virt-what \ - scripts/agent-local/vmwaretools \ - scripts/agent-local/zimbra \ - scripts/add_ds.pl \ - scripts/add_ds_to_rrd.pl \ - scripts/get-geshi.sh \ - scripts/get-jpgraph.sh \ - scripts/ifAlias \ - scripts/ifAlias_persist \ - scripts/makecss.sh \ - scripts/observium_agent \ - scripts/removespikes.php \ - scripts/removespikes.pl \ - scripts/rename-mibs.pl \ - scripts/rrdtoolx.py \ - poller-wrapper.py +SHEBANG_FILES= \ + mibs/process.pl \ + poller-wrapper.py \ + scripts/add_ds_to_rrd.pl \ + scripts/add_ds.pl \ + scripts/agent-local/areca-hw \ + scripts/agent-local/asterisk \ + scripts/agent-local/bind \ + scripts/agent-local/crashplan \ + scripts/agent-local/edac \ + scripts/agent-local/exim-mailqueue.sh \ + scripts/agent-local/hdarray \ + scripts/agent-local/ipmitool-sensor \ + scripts/agent-local/kamailio \ + scripts/agent-local/ksm \ + scripts/agent-local/lighttpd \ + scripts/agent-local/lmsensors \ + scripts/agent-local/lvs_stats \ + scripts/agent-local/memcached \ + scripts/agent-local/nginx \ + scripts/agent-local/postfix_mailgraph \ + scripts/agent-local/postfix_qshape \ + scripts/agent-local/postgresql.pl \ + scripts/agent-local/proxmox-qemu \ + scripts/agent-local/sabnzbd-qstatus \ + scripts/agent-local/temperature \ + scripts/agent-local/virt-what \ + scripts/agent-local/vmwaretools \ + scripts/agent-local/zimbra \ + scripts/get-geshi.sh \ + scripts/get-jpgraph.sh \ + scripts/glue.py \ + scripts/ifAlias \ + scripts/ifAlias_persist \ + scripts/logparser \ + scripts/makecss.sh \ + scripts/observium_agent \ + scripts/removespikes.php \ + scripts/removespikes.pl \ + scripts/rename-mibs.pl \ + scripts/rrdtoolx.py USE_PHP= ctype filter gd iconv json mcrypt mysqli openssl posix session snmp tokenizer xml zlib IGNORE_WITH_PHP= 71 @@ -88,7 +96,7 @@ WMIC_RUN_DEPENDS= wmic:net-mgmt/wmi-client .include -SUB_FILES+= pkg-message +SUB_FILES+= pkg-message observium.conf.sample SUB_LIST+= PHP="${PHPBASE}/bin/php" PYTHON=${PHPBASE}/bin/python ROOT_FILES= rename_device.php snmptrap.php add_device.php \ @@ -100,9 +108,11 @@ ROOT_DIRS= html scripts includes update mibs libs PORTDOCS= INSTALL README PORTEXAMPLES= snmp.conf.example snmpd.conf.example -.if ${PORT_OPTIONS:MAPACHEMOD} && !defined(PACKAGE_BUILDING) -USES+= php:mod +.if ${PORT_OPTIONS:MAPACHEMOD} USE_APACHE_RUN= 22+ +.endif +.if !defined(PACKAGE_BUILDING) +USES+= php:mod .else # Package builder doesn't create php5 with module USES+= php:web @@ -118,7 +128,7 @@ post-patch: ${REINPLACE_CMD} 's|%%LOCALBASE%%|${LOCALBASE}|g' ${WRKSRC}/poller-wrapper.py ${WRKSRC}/poller.php do-install: - ${MKDIR} ${STAGEDIR}/${WWWDIR} + ${MKDIR} ${STAGEDIR}/${WWWDIR} ${STAGEDIR}/${PREFIX}/${APACHEETCDIR}/Includes .for dir in ${ROOT_DIRS} ${MKDIR} ${STAGEDIR}/${WWWDIR}/${dir} cd ${WRKSRC}/${dir} && ${COPYTREE_SHARE} . ${STAGEDIR}/${WWWDIR}/${dir} @@ -147,5 +157,6 @@ do-install: ${INSTALL_DATA} ${WRKSRC}/${f} ${STAGEDIR}/${EXAMPLESDIR} .endfor .endif + ${INSTALL_DATA} ${WRKDIR}/observium.conf.sample ${STAGEDIR}/${PREFIX}/${APACHEETCDIR}/Includes .include diff --git a/net-mgmt/observium/files/observium.conf.sample.in b/net-mgmt/observium/files/observium.conf.sample.in new file mode 100644 index 000000000000..d72c5ea4d213 --- /dev/null +++ b/net-mgmt/observium/files/observium.conf.sample.in @@ -0,0 +1,66 @@ + +# Observium cannot be ran on a sub-uri (See the FAQ +# http://observium.org/docs/faq/). Hence this strawman +# config runs it as a virtual host on port 8080. +# +# Replace the '*:8080' by the actual virtual host(name) +# you will be using; and consider enabling SSL. An example +# can be fund at e /usr/local/etc/apache24/extra/httpd-ssl.conf +# + +Listen *:8080 + + Documentroot "%%WWWDIR%%/html" + AddHandler application/x-httpd-php .php + # + # CustomLog "/var/log/httpd-observium-access.log" common + + DirectoryIndex index.php + + Options Indexes FollowSymLinks Multiviews + AllowOverride None + + # These:w statement mirror the .htaccess + # files that are part of the normal + # Observium distribution. See the URL: + # + # https://httpd.apache.org/docs/current/howto/htaccess.html#when + # + # for the various reasons to promote + # these to an apache config file. + # + RedirectMatch 404 /\. + + RewriteEngine on + RewriteBase / + + # Block access to hidden files/dirs + RewriteRule ^\..*$ - [F,L] + # Don't favicon! + RewriteCond %{REQUEST_FILENAME} !^favicon\.ico + RewriteCond %{REQUEST_FILENAME} !-f + RewriteCond %{REQUEST_FILENAME} !-d + RewriteCond %{REQUEST_URI} !\.(js|ico|txt|gif|jpg|png|css|php) + RewriteCond %{REQUEST_URI} !^api/ + RewriteCond %{REQUEST_URI} !^rrd/ + RewriteCond %{REQUEST_URI} !=/server-status + RewriteRule ^(.*)$ index.php/$1/ + + AcceptPathInfo On + Require all granted + + + + deny from all + + + + deny from all + + + + deny from all + + + + diff --git a/net-mgmt/observium/files/pkg-message.in b/net-mgmt/observium/files/pkg-message.in index 20658fa53203..5e6eba0c5dec 100644 --- a/net-mgmt/observium/files/pkg-message.in +++ b/net-mgmt/observium/files/pkg-message.in @@ -56,7 +56,20 @@ sudo -u www %%WWWDIR%%/poller.php -h all -d 5: Install the above crontabs. +6: Edit the file + + %%PREFIX%%/%%APACHEETCDIR%%/Includes/observium.conf + + and fill out a port number and hostname. + +7: restart the webserver with + + apachectl restart + + or stop/start if in case of IP or SSL changes. + 6: log in with a web browser; using the username 'admin' and the password 'SomeInsecureAdminPassword'. Hosts can be added from the webinterface or from the commandline. + diff --git a/net-mgmt/observium/pkg-plist b/net-mgmt/observium/pkg-plist index cf8fb8501d79..9ec8a20bf590 100644 --- a/net-mgmt/observium/pkg-plist +++ b/net-mgmt/observium/pkg-plist @@ -11549,3 +11549,4 @@ @dir(www,www,) %%WWWDIR%%/logs @dir(www,www,) %%WWWDIR%%/rrd @dir %%WWWDIR%%/scripts/agent-local/munin-scripts +@sample %%APACHEETCDIR%%/Includes/observium.conf.sample -- cgit v1.2.3