summaryrefslogtreecommitdiffabout
authorSergey Poznyakoff <gray@gnu.org.ua>2012-03-01 17:29:35 (GMT)
committer Sergey Poznyakoff <gray@gnu.org.ua>2012-03-01 17:29:35 (GMT)
commit04cffee0dcc1b83cd851bd105115959fa8182b45 (patch) (side-by-side diff)
tree5690badfb10fbfd15122bd541482fed13b7a66dc
parent83d7c2e986bb88601dd820e5da1ac4edb92991cd (diff)
downloadslb-04cffee0dcc1b83cd851bd105115959fa8182b45.tar.gz
slb-04cffee0dcc1b83cd851bd105115959fa8182b45.tar.bz2
Update docs.
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--doc/config.texi76
1 files changed, 72 insertions, 4 deletions
diff --git a/doc/config.texi b/doc/config.texi
index 12c9525..b4a5b24 100644
--- a/doc/config.texi
+++ b/doc/config.texi
@@ -1091,9 +1091,18 @@ Defines a macro @var{name} to expand to @var{expansion}. Macros allow
to customize output formats on a per-server basis. @xref{macro}.
@end deffn
-@deffn {Config: server} assert "oid op pattern"
-Ensures that the value of SNMP variable @var{oid} matches
-@var{pattern}. The type of match is given by the @var{op} part.
+@deffn {Config: server} assert "@var{oid} @var{op} @var{pattern}" @{ ... @}
+@example
+assert "@var{oid} @var{op} @var{pattern}" @{
+ action @var{code};
+ message @var{text};
+@}
+@end example
+
+This statement ensures that the value of @var{oid} matches
+@var{pattern} and performs a specified action if not.
+
+The type of match is given by the @var{op} part.
The following @var{op} values indicate string comparisons:
@table @asis
@@ -1121,8 +1130,67 @@ A @samp{!} appearing before @var{op} reverses its meaning.
The following @var{op} codes specify numeric comparisons:
@samp{=}, @samp{!=}, @samp{<}, @samp{<=}, @samp{>}, @samp{>=}.
-If the assertion fails, the server is excluded from the load table.
+A special @var{pattern} value @samp{-prev} stands for the value of
+this @var{oid} collected previously.
+
+Both @code{action} and @code{message} are optional, but at least one
+of them must be present:
+
+@deffn {Config: assert} action code
+Specifies action to take when the assertion fails. Valid @var{code}
+values are:
+
+@table @asis
+@item abort
+Abort calculations for this server and excluded it from the load table
+for this round. Use this statement to ensure that a variable used in
+the computation refers to a correct entity. @xref{assertion abort
+example}, below.
+
+@item warn
+Issue a warning message and continue. Use this to indicate some minor
+exceptions that the admin should know about.
+
+@item reinit
+Re-initialize SNMP information for this server. This means, in
+particular, collecting the necessary subtrees and resolving indexed
+variables (@pxref{table}). This action is often used in conjunction
+with the @samp{-prev} value. For example:
+
+@example
+server "srv1" @{
+ @dots{}
+ assert "SNMPv2-MIB::sysUpTime.0 >= -prev" @{
+ action reinit;
+ @}
+@}
+@end example
+
+This statement reinitializes the server @samp{srv1} if its uptime
+becomes less than the previously registered value. That can happen
+either if the server itself has been rebooted, or its SNMP subsystem
+has been restarted.
+@end table
+@end deffn
+
+@deffn {Config: assert} message text
+Specifies the text to be shown in the log if the assertion fails. If
+not supplied, the argument to the @code{assert} statement is used
+instead.
+@end deffn
+@end deffn
+
+@deffn {Config: server} assert "@var{oid} @var{op} @var{pattern}"
+This is a simplifier form of the @code{assert} statement. It is
+equivalent to:
+
+@example
+assert "@var{oid} @var{op} @var{pattern}" @{
+ action abort;
+@}
+@end example
+@anchor{assertion abort example}
Use this statement to ensure that a variable used in the computation
refers to a correct entity. For example, if your expression refers to
@samp{IF-MIB::ifInOctets.3} (number of input octets on network

Return to:

Send suggestions and report system problems to the System administrator.