[package] lsm: update to 0.131
his patch updates link state monitor (lsm) to release 0.131, add sample connections.conf and update lsm.conf and lsm_script Signed-off-by: Edy Corak <info@loenshotel.de> git-svn-id: svn://svn.openwrt.org/openwrt/packages@33166 3c298f89-4303-0410-b956-a3cf2f4a3e73
This commit is contained in:
@ -8,14 +8,14 @@
|
|||||||
include $(TOPDIR)/rules.mk
|
include $(TOPDIR)/rules.mk
|
||||||
|
|
||||||
PKG_NAME:=lsm
|
PKG_NAME:=lsm
|
||||||
PKG_VERSION:=0.60
|
PKG_VERSION:=0.131
|
||||||
PKG_RELEASE:=3
|
PKG_RELEASE:=1
|
||||||
|
|
||||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
|
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
|
||||||
PKG_SOURCE_URL:=http://lsm.foobar.fi/download
|
PKG_SOURCE_URL:=http://lsm.foobar.fi/download
|
||||||
PKG_MD5SUM:=f4748308c0a1caa98d7e756778954116
|
PKG_MD5SUM:=c3ff15f5e0d3988a1a45f35392639d40
|
||||||
|
|
||||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)
|
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
|
||||||
|
|
||||||
include $(INCLUDE_DIR)/package.mk
|
include $(INCLUDE_DIR)/package.mk
|
||||||
|
|
||||||
@ -48,12 +48,14 @@ define Package/lsm/install
|
|||||||
$(INSTALL_DIR) $(1)/etc/lsm
|
$(INSTALL_DIR) $(1)/etc/lsm
|
||||||
$(INSTALL_DIR) $(1)/etc/lsm/script.d
|
$(INSTALL_DIR) $(1)/etc/lsm/script.d
|
||||||
$(INSTALL_DIR) $(1)/etc/init.d
|
$(INSTALL_DIR) $(1)/etc/init.d
|
||||||
|
$(INSTALL_DATA) ./files/connections.conf $(1)/etc/lsm/connections.conf
|
||||||
$(INSTALL_DATA) ./files/lsm.conf $(1)/etc/lsm/lsm.conf
|
$(INSTALL_DATA) ./files/lsm.conf $(1)/etc/lsm/lsm.conf
|
||||||
$(INSTALL_BIN) ./files/lsm_script $(1)/etc/lsm/script
|
$(INSTALL_BIN) ./files/lsm_script $(1)/etc/lsm/script
|
||||||
$(INSTALL_BIN) ./files/lsm.init $(1)/etc/init.d/lsm
|
$(INSTALL_BIN) ./files/lsm.init $(1)/etc/init.d/lsm
|
||||||
endef
|
endef
|
||||||
|
|
||||||
define Package/lsm/conffiles
|
define Package/lsm/conffiles
|
||||||
|
/etc/lsm/connections.conf
|
||||||
/etc/lsm/lsm.conf
|
/etc/lsm/lsm.conf
|
||||||
endef
|
endef
|
||||||
|
|
||||||
|
13
net/lsm/files/connections.conf
Normal file
13
net/lsm/files/connections.conf
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
connection {
|
||||||
|
name=Provider1
|
||||||
|
checkip=1.1.1.1
|
||||||
|
device=pppoe-wan
|
||||||
|
ttl=2
|
||||||
|
}
|
||||||
|
|
||||||
|
connection {
|
||||||
|
name=Provider2
|
||||||
|
checkip=2.2.2.2
|
||||||
|
device=eth0.2
|
||||||
|
ttl=1
|
||||||
|
}
|
@ -1,4 +1,3 @@
|
|||||||
|
|
||||||
#
|
#
|
||||||
# (C) 2009 Mika Ilmaranta <ilmis at nullnet.fi>
|
# (C) 2009 Mika Ilmaranta <ilmis at nullnet.fi>
|
||||||
#
|
#
|
||||||
@ -12,7 +11,7 @@
|
|||||||
#debug=10
|
#debug=10
|
||||||
#debug=9
|
#debug=9
|
||||||
debug=8
|
debug=8
|
||||||
reopen_on_enodev=1
|
# reopen_on_enodev=1
|
||||||
|
|
||||||
#
|
#
|
||||||
# Defaults for the connection entries
|
# Defaults for the connection entries
|
||||||
@ -21,7 +20,7 @@ defaults {
|
|||||||
name=defaults
|
name=defaults
|
||||||
checkip=127.0.0.1
|
checkip=127.0.0.1
|
||||||
eventscript=/etc/lsm/script
|
eventscript=/etc/lsm/script
|
||||||
max_packet_loss=15
|
max_packet_loss=20
|
||||||
max_successive_pkts_lost=7
|
max_successive_pkts_lost=7
|
||||||
min_packet_loss=5
|
min_packet_loss=5
|
||||||
min_successive_pkts_rcvd=10
|
min_successive_pkts_rcvd=10
|
||||||
|
@ -1,14 +1,11 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
#
|
#
|
||||||
# (C) 2009 Mika Ilmaranta <ilmis at nullnet.fi>
|
# (C) 2009 Mika Ilmaranta <ilmis@nullnet.fi>
|
||||||
|
# (C) 2009 Tom Eastep <teastep@shorewall.net>
|
||||||
#
|
#
|
||||||
# License: GPLv2
|
# License: GPLv2
|
||||||
#
|
#
|
||||||
|
|
||||||
#
|
|
||||||
# default event handling script
|
|
||||||
#
|
|
||||||
|
|
||||||
DATE=$(/bin/date)
|
DATE=$(/bin/date)
|
||||||
|
|
||||||
STATE=${1}
|
STATE=${1}
|
||||||
@ -25,42 +22,56 @@ CONS_WAIT=${11}
|
|||||||
CONS_MISS=${12}
|
CONS_MISS=${12}
|
||||||
AVG_RTT=${13}
|
AVG_RTT=${13}
|
||||||
|
|
||||||
cat <<EOM | mail -s "LSM: ${NAME} ${STATE}, IP ${CHECKIP}" ${WARN_EMAIL}
|
if [ -f /usr/share/shorewall-lite/lib.base ]; then
|
||||||
|
VARDIR=/etc/shorewall-lite/state
|
||||||
|
STATEDIR=/etc/shorewall-lite
|
||||||
|
else
|
||||||
|
VARDIR=/var/lib/shorewall
|
||||||
|
STATEDIR=/etc/shorewall
|
||||||
|
fi
|
||||||
|
|
||||||
|
[ -f ${STATEDIR}/vardir ] && . ${STATEDIR}/vardir
|
||||||
|
|
||||||
|
cat <<EOM | ssmtp ${WARN_EMAIL}
|
||||||
|
Subject: "LSM: ${NAME} ${STATE}, DEV ${DEVICE}"
|
||||||
|
|
||||||
Hi,
|
Hi,
|
||||||
|
|
||||||
Your connection ${NAME} has changed it's state to ${STATE} at ${DATE}.
|
Your connection ${NAME} has changed it's state to ${STATE} at ${DATE}.
|
||||||
|
|
||||||
Following parameters were passed:
|
Following parameters were passed:
|
||||||
|
|
||||||
newstate = ${STATE}
|
newstate = ${STATE}
|
||||||
name = ${NAME}
|
name = ${NAME}
|
||||||
checkip = ${CHECKIP}
|
checkip = ${CHECKIP}
|
||||||
device = ${DEVICE}
|
device = ${DEVICE}
|
||||||
warn_email = ${WARN_EMAIL}
|
warn_email = ${WARN_EMAIL}
|
||||||
|
|
||||||
Packet statuses:
|
Packet counters:
|
||||||
|
|
||||||
replied = ${REPLIED} packets replied
|
replied = ${REPLIED} packets replied
|
||||||
waiting = ${WAITING} packets waiting for reply
|
waiting = ${WAITING} packets waiting for reply
|
||||||
timeout = ${TIMEOUT} packets that have timeout (= packet loss)
|
timeout = ${TIMEOUT} packets that have timed out (= packet loss)
|
||||||
reply_late = ${REPLY_LATE} packets that received a reply after timeout
|
reply_late = ${REPLY_LATE} packets that received a reply after timeout
|
||||||
cons_rcvd = ${CONS_RCVD} consecutively received replies in sequence
|
cons_rcvd = ${CONS_RCVD} consecutively received replies in sequence
|
||||||
cons_wait = ${CONS_WAIT} consecutive packets waiting for reply
|
cons_wait = ${CONS_WAIT} consecutive packets waiting for reply
|
||||||
cons_miss = ${CONS_MISS} consecutive packets that have timed out
|
cons_miss = ${CONS_MISS} consecutive packets that have timed out
|
||||||
avg_rtt = ${AVG_RTT} average rtt [usec], calculated from received packets
|
avg_rtt = ${AVG_RTT} average rtt, notice that waiting and timed out packets have rtt = 0 when calculating this
|
||||||
|
|
||||||
BR,
|
Your LSM Daemon
|
||||||
Your LSM installation
|
|
||||||
|
|
||||||
EOM
|
EOM
|
||||||
|
|
||||||
cd /etc/lsm/script.d/
|
if [ ${STATE} = up ]; then
|
||||||
for script in $(ls); do
|
echo 0 > ${VARDIR}/${DEVICE}.status # Uncomment this line if you are running Shorewall 4.4.x or earlier
|
||||||
if [ ! -x $script ]; then
|
${VARDIR}/firewall enable ${DEVICE}
|
||||||
continue
|
else
|
||||||
fi
|
echo 1 > ${VARDIR}/${DEVICE}.status # Uncomment this line if you are running Shorewall 4.4.x or earlier
|
||||||
./$script "$@"
|
${VARDIR}/firewall disable ${DEVICE}
|
||||||
done
|
fi
|
||||||
|
|
||||||
exit 0;
|
/sbin/shorewall-lite show routing > /var/log/lsm
|
||||||
|
|
||||||
|
exit 0
|
||||||
|
|
||||||
#EOF
|
#EOF
|
||||||
|
Reference in New Issue
Block a user