2 # Copyright (C) 2007-2009 OpenWrt.org
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
9 include $(TOPDIR
)/rules.mk
15 PKG_SOURCE
:=$(PKG_NAME
)-$(PKG_VERSION
).
tar.gz
16 PKG_SOURCE_URL
:=@SF
/nagios
17 PKG_MD5SUM
:=b2d75e2962f1e3151ef58794d60c9e97
19 include $(INCLUDE_DIR
)/package.mk
25 TITLE
:=Daemon to execute Nagios
check commands on remote hosts
26 URL
:=http
://www.nagios.org
/download
29 define Package
/nrpe
/description
30 The NRPE addon is designed to allow you to execute Nagios plugins on
31 remote Linux
/Unix machines. The main reason for doing this is to allow
32 Nagios to monitor
"local" resources
(like CPU load
, memory usage
, etc.
)
33 on remote machines. Since these public resources are not usually
34 exposed to external machines
, an agent like NRPE must be installed on
35 the remote Linux
/Unix machines.
38 define Package
/nrpe
/postinst
47 # check if we are on real system
48 if
[ -z
"$${IPKG_INSTROOT}" ]; then
49 # create copies of passwd and group, if we use squashfs
50 rootfs
=`mount |awk '/root/ { print $$5 }'`
51 if
[ "$$rootfs" = "squashfs" ]; then
52 if
[ -h
/etc
/group
]; then
54 cp
-p
/rom
/etc
/group
/etc
/group
56 if
[ -h
/etc
/passwd
]; then
58 cp
-p
/rom
/etc
/passwd
/etc
/passwd
64 if
[ -z
"$$(grep ^\\$${name}: $${IPKG_INSTROOT}/etc/group)" ]; then
65 echo
"adding group $$name to /etc/group"
66 echo
"$${name}:x:$${id}:" >> $${IPKG_INSTROOT}/etc
/group
68 if
[ -z
"$$(grep ^\\$${name}: $${IPKG_INSTROOT}/etc/passwd)" ]; then
69 echo
"adding user $$name to /etc/passwd"
70 echo
"$${name}:x:$${id}:$${id}:$${name}:$${home}:$${shell}" >> $${IPKG_INSTROOT}/etc
/passwd
75 --with-ssl
="$(STAGING_DIR)/usr" \
76 --with-ssl-lib
="$(STAGING_DIR)/usr/lib"
78 define Package
/nrpe
/install
79 $(INSTALL_DIR
) $(1)/usr
/sbin
80 $(INSTALL_DIR
) $(1)/etc
81 $(INSTALL_DIR
) $(1)/etc
/init.d
82 $(INSTALL_DATA
) .
/files
/nrpe.cfg
$(1)/etc
/nrpe.cfg
83 $(INSTALL_BIN
) $(PKG_BUILD_DIR
)/src
/nrpe
$(1)/usr
/sbin
84 $(INSTALL_BIN
) .
/files
/$(PKG_NAME
).init
$(1)/etc
/init.d
/$(PKG_NAME
)
87 $(eval
$(call RequireCommand
,openssl
, \
88 $(PKG_NAME
) requires openssl installed on the host-system. \
91 $(eval
$(call BuildPackage
,nrpe
))