=cut
-state="${MUNIN_PLUGSTATE}/unbound.state"
-seentags="${MUNIN_PLUGSTATE}/unbound-seentags.state"
+my_state_name=`echo $0 | sed -e 's/^.*unbound\(2\?\)_munin_.*$/unbound\1/'`
+state="${MUNIN_PLUGSTATE}/$my_state_name.state"
+seentags="${MUNIN_PLUGSTATE}/$my_state_name-seentags.state"
warn=${spoof_warn:-1000}
crit=${spoof_crit:-100000}
lock=$state.lock
fi
ssh -o ControlPath=/tmp/unbound-ssh.$$.sock -M -o ExitOnForwardFailure=yes -p 2222 -fnN -L /tmp/unbound-control.$$.sock:/tmp/unbound-control.sock root@$router >/dev/null # open an SSH tunnel
- unbound-control -c /etc/unbound/unbound-control.conf -s /tmp/unbound-control.$$.sock stats > $state # run unbound-control over the SSH tunnel socket
+ unbound-control -c /etc/unbound/unbound-control.conf -s /tmp/unbound-control.$$.sock stats >$state # run unbound-control over the SSH tunnel socket
if test $? -ne 0; then
echo "error retrieving data from unbound server"
rm -f $lock
fi
# determine my type, by name
-id=`echo $0 | sed -e 's/^.*unbound_munin_//'`
+id=`echo $0 | sed -e 's/^.*unbound2\?_munin_//'`
if test "$id"x = ""x; then
# some default to keep people sane.
id="hits"