From 231da9d0f3ed6e3be40eee6de5bad3ee7392341c Mon Sep 17 00:00:00 2001 From: Jonathan McCrohan Date: Mon, 7 Jul 2014 23:32:41 +0100 Subject: [PATCH] muninlite: Import from oldpackages, add myself as maintainer Signed-off-by: Jonathan McCrohan --- admin/muninlite/Makefile | 52 +++++++++++++++++++ admin/muninlite/files/etc/xinetd.d/munin | 10 ++++ admin/muninlite/patches/001-no_disks.patch | 12 +++++ admin/muninlite/patches/002-hostname.patch | 11 ++++ .../patches/100-fix-no-ethtool.patch | 21 ++++++++ admin/muninlite/patches/200-add-tap-dev.patch | 20 +++++++ .../patches/210-add-bridge-devs.patch | 24 +++++++++ 7 files changed, 150 insertions(+) create mode 100644 admin/muninlite/Makefile create mode 100644 admin/muninlite/files/etc/xinetd.d/munin create mode 100644 admin/muninlite/patches/001-no_disks.patch create mode 100644 admin/muninlite/patches/002-hostname.patch create mode 100644 admin/muninlite/patches/100-fix-no-ethtool.patch create mode 100644 admin/muninlite/patches/200-add-tap-dev.patch create mode 100644 admin/muninlite/patches/210-add-bridge-devs.patch diff --git a/admin/muninlite/Makefile b/admin/muninlite/Makefile new file mode 100644 index 000000000..3388a2b87 --- /dev/null +++ b/admin/muninlite/Makefile @@ -0,0 +1,52 @@ +# +# Copyright (C) 2006-2014 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=muninlite +PKG_VERSION:=1.0.4 +PKG_RELEASE:=5 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=@SF/$(PKG_NAME) +PKG_MD5SUM:=a8cc86f0cc536a6c22dc298f4ed55339 + +include $(INCLUDE_DIR)/package.mk + +define Package/muninlite + SECTION:=admin + CATEGORY:=Administration + DEPENDS:=+xinetd + TITLE:=Munin node implemented in shell + URL:=http://sourceforge.net/projects/muninlite/ + MAINTAINER:=Jonathan McCrohan +endef + +define Package/muninlite/Default/description + Munin node implemented in shell. + Munin is a monitoring system for Unix networks. +endef + +define Package/muninlite/install + $(INSTALL_DIR) $(1)/usr/sbin/ + $(INSTALL_BIN) $(PKG_BUILD_DIR)/munin-node $(1)/usr/sbin/ + $(INSTALL_DIR) $(1)/etc/xinetd.d + $(INSTALL_DATA) ./files/etc/xinetd.d/munin $(1)/etc/xinetd.d/ +endef + +define Package/muninlite/conffiles +/etc/xinetd.d/munin +endef + +define Build/Configure +endef + +define Build/Compile + $(MAKE) -C $(PKG_BUILD_DIR) +endef + +$(eval $(call BuildPackage,muninlite)) diff --git a/admin/muninlite/files/etc/xinetd.d/munin b/admin/muninlite/files/etc/xinetd.d/munin new file mode 100644 index 000000000..012d71b9f --- /dev/null +++ b/admin/muninlite/files/etc/xinetd.d/munin @@ -0,0 +1,10 @@ +service munin +{ + socket_type = stream + protocol = tcp + wait = no + user = root + group = root + server = /usr/sbin/munin-node + disable = no +} diff --git a/admin/muninlite/patches/001-no_disks.patch b/admin/muninlite/patches/001-no_disks.patch new file mode 100644 index 000000000..bf9b2b1c5 --- /dev/null +++ b/admin/muninlite/patches/001-no_disks.patch @@ -0,0 +1,12 @@ +--- a/Makefile ++++ b/Makefile +@@ -1,7 +1,7 @@ + + +-PLUGINS=df cpu if_ if_err_ load memory processes swap netstat uptime interrupts irqstats ntpdate plugindir_ +-#PLUGINS=cpu if_ if_err_ load memory processes netstat uptime interrupts irqstats ++#PLUGINS=df cpu if_ if_err_ load memory processes swap netstat uptime interrupts irqstats ntpdate plugindir_ ++PLUGINS=cpu if_ if_err_ load memory processes netstat uptime interrupts irqstats + + munin-node: plugins/* munin-node.conf + @VERSION=$$(cat VERSION); \ diff --git a/admin/muninlite/patches/002-hostname.patch b/admin/muninlite/patches/002-hostname.patch new file mode 100644 index 000000000..5d871683c --- /dev/null +++ b/admin/muninlite/patches/002-hostname.patch @@ -0,0 +1,11 @@ +--- a/munin-node.in ++++ b/munin-node.in +@@ -113,7 +113,7 @@ PLUGINS=$RES + + # ===== MAIN LOOP ===== + FUNCTIONS="list nodes config fetch version quit" +-HOSTNAME=$(hostname -f 2>/dev/null || hostname) ++HOSTNAME=$(/sbin/uci get "system.@system[0].hostname" 2>/dev/null || cat /proc/sys/kernel/hostname) + echo "# munin node at $HOSTNAME" + while read arg0 arg1 + do diff --git a/admin/muninlite/patches/100-fix-no-ethtool.patch b/admin/muninlite/patches/100-fix-no-ethtool.patch new file mode 100644 index 000000000..88f7e3056 --- /dev/null +++ b/admin/muninlite/patches/100-fix-no-ethtool.patch @@ -0,0 +1,21 @@ +--- a/plugins/if_ ++++ b/plugins/if_ +@@ -15,10 +15,14 @@ config_if() { + echo "up.min 0" + echo "up.negative down" + echo "up.cdef up,8,*" +- if ethtool $1 | grep -q Speed; then +- MAX=$(($(ethtool $1 | grep Speed | sed -e 's/[[:space:]]\{1,\}/ /g' -e 's/^ //' -e 's/M.*//' | cut -d\ -f2) * 1000000)) +- echo "up.max $MAX" +- echo "down.max $MAX" ++ if [ -n "$(which ethtool)" ]; then ++ if [ -x "$(which ethtool)" ]; then ++ if ethtool $1 | grep -q Speed; then ++ MAX=$(($(ethtool $1 | grep Speed | sed -e 's/[[:space:]]\{1,\}/ /g' -e 's/^ //' -e 's/M.*//' | cut -d\ -f2) * 1000000)) ++ echo "up.max $MAX" ++ echo "down.max $MAX" ++ fi ++ fi + fi + } + fetch_if() { diff --git a/admin/muninlite/patches/200-add-tap-dev.patch b/admin/muninlite/patches/200-add-tap-dev.patch new file mode 100644 index 000000000..fa46ce6b3 --- /dev/null +++ b/admin/muninlite/patches/200-add-tap-dev.patch @@ -0,0 +1,20 @@ +--- a/munin-node.in ++++ b/munin-node.in +@@ -72,7 +72,7 @@ RES="" + for PLUG in $PLUGINS + do + if [ "$PLUG" = "if_" ]; then +- for INTER in $(grep '^ *\(ppp\|eth\|wlan\|ath\|ra\|ipsec\)\([^:]\)\{1,\}:' /proc/net/dev | cut -f1 -d: | sed 's/ //g'); ++ for INTER in $(grep '^ *\(ppp\|eth\|wlan\|ath\|ra\|ipsec\|tap\)\([^:]\)\{1,\}:' /proc/net/dev | cut -f1 -d: | sed 's/ //g'); + do + INTERRES=$(echo $INTER | sed 's/\./VLAN/') + RES="$RES if_$INTERRES" +@@ -80,7 +80,7 @@ do + eval "config_if_${INTERRES}() { config_if $INTER $@; };" + done + elif [ "$PLUG" = "if_err_" ]; then +- for INTER in $(grep '^ *\(ppp\|eth\|wlan\|ath\|ra\|ipsec\)\([^:]\)\{1,\}:' /proc/net/dev | cut -f1 -d: | sed 's/ //g'); ++ for INTER in $(grep '^ *\(ppp\|eth\|wlan\|ath\|ra\|ipsec\|tap\)\([^:]\)\{1,\}:' /proc/net/dev | cut -f1 -d: | sed 's/ //g'); + do + INTERRES=$(echo $INTER | sed 's/\./VLAN/') + RES="$RES if_err_$INTERRES" diff --git a/admin/muninlite/patches/210-add-bridge-devs.patch b/admin/muninlite/patches/210-add-bridge-devs.patch new file mode 100644 index 000000000..1a76e971d --- /dev/null +++ b/admin/muninlite/patches/210-add-bridge-devs.patch @@ -0,0 +1,24 @@ +--- a/munin-node.in ++++ b/munin-node.in +@@ -72,17 +72,17 @@ RES="" + for PLUG in $PLUGINS + do + if [ "$PLUG" = "if_" ]; then +- for INTER in $(grep '^ *\(ppp\|eth\|wlan\|ath\|ra\|ipsec\|tap\)\([^:]\)\{1,\}:' /proc/net/dev | cut -f1 -d: | sed 's/ //g'); ++ for INTER in $(grep '^ *\(ppp\|eth\|wlan\|ath\|ra\|ipsec\|tap\|br-\)\([^:]\)\{1,\}:' /proc/net/dev | cut -f1 -d: | sed 's/ //g'); + do +- INTERRES=$(echo $INTER | sed 's/\./VLAN/') ++ INTERRES=$(echo $INTER | sed -e 's/\./VLAN/' -e 's/\-/_/') + RES="$RES if_$INTERRES" + eval "fetch_if_${INTERRES}() { fetch_if $INTER $@; };" + eval "config_if_${INTERRES}() { config_if $INTER $@; };" + done + elif [ "$PLUG" = "if_err_" ]; then +- for INTER in $(grep '^ *\(ppp\|eth\|wlan\|ath\|ra\|ipsec\|tap\)\([^:]\)\{1,\}:' /proc/net/dev | cut -f1 -d: | sed 's/ //g'); ++ for INTER in $(grep '^ *\(ppp\|eth\|wlan\|ath\|ra\|ipsec\|tap\|br-\)\([^:]\)\{1,\}:' /proc/net/dev | cut -f1 -d: | sed 's/ //g'); + do +- INTERRES=$(echo $INTER | sed 's/\./VLAN/') ++ INTERRES=$(echo $INTER | sed -e 's/\./VLAN/' -e 's/\-/_/') + RES="$RES if_err_$INTERRES" + eval "fetch_if_err_${INTERRES}() { fetch_if_err $INTER $@; };" + eval "config_if_err_${INTERRES}() { config_if_err $INTER $@; };"