ソースを参照

muninlite: Import from oldpackages, add myself as maintainer

Signed-off-by: Jonathan McCrohan <jmccrohan@gmail.com>
Jonathan McCrohan 10 年 前
コミット
231da9d0f3

+ 52
- 0
admin/muninlite/Makefile ファイルの表示

@@ -0,0 +1,52 @@
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:=muninlite
11
+PKG_VERSION:=1.0.4
12
+PKG_RELEASE:=5
13
+
14
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
15
+PKG_SOURCE_URL:=@SF/$(PKG_NAME)
16
+PKG_MD5SUM:=a8cc86f0cc536a6c22dc298f4ed55339
17
+
18
+include $(INCLUDE_DIR)/package.mk
19
+
20
+define Package/muninlite
21
+  SECTION:=admin
22
+  CATEGORY:=Administration
23
+  DEPENDS:=+xinetd
24
+  TITLE:=Munin node implemented in shell
25
+  URL:=http://sourceforge.net/projects/muninlite/
26
+  MAINTAINER:=Jonathan McCrohan <jmccrohan@gmail.com>
27
+endef
28
+
29
+define Package/muninlite/Default/description
30
+	Munin node implemented in shell.
31
+	Munin is a monitoring system for Unix networks.
32
+endef
33
+
34
+define Package/muninlite/install
35
+	$(INSTALL_DIR) $(1)/usr/sbin/
36
+	$(INSTALL_BIN) $(PKG_BUILD_DIR)/munin-node $(1)/usr/sbin/
37
+	$(INSTALL_DIR) $(1)/etc/xinetd.d
38
+	$(INSTALL_DATA) ./files/etc/xinetd.d/munin $(1)/etc/xinetd.d/
39
+endef
40
+
41
+define Package/muninlite/conffiles
42
+/etc/xinetd.d/munin
43
+endef
44
+
45
+define Build/Configure
46
+endef
47
+
48
+define Build/Compile
49
+	$(MAKE) -C $(PKG_BUILD_DIR)
50
+endef
51
+
52
+$(eval $(call BuildPackage,muninlite))

+ 10
- 0
admin/muninlite/files/etc/xinetd.d/munin ファイルの表示

@@ -0,0 +1,10 @@
1
+service munin
2
+{
3
+	socket_type	= stream
4
+	protocol	= tcp
5
+	wait		= no
6
+	user		= root
7
+	group		= root
8
+	server		= /usr/sbin/munin-node
9
+	disable		= no
10
+}

+ 12
- 0
admin/muninlite/patches/001-no_disks.patch ファイルの表示

@@ -0,0 +1,12 @@
1
+--- a/Makefile
2
++++ b/Makefile
3
+@@ -1,7 +1,7 @@
4
+ 
5
+ 
6
+-PLUGINS=df cpu if_ if_err_ load memory processes swap netstat uptime interrupts irqstats ntpdate plugindir_
7
+-#PLUGINS=cpu if_ if_err_ load memory processes netstat uptime interrupts irqstats
8
++#PLUGINS=df cpu if_ if_err_ load memory processes swap netstat uptime interrupts irqstats ntpdate plugindir_
9
++PLUGINS=cpu if_ if_err_ load memory processes netstat uptime interrupts irqstats
10
+ 
11
+ munin-node: plugins/* munin-node.conf
12
+ 	@VERSION=$$(cat VERSION); \

+ 11
- 0
admin/muninlite/patches/002-hostname.patch ファイルの表示

@@ -0,0 +1,11 @@
1
+--- a/munin-node.in
2
++++ b/munin-node.in
3
+@@ -113,7 +113,7 @@ PLUGINS=$RES
4
+ 
5
+ # ===== MAIN LOOP =====
6
+ FUNCTIONS="list nodes config fetch version quit"
7
+-HOSTNAME=$(hostname -f 2>/dev/null || hostname)
8
++HOSTNAME=$(/sbin/uci get "system.@system[0].hostname" 2>/dev/null || cat /proc/sys/kernel/hostname)
9
+ echo "# munin node at $HOSTNAME"
10
+ while read arg0 arg1 
11
+ do 

+ 21
- 0
admin/muninlite/patches/100-fix-no-ethtool.patch ファイルの表示

@@ -0,0 +1,21 @@
1
+--- a/plugins/if_
2
++++ b/plugins/if_
3
+@@ -15,10 +15,14 @@ config_if() {
4
+   echo "up.min 0"
5
+   echo "up.negative down"
6
+   echo "up.cdef up,8,*"
7
+-  if ethtool $1 | grep -q Speed; then
8
+-    MAX=$(($(ethtool $1 | grep Speed | sed -e 's/[[:space:]]\{1,\}/ /g' -e 's/^ //' -e 's/M.*//' | cut -d\  -f2) * 1000000))
9
+-    echo "up.max $MAX"
10
+-    echo "down.max $MAX"
11
++  if [ -n "$(which ethtool)" ]; then
12
++	if [ -x "$(which ethtool)" ]; then
13
++  		if ethtool $1 | grep -q Speed; then
14
++    			MAX=$(($(ethtool $1 | grep Speed | sed -e 's/[[:space:]]\{1,\}/ /g' -e 's/^ //' -e 's/M.*//' | cut -d\  -f2) * 1000000))
15
++    			echo "up.max $MAX"
16
++    			echo "down.max $MAX"
17
++		fi
18
++	fi
19
+   fi
20
+ }
21
+ fetch_if() {

+ 20
- 0
admin/muninlite/patches/200-add-tap-dev.patch ファイルの表示

@@ -0,0 +1,20 @@
1
+--- a/munin-node.in
2
++++ b/munin-node.in
3
+@@ -72,7 +72,7 @@ RES=""
4
+ for PLUG in $PLUGINS
5
+ do 
6
+   if [ "$PLUG" = "if_" ]; then  
7
+-    for INTER in $(grep '^ *\(ppp\|eth\|wlan\|ath\|ra\|ipsec\)\([^:]\)\{1,\}:' /proc/net/dev | cut -f1 -d: | sed 's/ //g');
8
++    for INTER in $(grep '^ *\(ppp\|eth\|wlan\|ath\|ra\|ipsec\|tap\)\([^:]\)\{1,\}:' /proc/net/dev | cut -f1 -d: | sed 's/ //g');
9
+     do
10
+       INTERRES=$(echo $INTER | sed 's/\./VLAN/')
11
+       RES="$RES if_$INTERRES"
12
+@@ -80,7 +80,7 @@ do
13
+       eval "config_if_${INTERRES}() { config_if $INTER $@; };"
14
+     done
15
+   elif [ "$PLUG" = "if_err_" ]; then
16
+-    for INTER in $(grep '^ *\(ppp\|eth\|wlan\|ath\|ra\|ipsec\)\([^:]\)\{1,\}:' /proc/net/dev | cut -f1 -d: | sed 's/ //g');
17
++    for INTER in $(grep '^ *\(ppp\|eth\|wlan\|ath\|ra\|ipsec\|tap\)\([^:]\)\{1,\}:' /proc/net/dev | cut -f1 -d: | sed 's/ //g');
18
+     do
19
+       INTERRES=$(echo $INTER | sed 's/\./VLAN/')
20
+       RES="$RES if_err_$INTERRES"

+ 24
- 0
admin/muninlite/patches/210-add-bridge-devs.patch ファイルの表示

@@ -0,0 +1,24 @@
1
+--- a/munin-node.in
2
++++ b/munin-node.in
3
+@@ -72,17 +72,17 @@ RES=""
4
+ for PLUG in $PLUGINS
5
+ do 
6
+   if [ "$PLUG" = "if_" ]; then  
7
+-    for INTER in $(grep '^ *\(ppp\|eth\|wlan\|ath\|ra\|ipsec\|tap\)\([^:]\)\{1,\}:' /proc/net/dev | cut -f1 -d: | sed 's/ //g');
8
++    for INTER in $(grep '^ *\(ppp\|eth\|wlan\|ath\|ra\|ipsec\|tap\|br-\)\([^:]\)\{1,\}:' /proc/net/dev | cut -f1 -d: | sed 's/ //g');
9
+     do
10
+-      INTERRES=$(echo $INTER | sed 's/\./VLAN/')
11
++      INTERRES=$(echo $INTER | sed -e 's/\./VLAN/' -e 's/\-/_/')
12
+       RES="$RES if_$INTERRES"
13
+       eval "fetch_if_${INTERRES}() { fetch_if $INTER $@; };"
14
+       eval "config_if_${INTERRES}() { config_if $INTER $@; };"
15
+     done
16
+   elif [ "$PLUG" = "if_err_" ]; then
17
+-    for INTER in $(grep '^ *\(ppp\|eth\|wlan\|ath\|ra\|ipsec\|tap\)\([^:]\)\{1,\}:' /proc/net/dev | cut -f1 -d: | sed 's/ //g');
18
++    for INTER in $(grep '^ *\(ppp\|eth\|wlan\|ath\|ra\|ipsec\|tap\|br-\)\([^:]\)\{1,\}:' /proc/net/dev | cut -f1 -d: | sed 's/ //g');
19
+     do
20
+-      INTERRES=$(echo $INTER | sed 's/\./VLAN/')
21
++      INTERRES=$(echo $INTER | sed -e 's/\./VLAN/' -e 's/\-/_/')
22
+       RES="$RES if_err_$INTERRES"
23
+       eval "fetch_if_err_${INTERRES}() { fetch_if_err $INTER $@; };"
24
+       eval "config_if_err_${INTERRES}() { config_if_err $INTER $@; };"