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
26 TITLE:=Daemon to execute Nagios check commands on remote hosts
27 URL:=http://www.nagios.org/download
30 define Package/nrpe/description
31 The NRPE addon is designed to allow you to execute Nagios plugins on
32 remote Linux/Unix machines. The main reason for doing this is to allow
33 Nagios to monitor "local" resources (like CPU load, memory usage, etc.)
34 on remote machines. Since these public resources are not usually
35 exposed to external machines, an agent like NRPE must be installed on
36 the remote Linux/Unix machines.
39 define Package/nrpe/postinst
48 # check if we are on real system
49 if [ -z "$${IPKG_INSTROOT}" ]; then
50 # create copies of passwd and group, if we use squashfs
51 rootfs=`mount |awk '/root/ { print $$5 }'`
52 if [ "$$rootfs" = "squashfs" ]; then
53 if [ -h /etc/group ]; then
55 cp -p /rom/etc/group /etc/group
57 if [ -h /etc/passwd ]; then
59 cp -p /rom/etc/passwd /etc/passwd
65 if [ -z "$$(grep ^\\$${name}: $${IPKG_INSTROOT}/etc/group)" ]; then
66 echo "adding group $$name to /etc/group"
67 echo "$${name}:x:$${id}:" >> $${IPKG_INSTROOT}/etc/group
69 if [ -z "$$(grep ^\\$${name}: $${IPKG_INSTROOT}/etc/passwd)" ]; then
70 echo "adding user $$name to /etc/passwd"
71 echo "$${name}:x:$${id}:$${id}:$${name}:$${home}:$${shell}" >> $${IPKG_INSTROOT}/etc/passwd
76 --with-ssl="$(STAGING_DIR)/usr" \
77 --with-ssl-lib="$(STAGING_DIR)/usr/lib"
79 define Package/nrpe/install
80 $(INSTALL_DIR) $(1)/usr/sbin
81 $(INSTALL_DIR) $(1)/etc
82 $(INSTALL_DIR) $(1)/etc/init.d
83 $(INSTALL_DATA) ./files/nrpe.cfg $(1)/etc/nrpe.cfg
84 $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/nrpe $(1)/usr/sbin
85 $(INSTALL_BIN) ./files/$(PKG_NAME).init $(1)/etc/init.d/$(PKG_NAME)
88 $(eval $(call RequireCommand,openssl, \
89 $(PKG_NAME) requires openssl installed on the host-system. \
92 $(eval $(call BuildPackage,nrpe))