diff options
author | Sergey Poznyakoff <gray@gnu.org.ua> | 2012-03-01 19:29:35 +0200 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org.ua> | 2012-03-01 19:29:35 +0200 |
commit | 04cffee0dcc1b83cd851bd105115959fa8182b45 (patch) | |
tree | 5690badfb10fbfd15122bd541482fed13b7a66dc | |
parent | 83d7c2e986bb88601dd820e5da1ac4edb92991cd (diff) | |
download | slb-04cffee0dcc1b83cd851bd105115959fa8182b45.tar.gz slb-04cffee0dcc1b83cd851bd105115959fa8182b45.tar.bz2 |
Update docs.
-rw-r--r-- | doc/config.texi | 76 |
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 @@ -1093,5 +1093,14 @@ to customize output formats on a per-server basis. @xref{macro}. -@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: @@ -1123,4 +1132,63 @@ The following @var{op} codes specify numeric comparisons: -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 |