NAME

MooseX::Nagios::Status - parse the Nagios status.dat file

SYNOPSIS

use MooseX::Nagios::Status;

my $status = MooseX::Nagios::Status->new(
        filename => "/var/cache/nagios3/status.dat",
        );

# set 'block_handler' if you want events for each block
$status->parse_file;

# iterate over the blocks in the status file
for my $blocks ( $status->get_blocks("servicedowntime") ) {
        # these are hashrefs.
}

DESCRIPTION

This is a module which provides relatively fast and light-weight access to the nagios status file. In reality the memory used by the module is about 4 times the size of the actual status file on 64-bit systems due to pointer sizes and memory fragmentation issues.

Currently the interface is very raw; a higher-level interface with knowledge about what is being parsed will be implemented as needs/tuits arise (patches/pull requests most welcome!).