WATCHQUAGGA(8) System Manager's Manual WATCHQUAGGA(8)

watchquagga - a program to monitor the status of quagga daemons

watchquagga [option...] daemon...
watchquagga -h | -v

watchquagga is a watchdog program that monitors the status of supplied quagga daemons and tries to restart them in case they become unresponsive or shut down.

To determine whether a daemon is running, it tries to connect to the daemon's VTY UNIX stream socket, and send echo commands to ensure the daemon responds. When the daemon crashes, EOF is received from the socket, so that watchquagga can react immediately.

This program can run in one of the following 5 modes:

In this mode, the program serves as a monitor and reports status changes.
Example usage: watchquagga -d zebra ospfd bgpd
In this mode, whenever a daemon hangs or crashes, the given command is used to restart all watched daemons.
Example usage: watchquagga -dz \
-R '/sbin/service zebra restart; /sbin/service ospfd restart' \
zebra ospfd
In this mode, whenever a single daemon hangs or crashes, the given command is used to restart this daemon only.
Example usage: watchquagga -dz -r '/sbin/service %s restart' \
zebra ospfd bgpd
In this mode, whenever a single daemon hangs or crashes, the given command is used to restart this daemon only. The only exception is the zebra daemon; in this case, the following steps are taken: (1) all other daemons are stopped, (2) zebra is restarted, and (3) other daemons are started again.
Example usage: watchquagga -adz -r '/sbin/service %s restart' \
-s '/sbin/service %s start' \
-k '/sbin/service %s stop' zebra ospfd bgpd
In this mode, whenever a single daemon hangs or crashes, the following steps are taken: (1) all other daemons are stopped, (2) zebra is restarted, and (3) other daemons are started again.
Example usage: watchquagga -Adz -r '/sbin/service %s restart' \
-s '/sbin/service %s start' \
-k '/sbin/service %s stop' zebra ospfd bgpd

Important: It is believed that mode 2 (individual daemon restart) is not safe, and mode 3 (phased zebra restart) may not be safe with certain routing daemons.

In order to avoid restarting the daemons in quick succession, you can supply the -m and -M options to set the minimum and maximum delay between the restart commands. The minimum restart delay is recalculated each time a restart is attempted. If the time since the last restart attempt exceeds twice the value of -M, the restart delay is set to the value of -m, otherwise the interval is doubled (but capped at the value of -M).

Run in daemon mode. When supplied, error messages are sent to Syslog instead of standard output (stdout).
Set the VTY socket directory (the default value is "/var/run/quagga").
Do not ping the daemons to test whether they respond. This option is necessary if one or more daemons do not support the echo command.
Set the logging level (the default value is "6"). The value should range from 0 (LOG_EMERG) to 7 (LOG_DEBUG), but higher number can be supplied if extra debugging messages are required.
Set the minimum number of seconds to wait between invocations of the daemon restart commands (the default value is "60").
Set the maximum number of seconds to wait between invocations of the daemon restart commands (the default value is "600").
Set the status polling interval in seconds (the default value is "5").
Set the unresponsiveness timeout in seconds (the default value is "10").
Set the restart (kill) timeout in seconds (the default value is "20"). If any background jobs are still running after this period has elapsed, they will be killed.
Supply a Bourne shell command to restart a single daemon. The command string should contain the '%s' placeholder to be substituted with the daemon name.
Note that -r and -R options are not compatible.
Supply a Bourne shell command to start a single daemon. The command string should contain the '%s' placeholder to be substituted with the daemon name.
Supply a Bourne shell command to stop a single daemon. The command string should contain the '%s' placeholder to be substituted with the daemon name.
When one or more daemons are shut down, try to restart them using the Bourne shell command supplied on the command line.
Note that -r and -R options are not compatible.
When a daemon is in an unresponsive state, treat it as being shut down for the restart purposes.
When zebra hangs or crashes, restart all daemons taking the following steps: (1) stop all other daemons, (2) restart zebra, and (3) start other daemons again.
Note that this option also requires -r, -s, and -k options to be specified.
When any daemon (i.e., not just zebra) hangs or crashes, restart all daemons taking the following steps: (1) stop all other daemons, (2) restart zebra, and (3) start other daemons again.
Note that this option also requires -r, -s, and -k options to be specified.
Set the process identifier filename (the default value is "/var/run/quagga/watchquagga.pid").
When the supplied string is found in any of the command line option arguments (i.e., -r, -s, -k, or -R), replace it with a space.
This is an ugly hack to circumvent problems with passing the command line arguments containing embedded spaces.
Display the version information and exit.
Display the usage information and exit.

zebra(8), bgpd(8), isisd(8), ospfd(8), ospf6d(8), ripd(8), ripngd(8)

See the project homepage at http://www.quagga.net/.

Copyright 2004 Andrew J. Schorr

July 2010