size=2 width="100%" align=center>

VERSION

This document describes version 0.7beta of check_csl, released March 16, 2006.


SYNOPSIS

 
    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:
                -V,--version    Plug-in version;
                -v,--verbose    Verbosity level (up to 3);
                -h              Usage help;
                   --help       Manual help.

DESCRIPTION

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

Configuration file consists of two sections: 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.

Formula Section

Formula section must begin from first uncommented configuration 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.

Variables

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.

Operators

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

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.

Checks Section

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.

Check's variable

Every check variable is written on the separate line. Requirements for the variable names are written in Variables section.

Check's executable

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.

Check's description

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.

Example of Configuration File

 
    ###################################################################################
    #                                                                                 #
    #                           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.                                                                  #
    ###################################################################################

Runtime Timeout

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.

Verbose Level

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.


AUTHOR

Jelena Osadciaja ( elenute AT gmail DOT com)


COPYRIGHT AND LICENCE

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.