14 AutoPing
63
function action_to_perform(selected_outlets)
.
.
.
end
In the second form the argument
selected_outlets
(any other name will do) will receive a table of the 1-based
indices of outlets selected (e.g.
{1,3,6}
). The order of outlets in the table is unspecified; use
table.sort
in
the script function if you rely on a particular order.
The stats column shows some statistics:
•
TX
— the number of pings sent to the target IP address;
•
RX
— the number of pongs received back so far;
•
HIT
— the number of times the trigger action was executed.
On the sample image, three targets are being monitored (74.125.87.103, 67.122.199.250, and 192.168.0.93).
192.168.0.93 seems to be a very reliable/well-connected device: 823 pings were sent to it and 822 pongs received
back. Chances are very good, the 823rd pong will arrive soon. The reboot task (script function
toggle_stuff
←
-
_and_log
) was never executed.
Looks like 192.168.0.92 failed hard. The task (cycle outlets 3,5,6) was executed 5 times in a row but the target did
not respond. Monitoring was automatically disabled.
74.125.87.103 and 67.122.199.250 form a group, the trigger task will be performed if they both lose 5 sequential
packets simultaneously. This has happened 2 times so far. Monitoring a group of several external spatially separated
reliable IP addresses (in this example they belong to Google and Digital Loggers respectively) may become very
useful to detect a stuck ADSL modem or some other no-Internet condition.
14.3
Action on local network failures
AutoPing is designed to control operation of remote hosts. You usually don't want to e.g. cycle power to all servers
if you turn on same subnet restriction. So AutoPing tries not to trigger if there might be a problem local to the unit
itself. For example, if you detach the Ethernet cable from the unit, you'll see messages similar to the following:
kernel: eth0: link down
config.net: Interface "eth0" is down
autoping: ping x.y.z.t: no usable route to host, ..., not considered a failure
and no actions will be performed. A similar situation will occur if you reconfigure the controller to use a new IP
network from which old addresses are unreachable.
Use the
link://
to check for local link loss.
DLI LPC9 User’s Guide: 1.7.24.0
Summary of Contents for LPC9
Page 1: ...DLI LPC9 User s Guide 1 7 24 0 ...
Page 81: ......