++ed by:
KEEDI

1 PAUSE user(s)

Sven Nierlein
and 1 contributors

NAME

Monitoring::Livestatus::Class::Lite - Object-Oriented interface for Monitoring::Livestatus

DESCRIPTION

This module is an object-oriented interface for Monitoring::Livestatus. Just like Monitoring::Livestatus::Class but without Moose.

SYNOPSIS

    use Monitoring::Livestatus::Class::Lite;

    my $class = Monitoring::Livestatus::Class::Lite->new(
        peer => '/var/lib/nagios3/rw/livestatus.sock'
    );

    my $hosts = $class->table('hosts');
    my @data = $hosts->columns('display_name')->filter(
        { display_name => { '-or' => [qw/test_host_47 test_router_3/] } }
    )->hashref_array();
    print Dumper \@data;

ATTRIBUTES

peer

Connection point to the livestatus addon. This can be a unix domain or tcp socket.

Socket

    my $class = Monitoring::Livestatus::Class->new(
        peer => '/var/lib/nagios3/rw/livestatus.sock'
    );

TCP Connection

    my $class = Monitoring::Livestatus::Class->new(
        peer => '192.168.1.1:2134'
    );

ENVIRONMENT VARIABLES

MONITORING_LIVESTATUS_CLASS_TRACE

Print tracer output from this object.

MONITORING_LIVESTATUS_CLASS_TEST_PEER

Set peer for live tests.

METHODS

new

    new($options)

create new Class module

table

    table($tablename)

return instance for this table

columns

    columns($columns)

list of columns to fetch

options

    options($options)

set query options

filter

    filter($filter)

filter result set

stats

    stats($statsfilter)

set stats filter

hashref_pk

    hashref_pk($key)

return result as hash ref by key

hashref_array

    hashref_array()

return result as array

REPOSITORY

    Git: http://github.com/sni/Monitoring-Livestatus-Class-Lite

AUTHOR

Sven Nierlein, <nierlein at cpan.org>

Robert Bohne, <rbo at cpan.org>

COPYRIGHT & LICENSE

Copyright 2013 Sven Nierlein.

This program is free software; you can redistribute it and/or modify it under the terms of either: the GNU General Public License as published by the Free Software Foundation; or the Artistic License.

See http://dev.perl.org/licenses/ for more information.