diff options
| author | Lucas Castro <lucas@gnuabordo.com.br> | 2024-01-10 22:33:44 -0300 |
|---|---|---|
| committer | Lucas Castro <lucas@gnuabordo.com.br> | 2024-01-10 22:33:44 -0300 |
| commit | a4270020addc324fb60d2b1b446b41bc31e3baf8 (patch) | |
| tree | 8708f08c66a63f08c0cd88ab1a46faadcd3f4706 /default_script | |
Import Upstream version 1.0.4upstream/1.0.4
Diffstat (limited to 'default_script')
| -rw-r--r-- | default_script | 67 |
1 files changed, 67 insertions, 0 deletions
diff --git a/default_script b/default_script new file mode 100644 index 0000000..2fe3e7c --- /dev/null +++ b/default_script @@ -0,0 +1,67 @@ +#!/bin/sh +# +# Copyright (C) 2009-2015 Mika Ilmaranta <ilmis@nullnet.fi> +# Copyright (C) 2015 Tuomo Soini <tis@foobar.fi> +# +# License: GPLv2 +# + +# +# default event handling script +# + +STATE=${1} +NAME=${2} +CHECKIP=${3} +DEVICE=${4} +WARN_EMAIL=${5} +REPLIED=${6} +WAITING=${7} +TIMEOUT=${8} +REPLY_LATE=${9} +CONS_RCVD=${10} +CONS_WAIT=${11} +CONS_MISS=${12} +AVG_RTT=${13} +SRCIP=${14} +PREVSTATE=${15} +TIMESTAMP=${16} + +if [ -z "${WARN_EMAIL}" ] ; then + exit 0 +fi + +DATE=$(date --date=@${TIMESTAMP}) + +cat <<EOM | mail -s "LSM: ${NAME} ${STATE}, IP ${CHECKIP}" ${WARN_EMAIL} + +Hi, + +Your connection ${NAME} has changed its state to ${STATE} at ${DATE}. + +Following parameters were passed: +prevstate = ${PREVSTATE} +newstate = ${STATE} +name = ${NAME} +checkip = ${CHECKIP} +device = ${DEVICE} +sourceip = ${SRCIP} +warn_email = ${WARN_EMAIL} + +Packet statuses: +replied = ${REPLIED} packets replied +waiting = ${WAITING} packets waiting for reply +timeout = ${TIMEOUT} packets that have timed out (= packet loss) +reply_late = ${REPLY_LATE} packets that received a reply after timeout +cons_rcvd = ${CONS_RCVD} consecutively received replies in sequence +cons_wait = ${CONS_WAIT} consecutive packets waiting for reply +cons_miss = ${CONS_MISS} consecutive packets that have timed out +avg_rtt = ${AVG_RTT} average rtt [usec], calculated from received packets + +BR, +Your LSM installation + +EOM + +exit 0 +# |
