NAME

Data::Collector::App - An application implementation for Data::Collector

Using this implementation, one can write an application.

SYNOPSIS

use Data::Collector::App;

my $collector = Data::Collector::App->new_with_options();
$collector->run();

This module integrates all the checks and logics of an application.

It supports getopt command line parsing and optional configuration files.

ATTRIBUTES

configfile

An optional configuration file. If it exists, it is read and used for the value of the rest of these attributes (if they are present in the file).

Default: /etc/data_collector.yaml.

engine

Type of engine (OpenSSH, for example).

engine_args

Any additional arguments the engine might want.

format

Type of serialization (JSON or YAML, for example).

format_args

Any additional arguments the serializer might want.

output

A file to output to. If one is not provided, it will output the serialized result to stdout.

SUBROUTINES/METHODS

new

Creates a new instance of the application interface. This is the clean way of doing it. You would probably prefer new_with_options described below.

new_with_options

The same as new, only it parses command line arguments and takes care of reading a configuration file (if the correct argument for it is provided).

run

Runs the application: starts a new collector, collects the informtion and - depending on the options - either outputs the result to the screen or to a file.

AUTHOR

Sawyer X, <xsawyerx at cpan.org>