NAME Data::Collector - Collect information from multiple sources - like Puppet's Facter VERSION Version 0.01 SYNOPSIS This module collects various information from multiple sources and makes it available in different formats. The main purpose is to facilitate an information gatherning subsystem, much like Puppet's Facter, to be used in system monitoring and administration. However, Data::Collector is much more dynamic. It supports any number of engines and formats. Thus, it can be used for push or pull situations, can work with monitoring systems, integrate with testing suites and otherwise a pretty wide variety of situations. use Data::Collector; my $collector = Data::Collector->new( engine => 'OpenSSH', # default engine_args => { password => read_password('Pass: ') }, format => 'JSON', # default ); my %data = $collector->collect; ... ATTRIBUTES engine(Str) The engine that will be used to collect the information. This is the underlying layer that will gather the information. The default is OpenSSH, you can use any other one you want and even create your own. By implementing your own, you can have fetching done via database queries, online searching, local system commands or even telnet, if that's what you're using. engine_args(HashRef) Any arguments that the engine might need. These are passed to the engine's *new* method. Other than making sure it's a hash reference, the value is not checked and is left for the engine's discression. Data::Collector::Engine::OpenSSH requires a *host*, and allows a *user* and *passwd*. format(Str) This is the format in which you want the information. This will most likely refer to the serializer you want, but it doesn't have to be. For example, you could implement your own *Serializer* which will actually be a module to push all the changes you want in a database you have. The default is JSON. format_args(HashRef) Much like *engine_args*, you can supply any additional arguments that will reach the serializer's *new* method. data(HashRef) While (and post) collecting, this attribute contains all the information [being] gathered. It is this data that is sent to the serializer in order to do whatever it wants with it. engine_object(Object) This attributes holds the engine object. This should probably be left for either testing or advanced usage. Please refrain from playing with it if you're unsure how it works. collected(Bool) This is boolean attribute to indicate whether or not a collection has taken place. When running a collection twice, you will without a doubt trigger the registry safe mechanism by trying to register every Info module again. In order to provide a proper error msg indicting this, the "collected" attribute is marked after a collection. If you clean the registry properly (using Data::Collector::Info's "clear_registry"), it will also clean up this boolean. SUBROUTINES/METHODS collect The main function of Data::Collector. It runs all the information collecting modules. When it is done, it runs the *serialize* method in order to serialize the information fetched. serialize Loads the serializer (according to the *format* selected) and asks it to serialize the data it collected. This method can be run manually as well, but it is automatically run when you run *collect*. clear_registry Clears the information registry. The registry keeps all the keys of different information modules. The registry makes sure information modules don't step on each other. However, this can prevent you from running collect more than once since it will try to reregister all the information modules. This method clears the registry and clears out the "collected" boolean, allowing you to run *collect* again. AUTHOR Sawyer X, "" BUGS Please report any bugs or feature requests to "bug-data-collector at rt.cpan.org", or through the web interface at . I will be notified, and then you'll automatically be notified of progress on your bug as I make changes. SUPPORT You can find documentation for this module with the perldoc command. perldoc Data::Collector You can also look for information at: * RT: CPAN's request tracker * AnnoCPAN: Annotated CPAN documentation * CPAN Ratings * Search CPAN ACKNOWLEDGEMENTS LICENSE AND COPYRIGHT Copyright 2010 Sawyer X. 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.