Using ICPLD with config file
The ICPLD config file is very simple. ICPLD looks for the config file in /usr/local/etc/icpld.conf, unless anything else is specified
with the -config argument on command line.
There is an example icpld.conf included in the root of the icpld directory which
can be edited and copied to /usr/local/etc
The layout of the config file is very standard and easy. Each line, not beginning with '#' is considered an option.
The syntax is
option=value
This info is an exctraction and (hopefully) simplification of the contents of ICPLD's man page
The available options are as follows:
Explanation:
(int) = Integer. Whole numbers.
(str) = String. String of text.
(bool) = Boolean. Either 'true' or 'false'.
ip (str) - This is the ip we will probe for an ICMP reply.
fbip (str) - If the host specified in 'ip' is not responding, we will request a reply from this ip instead. Just to make sure it is not the
peering machine that is down, and not ours.
interval (int) - This option sets how often we should probe the ip provided with 'ip'.
(default: 10 seconds)
dinterval (int) - Since ICMP requests and replies is considered network traffic, it might be a good idea to set another probing interval to use
when the connection is down. It will probe with the frequence of 'interval', until the connection is unavailable, then it will switch over and use 'dinterval'.
dinterval can and should be set lower than interval, as it matters less since the connection is
down. (default: 6 seconds)
logFile (str) - Sets the path to where ICPLD should keep the log file. Note that, unless other is provided at command line, this is what ICPLD
will use for all log-related operations eg. -turn and -reset. A log placed somewhere else than what
this option says, will for example not be turned. (default: ~/.icpld/log)
htmlFile (str) - ICPLD duplicates the log into HTML format. This option tells ICPLD where it should be put. A hint is to put it in a directory
where your web server can access it.
daemonize (bool) - Determines wheter ICPLD will fork into the background or not. Being in the foreground is somewhat more verbose since ICPLD
only logs to syslog on critical errors. If you think
ICPLD is acting strange, it may be helpful to run ICPLD in the foreground to see eventual less
critical error messages such as permission errors and such. (default: daemonize)
errfile (str) - If the pinging sequence fails, the output of ping is copied to this file.
Useful for troubleshooting. (default: ~/.icpld/errors)
iface (str) - Tells ICPLD which interface or (on some platforms) which source address to
send the ICMP signals from (default: kernel default, most users don't need this)
nobeep (bool) - If ran into foreground, ICPLD will generate a beeping sound depending on
this option. (default: beep on)
pint (int) - ICPLD normally sends two ICMP packets to the receieving. The pint option sets the interval with
which these two packets will be sent. (default: 1.0 seconds)
cmd4dn - This can be set to a command of your desire, and will be executed as soon as the IPv4 connection is determined as unavailable.
This is especially useful when you feel that you need to be alerted whenever the status of your connection changes
cmd4up - Same as above, but when the connection comes back up after downtime
Additionally there are a few more options available if icpld is compiled with IPv6 support;
ip6 (str) - This is the IPv6 address we will probe for ICMP replies
fbip6 (str) - This is the fallback address used when the one specified with ip6 is unresponsive
errfile6 (str) - If the pinging sequence fails, the output of ping is copied to this
file. Useful for troubleshooting.
logFile6 (str) - This should be set to a path to a file which icpld will write its output to
htmlFile6 (str) - This path should point to a file which will contain a duplication of the log in HTML format
cmd6dn - This can be set to a command of your desire, and will be executed as soon as the IPv6 connection is determined as unavailable.
This is especially useful when you feel that you need to be alerted whenever the status of your connection changes
cmd6up - Same as above, but when the connection comes back up after downtime
An fairly good and normal config would look something like this:
# ICPLD example config file.
ip=192.168.0.1
fbip=192.168.0.2
interval=8
dinterval=5
logFile=~/.icpld/log
errfile=~/.icpld/errors
iface=eth0
htmlFile=/usr/local/apache/htdocs/icpld.html
daemonize=true
nobeep=true
pint=1.0
cmd4dn=play ~/mysounds/awwww.wav
cmd4up=play ~/mysounds/yipee.wav
Of course the ip field is crucial to change.
If you intend to use ICPLD with an addiotional IPv6 connection, your config could look something like this:
ip=192.168.0.1
ip6=3ffe::1
fbip=192.168.0.2
fbip6=3ffe::2
interval=9
dinterval=5
pint=1.0
errfile=~/.icpld/errors
errfile6=~/.icpld/errors
iface=eth0
daemonize=true
logFile=~/.icpld/log
logFile6=~/.icpld/log
htmlFile=/usr/local/apache/htdocs/icpld.html
htmlFile6=/usr/local/apache/htdocs/icpld-v6.html
nobeep=false
cmd4dn=play ~/mysounds/awwww.wav
cmd4up=play ~/mysounds/yipee.wav
cmd6dn=play ~/mysounds/awwww.wav
cmd6up=play ~/mysounds/yipee.wav