NAME

Thruk::Utils::CLI - Utilities Collection for CLI Tool

DESCRIPTION

Utilities Collection for CLI scripting with Thruk. Allows you to access internal structures and change config information.

METHODS

new

    new([ $options ])

 $options = {
    verbose => 0-4, # be more verbose
 }

create CLI tool object

get_c

    get_c()

return Thruk::Context context object

BACKEND CONNECTION POOL

The Backend Connection Pool can be uses for own querys against all connected backends in Thruk.

get_db

    get_db()

Return connection pool as a Thruk::Backend::Manager object.

CONFIG TOOL - OBJECT CONFIGURATION

These methods will only be available if you have the config tool plugin enabled and if you set core config items to access the core objects config.

get_object_db

    get_object_db()

Return config database as a Monitoring::Config object.

store_objects

    store_objects()

Store changed objects. Changes will be stashed into Thruks internal object cache and can then be saved, reviewed or discarded.

request_url

    request_url($c, $url, [$cookies], [$method], [$postdata], [$headers], [$insecure])

returns requested url as string. In list context returns ($code, $result)

load_module

    load_module($module)

load given module and returns true on success

from_local

    $self->from_local($c, $options)

main entry point for cli commands from the terminal

from_fcgi

    from_fcgi($c, $string)

main entry point for cli commands over http(s).

get_submodule_help

    get_submodule_help($module, [$data])

returns help extracted from pod for given module

read_stdin_password

    read_stdin_password()

read password from stdin

EXAMPLES

there are some cli scripting examples in the examples subfolder of the source package.