ASNMTAP

 view release on metacpan or  search on metacpan

applications/collector-test.pl  view on Meta::CPAN

#!/usr/bin/env perl
# ----------------------------------------------------------------------------------------------------------
# © Copyright 2003-2011 Alex Peeters [alex.peeters@citap.be]
# ----------------------------------------------------------------------------------------------------------
# 2011/mm/dd, v3.002.003, collector-test.pl for ASNMTAP::Asnmtap::Applications::Collector
# ----------------------------------------------------------------------------------------------------------

use strict;
use warnings;           # Must be used in test mode only. This reduces a little process speed
#use diagnostics;       # Must be used in test mode only. This reduces a lot of process speed

# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

BEGIN { if ( $ENV{ASNMTAP_PERL5LIB} ) { eval 'use lib ( "$ENV{ASNMTAP_PERL5LIB}" )'; } }

# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

use DBI;
use File::stat;
use Time::Local;
use Getopt::Long;
use Date::Calc qw(Delta_DHMS);

# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

use ASNMTAP::Time v3.002.003;
use ASNMTAP::Time qw(&get_datetimeSignal &get_csvfiledate &get_csvfiletime &get_logfiledate &get_datetime &get_timeslot);

use ASNMTAP::Asnmtap::Applications::Collector v3.002.003;
use ASNMTAP::Asnmtap::Applications::Collector qw(:APPLICATIONS :COLLECTOR :DBCOLLECTOR);

# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

use lib ( "$CHARTDIRECTORLIB" );
use perlchartdir;

# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

use vars qw($opt_H  $opt_M $opt_C $opt_W $opt_A $opt_N $opt_s $opt_S $opt_D $opt_V $opt_h $PROGNAME);

# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

$PROGNAME       = "collector.pl";
my $prgtext     = "Collector for the '$APPLICATION'";
my $version     = do { my @r = (q$Revision: 3.002.003$ =~ /\d+/g); sprintf "%d."."%03d" x $#r, @r }; # must be all on one line or MakeMaker will get confused.

# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

my $status      = 'N';                                          # default
my $dumphttp    = 'N';                                          # default
my $debug       = 'F';                                          # default
my $logging     = '<NIHIL>';                                    # default
my $httpdump    = '<NIHIL>';                                    # default
my $lockMySQL   = 0;                                            # default
my $alarm       = 5;                                            # default 5

my $perfParseMethode = 'PULP';                           # 'AIP', default

# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

my $boolean_screenDebug = 0;									# default
my $boolean_debug_all   = 0;									# default
my $boolean_debug_NOK   = 0;									# default

# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

my $boolean_loopQuit    = 0;

my ($directory, $action, $dproc, $dcron);
my ($tmin, $thour, $tmday, $tmon, $twday, $tinterval, $tcommand);

# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

sub print_help ();
sub print_usage ();

Getopt::Long::Configure('bundling');

GetOptions (
  "H=s" => \$opt_H, "hostname=s"      => \$opt_H,
  "M=s" => \$opt_M, "mode=s"          => \$opt_M,
  "C=s" => \$opt_C, "collectorlist=s" => \$opt_C,
  "W:s" => \$opt_W, "screenDebug:s"   => \$opt_W,
  "A:s" => \$opt_A, "allDebug:s"      => \$opt_A,
  "N:s" => \$opt_N, "nokDebug:s"      => \$opt_N,
  "s:s" => \$opt_s, "dumphttp:s"      => \$opt_s,
  "S:s" => \$opt_S, "status:s"        => \$opt_S,
  "D:s" => \$opt_D, "debug:s"         => \$opt_D,
  "V"   => \$opt_V, "version"         => \$opt_V,
  "h"   => \$opt_h, "help"            => \$opt_h
);

if ($opt_V) { print_revision($PROGNAME, $version); exit $ERRORS{OK}; }
if ($opt_h) { print_help(); exit $ERRORS{OK}; }



( run in 2.419 seconds using v1.01-cache-2.11-cpan-39bf76dae61 )