1WATCHQUAGGA(8) System Manager's Manual WATCHQUAGGA(8)
2
3
4
6 watchquagga - a program to monitor the status of quagga daemons
7
9 watchquagga [option...] daemon...
10 watchquagga -h | -v
11
13 watchquagga is a watchdog program that monitors the status of supplied
14 quagga daemons and tries to restart them in case they become unrespon‐
15 sive or shut down.
16
17 To determine whether a daemon is running, it tries to connect to the
18 daemon's VTY UNIX stream socket, and send echo commands to ensure the
19 daemon responds. When the daemon crashes, EOF is received from the
20 socket, so that watchquagga can react immediately.
21
22 This program can run in one of the following 5 modes:
23
24 Mode 0: monitor
25 In this mode, the program serves as a monitor and reports status
26 changes.
27
28 Example usage: watchquagga -d zebra ospfd bgpd
29
30 Mode 1: global restart
31 In this mode, whenever a daemon hangs or crashes, the given com‐
32 mand is used to restart all watched daemons.
33
34 Example usage: watchquagga -dz \
35 -R '/sbin/service zebra restart; /sbin/service ospfd restart' \
36 zebra ospfd
37
38 Mode 2: individual daemon restart
39 In this mode, whenever a single daemon hangs or crashes, the
40 given command is used to restart this daemon only.
41
42 Example usage: watchquagga -dz -r '/sbin/service %s restart' \
43 zebra ospfd bgpd
44
45 Mode 3: phased zebra restart
46 In this mode, whenever a single daemon hangs or crashes, the
47 given command is used to restart this daemon only. The only
48 exception is the zebra daemon; in this case, the following steps
49 are taken: (1) all other daemons are stopped, (2) zebra is
50 restarted, and (3) other daemons are started again.
51
52 Example usage: watchquagga -adz -r '/sbin/service %s restart' \
53 -s '/sbin/service %s start' \
54 -k '/sbin/service %s stop' zebra ospfd bgpd
55
56 Mode 4: phased global restart for any failure
57 In this mode, whenever a single daemon hangs or crashes, the
58 following steps are taken: (1) all other daemons are stopped,
59 (2) zebra is restarted, and (3) other daemons are started again.
60
61 Example usage: watchquagga -Adz -r '/sbin/service %s restart' \
62 -s '/sbin/service %s start' \
63 -k '/sbin/service %s stop' zebra ospfd bgpd
64
65 Important: It is believed that mode 2 (individual daemon restart) is
66 not safe, and mode 3 (phased zebra restart) may not be safe with cer‐
67 tain routing daemons.
68
69 In order to avoid restarting the daemons in quick succession, you can
70 supply the -m and -M options to set the minimum and maximum delay
71 between the restart commands. The minimum restart delay is recalcu‐
72 lated each time a restart is attempted. If the time since the last
73 restart attempt exceeds twice the value of -M, the restart delay is set
74 to the value of -m, otherwise the interval is doubled (but capped at
75 the value of -M).
76
78 -d, --daemon
79 Run in daemon mode. When supplied, error messages are sent to
80 Syslog instead of standard output (stdout).
81
82 -S directory, --statedir directory
83 Set the VTY socket directory (the default value is
84 "/var/run/quagga").
85
86 -e, --no-echo
87 Do not ping the daemons to test whether they respond. This
88 option is necessary if one or more daemons do not support the
89 echo command.
90
91 -l level, --loglevel level
92 Set the logging level (the default value is "6"). The value
93 should range from 0 (LOG_EMERG) to 7 (LOG_DEBUG), but higher
94 number can be supplied if extra debugging messages are required.
95
96 -m number, --min-restart-interval number
97 Set the minimum number of seconds to wait between invocations of
98 the daemon restart commands (the default value is "60").
99
100 -M number, --max-restart-interval number
101 Set the maximum number of seconds to wait between invocations of
102 the daemon restart commands (the default value is "600").
103
104 -i number, --interval number
105 Set the status polling interval in seconds (the default value is
106 "5").
107
108 -t number, --timeout number
109 Set the unresponsiveness timeout in seconds (the default value
110 is "10").
111
112 -T number, --restart-timeout number
113 Set the restart (kill) timeout in seconds (the default value is
114 "20"). If any background jobs are still running after this
115 period has elapsed, they will be killed.
116
117 -r command, --restart command
118 Supply a Bourne shell command to restart a single daemon. The
119 command string should contain the '%s' placeholder to be substi‐
120 tuted with the daemon name.
121
122 Note that -r and -R options are not compatible.
123
124 -s command, --start-command command
125 Supply a Bourne shell command to start a single daemon. The com‐
126 mand string should contain the '%s' placeholder to be substi‐
127 tuted with the daemon name.
128
129 -k command, --kill-command command
130 Supply a Bourne shell command to stop a single daemon. The com‐
131 mand string should contain the '%s' placeholder to be substi‐
132 tuted with the daemon name.
133
134 -R, --restart-all
135 When one or more daemons are shut down, try to restart them
136 using the Bourne shell command supplied on the command line.
137
138 Note that -r and -R options are not compatible.
139
140 -z, --unresponsive-restart
141 When a daemon is in an unresponsive state, treat it as being
142 shut down for the restart purposes.
143
144 -a, --all-restart
145 When zebra hangs or crashes, restart all daemons taking the fol‐
146 lowing steps: (1) stop all other daemons, (2) restart zebra, and
147 (3) start other daemons again.
148
149 Note that this option also requires -r, -s, and -k options to be
150 specified.
151
152 -A, --always-all-restart
153 When any daemon (i.e., not just zebra) hangs or crashes, restart
154 all daemons taking the following steps: (1) stop all other dae‐
155 mons, (2) restart zebra, and (3) start other daemons again.
156
157 Note that this option also requires -r, -s, and -k options to be
158 specified.
159
160 -p filename, --pid-file filename
161 Set the process identifier filename (the default value is
162 "/var/run/quagga/watchquagga.pid").
163
164 -b string, --blank-string string
165 When the supplied string is found in any of the command line
166 option arguments (i.e., -r, -s, -k, or -R), replace it with a
167 space.
168
169 This is an ugly hack to circumvent problems with passing the
170 command line arguments containing embedded spaces.
171
172 -v, --version
173 Display the version information and exit.
174
175 -h, --help
176 Display the usage information and exit.
177
179 bgpd(8), ripd(8), ripngd(8), ospfd(8), ospf6d(8), isisd(8).
180
181 See the project homepage at <http://www.quagga.net/>.
182
184 Copyright 2004 Andrew J. Schorr
185
186
187
188 July 2010 WATCHQUAGGA(8)