Browse Source

apinger: add apinger package

Alarm Pinger (apinger) is a little tool which monitors various IP devices by
simple ICMP echo requests. There are various other tools, that can do this,
but most of them are shell or perl scripts, spawning many processes, thus much
CPU-expensive, especially when one wants continuous monitoring and fast
response on target failure.

Signed-off-by: Alex Samorukov <samm@os2.kiev.ua>
Alex Samorukov 9 years ago
parent
commit
11e83c6928

+ 67
- 0
net/apinger/Makefile View File

@@ -0,0 +1,67 @@
1
+#
2
+# Copyright (C) 2006-2014 OpenWrt.org
3
+#
4
+# This is free software, licensed under the GNU General Public License v2.
5
+# See /LICENSE for more information.
6
+#
7
+
8
+include $(TOPDIR)/rules.mk
9
+
10
+PKG_NAME:=apinger
11
+PKG_VERSION:=0.6.1
12
+PKG_RELEASE=$(PKG_SOURCE_VERSION)
13
+
14
+PKG_SOURCE_PROTO:=git
15
+PKG_SOURCE_URL:=https://github.com/Jajcus/apinger.git
16
+PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
17
+PKG_SOURCE_VERSION:=c7da72f7ec26eedd7fd8d224c0e10787b204f94e
18
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
19
+
20
+PKG_MAINTAINER:=Alex Samorukov <samm@os2.kiev.ua>
21
+PKG_LICENSE:= GPL-2.0
22
+
23
+PKG_FIXUP:=autoreconf
24
+
25
+PKG_BUILD_PARALLEL:=1
26
+PKG_INSTALL:=1
27
+
28
+include $(INCLUDE_DIR)/package.mk
29
+
30
+define Package/apinger
31
+  SECTION:=net
32
+  CATEGORY:=Network
33
+  TITLE:=Tool which monitors various IP devices by simple ICMP echo requests
34
+  URL:=https://github.com/Jajcus/apinger
35
+  PKG_MAINTAINER:=Alex Samorukov <samm@os2.kiev.ua>
36
+endef
37
+
38
+define Package/apinger/description
39
+	Alarm Pinger (apinger) is a little tool which monitors various IP devices by
40
+	simple ICMP echo requests. There are various other tools, that can do this,
41
+	but most of them are shell or perl scripts, spawning many processes, thus much
42
+	CPU-expensive, especially when one wants continuous monitoring and fast
43
+	response on target failure.  Alarm Pinger is a single program written in C, so
44
+	it doesn't need much CPU power even when monitoring many targets with frequent
45
+	probes.  Alarm Pinger supports both IPv4 and IPv6. The code have been tested
46
+	on Linux and FreeBSD.
47
+endef
48
+
49
+define Package/apinger/conffiles
50
+/etc/apinger.conf
51
+endef
52
+
53
+define Build/Configure
54
+	$(call Build/Configure/Default)
55
+endef
56
+
57
+define Package/apinger/install
58
+	$(INSTALL_DIR) $(1)/usr/sbin
59
+	$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/apinger $(1)/usr/sbin/
60
+	$(INSTALL_DIR) $(1)/etc
61
+	$(INSTALL_DATA) $(PKG_BUILD_DIR)/src/apinger.conf $(1)/etc/apinger.conf
62
+	$(INSTALL_DIR) $(1)/etc/init.d
63
+	$(INSTALL_BIN) ./files/apinger.init $(1)/etc/init.d/apinger
64
+endef
65
+
66
+$(eval $(call BuildPackage,apinger))
67
+

+ 18
- 0
net/apinger/files/apinger.init View File

@@ -0,0 +1,18 @@
1
+#!/bin/sh /etc/rc.common
2
+# Copyright (C) 2006-2011 OpenWrt.org
3
+
4
+START=80
5
+
6
+SERVICE_USE_PID=1
7
+
8
+start() {
9
+	service_start /usr/sbin/apinger
10
+}
11
+
12
+stop() {
13
+	service_stop /usr/sbin/apinger
14
+}
15
+
16
+reload() {
17
+	service_reload /usr/sbin/apinger
18
+}

+ 13
- 0
net/apinger/patches/001-autoreconf.patch View File

@@ -0,0 +1,13 @@
1
+--- apinger-0.6.1/acinclude.m4	2003-10-21 12:44:48.000000000 +0000
2
++++ apinger-0.6.1/acinclude.m4	2015-04-08 15:27:37.451903960 +0000
3
+@@ -39,9 +39,7 @@
4
+ 		[$jk_inet_includes
5
+ $jk_icmp_includes])
6
+ 
7
+-AC_CHECK_MEMBERS([struct icmp.icmp_type, struct icmp.icmp_code,\
8
+-struct icmp.icmp_cksum, struct icmp.icmp_seq,\
9
+-struct icmp.icmp_id],[],
10
++AC_CHECK_MEMBERS([struct icmp.icmp_type, struct icmp.icmp_code,struct icmp.icmp_cksum, struct icmp.icmp_seq,struct icmp.icmp_id],[],
11
+ 		AC_MSG_ERROR(struct icmp not defined or not compatible),
12
+ 		[$jk_inet_includes
13
+ $jk_icmp_includes])

+ 11
- 0
net/apinger/patches/002-run_as_user.patch View File

@@ -0,0 +1,11 @@
1
+--- apinger-0.6.1/src/apinger.conf.orig	2015-04-08 16:05:24.558919722 +0000
2
++++ apinger-0.6.1/src/apinger.conf	2015-04-08 16:07:47.089170236 +0000
3
+@@ -9,7 +9,7 @@
4
+ 
5
+ ## User and group the pinger should run as
6
+ user "nobody"
7
+-group "nobody"
8
++group "nogroup"
9
+ 
10
+ ## Mailer to use (default: "/usr/lib/sendmail -t")
11
+ #mailer "/var/qmail/bin/qmail-inject" 

+ 11
- 0
net/apinger/patches/003-no_docs.patch View File

@@ -0,0 +1,11 @@
1
+--- apinger-0.6.1/Makefile.am.orig	2015-04-08 16:47:40.999990050 +0000
2
++++ apinger-0.6.1/Makefile.am	2015-04-08 16:48:07.565220137 +0000
3
+@@ -1,7 +1,7 @@
4
+ 
5
+ EXTRA_DIST = autogen.sh TODO BUGS
6
+ 
7
+-SUBDIRS = src doc
8
++SUBDIRS = src
9
+ 
10
+ .PHONY: ChangeLog
11
+