mirror of
https://git.freebsd.org/ports.git
synced 2025-07-18 17:59:20 -04:00
Support STAGE
Switch to the latest community edition: updated bi-annually Remove JAIL option; if you need to run Observium in a jail please enable raw socket support for the jail. Upstream is very specific about what they support and pulling an ancient perl fping script from CPAN is not comforting. Sponsored by: SupraNet Communications, Inc
This commit is contained in:
parent
e603a10bea
commit
5296f66b97
Notes:
svn2git
2021-03-31 03:12:20 +00:00
svn path=/head/; revision=363196
5 changed files with 4837 additions and 1510 deletions
|
@ -2,14 +2,11 @@
|
|||
# $FreeBSD$
|
||||
|
||||
PORTNAME= observium
|
||||
PORTVERSION= 0.11.5.2261
|
||||
PORTREVISION= 1
|
||||
PORTVERSION= 0.14.4.5229
|
||||
CATEGORIES= net-mgmt
|
||||
MASTER_SITES= http://observium.org/ \
|
||||
http://cpansearch.perl.org/src/BBB/Net-Ping-2.31/demo/
|
||||
DISTNAME= ${PORTNAME}-latest
|
||||
DISTFILES= ${DISTNAME}${EXTRACT_SUFX} # prevent being 'fping' with JAIL
|
||||
EXTRACT_ONLY= ${DISTNAME}${EXTRACT_SUFX}
|
||||
MASTER_SITES= http://www.observium.org/
|
||||
DISTNAME= ${PORTNAME}-community-latest
|
||||
DIST_SUBDIR= ${PORTNAME}-${PORTVERSION}
|
||||
|
||||
MAINTAINER= ports@FreeBSD.org
|
||||
COMMENT= Autodiscovering PHP/MySQL/SNMP based network monitoring
|
||||
|
@ -18,9 +15,16 @@ LICENSE= GPLv3
|
|||
|
||||
WRKSRC= ${WRKDIR}/${PORTNAME}
|
||||
|
||||
USES= shebangfix
|
||||
SHEBANG_FILES= mibs/process.pl html/js/makemini.pl \
|
||||
scripts/watchmaillog/watchmaillog.pl \
|
||||
scripts/agent-local/postgresql.pl \
|
||||
scripts/removespikes.pl scripts/add_ds.pl
|
||||
USE_PHP= snmp ctype gd mysql session xml
|
||||
WANT_PHP_CLI= yes
|
||||
|
||||
NO_BUILD= yes
|
||||
|
||||
RUN_DEPENDS+= rrdtool:${PORTSDIR}/databases/rrdtool \
|
||||
dot:${PORTSDIR}/graphics/graphviz \
|
||||
Magick-config:${PORTSDIR}/graphics/ImageMagick \
|
||||
|
@ -29,33 +33,28 @@ RUN_DEPENDS+= rrdtool:${PORTSDIR}/databases/rrdtool \
|
|||
${LOCALBASE}/share/pear/Net/IPv6.php:${PORTSDIR}/net/pear-Net_IPv6 \
|
||||
snmpget:${PORTSDIR}/net-mgmt/net-snmp
|
||||
|
||||
OPTIONS_DEFINE= APACHEMOD MYSQLD JAIL
|
||||
OPTIONS_DEFINE= APACHEMOD MYSQLD
|
||||
OPTIONS_DEFAULT= APACHEMOD
|
||||
APACHEMOD_DESC= Use PHP with Apache 2.2+ module
|
||||
MYSQLD_DESC= Use local MySQL server
|
||||
JAIL_DESC= This is a jail installation
|
||||
|
||||
NO_STAGE= yes
|
||||
.include <bsd.port.options.mk>
|
||||
|
||||
SUB_FILES+= pkg-message
|
||||
SUB_LIST+= PHP="${PHPBASE}/bin/php"
|
||||
|
||||
# :r!ls *.php *.sql
|
||||
ROOT_FILES= addhost.php adduser.php alerts.php check-errors.php \
|
||||
check-services.php delhost.php discovery.php \
|
||||
generate-iplist.php irc.php poll-billing.php \
|
||||
poll-device.php poller.php renamehost.php snmptrap.php \
|
||||
syslog.php database-schema.sql database-update-pre1000.sql \
|
||||
database-update-pre1435.sql database-update-pre2245.sql \
|
||||
database-update.sql config.php.default
|
||||
ROOT_DIRS= attic contrib html includes mibs scripts upgrade-scripts
|
||||
PORTDOCS= CHANGELOG INSTALL README
|
||||
ROOT_FILES= rename_device.php snmptrap.php .scrutinizer.yml add_device.php \
|
||||
snmpd.conf.example check-errors.php config_to_json.php delete_device.php \
|
||||
syslog.php irc.php snmp.conf.example adduser.php discovery.php \
|
||||
check-services.php poller.php config.php.default poller-wrapper.py
|
||||
ROOT_DIRS= html scripts includes update mibs
|
||||
|
||||
PORTDOCS= INSTALL README
|
||||
PORTEXAMPLES= snmp.conf.example snmpd.conf.example
|
||||
|
||||
.if ${PORT_OPTIONS:MAPACHEMOD} && !defined(PACKAGE_BUILDING)
|
||||
WANT_PHP_MOD= yes
|
||||
USE_APACHE= 22+
|
||||
USE_APACHE_RUN= 22+
|
||||
.else
|
||||
# Package builder doesn't create php5 with module
|
||||
WANT_PHP_WEB= yes
|
||||
|
@ -67,61 +66,28 @@ USE_MYSQL= server
|
|||
USE_MYSQL= client
|
||||
.endif
|
||||
|
||||
.if ${PORT_OPTIONS:MJAIL}
|
||||
RUN_DEPENDS+= p5-Net-Ping>=0:${PORTSDIR}/net/p5-Net-Ping
|
||||
DISTFILES+= fping
|
||||
SUB_LIST+= FPING="${LOCALBASE}/bin/fping-perl"
|
||||
PLIST_SUB+= JAIL=""
|
||||
.else
|
||||
RUN_DEPENDS+= fping:${PORTSDIR}/net/fping
|
||||
SUB_LIST+= FPING="${LOCALBASE}/sbin/fping"
|
||||
PLIST_SUB+= JAIL="@comment "
|
||||
.endif
|
||||
|
||||
post-extract:
|
||||
@${FIND} ${WRKSRC} -name '.svn' -exec ${RM} -rf {} +
|
||||
.if defined(WITH_JAIL)
|
||||
@${CP} ${DISTDIR}/fping ${WRKDIR}/fping
|
||||
.endif
|
||||
|
||||
do-build:
|
||||
.if ${PORT_OPTIONS:MJAIL}
|
||||
@${REINPLACE_CMD} -e 's,^#!.*$$,#!${PERL},' ${WRKDIR}/fping
|
||||
.endif
|
||||
@${FIND} ${WRKSRC} -name '*.pl' | ${XARGS} ${REINPLACE_CMD} \
|
||||
-e 's,#!/usr/bin/perl,#!${PERL},'
|
||||
@${REINPLACE_CMD} -E 's,<\?=([^?]+)\?>,<?php echo \1;?>,g' \
|
||||
${WRKSRC}/html/graph-realtime.php
|
||||
@${RM} ${WRKSRC}/html/includes/geshi/docs/COPYING
|
||||
@${RM} ${WRKSRC}/html/pages/addhost.inc.php.orig
|
||||
|
||||
do-install:
|
||||
@${MKDIR} ${WWWDIR}
|
||||
@${FIND} ${WRKSRC} -name '*.bak' -delete
|
||||
@${MKDIR} ${STAGEDIR}/${WWWDIR}
|
||||
.for dir in ${ROOT_DIRS}
|
||||
@${MKDIR} ${WWWDIR}/${dir}
|
||||
@${ECHO_MSG} "===> Installing ${dir}"
|
||||
@cd ${WRKSRC}/${dir} && ${COPYTREE_SHARE} . ${WWWDIR}/${dir}
|
||||
@${MKDIR} ${STAGEDIR}/${WWWDIR}/${dir}
|
||||
@cd ${WRKSRC}/${dir} && ${COPYTREE_SHARE} . ${STAGEDIR}/${WWWDIR}/${dir}
|
||||
.endfor
|
||||
@${ECHO_MSG} "===> Installing root files"
|
||||
.for f in ${ROOT_FILES}
|
||||
@${INSTALL_DATA} ${WRKSRC}/${f} ${WWWDIR}
|
||||
@${INSTALL_DATA} ${WRKSRC}/${f} ${STAGEDIR}/${WWWDIR}
|
||||
.endfor
|
||||
|
||||
.if ${PORT_OPTIONS:MDOCS}
|
||||
@${MKDIR} ${DOCSDIR}
|
||||
@${MKDIR} ${STAGEDIR}/${DOCSDIR}
|
||||
.for f in ${PORTDOCS}
|
||||
@${INSTALL_DATA} ${WRKSRC}/${f} ${DOCSDIR}
|
||||
@${INSTALL_DATA} ${WRKSRC}/${f} ${STAGEDIR}/${DOCSDIR}
|
||||
.endfor
|
||||
.endif
|
||||
.if ${PORT_OPTIONS:MEXAMPLES}
|
||||
@${MKDIR} ${EXAMPLESDIR}
|
||||
@${MKDIR} ${STAGEDIR}/${EXAMPLESDIR}
|
||||
.for f in ${PORTEXAMPLES}
|
||||
@${INSTALL_DATA} ${WRKSRC}/${f} ${EXAMPLESDIR}
|
||||
@${INSTALL_DATA} ${WRKSRC}/${f} ${STAGEDIR}/${EXAMPLESDIR}
|
||||
.endfor
|
||||
.endif
|
||||
.if ${PORT_OPTIONS:MJAIL}
|
||||
@${INSTALL_SCRIPT} ${WRKDIR}/fping ${PREFIX}/bin/fping-perl
|
||||
.endif
|
||||
|
||||
post-install:
|
||||
@${ECHO_CMD}; ${CAT} ${PKGMESSAGE}; ${ECHO_CMD}
|
||||
|
|
|
@ -1,4 +1,2 @@
|
|||
SHA256 (observium-latest.tar.gz) = f1896cc7799656650f5dd8b1c3c60b78cfc155ec0c828f906bdfcc088f556dde
|
||||
SIZE (observium-latest.tar.gz) = 30828714
|
||||
SHA256 (fping) = 2ec7132c32cae5006731d416b2340e405cad028dd83c01438131a8a0373e5524
|
||||
SIZE (fping) = 5059
|
||||
SHA256 (observium-0.14.4.5229/observium-community-latest.tar.gz) = 3a692eea00ccbf790ac01d3f95f9d351942ea4247b3a205e973afefdec4e1595
|
||||
SIZE (observium-0.14.4.5229/observium-community-latest.tar.gz) = 33307221
|
||||
|
|
|
@ -1,15 +0,0 @@
|
|||
--- html/pages/addhost.inc.php.orig 2011-09-08 09:10:31.000000000 -0800
|
||||
+++ html/pages/addhost.inc.php 2012-02-20 07:26:57.000000000 -0900
|
||||
@@ -13,7 +13,11 @@
|
||||
if ($_SESSION['userlevel'] > '5')
|
||||
{
|
||||
$hostname = mres($_POST['hostname']);
|
||||
- if ($_POST['community']) { $community = mres($_POST['community']); } else { $community = $config['snmp']['community']; }
|
||||
+ if ($_POST['community'])
|
||||
+ {
|
||||
+ $community = mres($_POST['community']);
|
||||
+ array_unshift($config['snmp']['community'], $community);
|
||||
+ } else { $community = $config['snmp']['community'][0]; }
|
||||
$snmpver = mres($_POST['snmpver']);
|
||||
if ($_POST['port']) { $port = mres($_POST['port']); } else { $port = "161"; }
|
||||
print_message("Adding host $hostname community $community port $port");
|
|
@ -1,10 +1,10 @@
|
|||
=== Configuration details ===
|
||||
You can mostly follow the guide at:
|
||||
http://observium.org/wiki/FreeBSD_SVN_Installation
|
||||
http://observium.org/wiki/Installation
|
||||
|
||||
with the following notes:
|
||||
- Installation directory is %%WWWDIR%%
|
||||
- $config['fping'] should be set to '%%FPING%%'
|
||||
- $config['fping'] should be set to '%%LOCALBASE%%/sbin/fping'
|
||||
- The following lines should be added to /etc/crontab:
|
||||
|
||||
33 */6 * * * www cd %%WWWDIR%% && %%PHP%% discovery.php -h all > /dev/null 2>&1
|
||||
|
|
File diff suppressed because it is too large
Load diff
Loading…
Add table
Reference in a new issue