Elive
view release on metacpan or search on metacpan
script/elive_lint_config view on Meta::CPAN
#!/usr/bin/perl
package Elive::script::elive_lint_config;
use warnings; use strict;
use Getopt::Long;
use XML::Simple;
use Elive::Connection::SDK;
use Pod::Usage;
=head1 NAME
elive_lint_config - Elluminate Live! Manager (ELM) configuration file checker
=head1 SYNOPSIS
% cd /opt/ElluminateLive/manager/tomcat/webapps/mysite
% elive_lint_config WEB-INF/resources/configuration.xml
=head1 DESCRIPTION
This script can be run on Elluminate Live server site configuration files
to perform some rough checks on the basic setup.
In particular, some command adapter definitions may be missing. This seems to
depend on the sites vintage, manual edits, and the general upgrade history.
It may be useful to rerun this script after upgrading either Elluminate Live,
or creating new site instances.
=head1 BUGS AND LIMITATIONS
Missing commands seemed to be more of a problem on older versions of Elluminate
Live! up to about 9.5 (ELM 3.0). So this script is more likely to be of benefit
for older versions of Elluminate Live!.
=head1 SEE ALSO
perldoc Elive
http://search.cpan.org/dist/Elive
=cut
main(@ARGV) unless caller;
sub main {
local(@ARGV) = @_;
my $help;
(GetOptions(
'help|?' => \$help,
)
&& (($help && pod2usage(0)) || (my $config_file = shift @ARGV))
&& (!@ARGV))
|| pod2usage(2);
print "Elive ${Elive::VERSION} - Elluminate Live! configuration checker\n";
print "Checking: $config_file\n";
my %required_commands = %{ Elive::Connection::SDK->known_commands };
my %found;
my $config = XMLin($config_file,
KeepRoot => 1,
ForceArray => 1,
);
my @errors;
*STDERR->autoflush();
#
# check and report on ldap status
#
if (my @daos = _get_elems($config, qw/elm daofactory dao/)) {
my ($ldap_dao) = grep {
my ($class) =_get_elems($_, 'class');
$class =~ m{ldapdao}i;
} @daos;
if ($ldap_dao) {
print "Note: using LDAP for user management:\n\n";
my @arguments = _get_elems($ldap_dao, 'argument');
foreach my $argument (sort {$a->{name}[0] cmp $b->{name}[0]} @arguments) {
my $name = $argument->{name}[0];
my $value = $argument->{value}[0];
( run in 0.494 second using v1.01-cache-2.11-cpan-39bf76dae61 )