1 # Created by: Blaz Zupan <blaz@si.FreeBSD.org>
4 PORTNAME= monitoring-plugins
8 MASTER_SITES= https://www.monitoring-plugins.org/download/ LOCAL/mat/${PORTNAME}
10 MAINTAINER= mat@FreeBSD.org
11 COMMENT= Monitoring Plugins for Nagios
14 LICENSE_FILE= ${WRKSRC}/COPYING
16 CONFLICTS_INSTALL= nagios-plugins-*
18 USES= charsetfix gmake perl5 libtool
21 OPTIONS_DEFINE= QSTAT FPING NETSNMP RADIUS MYSQL PGSQL LDAP IPV6 JAIL NLS DBI EXTRAOPTS SSH_PORTABLE
23 OPTIONS_SINGLE_DNS= DNS_BASE DNS_BINDTOOLS DNS_BIND99 DNS_BIND910
24 OPTIONS_DEFAULT=IPV6 EXTRAOPTS DNS_BASE
27 QSTAT_DESC= Game server query support (check_game)
28 FPING_DESC= Support for non-flooding fast ping (check_fping)
29 NETSNMP_DESC= SNMP support (check_snmp)
30 RADIUS_DESC= Radius support (check_radius)
31 MYSQL_DESC= MySQL support (check_mysql)
32 PGSQL_DESC= PostgreSQL support (check_pgsql)
33 LDAP_DESC= OpenLDAP support (check_ldap)
34 JAIL_DESC= Compilation within jail(8) (see help)
35 DBI_DESC= Check database using DBI
36 EXTRAOPTS_DESC= Parsing of plugins ini config files for extra options
37 SSH_PORTABLE_DESC= Build check_ssh with ports openssh (instead of base)
39 DNS_DESC= Configuration of check_dig and check_dns (see help)
41 DNS_BASE_DESC= >= 10 means drill for check_dig and no check_dns
42 DNS_BINDTOOLS_DESC= Use dig and nslookup from dns/bind-tools
43 DNS_BIND99_DESC= Use dig and nslookup from dns/bind99
44 DNS_BIND910_DESC= Use dig and nslookup from dns/bind910
46 EXTRAOPTS_CONFIGURE_ENABLE= extra-opts
50 NAGIOSDIR?= /var/spool/nagios
52 NAGIOSWWWDIR?= www/nagios
53 NAGIOSHTMURL?= /nagios
54 NAGIOSCGIURL?= ${NAGIOSHTMURL}/cgi-bin
56 NAGIOSPOLLIP?= 127.0.0.1
59 CONFIGURE_ARGS+=--with-cgiurl=${NAGIOSCGIURL} \
60 --sbindir=${PREFIX}/${NAGIOSWWWDIR}/cgi-bin \
61 --libexecdir=${PREFIX}/libexec/nagios \
62 --datadir=${PREFIX}/share \
63 --sysconfdir=${PREFIX}/etc/nagios \
64 --localstatedir=${NAGIOSDIR} \
68 # Also, force some commands with their expected paths so that they don't get
70 CONFIGURE_ARGS+=--with-qmail-qstat-command=/var/qmail/bin/qmail-qstat
72 CPPFLAGS+= -I${LOCALBASE}/include
73 LIBS+= -L${LOCALBASE}/lib
75 QSTAT_BUILD_DEPENDS= qstat:${PORTSDIR}/games/qstat
76 QSTAT_RUN_DEPENDS= qstat:${PORTSDIR}/games/qstat
77 QSTAT_CONFIGURE_OFF= ac_cv_path_PATH_TO_QUAKESTAT= \
78 ac_cv_path_PATH_TO_QSTAT=
80 IPV6_CONFIGURE_WITH= ipv6
82 FPING_BUILD_DEPENDS= fping:${PORTSDIR}/net/fping
83 FPING_RUN_DEPENDS= fping:${PORTSDIR}/net/fping
84 FPING_CONFIGURE_OFF= ac_cv_path_PATH_TO_FPING= \
85 ac_cv_path_PATH_TO_FPING6=
87 NETSNMP_BUILD_DEPENDS= snmpcheck:${PORTSDIR}/net-mgmt/net-snmp \
88 p5-Net-SNMP>=0:${PORTSDIR}/net-mgmt/p5-Net-SNMP
89 NETSNMP_RUN_DEPENDS= snmpcheck:${PORTSDIR}/net-mgmt/net-snmp \
90 p5-Net-SNMP>=0:${PORTSDIR}/net-mgmt/p5-Net-SNMP
91 NETSNMP_CONFIGURE_OFF= ac_cv_path_PATH_TO_SNMPGET= \
92 ac_cv_path_PATH_TO_SNMPGETNEXT=
94 RADIUS_LIB_DEPENDS= libradiusclient-ng.so:${PORTSDIR}/net/radiusclient
95 RADIUS_CONFIGURE_WITH= radius
98 MYSQL_CONFIGURE_ON= --with-mysql=${LOCALBASE}
99 MYSQL_CONFIGURE_OFF= --without-mysql
102 PGSQL_CONFIGURE_ON= --with-pgsql=${LOCALBASE}
103 PGSQL_CONFIGURE_OFF= --without-pgsql
105 LDAP_USE= openldap=yes
106 LDAP_CONFIGURE_WITH= ldap
109 NLS_CONFIGURE_ENABLE= nls
110 NLS_USES_OFF= gettext:build
112 DBI_LIB_DEPENDS= libdbi.so:${PORTSDIR}/databases/libdbi
113 DBI_CONFIGURE_WITH= dbi
115 DNS_BINDTOOLS_BUILD_DEPENDS= ${LOCALBASE}/bin/dig:${PORTSDIR}/dns/bind-tools
116 DNS_BINDTOOLS_CONFIGURE_ON= --with-dig-command=${LOCALBASE}/bin/dig \
117 --with-nslookup-command=${LOCALBASE}/bin/nslookup
118 DNS_BIND99_BUILD_DEPENDS= ${LOCALBASE}/bin/dig:${PORTSDIR}/dns/bind99
119 DNS_BIND99_CONFIGURE_ON= --with-dig-command=${LOCALBASE}/bin/dig \
120 --with-nslookup-command=${LOCALBASE}/bin/nslookup
121 DNS_BIND910_BUILD_DEPENDS= ${LOCALBASE}/bin/dig:${PORTSDIR}/dns/bind910
122 DNS_BIND910_CONFIGURE_ON= --with-dig-command=${LOCALBASE}/bin/dig \
123 --with-nslookup-command=${LOCALBASE}/bin/nslookup
125 SSH_PORTABLE_BUILD_DEPENDS= ${LOCALBASE}/bin/ssh:${PORTSDIR}/security/openssh-portable
126 SSH_PORTABLE_RUN_DEPENDS:= ${SSH_PORTABLE_BUILD_DEPENDS}
127 SSH_PORTABLE_CONFIGURE_ON= --with-ssh-command=${LOCALBASE}/bin/ssh
129 .include <bsd.port.options.mk>
131 .if ${OSVERSION} > 1000055 && ${PORT_OPTIONS:MDNS_BASE}
132 EXTRA_PATCHES+= ${FILESDIR}/extra-patch-dig-to-drill.diff
133 CONFIGURE_ARGS+=--with-dig-command=/usr/bin/drill
134 PLIST_SUB+= CHECK_DNS="@comment "
136 . if ${PORT_OPTIONS:MDNS_BASE}
137 CONFIGURE_ARGS+= --with-dig-command=/usr/bin/dig \
138 --with-nslookup-command=/usr/bin/nslookup
140 PLIST_SUB+= CHECK_DNS=""
143 .if !exists(/usr/bin/ssh) && empty(PORT_OPTIONS:MSSH_PORTABLE)
144 PLIST_SUB+= SSH="@comment "
150 .for file in check_by_ssh.c check_disk.c check_http.c check_mrtgtraf.c \
151 check_nagios.c check_ntp.c check_ntp_peer.c check_ntp_time.c \
152 check_pgsql.c check_snmp.c check_ssh.c check_swap.c check_time.c \
154 @${REINPLACE_CMD} -e 's|setlocale (LC_ALL, "");|setlocale (LC_ALL, ""); setlocale(LC_NUMERIC, "C");|g' ${WRKSRC}/plugins/${file}
156 @${REINPLACE_CMD} -e 's|chown root|${TRUE}|g' ${WRKSRC}/plugins-root/Makefile.in
157 .if ${PORT_OPTIONS:MJAIL}
158 @${REINPLACE_CMD} -e 's# 127\.0\.0\.1 # ${NAGIOSPOLLIP} #g' ${WRKSRC}/configure
159 @${REINPLACE_CMD} -e 's# ::1 # ${NAGIOSPOLLIP6} #g' ${WRKSRC}/configure
162 .include <bsd.port.mk>