summaryrefslogtreecommitdiffstats
path: root/net-mgmt/nagios-silfreed-plugins/Makefile
blob: 605287c6bcf303070f237a196e7d9274cc6c9aef (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
# New ports collection makefile for:	nagios-silfreed-plugins
# Date created:				22 Jul 2004
# Whom:					Bruce M Simpson <bms@FreeBSD.org>
#
# $FreeBSD$
#

PORTNAME=	nagios-silfreed-plugins
PORTVERSION=	1.1
CATEGORIES=	net-mgmt
MASTER_SITES=	http://www.silfreed.net/download/progs/nagios/
DISTFILES=	check_snmp_counter-0.6.tar.gz \
		check_snmp_gauge-0.3.0.tar.gz \
		check_snmp_if-0.6.tar.gz \
		check_snmp_if_max-0.3.0.tar.gz \
		check_tcping-0.1.5.tar.gz \
		dns_delegation-0.1.0.tar.gz
.if defined(WITH_EXPECT_TOOLS)
DISTFILES+=	check_max_clients_route-0.1.6.tar.gz \
		check_pm3_clients_route-0.1.0.tar.gz
.endif
DIST_SUBDIR=	${PORTNAME}

MAINTAINER=	sylvio@FreeBSD.org
COMMENT=	Additional SNMP plugins for Nagios from silfreed.net

# Also uses traceroute, dig at runtime (in base system with hardcoded paths).
RUN_DEPENDS+=	\
	p5-Net-Netmask>=0:${PORTSDIR}/net-mgmt/p5-Net-Netmask \
	p5-Net-SNMP>=0:${PORTSDIR}/net-mgmt/p5-Net-SNMP
.if defined(WITH_EXPECT_TOOLS)
RUN_DEPENDS+=	\
	${LOCALBASE}/bin/expect:${PORTSDIR}/lang/expect
.endif

USE_PERL5=	yes
NO_WRKSUBDIR=	yes

NAGIOS_PLUGIN_DIR=	${PREFIX}/libexec/nagios

pre-everything::
.if !defined(WITH_EXPECT_TOOLS)
	@${ECHO_MSG} "${PORTNAME} has the following tunable option(s):"
	@${ECHO_MSG} ""
	@${ECHO_MSG} "WITH_EXPECT_TOOLS=yes  Installs additional plugins"
	@${ECHO_MSG} "                       which require lang/expect"
	@${ECHO_MSG} ""
.endif

do-build:
	cd ${WRKSRC}/check_tcping-0.1.5 ; \
	  ${CC} ${CFLAGS} -o check_tcping check_tcping.c

# Documentation
PLUGIN_README_DIRS=	\
	check_snmp_counter-0.6 \
	check_snmp_gauge-0.3.0 \
	check_snmp_if-0.6 \
	check_snmp_if_max-0.3.0 \
	check_tcping-0.1.5 \
	dns_delegation-0.1.0

.if defined(WITH_EXPECT_TOOLS)
PLUGIN_README_DIRS+=	\
	check_max_clients_route-0.1.6 \
	check_pm3_clients_route-0.1.0

CHECKMAXCLIENTS_SCRIPTS=	check_max_clients_route iproutecheck.pm \
				tnt tnt.exp
CHECKPM3CLIENTS_SCRIPTS=	check_pm3_clients_route pm3 pm3.exp

PLIST_SUB+=	EXPECTTOOLS=""
.else
PLIST_SUB+=	EXPECTTOOLS="@comment "
.endif

do-install:
	${MKDIR} ${NAGIOS_PLUGIN_DIR}
	${MKDIR} ${EXAMPLESDIR}
	${INSTALL_SCRIPT} ${WRKSRC}/check_snmp_counter-0.6/check_snmp_counter ${NAGIOS_PLUGIN_DIR}
	${INSTALL_SCRIPT} ${WRKSRC}/check_snmp_gauge-0.3.0/check_snmp_gauge ${NAGIOS_PLUGIN_DIR}
	${INSTALL_SCRIPT} ${WRKSRC}/check_snmp_if-0.6/check_snmp_if ${NAGIOS_PLUGIN_DIR}
	${INSTALL_SCRIPT} ${WRKSRC}/check_snmp_if-0.6/gen_check_snmp_if_services ${NAGIOS_PLUGIN_DIR}
	${INSTALL_DATA} ${WRKSRC}/check_snmp_if-0.6/services-check_snmp_if.template ${EXAMPLESDIR}
	${INSTALL_SCRIPT} ${WRKSRC}/check_snmp_if_max-0.3.0/check_snmp_if_max ${NAGIOS_PLUGIN_DIR}
	${INSTALL_SCRIPT} ${WRKSRC}/check_snmp_if_max-0.3.0/gen_check_snmp_if_max_services ${NAGIOS_PLUGIN_DIR}
	${INSTALL_PROGRAM} ${WRKSRC}/check_tcping-0.1.5/check_tcping ${NAGIOS_PLUGIN_DIR}
.if defined(WITH_EXPECT_TOOLS)
.for i in ${CHECKMAXCLIENTS_SCRIPTS}
	${INSTALL_SCRIPT} ${WRKSRC}/check_max_clients_route-0.1.6/${i} ${NAGIOS_PLUGIN_DIR}
.endfor
.for i in ${CHECKPM3CLIENTS_SCRIPTS}
	${INSTALL_SCRIPT} ${WRKSRC}/check_pm3_clients_route-0.1.0/${i} ${NAGIOS_PLUGIN_DIR}
.endfor
.endif
.if !defined(NOPORTDOCS)
	${MKDIR} ${DOCSDIR}
.for i in ${PLUGIN_README_DIRS}
	${INSTALL_DATA} ${WRKSRC}/${i}/README ${DOCSDIR}/${i}.README
.endfor
.endif

.include <bsd.port.mk>
OpenPOWER on IntegriCloud