This document describes version 0.8 beta of check_csl, released March 17, 2006.
check_csl.pl option=value [switch(es)] Available options are: -f,--file Configuration file name - required; -t,--timeout Plug-in timeout in seconds; Available switches are: -url Provide instructions URL -V,--version Plug-in version; -v,--verbose Verbosity level (up to 3); -h Usage help; --help Manual help.
check_csl runs necessary checks and according to defined conditions,
interprets results and returns service level - OK
, Warning
or
Critical
.
Calculation conditions are written to configuration file in form of formula. Also information about checks, executed by plug-in, is included in same configuration file. It is also possible to specify custom plug-in runtime timeout and desirable verbosity level.
Configuration file consists of three sections: Instruction section,formula
section, according which the final result will be calculated, and checks
description section, where checks executables are written. Comments, beginning
with comment sign #
are allowed.
Instructions section is only required when -url
switch is enabled. This section
must begin whith first uncommented configuration file line. The URL with instructions
will be given with WARNING
and CRITICAL
output. The sections contains one
line with URL and short URL descritpion (not required), separated by white
space. If no -url
switch specified, this line MUST be commented.
If no -url
switch specified,Formula section must begin from first uncommented
configuration file line, else, the section must begin with second uncommented file
line. Formula contains expression, which may consist of variables, operators and
parentheses. Variable keeps state of a particular check, operators describe
the way results will be interpreted, and parentheses change the expression
execution priority.
Check variable keeps calculated check's state. Every different check must have
one and only variable. Information about what check variable is related to is
kept in Check's description section. Name of the variable must contain only
``word'' symbols (alphanumeric or _
), no white spaces are allowed. Names are
case-sensitive. Variables are separated between each other with operator sign
or parentheses too. Variables keep OK
, Warning
or Critical
values.
Within calculations two types of operators are used: logical OR marked
with +
sign and logical AND marked with *
sign. logical AND operator
has higher priority level than logical OR operator. Execution priority may be
changed with parentheses.
If expression contains two variables and operator sign, the calculated result would be:
1 var's value: OK OK OK Warning Warning Critical 2 var's value: OK Warning Critical Warning Critical Critical
Result of "+": OK Warning Warning Warning Warning Critical Result of "*": OK Warning Critical Warning Critical Critical
Parentheses change the order of operations. Covered expression will be evaluated first. If there are nested parentheses, the expression covered with inner parentheses is evaluated first. Overall:
If expression has parentheses, the covered expression is evaluated first.
Result of logical AND is calculated.
Result of logical OR is calculated.
In the Check's description section the check's variable name, check's full path to the executable, and short description (not required), are written. This section must begin with first uncommented line after the Formula section.
Every check variable is written on the separate line. Requirements for the variable names are written in Variables section.
After the variable's name and equation sign =
follows the path to check's
file and its arguments. Nagios must have proper permissions to execute check.
Since availability level calculations may include same check's names with
different arguments, the use of check's file names for short description is
not convenient. Also, using the variable's name for short check description
may not be convenient either. Therefore explicit short check description is
allowed after the exclamation mark !
. It is possible to specify distinct
variable name or include a short check description.
################################################################################### # # # Start of Instrucrions URL section # http://www.google.com instructions # # # End of Instructions URL section # # (Comment this section if no "-url" swith will be used) # ################################################################################### # # # Start of Formula's section # (a+b)*host3 # # # End of Formula's section # ################################################################################### # # # Start of Check's Description section # # # a=/usr/share/nagios/plugins/check_ping -H google.lt -w 100,10%% -c 200,20%% !google b=/usr/share/nagios/plugins/check_ping -H cisco.com -w 150,30%% -c 400,80%% !cisco host3=/usr/share/nagios/plugins/check_ping -H 192.168.0.1 -w 30,5%% -c 50,50%% # # # End of Check's Description section # # # # The expression above shows, that the availability level can be achieved if right# # host3 availability level and one of the google or cisco availability levels # # condition met. # ###################################################################################
All plug-ins have limited runtime, and the default timeout value is specified
in the Nagios configuration file. It is possible to specify explicit timeout
value in seconds with option --timeout
. Since every check is run in separate
thread, when plug-in timeouts because of timeouted check, it detaches all
threads, leaving them work by their own until they're done, and exits with
state UNKNOWN
. This feature is highly experimental.
If this switch is enabled, with WARNING
or CRITICAL
output the additional
HTML coded URL will be given. The page, URL is pointing to, should contain some
instructions for the contact groups. The URL and short description must be written
in configuration file, that plug-in could return
<a href="url">short_description</a>
.
With default verbosity level plug-in produces single line output: Ok
,
Warning
or Critical
.
With first verbose level plug-in returns single line output with additional
information: short check's description, which returned state Warning
or
Critical
.
With second verbose level plug-in produces multi line output,
specifying on each separate line which checks returned state Warning
and
Critical
and what arguments were they called with.
If plug-in is run under third verbosity level, it generates multi line output, additionally including check's generated output.
Jelena Osadciaja (elenute AT gmail DOT com)
check_csl is licensed under the terms of the GNU General Public License Version 2 as published by the Free Software Foundation.
Like Nagios itself, check_csl is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE WARRANTY OF DESIGN, MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE.