1 # Created by: rflynn@acsalaska.net
5 PORTVERSION= 0.15.06.6430
8 MASTER_SITES= http://www.observium.org/
9 DISTNAME= ${PORTNAME}-community-latest
10 DIST_SUBDIR= ${PORTNAME}-${PORTVERSION}
12 MAINTAINER= feld@FreeBSD.org
13 COMMENT= Autodiscovering PHP/MySQL/SNMP based network monitoring
17 WRKSRC= ${WRKDIR}/${PORTNAME}
19 USES= python shebangfix
20 SHEBANG_FILES= html/js/makemini.pl \
22 scripts/agent-local/areca-hw \
23 scripts/agent-local/asterisk \
24 scripts/agent-local/bind \
25 scripts/agent-local/crashplan \
26 scripts/agent-local/edac \
27 scripts/agent-local/exim-mailqueue.sh \
28 scripts/agent-local/hdarray \
29 scripts/agent-local/ipmitool-sensor \
30 scripts/agent-local/ksm \
31 scripts/agent-local/lmsensors \
32 scripts/agent-local/postfix_mailgraph \
33 scripts/agent-local/postfix_qshape \
34 scripts/agent-local/postgresql.pl \
35 scripts/agent-local/sabnzbd-qstatus \
36 scripts/agent-local/temperature \
37 scripts/agent-local/vmwaretools \
38 scripts/agent-local/zimbra \
39 scripts/cron-hourly.sh \
40 scripts/cron-minute.sh \
42 scripts/get-geshi.sh \
43 scripts/get-jpgraph.sh \
44 scripts/ifAlias scripts/rename-mibs.pl \
46 scripts/observium_agent \
47 scripts/removespikes.php scripts/rrdtoolx.py \
48 scripts/removespikes.pl scripts/add_ds.pl \
49 scripts/watchmaillog/watchmaillog.pl
51 USE_PHP= ctype filter gd json mcrypt mysql session snmp tokenizer xml
56 RUN_DEPENDS+= rrdtool:${PORTSDIR}/databases/rrdtool \
57 dot:${PORTSDIR}/graphics/graphviz \
58 Magick-config:${PORTSDIR}/graphics/ImageMagick \
59 mtr:${PORTSDIR}/net/mtr-nox11 \
60 ${LOCALBASE}/share/pear/Net/IPv4.php:${PORTSDIR}/net/pear-Net_IPv4 \
61 ${LOCALBASE}/share/pear/Net/IPv6.php:${PORTSDIR}/net/pear-Net_IPv6 \
62 snmpget:${PORTSDIR}/net-mgmt/net-snmp
64 OPTIONS_DEFINE= APACHEMOD FPING IPMITOOL LIBVIRT MYSQLD NAGPLUGINS NMAP PYPOLLER SVN WMIC
65 OPTIONS_DEFAULT= APACHEMOD FPING IPMITOOL LIBVIRT NAGPLUGINS NMAP PYPOLLER SVN WMIC
66 APACHEMOD_DESC= Use PHP with Apache 2.2+ module
67 FPING_DESC= Enable fping support ping monitoring
68 IPMITOOL_DESC= Enable support for monitoring hardware IPMI
69 MYSQLD_DESC= Use local MySQL server
70 WMIC_DESC= Enable support for WMI polling
71 PYPOLLER_DESC= Enable Python Poller Wrapper
73 FPING_RUN_DEPENDS= fping:${PORTSDIR}/net/fping
74 IPMITOOL_RUN_DEPENDS= ipmitool:${PORTSDIR}/sysutils/ipmitool
75 LIBVIRT_RUN_DEPENDS= virsh:${PORTSDIR}/devel/libvirt
76 NAGPLUGINS_RUN_DEPENDS= ${LOCALBASE}/libexec/nagios/check_nagios:${PORTSDIR}/net-mgmt/nagios-plugins
77 NMAP_RUN_DEPENDS= nmap:${PORTSDIR}/security/nmap
78 PYPOLLER_RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}MySQLdb>0:${PORTSDIR}/databases/py-MySQLdb
79 SVN_RUN_DEPENDS= svn:${PORTSDIR}/devel/subversion
80 WMIC_RUN_DEPENDS= wmic:${PORTSDIR}/net-mgmt/wmi-client
82 .include <bsd.port.options.mk>
84 SUB_FILES+= pkg-message
85 SUB_LIST+= PHP="${PHPBASE}/bin/php"
87 ROOT_FILES= rename_device.php snmptrap.php .scrutinizer.yml add_device.php \
88 snmpd.conf.example check-errors.php config_to_json.php delete_device.php \
89 syslog.php irc.php snmp.conf.example adduser.php discovery.php \
90 check-services.php poller.php config.php.default poller-wrapper.py
91 ROOT_DIRS= html scripts includes update mibs
93 PORTDOCS= INSTALL README
94 PORTEXAMPLES= snmp.conf.example snmpd.conf.example
96 .if ${PORT_OPTIONS:MAPACHEMOD} && !defined(PACKAGE_BUILDING)
100 # Package builder doesn't create php5 with module
104 .if ${PORT_OPTIONS:MMYSQLD}
111 ${REINPLACE_CMD} 's|%%LOCALBASE%%|${LOCALBASE}|g' ${WRKSRC}/poller-wrapper.py ${WRKSRC}/poller.php
114 ${MKDIR} ${STAGEDIR}/${WWWDIR}
115 .for dir in ${ROOT_DIRS}
116 ${MKDIR} ${STAGEDIR}/${WWWDIR}/${dir}
117 cd ${WRKSRC}/${dir} && ${COPYTREE_SHARE} . ${STAGEDIR}/${WWWDIR}/${dir}
119 .for f in ${ROOT_FILES}
120 ${INSTALL_DATA} ${WRKSRC}/${f} ${STAGEDIR}/${WWWDIR}
122 # Create empty rrd dir writable by www
123 ${MKDIR} ${STAGEDIR}/${WWWDIR}/rrd
124 # Files in scripts dir should be executable
125 ${FIND} ${STAGEDIR}/${WWWDIR}/scripts -type f -exec ${CHMOD} +x {} \;
126 # Ensure PHP and Python scripts are executable
127 ${FIND} ${STAGEDIR}/${WWWDIR} -type f -name '*.py' -or -type f -name '*.php' -exec ${CHMOD} +x {} \;
129 ${MV} ${STAGEDIR}/${WWWDIR}/config.php.default ${STAGEDIR}/${WWWDIR}/config.php.default.sample
131 .if ${PORT_OPTIONS:MDOCS}
132 ${MKDIR} ${STAGEDIR}/${DOCSDIR}
133 .for f in ${PORTDOCS}
134 ${INSTALL_DATA} ${WRKSRC}/${f} ${STAGEDIR}/${DOCSDIR}
137 .if ${PORT_OPTIONS:MEXAMPLES}
138 ${MKDIR} ${STAGEDIR}/${EXAMPLESDIR}
139 .for f in ${PORTEXAMPLES}
140 ${INSTALL_DATA} ${WRKSRC}/${f} ${STAGEDIR}/${EXAMPLESDIR}
144 .include <bsd.port.mk>