Sébastien Aperghis-Tramoni > RackMan-1.18 > racktables-check

Download:
RackMan-1.18.tar.gz

Annotate this POD

CPAN RT

Open  1
View/Report Bugs
Source  

NAME ^

racktables-check - Perform various consistency checks on RackTables objects

SYNOPSIS ^

    racktables-check [--config /etc/rack.conf] ...
    racktables-check { --help | --man | --version }

OPTIONS ^

Program options

-c, --config path

Specify the path to the configuration file. Default to /usr/local/etc/rack.conf

-F, --filter list of tokens

Specify a comma-separated list of tokens, defining tags and attribute values. This option overrides the [cfengine-tags]/filter config parameter. See the corresponding documentation for more details.

-t, --format json|yaml

Specify the format for printing or storing the results. Available formats are json and yaml. Default is yaml.

-o, --output path

Specify the file to store the results. If none is specified, the results are printed on standard output.

-v, --verbose

Run the program in verbose mode.

Help options

-h, --help

Print a short usage description, then exit.

--man

Print the manual page of the program, then exit.

-V, --version

Print the program name and version, then exit.

Arguments

The rest of the argument, if any, are used as device names to perform the checks upon. If none is given, process all known devices (minus the filter).

DESCRIPTION ^

This program is a small consistency checking engine for RackTables objects. You can control what to check and how by defining rules in the configuration file.

CONFIGURATION ^

racktables-check's configuration is stored in rack(1)'s configuration, with the following additional definitions.

Section [racktables-check]

RULES SYNTAX ^

The general syntax of a rule is:

    [selector] property-name operator operand

The property-name is the only mandatory part. It defines the RackObject property (in a very broad sense of the term) to check. Valid properties are:

When a property returns a list of values, the rule simply is applied to each value. In case of failure, the value is indicated in the message.

The selector makes the rule only check objects corresponding to the given criterion, written as [property-name=value]. valid properties are the same as in the main part of the rule. Multiple values can be given by separating them with a pipe (|).

For example, [type=Server] selects only the servers, [type=PDU|Switch] selects both PDUs and switches. [attr:Use=prod] selects objects with the attribute Use set to prod.

The operator and operand defines the check operation. If none is given, the property is checked to have a defined value. Valid operators are:

Note: To keep the code simple, all names and values in the rules are case sensitive, and must match the way they are entered in RackTables.

EXAMPLES ^

This set of rules makes sure that most network properties of servers are correctly defined. It only assumes that servers have a FQDN attribute which contains, obviously, their FQDN:

    [racktables-check]
    enforce_interface_match = 1
    rule = [type=Server] attr:FQDN %check_dns
    rule = [type=Server] gateway
    rule = [type=Server] addresses
    rule = [type=Server] interfaces ~ /(bce|bge|em|eth|fxp|lagg|re|vlan|xl)\d+/

FILTER SYNTAX ^

A filter is a comma-separated list of tokens, defining tags and attribute values used as criteria to determine which device to keep. The general syntax is:

    token, token, ...

with no arbitrary limits on the number of tokens. The syntax of a token works like this:

Examples

AUTHOR ^

Sebastien Aperghis-Tramoni (sebastien@aperghis.net)

syntax highlighting: