1
0
mirror of https://git.openwrt.org/feed/packages.git synced 2024-06-18 21:33:53 +02:00
openwrt-packages/net/apinger/files/apinger-hotplug
Jaymin Patel e4e3206f32 apinger: improve uci and procd support
- convert apinger into procd instances
- generate instance specific apinger.conf from uci
- hotplug handling for apinger alarms
- restart apinger interface instance on ifup action of interface
- don't exit on packet count mismatch, allows to use apinger as monitor
  for multiple targets handling
- add srcip option to target configuration, allows specifying source ip
  used to monitor target
- allow creating status file in script parseable format

Patches are ported against latest version of apinger and referenced from
https://git.pld-linux.org/?p=packages/apinger.git;a=summary

Signed-off-by: Jaymin Patel <jem.patel@gmail.com>
2022-07-12 12:27:05 +05:30

23 lines
550 B
Bash

#!/bin/sh
usage_help()
{
echo "$0 <action> <instance> <target> <srcip> <target_desc> <alarm> <alarmtype> <reason> <send> <recieved> <loss> <delay> <timestamp>"
}
export ACTION=$1
export INSTANCE=$2
export APINGER_TARGET=$3
export APINGER_SRCIP=$4
export APINGER_TARGET_ID=$5
export APINGER_ALARM=$6
export APINGER_ALARM_TYPE=$7
export APINGER_ALARM_MESSAGE=$8
export APINGER_PROBES_SENT=$9
export APINGER_PROBES_RECEIVED=${10}
export APINGER_LOSS=${11}
export APINGER_DELAY=${12}
export APINGER_TIMESTAMP=${13}
exec /sbin/hotplug-call apinger $@