NAME
Data::Collector::App - An application implementation for Data::Collector
VERSION
version 0.15
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.
Using this implementation, one can write an application.
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.
info_args
Any additional arguments the Info module might want.
You generally don't want to play with it, trust me.
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.
BUILD
Subroutine run after initialization. Used to create the info_args
attribute for the main Data::Collector
.
AUTHOR
Sawyer X <xsawyerx@cpan.org>
COPYRIGHT AND LICENSE
This software is copyright (c) 2012 by Sawyer X.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.