ASNMTAP

 view release on metacpan or  search on metacpan

Changes  view on Meta::CPAN

                                   - UPDATE create_weblogic_configuration_for_SNMPTT.pl
							     - /plugins/templates/snmptt/
                                   - UPDATE check_SNMPTT_weblogic.pl
                                   - UPDATE snmptt-bea-weblogic.conf
                                 - UPDATE create_weblogic_configuration_database_with_SNMP-3.000.019.SQL
                                   - PRIMARY KEY + `trapMBeanType_MATCH`
                                 - UPDATE create_weblogic_configuration_database_with_SNMP-3.000.019_mysql-v5.0.x.SQL
                                   - PRIMARY KEY + `trapMBeanType_MATCH`

Version 3.000.018, 2008/07/07, by Alex Peeters.
                               - security update

Version 3.000.017, 2008/06/09, by Alex Peeters with contributions from Yves Van den Hove.
                               Makefile.PL
                               - version update Bundle::DBI:                   1.604
                               - version update CGI:                           3.37
                               - version update CGI::Session:                  4.30
                               - version update CPAN:                          1.9205
                               - version update CPANPLUS:                      0.84
                               - version update Compress::Zlib:                2.010
                               - version update Config::General:               2.38

Changes  view on Meta::CPAN

                               comments.pl
                               - FIX regarding 'Please re-enter entry date/time: Date/Time are into the future!'
                               - FIX regarding 'Please re-enter solved date/time: Date/Time are into the future!'
                               crontab verify disable email when ...
                               - By default cron jobs sends a email to the user account executing the cronjob.
                                 Because this is not needed we put the following command At the end of the cron job line.
                                 '> /dev/null (default)' or '> /dev/null 2>&1'
                               detailedStatisticsReportGenerationAndCompareResponsetimeTrends.pl, generateChart.pl & htmlToPdf.pl
                               - add my $timeperiodID = (defined $cgi->param('timeperiodID')) ? $cgi->param('timeperiodID') : 'none';
                               display.pl
                               - add -c, --creationTime=<YYYY-MM-DD HH:MM:SS>, YYYY-MM-DD HH:MM:SS: year, month, day, hours, minutes and seconds to use instead of the current time when --loop = F
                               - add sort results by status, group, comments and then by time
                               - FIX <\\/embed> added
                               - FIX stop caching sound during refresh when sound off
                               - FIX when downtime into the future, problem with the 'Condended View'
                               - UPDATE replace '$TcommentData =~ s/<br><br>/<br>/g;' with '$TcommentData =~ s/(?:<br>)+/<br>/g;'
                               display.pl and plugins.pl
                               - FIX interval/step must be greather then 0!
                               getArchivedDisplays.pl
                               - NEW Archived Displays
                               generateConfig.pl

Changes  view on Meta::CPAN

                               - replaced 'Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; ASNMTAP; U;' with 'Mozilla/4.7 (compatible; ASNMTAP; U;'
                               - NEW $ENV{HTTPS_VERSION} for v2, v3 and v23
                               ASNMTAP::Asnmtap::Plugins::Nagios
                               - NEW check_nagios-comments-cleanup.pl
                               - NEW EPN (Embedded Perl Nagios) compatible
                               ASNMTAP::Asnmtap::Plugins::NPTest
                               - upgrade van version NPTest v1.11 to v1.13
                               - replace NPTest->testCmd with ASNMTAP::Asnmtap::Plugins::NPTest->testCmd
                               ASNMTAP::Asnmtap::Plugins::SOAP
                               - add $SOAP::Constants::PATCH_HTTP_KEEPALIVE
                               - add ws-security through WSRF::Lite
                               ASNMTAP::Asnmtap::Plugins::WebTransact
                               - based on 'Nagios::WebTransact' v0.14.1 & v0.16 from Stanley Hopcroft [Stanley.Hopcroft@IPAustralia.Gov.AU]
             ATTENTION   -->   asnmtap-3.000.012.sql
                               - NEW table `environment`
                               - add `userPassword` varchar(15) NOT NULL default '' at table reports
                               - remove `reportTitle` varchar(100) NOT NULL default '' from table reports
                               - add `downtimeScheduling` tinyint(1) NOT NULL default '1' and `generatedReports` tinyint(1) NOT NULL default '0' at table users
                               FIX Popup Calendar
                               - replace document.forms[0].endDate with document.forms[1].endDate
                               collector.pl

Changes  view on Meta::CPAN

                               collector.pl & display.pl
                               - update atime and mtime from the PID file every timeslot
                               - email message for started, stopped & reloaded
                               collectorCrontabSchedulingReports.pl & collectorDaemonSchedulingReports.pl
                               - show only the Plugins regarding correspondending server
                               comments.pl & holidayBundleSetDowntimes.pl
                               - Sending email for: Downtime Scheduling
                               detailedStatisticsReportGenerationAndCompareResponsetimeTrends.pl
                               - Problem details: link to the correspondending 'Debug Report' when 'Format Output' equals 'HTML'
                               detailedStatisticsReportGenerationAndCompareResponsetimeTrends.pl, generateChart.pl & trendlineCorrectionReports.pl
                               - replace round(avg(duration), 2) with round(avg(time_to_sec(duration)), 2) because of wrong averages
                               display.pl
                               - possibility for sound on/off
                               - onderdrukking ledige groepen in full view
                               - vermelden op welke probe een test wordt uitgevoerd
                               - onderdrukken niet persistent downtimes in condenced view
                               - mask password for '--dnPass=', used by check_template-ldap.pl
                               - environment icons, exclaim popup window for plugins and comments
                               - 'In Progress'-animated icon replaced with 'In Progress'-static icon for faster display!
                               - de debugrapporten onderaan de view enkel aanklikbaar maken als de file via rsync al aanwezig is op het moment van de display generatie, ter voorkoming van 404 errors.
                               - add console messages: 'No Monitored Applications', 'All Monitored Applications are OK', '..., probably collector/config problems!' & , '..., probably database problems!'

MANIFEST  view on Meta::CPAN

plugins/templates/xml/ServletTestRunner.xml

plugins/templates/ssl/crt/alex-peeters.crt
plugins/templates/ssl/crt/server-ca.crt

plugins/templates/ssl/key/alex-peeters-nopass.key
plugins/templates/ssl/key/alex-peeters.key
plugins/templates/ssl/key/server-ca.key

etc/chatscripts/ASNMTAP
etc/ppp/pap-secrets
etc/ppp/peers/ASNMTAP
etc/ppp/resolv/ASNMTAP

usr/bin/plog                                        plog
usr/bin/poff                                        poff
usr/bin/pon                                         pon

plugins/tools/removeModulePerl.pl
plugins/tools/GrinderCaptureConverter.pl

Makefile.PL  view on Meta::CPAN


# replace `(q$Revision: 3.002.xxx$ =~ /\d+/g)` with `(q$Revision: 3.002.yyy$ =~ /\d+/g)`
# replace `v3.002.xxx;` with `v3.002.yyy;`
# replace `'3.002.xxx'` with `'3.002.yyy'`
# replace ASNMTAP 3.002.xxx postfix; nl-BE; rv:3.002.xxx) Gecko/yyyymmdd with ASNMTAP 3.002.yyy postfix; nl-BE; rv:3.002.yyy) Gecko/2010....

# Upload new release ----------------------------------------------------
# replace 'Latest update: dd month 2011' with 'Latest update: .. ... 2010'
# replace `# 2010/mm/dd, v` with `# 2010/../.., v`

# Module section  - - - - - - - - - - - - - - - - - - - - - - - - - - - -

use Config qw(%Config);
use ExtUtils::MakeMaker qw(WriteMakefile prompt);

my $module  = 'ExtUtils::MakeMaker';
my $version = '6.32';

unless ( eval ( "require $module; Exporter::require_version ( '$module', $version );" ) ) {
  print "\n$module v$version, required for 'perl Makefile.PL' via CPAN\n";
  print "\nperl -MCPAN -e 'install $module'\n\n";

Makefile.PL  view on Meta::CPAN


# $module  = 'ExtUtils::Autoconf';
# $version = '0.02';

# unless ( eval ( "require $module; Exporter::require_version ( '$module', $version );" ) ) {
#   print "\n$module v$version, required for 'perl Makefile.PL' via CPAN\n";
#   print "\nperl -MCPAN -e 'install $module'\n\n";
#   exit;
# }

# Configuration section - - - - - - - - - - - - - - - - - - - - - - - - -

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 $PERL_AUTOINSTALL     = exists $ENV{PERL_AUTOINSTALL}     ? $ENV{PERL_AUTOINSTALL}     : 0;
my $ASNMTAP_APPLICATIONS = exists $ENV{ASNMTAP_APPLICATIONS} ? $ENV{ASNMTAP_APPLICATIONS} : 0;
my $ASNMTAP_PLUGINS      = exists $ENV{ASNMTAP_PLUGINS}      ? $ENV{ASNMTAP_PLUGINS}      : 0;
my $ASNMTAP_UID          = exists $ENV{ASNMTAP_UID}          ? $ENV{ASNMTAP_UID}          : '500';
my $ASNMTAP_GID          = exists $ENV{ASNMTAP_GID}          ? $ENV{ASNMTAP_GID}          : '500';
my $ASNMTAP_PATH         = exists $ENV{ASNMTAP_PATH}         ? $ENV{ASNMTAP_PATH}         : '/opt/asnmtap';
my $ASNMTAP_PROXY        = exists $ENV{ASNMTAP_PROXY}        ? $ENV{ASNMTAP_PROXY}        : '0.0.0.0';

Makefile.PL  view on Meta::CPAN


    [ 'plugins/nagios/templates/xml/*.xml',   'r' ],
    [ 'plugins/nagios/templates/xml/*.xml-*', 'r' ],
   ]
  ],
  [ '*011101', 'IO support',          'ASNMTAP::Asnmtap::Plugins::IO',          { 'ASNMTAP::Asnmtap::Plugins' => '*0011', 'IO' => '1.23' }, 1, [], [] ],
  [ '*001102', 'Mail support',        'ASNMTAP::Asnmtap::Plugins::Mail',        { 'ASNMTAP::Asnmtap::Plugins' => '*0011', 'Date::Calc' => '5.4', 'Email::Simple' => '2.003', 'IO::String' => '1.08', 'Mail::POP3Client' => '2.18', 'Mail::Sendmail' => '0....
  [ '*001103', 'Modem support',       'ASNMTAP::Asnmtap::Plugins::Modem',       { 'ASNMTAP::Asnmtap::Plugins' => '*0011', 'IO' => '1.23', ( $^O eq 'MSWin32' ? ('Win32::SerialPort' => '0.19', 'Win32::API' => '0.41', 'Win32::RASE' => '1.01') : ('Device...
   [
    [ '/etc/chatscripts/ASNMTAP', 'R' ],
    [ '/etc/ppp/pap-secrets',     'R' ],
    [ '/etc/ppp/peers/ASNMTAP',   'R' ],
    [ '/etc/ppp/resolv/ASNMTAP',  'R' ],
    [ '/usr/bin/plog',            'R' ],
    [ '/usr/bin/poff',            'R' ],
    [ '/usr/bin/pon',             'R' ],
   ]
  ],
  [ '*001104', 'SOAP support',        'ASNMTAP::Asnmtap::Plugins::SOAP',        { 'ASNMTAP::Asnmtap::Plugins' => '*0011', 'SOAP::Lite' => '0.710.08', 'WSRF::Lite' => '0.8.2.7', 'DateTime' => '0.37', 'DateTime::Format::Epoch' => '0.10', 'DateTime::For...
  [ '*001105', 'WebTransact support', 'ASNMTAP::Asnmtap::Plugins::WebTransact', { 'ASNMTAP::Asnmtap::Plugins' => '*0011', 'Bundle::LWP' => '1.11', 'CGI' => '3.37', 'Compress::Zlib' => '2.010', 'Crypt::SSLeay' => '0.56', 'Digest::MD5' => '2.36', 'IO::...
  [ '*001106', 'XML support',         'ASNMTAP::Asnmtap::Plugins::XML',         { 'ASNMTAP::Asnmtap::Plugins' => '*0011', 'XML::Parser' => '2.36', 'XML::LibXML' => '1.70', 'XML::Simple' => '2.18' }, 2, [], [] ],

Makefile.PL  view on Meta::CPAN

  [ '', 'LDAP template',              'check_template-ldap.pl',                 { 'Convert::ASN1' => '0.19', 'URI::ldap' => '1.11', 'Digest::MD5' => '2.36', 'XML::Parser' => '2.36', 'Net::LDAP' => '0.34' }, 4, [], [] ],
  [ '', 'MySQL template',             'check_MySQL-database-replication.pl',    { 'Bit::Vector' => '6.3', 'Date::Calc' => '5.4', 'Bundle::DBI' => '1.604', 'Bundle::DBD::mysql' => '4.004', 'DBIx::Log4perl' => '0.18', 'Log::Log4perl' => '1.26' }, 4, []...
  [ '', 'SFTP template',              'check_template-sftp.pl',                 { 'Net::SFTP::Foreign' => '1.61' }, 4, [], [] ]
);

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

my %has_module_cache = ();

# Allow us to suppress all program installation with the -n (library only) option.
# This is for those that don't want to mess with the configuration section of this file.
use Getopt::Std;
use vars qw ( $opt_n );
unless ( getopts ('n') ) { die "Usage: $0 [-n]\n"; }
my $prompt = ( $opt_n ) ? 0 : 1;

unlink ('t/APPLICATIONS_ENABLED')        if ( -e 't/APPLICATIONS_ENABLED' );
unlink ('t/APPLICATIONS_CGI_ENABLED')    if ( -e 't/APPLICATIONS_CGI_ENABLED' );

unlink ('t/PLUGINS_ENABLED')             if ( -e 't/PLUGINS_ENABLED' );
unlink ('t/PLUGINS_NPTEST_ENABLED')      if ( -e 't/PLUGINS_NPTEST_ENABLED' );

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

      unlink ($loggedStatus);
    } else {
      $dumphttpRename = 'UNKNOWN';
      $returnStatus = "$dumphttpRename - $title: $loggedStatus doesn't exist - contact server administrators";
    }
  }

  my ($duration) = $returnStatus =~ m/Trendline=([0-9.]+)s;[0-9.]+;;;$/i;

  if (defined $duration) {
    my ($thour, $tmin, $tsec);
    $thour = int ($duration / 3600);
    $tmin  = int (int ($duration % 3600) / 60);
    $tsec  = int ($duration % 60);
    $duration = sprintf("%02d:%02d:%02d", $thour, $tmin, $tsec);
  } else {
    my ($tyear, $tmonth, $tday, $thour, $tmin, $tsec, @startDateTime, @endDateTime, @diffDateTime);

    ($tyear, $tmonth, $tday) = split(/\//, $startDate);
    ($thour, $tmin, $tsec)   = split(/\:/, $startTime);
    @startDateTime = ($tyear, $tmonth, $tday, $thour, $tmin, $tsec);

    ($tyear, $tmonth, $tday) = split(/\//, $endDate);
    ($thour, $tmin, $tsec)   = split(/\:/, $endTime);
    @endDateTime = ($tyear, $tmonth, $tday, $thour, $tmin, $tsec);

    @diffDateTime = Delta_DHMS(@startDateTime, @endDateTime);
    $duration = sprintf("%02d:%02d:%02d", $diffDateTime[1], $diffDateTime[2], $diffDateTime[3]);
  }

# my ($outputData, $performanceData) = split(/\|/, $returnStatus, 2);
  my $_returnStatus = reverse $returnStatus;
  my ($_outputData, $_performanceData) = reverse split(/\|/, $_returnStatus, 2);
  my $outputData = reverse $_outputData;
  my $performanceData = reverse $_performanceData;

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

  my (@dataOK, @dataCritical, @dataWarning, @dataUnknown, @dataNoTest, @dataOffline, @RRDlabels);
  my ($step, $lastTimeslot, $firstTimeslot, $duration, $startTime, $status, $timeslot, $findString);

  $step          = $interval * 60;
  $lastTimeslot  = timelocal (0, (localtime)[1,2,3,4,5]);
  $firstTimeslot = $lastTimeslot - ($step * ($limitTest));
  $findString    = "select SQL_NO_CACHE duration, startTime, status, timeslot from $SERVERTABLEVENTS force index (uKey) where catalogID = '$catalogID' and uKey = '$uniqueKey' and step <> '0' and (timeslot between '$firstTimeslot' and '$lastTimeslot')...
  print "$findString\n" if ($debug eq 'T');

  # data en labels in array zetten
  my ($counter, $seconden, $ttimeslot);

  for ( $counter = 0; $counter < $limitTest; $counter++) {
    push (@dataOK,       "0");
    push (@dataWarning,  "0");
    push (@dataCritical, "0");
    push (@dataUnknown,  "0");
    push (@dataNoTest,   "0");
    push (@dataOffline,  "0");
    push (@RRDlabels,    " ");
  }

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

    } else {
      $sth->bind_columns( \$duration, \$startTime, \$status, \$timeslot ) or $rv = errorTrapDBIgraphEntry("Cannot sth->bind_columns: $findString", \$logger, $debug);

      unless ( $rv ) {
        $title .= " - Cannot sth->bind_columns";
      } else {
        $counter = 0;
        my $limitTrendline = ($yMarkValue) ? $yMarkValue * 2.5 : 9000;

        while( $sth->fetch() ) {
          $seconden  = int(substr($duration, 6, 2)) + int(substr($duration, 3, 2)*60) + int(substr($duration, 0, 2)*3600);
          $seconden += 0.5 if ($seconden == 0); # correction for to fast testresults
          $ttimeslot = abs((($lastTimeslot - $timeslot) / $step) - $limitTest);

          if ($ttimeslot >= 0) {
            $status = 'UNKNOWN' if ($status eq '<NIHIL>');

      	    if ($status eq 'OK') {
              $dataOK[$ttimeslot] = ($seconden < $limitTrendline) ? $seconden : $limitTrendline;
            } elsif ($status eq 'CRITICAL') {
              $dataCritical[$ttimeslot] = '-5';
            } elsif ($status eq 'WARNING'){
              $dataWarning[$ttimeslot]  = '-5';
            } elsif ($status eq 'UNKNOWN'){
              $dataUnknown[$ttimeslot]  = '-5';
            } elsif ($status eq 'NO TEST') {
              $dataNoTest[$ttimeslot]   = '-5';
            } elsif ($status eq 'OFFLINE') {
              $dataOffline[$ttimeslot]  = '-5';

applications/collector.pl  view on Meta::CPAN

      unlink ($loggedStatus);
    } else {
      $dumphttpRename = 'UNKNOWN';
      $returnStatus = "$dumphttpRename - $title: $loggedStatus doesn't exist - contact server administrators";
    }
  }

  my ($duration) = $returnStatus =~ m/Trendline=([0-9.]+)s;[0-9.]+;;;$/i;

  if (defined $duration) {
    my ($thour, $tmin, $tsec);
    $thour = int ($duration / 3600);
    $tmin  = int (int ($duration % 3600) / 60);
    $tsec  = int ($duration % 60);
    $duration = sprintf("%02d:%02d:%02d", $thour, $tmin, $tsec);
  } else {
    my ($tyear, $tmonth, $tday, $thour, $tmin, $tsec, @startDateTime, @endDateTime, @diffDateTime);

    ($tyear, $tmonth, $tday) = split(/\//, $startDate);
    ($thour, $tmin, $tsec)   = split(/\:/, $startTime);
    @startDateTime = ($tyear, $tmonth, $tday, $thour, $tmin, $tsec);

    ($tyear, $tmonth, $tday) = split(/\//, $endDate);
    ($thour, $tmin, $tsec)   = split(/\:/, $endTime);
    @endDateTime = ($tyear, $tmonth, $tday, $thour, $tmin, $tsec);

    @diffDateTime = Delta_DHMS(@startDateTime, @endDateTime);
    $duration = sprintf("%02d:%02d:%02d", $diffDateTime[1], $diffDateTime[2], $diffDateTime[3]);
  }

# my ($outputData, $performanceData) = split(/\|/, $returnStatus, 2);
  my $_returnStatus = reverse $returnStatus;
  my ($_outputData, $_performanceData) = reverse split(/\|/, $_returnStatus, 2);
  my $outputData = reverse $_outputData;
  my $performanceData = reverse $_performanceData;

applications/collector.pl  view on Meta::CPAN

  my (@dataOK, @dataCritical, @dataWarning, @dataUnknown, @dataNoTest, @dataOffline, @RRDlabels);
  my ($step, $lastTimeslot, $firstTimeslot, $duration, $startTime, $status, $timeslot, $findString);

  $step          = $interval * 60;
  $lastTimeslot  = timelocal (0, (localtime)[1,2,3,4,5]);
  $firstTimeslot = $lastTimeslot - ($step * ($limitTest));
  $findString    = "select SQL_NO_CACHE duration, startTime, status, timeslot from $SERVERTABLEVENTS force index (uKey) where catalogID = '$catalogID' and uKey = '$uniqueKey' and step <> '0' and (timeslot between '$firstTimeslot' and '$lastTimeslot')...
  print "$findString\n" if ($debug eq 'T');

  # data en labels in array zetten
  my ($counter, $seconden, $ttimeslot);

  for ( $counter = 0; $counter < $limitTest; $counter++) {
    push (@dataOK,       "0");
    push (@dataWarning,  "0");
    push (@dataCritical, "0");
    push (@dataUnknown,  "0");
    push (@dataNoTest,   "0");
    push (@dataOffline,  "0");
    push (@RRDlabels,    " ");
  }

applications/collector.pl  view on Meta::CPAN

    } else {
      $sth->bind_columns( \$duration, \$startTime, \$status, \$timeslot ) or $rv = errorTrapDBIgraphEntry("Cannot sth->bind_columns: $findString", \$logger, $debug);

      unless ( $rv ) {
        $title .= " - Cannot sth->bind_columns";
      } else {
        $counter = 0;
        my $limitTrendline = ($yMarkValue) ? $yMarkValue * 2.5 : 9000;

        while( $sth->fetch() ) {
          $seconden  = int(substr($duration, 6, 2)) + int(substr($duration, 3, 2)*60) + int(substr($duration, 0, 2)*3600);
          $seconden += 0.5 if ($seconden == 0); # correction for to fast testresults
          $ttimeslot = abs((($lastTimeslot - $timeslot) / $step) - $limitTest);

          if ($ttimeslot >= 0) {
            $status = 'UNKNOWN' if ($status eq '<NIHIL>');

      	    if ($status eq 'OK') {
              $dataOK[$ttimeslot] = ($seconden < $limitTrendline) ? $seconden : $limitTrendline;
            } elsif ($status eq 'CRITICAL') {
              $dataCritical[$ttimeslot] = '-5';
            } elsif ($status eq 'WARNING'){
              $dataWarning[$ttimeslot]  = '-5';
            } elsif ($status eq 'UNKNOWN'){
              $dataUnknown[$ttimeslot]  = '-5';
            } elsif ($status eq 'NO TEST') {
              $dataNoTest[$ttimeslot]   = '-5';
            } elsif ($status eq 'OFFLINE') {
              $dataOffline[$ttimeslot]  = '-5';

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

  }

  $prevGroep = '';
  my $dstatusMessage;

  my $creationDate;

  if ( defined $creationTime ) {
    my ($date, $time) = split (/ /, $creationTime);
    my ($year, $month, $day) = split (/-/, $date);
    my ($hour, $minute, $seconds) = split (/:/, $time);
    $creationDate = timelocal ( $seconds, $minute, $hour, $day, $month-1, $year-1900 );
    printHtmlHeader( $APPLICATION .' - '. $ENVIRONMENT{$Cenvironment} .' from '. $CATALOGID .' ('. scalar(localtime($creationDate)) .')' );
  } else {
    $creationDate = time();
    printHtmlHeader( $APPLICATION .' - '. $ENVIRONMENT{$Cenvironment} .' from '. $CATALOGID );
  }

  $rv  = 1;
  $dbh = DBI->connect("DBI:mysql:$DATABASE:$serverName:$SERVERPORTREADWRITE", "$SERVERUSERREADWRITE", "$SERVERPASSREADWRITE") or $rv = errorTrapDBI($checklist, "Cannot connect to the database");

  if ($lockMySQL) {

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

                      $ref->{filename} = '<NIHIL>';
                    }
                  }
                }

                my $tstatusMessage = ( ( $catalogID ne $CATALOGID or $ref->{filename} eq '<NIHIL>' ) ? encode_html_entities('M', $ref->{statusMessage}) : '<A HREF="'.$ref->{filename}.'" TARGET="_blank">'.encode_html_entities('M', $ref->{statusMessage...
                $statusIcon = ($acked and ($activationTimeslot - $step < $ref->{timeslot}) and ($suspentionTimeslot > $ref->{timeslot})) ? ( $instability ? $ICONSUNSTABLE {$tstatus} : $ICONSACK {$tstatus} ) : $ICONS{$tstatus};

                if ( $timeslot == 0 or $timeslot == 1 ) {
                  my ($year, $month, $day) = split (/-/, $ref->{endDate});
                  my ($hour, $minute, $seconds) = split (/:/, $ref->{endTime});
                  $itemTimelocal[$timeslot] = timelocal ( $seconds, $minute, $hour, $day, $month-1, $year-1900 );
                }

                if ( $timeslot == 0 or ( $timeslot == 1 and $itemStatus[0] eq 'IN PROGRESS' ) ) {
                  $statusOverlib = ( $timeslot ? $itemStatus[1] : $itemStatus[0] );

                  if ($pagedirOrig =~ /^(?:index|test)$/ and -s "$APPLICATIONPATH/custom/cartography.pm") {
                    require "$APPLICATIONPATH/custom/cartography.pm";
                    createGifForCartography( $catalogID_uniqueKey, $statusOverlib );
                  }

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

   FILENAME : filename from the checklist for the html output loop (default 'DisplayCT')
-P, --pagedir=<PAGEDIR>
   PAGEDIR  : sub directory name for the html output (default 'index')
-L, --loop=F|T
   F(alse)  : loop off (default)
   T(rue)   : loop on
-t, --trigger=F|T
   F(alse)  : trigger off (default)
   T(rue)   : trigger on
-c, --creationTime=<YYYY-MM-DD HH:MM:SS>
   YYYY-MM-DD HH:MM:SS: year, month, day, hours, minutes and seconds to use instead of the current time when --loop = F
-T, --displayTime=F|T
   F(alse)  : display timeslots into html output off
   T(rue)   : display timeslots into html output (default)
-l, --lockMySQL=F|T
   F(alse)  : lock MySQL table off (default)
   T(rue)   : lock MySQL table on
-D, --debug=F|T
   F(alse)  : screendebugging off (default)
   T(true)  : normal screendebugging on
-V, --version

applications/display.pl  view on Meta::CPAN

  }

  $prevGroep = '';
  my $dstatusMessage;

  my $creationDate;

  if ( defined $creationTime ) {
    my ($date, $time) = split (/ /, $creationTime);
    my ($year, $month, $day) = split (/-/, $date);
    my ($hour, $minute, $seconds) = split (/:/, $time);
    $creationDate = timelocal ( $seconds, $minute, $hour, $day, $month-1, $year-1900 );
    printHtmlHeader( $APPLICATION .' - '. $ENVIRONMENT{$Cenvironment} .' from '. $CATALOGID .' ('. scalar(localtime($creationDate)) .')' );
  } else {
    $creationDate = time();
    printHtmlHeader( $APPLICATION .' - '. $ENVIRONMENT{$Cenvironment} .' from '. $CATALOGID );
  }

  $rv  = 1;
  $dbh = DBI->connect("DBI:mysql:$DATABASE:$serverName:$SERVERPORTREADWRITE", "$SERVERUSERREADWRITE", "$SERVERPASSREADWRITE") or $rv = errorTrapDBI($checklist, "Cannot connect to the database");

  if ($lockMySQL) {

applications/display.pl  view on Meta::CPAN

                      $ref->{filename} = '<NIHIL>';
                    }
                  }
                }

                my $tstatusMessage = ( ( $catalogID ne $CATALOGID or $ref->{filename} eq '<NIHIL>' ) ? encode_html_entities('M', $ref->{statusMessage}) : '<A HREF="'.$ref->{filename}.'" TARGET="_blank">'.encode_html_entities('M', $ref->{statusMessage...
                $statusIcon = ($acked and ($activationTimeslot - $step < $ref->{timeslot}) and ($suspentionTimeslot > $ref->{timeslot})) ? ( $instability ? $ICONSUNSTABLE {$tstatus} : $ICONSACK {$tstatus} ) : $ICONS{$tstatus};

                if ( $timeslot == 0 or $timeslot == 1 ) {
                  my ($year, $month, $day) = split (/-/, $ref->{endDate});
                  my ($hour, $minute, $seconds) = split (/:/, $ref->{endTime});
                  $itemTimelocal[$timeslot] = timelocal ( $seconds, $minute, $hour, $day, $month-1, $year-1900 );
                }

                if ( $timeslot == 0 or ( $timeslot == 1 and $itemStatus[0] eq 'IN PROGRESS' ) ) {
                  $statusOverlib = ( $timeslot ? $itemStatus[1] : $itemStatus[0] );

                  if ($pagedirOrig =~ /^(?:index|test)$/ and -s "$APPLICATIONPATH/custom/cartography.pm") {
                    require "$APPLICATIONPATH/custom/cartography.pm";
                    createGifForCartography( $catalogID_uniqueKey, $statusOverlib );
                  }

applications/display.pl  view on Meta::CPAN

   FILENAME : filename from the checklist for the html output loop (default 'DisplayCT')
-P, --pagedir=<PAGEDIR>
   PAGEDIR  : sub directory name for the html output (default 'index')
-L, --loop=F|T
   F(alse)  : loop off (default)
   T(rue)   : loop on
-t, --trigger=F|T
   F(alse)  : trigger off (default)
   T(rue)   : trigger on
-c, --creationTime=<YYYY-MM-DD HH:MM:SS>
   YYYY-MM-DD HH:MM:SS: year, month, day, hours, minutes and seconds to use instead of the current time when --loop = F
-T, --displayTime=F|T
   F(alse)  : display timeslots into html output off
   T(rue)   : display timeslots into html output (default)
-l, --lockMySQL=F|T
   F(alse)  : lock MySQL table off (default)
   T(rue)   : lock MySQL table on
-D, --debug=F|T
   F(alse)  : screendebugging off (default)
   T(true)  : normal screendebugging on
-V, --version

applications/htmlroot/cgi-bin/admin/generateConfig.pl  view on Meta::CPAN

            $commands {$server} {TODO} {$_id} {active} = $active;
            $commands {$server} {TODO} {$_id} {command} = "'$filename' ?";
            $compareText .= '<br><FONT COLOR="yellow"> ['. $_id .'] '. $commands {$server} {TODO} {$_id} {command} .'</FONT>' if ( $debug eq 'T' );
		  } elsif (($filename =~ /^(slave|master)\/DisplayCT-[\w-]+\.sh$/) or ($filename =~ /^(slave|master)\/CollectorCT-[\w-]+\.sh$/)) {
            $commands {$server} {START} {++$_id} {auto} = 0;
            $commands {$server} {START} {$_id} {label} = '=d';
            $commands {$server} {START} {$_id} {active} = $active;
            $commands {$server} {START} {$_id} {command} = "$SSHCOMMAND $connectArguments $SSHLOGONNAME\@$server ". $ASNMTAP_PATH { substr ($type, -1, 1) } { $server } .'/applications/'. ( ($type eq 'CM' or $type eq 'DM') ? 'master' : 'slave' ) ."/$f...
            $compareText .= '<br><FONT COLOR="#99CC99"> ['. $_id .'] '. $commands {$server} {START} {$_id} {command} .'</FONT>' if ( $debug eq 'T' );
        # } elsif ( $filename =~ /^master\/rsync-mirror-failover-[\w\-.]+.conf$/ or $filename =~ /^slave\/rsync-mirror-failover-[\w\-.]+.conf$/) {
            # deze bestanden worden reeds gecopieerd door middel van bovenstaande SCP in deze sectie
          }
        }
      } elsif ( $compareView =~ /^diff: installed: No such file or directory/ ) {
        $compareText = "The installed configuration doesn't exist.";
      } elsif ( $compareView =~ /^diff: generated: No such file or directory/ ) {
        $compareText = "The generated configuration doesn't exist.";
      } else {
        $compareText = "<b>Under construction:</b> < $compareView >";
      }

applications/htmlroot/cgi-bin/comments.pl  view on Meta::CPAN

my ($sessionID, $iconAdd, $iconDelete, $iconDetails, $iconEdit, $iconQuery, $iconTable, $errorUserAccessControl, $remoteUserLoggedOn, undef, undef, $givenNameLoggedOn, $familyNameLoggedOn, undef, undef, $userType, undef, undef, undef, $subTitle) = us...

unless ( defined $errorUserAccessControl ) {
  unless ( defined $userType ) {
    print_header (*STDOUT, $pagedir, $pageset, $htmlTitle, $subTitle, 3600, '', 'F', '', $sessionID);
    print "<br>\n<table WIDTH=\"100%\" border=0><tr><td class=\"HelpPluginFilename\">\n<font size=\"+1\">$errorUserAccessControl</font>\n</td></tr></table>\n<br>\n";
  } else {
    $action = "listView" if ( $userType == 0 and ($action eq 'insertView' or $action eq 'insert' or $action eq 'createView' or $action eq 'create' or $action eq 'deleteView' or $action eq 'delete' or $action eq 'editView' or $action eq 'edit' or $act...
    my $urlWithAccessParameters = $ENV{SCRIPT_NAME} ."?pagedir=$pagedir&amp;pageset=$pageset&amp;debug=$debug&amp;CGISESSID=$sessionID";

    my ($CactivationTimeslot, $CsuspentionTimeslot, $tsec, $tmin, $thour, $tday, $tmonth, $tyear);

    if ($CactivationDate ne '' and $CactivationTime ne '') {
      ($tyear, $tmonth, $tday) = split(/\-/, $CactivationDate);
      $tyear -= 1900; $tmonth--;
      ($thour, $tmin, $tsec) = split(/:/, $CactivationTime);
      $CactivationTimeslot = timelocal($tsec, $tmin, $thour, $tday, $tmonth, $tyear);
    } else {
      $CactivationTimeslot = '';
    }

    if ($CsuspentionDate ne '' and $CsuspentionTime ne '') {
      ($tyear, $tmonth, $tday) = split(/\-/, $CsuspentionDate);
      $tyear -= 1900; $tmonth--;
      ($thour, $tmin, $tsec) = split(/:/, $CsuspentionTime);
      $CsuspentionTimeslot = timelocal($tsec, $tmin, $thour, $tday, $tmonth, $tyear);
    } else {
      $CsuspentionTimeslot = '';
    }

    my ($CentryDate, $CentryTime, $CentryTimeslot, $CsolvedDate, $CsolvedTime, $CsolvedTimeslot);

    if ($action eq 'historyView' or $action eq 'history') {
      $CentryDate = ($cgi->param('entryDate') or '');
      $CentryTime = ($cgi->param('entryTime') or '');

      if ($CentryDate ne '' and $CentryTime ne '') {
        ($tyear, $tmonth, $tday) = split(/\-/, $CentryDate);
        $tyear -= 1900; $tmonth--;
        ($thour, $tmin, $tsec) = split(/:/, $CentryTime);
        $CentryTimeslot = timelocal($tsec, $tmin, $thour, $tday, $tmonth, $tyear);
      } else {
        $CentryTimeslot = '';
      }

      $CsolvedDate = ($cgi->param('solvedDate') or '');
      $CsolvedTime = ($cgi->param('solvedTime') or '');

      if ($CsolvedDate ne '' and $CsolvedTime ne '') {
        ($tyear, $tmonth, $tday) = split(/\-/, $CsolvedDate);
        $tyear -= 1900; $tmonth--;
        ($thour, $tmin, $tsec) = split(/:/, $CsolvedTime);
        $CsolvedTimeslot = timelocal($tsec, $tmin, $thour, $tday, $tmonth, $tyear);
      } else {
        $CsolvedTimeslot = '';
      }
    } else {
      $CentryDate        = ($cgi->param('entryDate')      or "$currentYear-$currentMonth-$currentDay");
      $CentryTime        = ($cgi->param('entryTime')      or "$currentHour:$currentMin:$currentSec");
      $CentryTimeslot    = ($cgi->param('entryTimeslot')  or timelocal($currentSec, $currentMin, $currentHour, $currentDay, $localMonth, $localYear));

      if ($CproblemSolved) {
        $CsolvedDate     = ($cgi->param('solvedDate')     or "$currentYear-$currentMonth-$currentDay");

applications/htmlroot/cgi-bin/comments.pl  view on Meta::CPAN

            if ($action eq 'create') {
              require "$APPLICATIONPATH/custom/supportRequest.pm";
              my ($description, $outageStartDate, $outageStartTime) = ('Description: Support Ticket ...');
              my ($succeeded, $alert, $error) = insertSupportRequest ($CcatalogID, $CuKey, $title, $CremoteUser, $outageStartDate, $outageStartTime, $description, $pagedir, $pageset, $htmlTitle, $subTitle, 3600, '', $sessionID, $debug);

              if (defined $outageStartDate and defined $outageStartTime) {
                $CactivationDate = $outageStartDate;
                $CactivationTime = $outageStartTime;
                ($tyear, $tmonth, $tday) = split(/\-/, $CactivationDate);
                $tyear -= 1900; $tmonth--;
                ($thour, $tmin, $tsec) = split(/:/, $CactivationTime);
                $CactivationTimeslot = timelocal($tsec, $tmin, $thour, $tday, $tmonth, $tyear);
              }

              unless ($succeeded) {
                $action = $nextAction = 'createError';
                $htmlTitle = "$Ctitle: id $Cid create error";
                $matchingComments = "<tr><td><H1>Error:</H1>\n'$error'<BR></td></tr>";
              }

              $CcommentData = 'Support Request: '. (($succeeded) ? "SR $succeeded" : "ERROR '$error'");
              $CcommentData .= ", $CactivationDate $CactivationTime";

applications/htmlroot/cgi-bin/detailedStatisticsReportGenerationAndCompareResponsetimeTrends.pl  view on Meta::CPAN

<BODY>
</BODY>
</HTML>
EndOfHtml

    exit;
  }

  my ($rv, $dbh, $sth, $uKey, $sqlQuery, $sqlSelect, $sqlAverage, $sqlInfo, $sqlErrors, $sqlWhere, $sqlPeriode);
  my ($printerFriendlyOutputBox, $formatOutputSelect, $catalogIDSelect, $uKeySelect1, $uKeySelect2, $uKeySelect3, $images);
  my ($subtime, $endTime, $duration, $seconden, $status, $statusMessage, $title, $Title, $shortDescription, $rest, $dummy, $count);
  my ($averageQ, $numbersOfTestsQ, $startDateQ, $stepQ, $endDateQ, $errorMessage, $chartOrTableChecked);
  my ($checkbox, $tables, $shortDescriptionTextArea, $infoTable, $topxTable, $errorList, $errorDetailList, $commentDetailList, $perfdataDetailList, $responseTable, $goodDate);
  my ($fromto, $years, $weeks, $months, $quarters, $slaWindows, $selectedYear, $selectedWeek, $selectedMonth, $selectedQuarter, $slaWindow, $i);
  my @arrMonths = qw(January Februari March April May June July August September October November December);

  # open connection to database and query data
  $rv  = 1;
  $dbh = DBI->connect("dbi:mysql:$DATABASE:$SERVERNAMEREADONLY:$SERVERPORTREADONLY", "$SERVERUSERREADONLY", "$SERVERPASSREADONLY" ) or $rv = error_trap_DBI(*STDOUT, "Cannot connect to the database", $debug, $pagedir, $pageset, $htmlTitle, $subTitle, ...

  if ( $dbh and $rv ) {

applications/htmlroot/cgi-bin/detailedStatisticsReportGenerationAndCompareResponsetimeTrends.pl  view on Meta::CPAN

          $chartOrTableChecked = 1;
        } else {
          $dummy = '';
        }

        $tables .= "        <input type=\"checkbox\" name=\"topx\"$dummy> Show Top 20 Slow tests<br>";

        # Sql init & Query's  - - - - - - - - - - - - - - - - - - - - - -
        if ((($details eq 'on') or ($comments eq 'on') or ($perfdata eq 'on') or ($topx eq 'on')) and ! defined $errorMessage) {
          $sqlSelect  = "select SQL_NO_CACHE startDate as startDateQ, startTime, endDate as endDateQ, endTime, duration, status, statusMessage";
          $sqlAverage = "select SQL_NO_CACHE avg(time_to_sec(duration)) as average";
          $sqlErrors  = "select SQL_NO_CACHE statusmessage, count(statusmessage) as aantal";
          $sqlWhere   = "WHERE catalogID='$CcatalogID' and uKey = '$uKey1'";
          $sqlPeriode = "AND startDate BETWEEN '$sqlStartDate' AND '$sqlEndDate' $sqlPeriode " if (defined $sqlStartDate and defined $sqlEndDate);
        }

        my ($numbersOfTests, $step, $average);
        my $forceIndex = "force index (key_startDate)"; $forceIndex = '';

        # Short Description - - - - - - - - - - - - - - - - - - - - - - - -
        if ( $uKey1 ne 'none' ) {

applications/htmlroot/cgi-bin/detailedStatisticsReportGenerationAndCompareResponsetimeTrends.pl  view on Meta::CPAN

            $sth->finish() or $rv = error_trap_DBI("", "Cannot sth->finish", $debug, '', "", '', "", -1, '', $sessionID);
          }

          # General information table - - - - - - - - - - - - - - - - - - -
          $infoTable = "<H1>General information</H1>\n";
          $infoTable .= "<table border=\"0\" cellpadding=\"1\" cellspacing=\"1\" bgcolor=\"$COLORSTABLE{TABLE}\"><tr><th width=\"200\">Entry</th><th>Value</th></tr>\n";
          $infoTable .= "  <tr><td bgcolor=\"$COLORSTABLE{ENDBLOCK}\">Application</td><td bgcolor=\"$COLORSTABLE{STARTBLOCK}\"> " .substr($htmlTitle, 11). " </td></tr>\n";
          $infoTable .= "  <tr><td bgcolor=\"$COLORSTABLE{ENDBLOCK}\">Report Type</td><td bgcolor=\"$COLORSTABLE{STARTBLOCK}\"> " .$inputType. ( defined $slaWindow ? ", " .$slaWindow : '') ." </td></tr>\n";
          $infoTable .= "  <tr><td bgcolor=\"$COLORSTABLE{ENDBLOCK}\">Generated on</td><td bgcolor=\"$COLORSTABLE{STARTBLOCK}\"> " .$now. "</td></tr>\n";
          $infoTable .= "  <tr><td colspan=\"2\"><br></td></tr>\n";
          $infoTable .= "  <tr><td bgcolor=\"$COLORSTABLE{ENDBLOCK}\">Average (ok only)</td><td bgcolor=\"$COLORSTABLE{STARTBLOCK}\"> " .substr($average,0,5). " seconds </td></tr>\n" if (defined $average);

          if (($step >= 1) and ($numberOfDays >= 1)) {
            $infoTable .= "  <tr><td bgcolor=\"$COLORSTABLE{ENDBLOCK}\">Test interval</td><td bgcolor=\"$COLORSTABLE{STARTBLOCK}\"> " .($step/60). " minutes</td></tr>\n";
            $infoTable .= "  <tr><td bgcolor=\"$COLORSTABLE{ENDBLOCK}\">Should run 'X' tests:</td><td bgcolor=\"$COLORSTABLE{STARTBLOCK}\"> " .((86400/$step)* $numberOfDays). " </td></tr>\n";
            $infoTable .= "  <tr><td bgcolor=\"$COLORSTABLE{ENDBLOCK}\">Number of tests run </td><td bgcolor=\"$COLORSTABLE{STARTBLOCK}\"> " .$numbersOfTests. " (".substr(($numbersOfTests/((86400/$step)* $numberOfDays))*100,0,6)."%)</td></tr>\n";
          }

          $infoTable .= "</table>\n";
        }

applications/htmlroot/cgi-bin/detailedStatisticsReportGenerationAndCompareResponsetimeTrends.pl  view on Meta::CPAN

                $perfdataDetailList .= "<table border=\"0\" cellpadding=\"1\" cellspacing=\"1\" bgcolor=\"$COLORSTABLE{TABLE}\"><tr><td width=\"400\">No Performance Data defined!</td></tr></table>";
              }

              $sth->finish() or $rv = error_trap_DBI("", "Cannot sth->finish", $debug, '', "", '', "", -1, '', $sessionID);
            }
          }
        }

        if ($details eq 'on' and ! defined $errorMessage) {
          # Problem Detail  - - - - - - - - - - - - - - - - - - - - - - - -
          my ($oneblock, $block, $firstrun, $nstartDateQ, $nstartTime, $nendDateQ, $nendTime, $nseconden);
          my ($test, $resultsdir, $tel, $wtel, $nstatus, $nrest, $nyear, $nmonth, $nday, $nhours, $nminuts, $nseconds, $rrest);

          $errorDetailList = "<H1>Problem Details</H1>\n";
          $responseTable = "<H1>Response time warnings</H1>\n";

          $sqlQuery = "select SQL_NO_CACHE test, resultsdir from $SERVERTABLPLUGINS $sqlWhere";
          $sth = $dbh->prepare( $sqlQuery ) or $rv = error_trap_DBI("", "Cannot dbh->prepare: $sqlQuery", $debug, '', "", '', "", -1, '', $sessionID);
          $sth->execute() or $rv = error_trap_DBI("", "Cannot sth->execute: $sqlQuery", $debug, '', "", '', "", -1, '', $sessionID) if $rv;

          if ( $rv ) {
            ($test, $resultsdir) = $sth->fetchrow_array() or $rv = error_trap_DBI("", "Cannot sth->execute: $sqlQuery", $debug, '', "", '', "", -1, '', $sessionID) if $rv;

applications/htmlroot/cgi-bin/detailedStatisticsReportGenerationAndCompareResponsetimeTrends.pl  view on Meta::CPAN

              $sth->execute() or $rv = error_trap_DBI("", "Cannot sth->execute: $sqlQuery", $debug, '', "", '', "", -1, '', $sessionID) if $rv;
              $sth->bind_columns( \$startDateQ, \$startTime, \$endDateQ, \$endTime, \$duration, \$status, \$statusMessage ) or $rv = error_trap_DBI("", "Cannot sth->bind_columns: $sqlQuery", $debug, '', "", '', "", -1, '', $sessionID) if $rv;
            }
          }

          if ( $rv ) {
            sub createLinkToDebugFile {
              my ($startDate, $startTime, $status, $statusMessage) = @_;

              my ($year, $month, $day) = split (/-/, $startDate);
              my ($hour, $min, $sec) = split (/:/, $startTime);

              if ( $formatOutput ne 'html' or $htmlToPdf ) {
                return ($statusMessage);
              } else {
                my $catalogID_uKey1 = ( ( $CcatalogID eq 'CID' ) ? '' : $CcatalogID .'_' ) . $uKey1;

                if (-e "$PREFIXPATH/$RESULTSDIR/$resultsdir/$DEBUGDIR/$year$month$day$hour$min$sec-$test-$catalogID_uKey1-$status.htm") {
                  return ("<A HREF=\"$RESULTSURL/$resultsdir/$DEBUGDIR/$year$month$day$hour$min$sec-$test-$catalogID_uKey1-$status.htm\" target=\"_blank\">$statusMessage</A>");
                } else {
                  return ($statusMessage);
                }
              }
            }

            $firstrun = 1; $oneblock = $tel = $wtel = 0;

            while( $sth->fetch() ) {
              $seconden = int(substr($duration, 6, 2)) + int(substr($duration, 3, 2)*60) + int(substr($duration, 0, 2)*3600);
              (undef, $rest) = split(/:/, $statusMessage, 2);

            # ($rest, undef) = split(/\|/, $rest, 2) if (defined $rest); # remove performance data
              if (defined $rest) {
                my $_rest = reverse $rest;
                my ($_rest, undef) = reverse split(/\|/, $_rest, 2);
                my $rest = reverse $_rest;
              } 

              if ($firstrun) {
                $firstrun = 0;
              } else {
                ($oneblock, $block, $rrest, $dummy) = setBlockBGcolor ($oneblock, $status, $step, $startDateQ, $startTime, $nyear, $nmonth, $nday, $nhours, $nminuts, $nseconds, $nstatus, $nrest);

                if ($rrest =~ /^Response/) {
                  $wtel++;
                  $responseTable .= "<table width=\"100%\" border=\"0\" cellpadding=\"1\" cellspacing=\"1\" bgcolor=\"$COLORSTABLE{TABLE}\"><tr><th width=\"40\"> # </th><th>Start</th><th>Stop</th><th>Duration</th><th>Status</th><th>Status Message</th...
                  $responseTable .= "<tr $block><td>$dummy$wtel</td><td> $nstartDateQ \@ $nstartTime</td><td>$nendDateQ \@ $nendTime</td><td align=\"center\">".$nseconden."s</td><td><font color=\"".$COLORS {$nstatus}."\"> ".encode_html_entities('S', ...
                } else {
                  $tel++;
                  $errorDetailList .= "<table width=\"100%\" border=\"0\" cellpadding=\"1\" cellspacing=\"1\" bgcolor=\"$COLORSTABLE{TABLE}\"><tr><th width=\"40\"> # </th><th>Start</th><th>Stop</th><th>Duration</th><th>Status</th><th>Status Message</...
                  $errorDetailList .= "<tr $block><td>$dummy$tel</td><td> $nstartDateQ \@ $nstartTime</td><td>$nendDateQ \@ $nendTime</td><td align=\"center\">".$nseconden."s</td><td><font color=\"".$COLORS{$nstatus}."\"> ".encode_html_entities('S', ...
                }
              }

              ($nyear, $nmonth, $nday, $nhours, $nminuts, $nseconds, $nstartDateQ, $nstartTime, $nendDateQ, $nendTime, $nseconden, $nstatus, $nrest) = setPreviousValues ($startDateQ, $startTime, $endDateQ, $endTime, $seconden, $status, $rest);
            }

            if ($tel || $wtel) {
              ($oneblock, $block, $rrest, $dummy) = setBlockBGcolor ($oneblock, $status, 0, $startDateQ, $startTime, $nyear, $nmonth, $nday, $nhours, $nminuts, $nseconds, $nstatus, $nrest);
  
              if ($rrest =~ /^Response/) {
                $wtel++;
                $responseTable .= "<tr $block><td>$dummy$wtel</td><td> $nstartDateQ \@ $nstartTime</td><td>$nendDateQ \@ $nendTime</td><td align=\"center\">".$nseconden."s</td><td><font color=\"".$COLORS {$nstatus}."\"> ".encode_html_entities('S', $n...
              } else {
                $tel++;
                $errorDetailList .= "<tr $block><td>$dummy$tel</td><td> $nstartDateQ \@ $nstartTime</td><td>$nendDateQ \@ $nendTime</td><td align=\"center\">".$nseconden."s</td><td><font color=\"".$COLORS {$nstatus}."\"> ".encode_html_entities('S', $...
              }
            }

            $responseTable .= "</table>\n<br>\n<table border=\"0\" cellpadding=\"1\" cellspacing=\"1\" bgcolor=\"$COLORSTABLE{TABLE}\"><tr><td>Legende:</td><td>&nbsp;&nbsp;&nbsp;</td><td bgcolor=\"$COLORSTABLE{NOBLOCK}\">&nbsp;&nbsp;&nbsp;Single item...

            if ($tel) {
              $errorDetailList .= "</table>\n<br>\n<table border=\"0\" cellpadding=\"1\" cellspacing=\"1\" bgcolor=\"$COLORSTABLE{TABLE}\"><tr><td>Legende:</td><td>&nbsp;&nbsp;&nbsp;</td><td bgcolor=\"$COLORSTABLE{NOBLOCK}\">&nbsp;&nbsp;&nbsp;Single ...
            } else {
              $errorDetailList .= "<table border=\"0\" cellpadding=\"1\" cellspacing=\"1\" bgcolor=\"$COLORSTABLE{TABLE}\"><tr><td width=\"400\">No problems for this period!</td></tr></table>\n";
            }

applications/htmlroot/cgi-bin/detailedStatisticsReportGenerationAndCompareResponsetimeTrends.pl  view on Meta::CPAN


          $sqlQuery = create_sql_query_events_from_range_year_month ($inputType, $sqlStartDate, $sqlEndDate, $sqlSelect, $forceIndex, $sqlWhere, $sqlPeriode, "AND status = 'OK' AND statusMessage regexp ': Response time [[:alnum:]]+.[[:alnum:]]+ > tre...
          $sth = $dbh->prepare( $sqlQuery ) or $rv = error_trap_DBI("", "Cannot dbh->prepare: $sqlQuery", $debug, '', "", '', "", -1, '', $sessionID);
          $sth->execute() or $rv = error_trap_DBI("", "Cannot sth->execute: $sqlQuery", $debug, '', "", '', "", -1, '', $sessionID) if $rv;
          $sth->bind_columns( \$startDateQ, \$startTime, \$endDateQ, \$endTime, \$duration, \$status, \$statusMessage ) or $rv = error_trap_DBI("", "Cannot sth->bind_columns: $sqlQuery", $debug, '', "", '', "", -1, '', $sessionID) if $rv;

          if ( $rv ) {
            $oneblock = $wtel = 0; 

            while( $sth->fetch() ) {
              $seconden = int(substr($duration, 6, 2)) + int(substr($duration, 3, 2)*60) + int(substr($duration, 0, 2)*3600);
              (undef, $rest) = split(/:/, $statusMessage, 2);

            # ($rest, undef) = split(/\|/, $rest, 2) if (defined $rest); # remove performance data
              if (defined $rest) {
                my $_rest = reverse $rest;
                my ($_rest, undef) = reverse split(/\|/, $_rest, 2);
                my $rest = reverse $_rest;
              } 
							
              if ($wtel) {
                ($oneblock, $block, $rrest, $dummy) = setBlockBGcolor ($oneblock, $status, $step, $startDateQ, $startTime, $nyear, $nmonth, $nday, $nhours, $nminuts, $nseconds, $nstatus, $nrest);
                $responseTable .= "<tr $block><td>$dummy$wtel</td><td> $nstartDateQ \@ $nstartTime</td><td>$nendDateQ \@ $nendTime</td><td align=\"center\">".$nseconden."s</td><td><font color=\"".$COLORS {$nstatus}."\"> " .encode_html_entities('S', $...
              } else {
                $responseTable .= "<table width=\"100%\" border=\"0\" cellpadding=\"1\" cellspacing=\"1\" bgcolor=\"$COLORSTABLE{TABLE}\"><tr><th width=\"40\"> # </th><th>Start</th><th>Stop</th><th>Duration</th><th>Status</th><th>Status Message</th><...
              }

              $wtel++;
              ($nyear, $nmonth, $nday, $nhours, $nminuts, $nseconds, $nstartDateQ, $nstartTime, $nendDateQ, $nendTime, $nseconden, $nstatus, $nrest) = setPreviousValues ($startDateQ, $startTime, $endDateQ, $endTime, $seconden, $status, $rest);
            }

            if ($wtel) {
              ($oneblock, $block, $rrest, $dummy) = setBlockBGcolor ($oneblock, $status, 0, $startDateQ, $startTime, $nyear, $nmonth, $nday, $nhours, $nminuts, $nseconds, $nstatus, $nrest);
              $responseTable .= "<tr $block><td>$dummy$wtel</td><td> $nstartDateQ \@ $nstartTime</td><td>$nendDateQ \@ $nendTime</td><td align=\"center\">".$nseconden."s</td><td><font color=\"".$COLORS {$nstatus}."\"> " .encode_html_entities('S', $ns...
              $responseTable .= "</table>\n<br>\n<table border=\"0\" cellpadding=\"1\" cellspacing=\"1\" bgcolor=\"$COLORSTABLE{TABLE}\"><tr><td>Legende:</td><td>&nbsp;&nbsp;&nbsp;</td><td bgcolor=\"$COLORSTABLE{NOBLOCK}\">&nbsp;&nbsp;&nbsp;Single it...
            } else {
              $responseTable .= "<table border=\"0\" cellpadding=\"1\" cellspacing=\"1\" bgcolor=\"$COLORSTABLE{TABLE}\"><tr><td width=\"400\">No response time warnings for this period!</td></tr></table>\n";
            }

            $sth->finish() or $rv = error_trap_DBI("", "Cannot sth->finish", $debug, '', "", '', "", -1, '', $sessionID);
          }

          # Problem Summary - - - - - - - - - - - - - - - - - - - - - - -
          $sqlQuery = create_sql_query_events_from_range_year_month ($inputType, $sqlStartDate, $sqlEndDate, $sqlErrors, $forceIndex, $sqlWhere, $sqlPeriode, "AND status ='CRITICAL'", "GROUP BY statusmessage", '', "order by aantal desc, statusmessage...

applications/htmlroot/cgi-bin/detailedStatisticsReportGenerationAndCompareResponsetimeTrends.pl  view on Meta::CPAN

          $sth->execute() or $rv = error_trap_DBI("", "Cannot sth->execute: $sqlQuery", $debug, '', "", '', "", -1, '', $sessionID) if $rv;
          $sth->bind_columns( \$startDatetx, \$startTimetx,\$durationtx ) or $rv = error_trap_DBI("", "Cannot sth->bind_columns: $sqlQuery", $debug, '', "", '', "", -1, '', $sessionID) if $rv;

          if ( $rv ) {
            $topxTable .= "<H1>Top 20 Slow Tests </H1>\n";
            $topxTable .= "\n<table border=\"0\" cellpadding=\"1\" cellspacing=\"1\" bgcolor=\"$COLORSTABLE{TABLE}\"><tr><th width=\"40\"> # </th><th>Time</th><th>Duration</th></tr>\n";

            my $teltopx = 1;
	
            while( $sth->fetch() ) {
              $seconden = int(substr($durationtx, 6, 2)) + int(substr($durationtx, 3, 2)*60) + int(substr($durationtx, 0, 2)*3600);
              $topxTable .= "<tr bgcolor=\"$COLORSTABLE{STARTBLOCK}\"><td width=\"30\">$teltopx</td><td width=\"200\" align=\"center\">$startDatetx \@ $startTimetx</td><td width=\"80\" align=\"right\"><b>$seconden sec</b></td></tr>\n";
              $teltopx++;
            }			

            $topxTable .= "<tr><td width=\"400\">No top 20 slow tests for this period!</td></tr>\n" if ($teltopx == 1);
            $topxTable .= "</table>";
            $sth->finish() or $rv = error_trap_DBI("", "Cannot sth->finish", $debug, '', "", '', "", -1, '', $sessionID);
          }
        }
      }

applications/htmlroot/cgi-bin/detailedStatisticsReportGenerationAndCompareResponsetimeTrends.pl  view on Meta::CPAN

}

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

print_legend (*STDOUT);
print '</BODY>', "\n", '</HTML>', "\n";

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

sub setBlockBGcolor {
  my ($oneblock, $status, $step, $startDateQ, $startTime, $nyear, $nmonth, $nday, $nhours, $nminuts, $nseconds, $nstatus, $nrest) = @_;

  my $block;

  if ($step == 0) {
    $block = ($oneblock) ? " bgcolor=\"$COLORSTABLE{ENDBLOCK}\" " : " bgcolor=\"$COLORSTABLE{NOBLOCK}\" ";
    $oneblock = 0;
  } else {
    my ($year, $month, $day) = split(/-/, $startDateQ);
    my ($hours, $minuts, $seconds) = split(/:/, $startTime);

    my ($ddays, $dhours, $dminuts, $dseconds) = Delta_DHMS ($nyear, $nmonth, $nday, $nhours, $nminuts, $nseconds, $year, $month, $day, $hours, $minuts, $seconds);
    my $dtotsec = $dseconds + ($dminuts * 60) + ($dhours * 3600) + ($ddays * 86400);

    if (($dtotsec < ($step * 2.2)) and ($nstatus eq $status)) {
      $block = ($oneblock) ? " bgcolor=\"$COLORSTABLE{ENDBLOCK}\" " : " bgcolor=\"$COLORSTABLE{STARTBLOCK}\" ";
      $oneblock = 1;
    } else {
      $block = ($oneblock) ? " bgcolor=\"$COLORSTABLE{ENDBLOCK}\" " : " bgcolor=\"$COLORSTABLE{NOBLOCK}\" ";
      $oneblock = 0;
    }
  }

  my ($dummy, $rrest);

applications/htmlroot/cgi-bin/detailedStatisticsReportGenerationAndCompareResponsetimeTrends.pl  view on Meta::CPAN

    $rrest = '';
  }

  $rrest =~ s/^ +//g; 
  return ($oneblock, $block, $rrest, '');
}

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

sub setPreviousValues {
  my ($startDateQ, $startTime, $endDateQ, $endTime, $seconden, $status, $rest) = @_;

  my ($nyear, $nmonth, $nday) = split(/-/, $startDateQ);
  my ($nhours, $nminuts, $nseconds) = split(/:/, $startTime);
  return ($nyear, $nmonth, $nday, $nhours, $nminuts, $nseconds, $startDateQ, $startTime, $endDateQ, $endTime, $seconden, $status, $rest);
}

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

applications/htmlroot/cgi-bin/generateChart.pl  view on Meta::CPAN

                  push (@data, $problemSummary{$rest});
                  push (@labels, substr($rest, 1, 38));
                }
              } else {
			          $hight = 380; $rv = 0; $errorMessage = "NO ERRORS FOR THIS PERIOD";
              }

              $sth->finish() or ($rv, $errorMessage, $dbiErrorCode, $dbiErrorString) = error_trap_DBI("", "Cannot sth->finish", $debug, '', "", '', "", 0, '', $sessionID);
            }
          } elsif ( $selChart eq "Bar" ) {
            my ($seconden, $duration, $startDate, $startTime, $status, $step);
            my ($dataOK, $dataWarning, $dataCritical, $dataUnknown, $dataNoTest, $dataOffline);
            $sql = create_sql_query_events_from_range_year_month ($inputType, $sqlStartDate, $sqlEndDate, "select SQL_NO_CACHE duration, startDate, startTime, status, step", $forceIndex, "WHERE catalogID = '$CcatalogID' and uKey = '$uKey1'", $sqlPeri...
            $sth = $dbh->prepare( $sql ) or ($rv, $errorMessage, $dbiErrorCode, $dbiErrorString) = error_trap_DBI("", "Cannot dbh->prepare: $sql", $debug, '', "", '', "", 0, '', $sessionID);
            $sth->execute() or ($rv, $errorMessage, $dbiErrorCode, $dbiErrorString) = error_trap_DBI("", "Cannot sth->execute: $sql", $debug, '', "", '', "", 0, '', $sessionID) if $rv;
            $sth->bind_columns( \$duration, \$startDate, \$startTime, \$status, \$step ) or ($rv, $errorMessage, $dbiErrorCode, $dbiErrorString) = error_trap_DBI("", "Cannot sth->bind_columns: $sql", $debug, '', "", '', "", 0, '', $sessionID) if $rv;

		        if ( $rv ) {
  		        if ( $sth->rows ) {
                my $counter = 0;
                $numberOfLabels = ($sth->rows < 25) ? $sth->rows : 25;
                my $labelCounter = int($sth->rows / $numberOfLabels);
                my $limitTrendvalue = ($trendvalue) ? $trendvalue * 2.5 : 9000;
                my $moreDays = (defined $endDateIN or $inputType eq "year" or $inputType eq "quarter" or $inputType eq "month" or $inputType eq "week") ? 1 : 0;

                while( $sth->fetch() ) {
                  $dataOK = $dataWarning = $dataCritical = $dataUnknown = $dataNoTest = $dataOffline = "0";
                  $seconden = int(substr($duration, 6, 2)) + int(substr($duration, 3, 2)*60) + int(substr($duration, 0, 2)*3600);
                  $seconden += 0.5 if ($seconden == 0); # correction for to fast testresults

                  if ($status eq 'OK') {
                    $dataOK = ($seconden < $limitTrendvalue) ? $seconden : $limitTrendvalue;
                  } elsif ($status eq 'WARNING') {
                    $dataWarning = "-5";
                  } elsif ($status eq 'CRITICAL') {
                    $dataCritical = "-5";
                  } elsif ($status eq 'UNKNOWN') {
                    $dataUnknown = "-5";
                  } elsif ($status eq 'NO TEST') {
                    $dataNoTest = "-5";
                  } elsif ($status eq 'OFFLINE') {
                    $dataOffline = "-5";

applications/htmlroot/cgi-bin/generateChart.pl  view on Meta::CPAN

$c->addText($width/2, (($hight - $yOffset - $AreaBOffset)/2) + $yOffset + 16, $errorMessage, "arial.ttf", 12, 0xFF0000, 5, 0) if ( defined $errorMessage );
$c->addText($width/2, (($hight - $yOffset - $AreaBOffset)/2) + $yOffset - 16, $dbiErrorCode, "arial.ttf", 10, 0xFF0000, 5, 0) if ( defined $dbiErrorCode );
$c->addText($width/2, (($hight - $yOffset - $AreaBOffset)/2) + $yOffset + 48, $dbiErrorString, "arial.ttf", 10, 0xFF0000, 5, 0) if ( defined $dbiErrorString );

# Add a custom CDML text at the bottom right of the plot area as the logo
$c->addText($width - 3, 92, $APPLICATION . " @ " . $BUSINESS, "arial.ttf", 8, $forGround, 6, 270);
$c->addText($width - 18, $hight - 18, $DEPARTMENT . " @ " . $BUSINESS . ", created on: " . scalar(localtime()) . ".", "arial.ttf", 8, $forGround, 6, 0);

if ( $rv ) {
  if ( $selChart eq "Status" or $selChart eq "ErrorDetails" ) {
    # use given color array as the data colors (sector colors)
    if ( $selChart eq "Status" ) {
      my (@colors);
      foreach my $label (@labels) { push (@colors, $COLORSPIE {$label} ); }
      $c->setColors2($perlchartdir::DataColor, \@colors);

      # Add icons to the chart as a custom field
      $c->addExtraField(\@icons);
    } elsif ( $selChart eq "ErrorDetails" ) {
      my $colors = [0xb8bc9c, 0xecf0b9, 0x999966, 0x333366, 0xc3c3e6, 0x594330,0xa0bdc4];
      $c->setColors2($perlchartdir::DataColor, $colors);
    }

    # Use the side label layout method
    $c->setLabelLayout($perlchartdir::SideLayout);
    $c->setLabelStyle("tahoma.ttf", 8, $forGround)->setBackground($perlchartdir::Transparent, $perlchartdir::Transparent, 0);
    $c->setLabelFormat("<*block,valign=absmiddle*><*img={field0}*> {label} (#{value} - {percent}%)");

    # Set the border color of the sector the same color as the fill color. Set the line color of the join line to forgroundcolor
    $c->setLineColor($perlchartdir::SameAsMainColor, $forGround);

    # Set the start angle to 135 degrees
    $c->setStartAngle(135);

    # Set the pie data and the pie labels
    $c->setData(\@data, \@labels);
  } else {
    # Set the labels on the x & y axis
    my $fontAngel = ( $selChart eq "HourlyAverage" ) ? 0 : 45;

applications/htmlroot/cgi-bin/generateChart.pl  view on Meta::CPAN

print $c->makeChart2($perlchartdir::PNG);

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

sub getAverage {
  my ($number, $dbh, $rv, $uKey, $sqlStartDate, $sqlEndDate, $sqlPeriode, $selChart, $debug) = @_;

  my ($sql, $sth, $errorMessage, $dbiErrorCode, $dbiErrorString, $startDate, $hour, $average, @avg, @labels);

  if ( $selChart eq "HourlyAverage" ) {
    $sql = create_sql_query_events_from_range_year_month ($inputType, $sqlStartDate, $sqlEndDate, "select SQL_NO_CACHE startDate, hour(startTime) as hour, round(avg(time_to_sec(duration)), 2)", $forceIndex, "WHERE catalogID = '$CcatalogID' and uKey =...
  } else {
    $sql = create_sql_query_events_from_range_year_month ($inputType, $sqlStartDate, $sqlEndDate, "select SQL_NO_CACHE startDate, round(avg(time_to_sec(duration)), 2)", $forceIndex, "WHERE catalogID = '$CcatalogID' and uKey = '$uKey'", $sqlPeriode, "...
  }

  $sth = $dbh->prepare( $sql ) or ($rv, $errorMessage, $dbiErrorCode, $dbiErrorString) = error_trap_DBI("", "Cannot dbh->prepare: $sql", $debug, '', "", '', "", 0, '', $sessionID);
  $sth->execute() or ($rv, $errorMessage, $dbiErrorCode, $dbiErrorString) = error_trap_DBI("", "Cannot sth->execute: $sql", $debug, '', "", '', "", 0, '', $sessionID) if $rv;

  if ( $selChart eq "HourlyAverage" ) {
    $sth->bind_columns( \$startDate, \$hour, \$average ) or ($rv, $errorMessage, $dbiErrorCode, $dbiErrorString) = error_trap_DBI("", "Cannot sth->bind_columns: $sql", $debug, '', "", '', "", 0, '', $sessionID) if $rv;
  } else {
    $sth->bind_columns( \$startDate, \$average ) or ($rv, $errorMessage, $dbiErrorCode, $dbiErrorString) = error_trap_DBI("", "Cannot sth->bind_columns: $sql", $debug, '', "", '', "", 0, '', $sessionID) if $rv;
  }

applications/htmlroot/cgi-bin/moderator/comments.pl  view on Meta::CPAN


    my $localYear    = sprintf ("%04d", (localtime)[5] );
    my $localMonth   = sprintf ("%02d", (localtime)[4] );
    my $currentYear  = sprintf ("%04d", (localtime)[5] + 1900 );
    my $currentMonth = sprintf ("%02d", (localtime)[4] + 1 );
    my $currentDay   = sprintf ("%02d", (localtime)[3] );
    my $currentHour  = sprintf ("%02d", (localtime)[2] );
    my $currentMin   = sprintf ("%02d", (localtime)[1] );
    my $currentSec   = sprintf ("%02d", (localtime)[0] );

    my ($CactivationTimeslot, $CsuspentionTimeslot, $tsec, $tmin, $thour, $tday, $tmonth, $tyear);

    if ($CactivationDate ne '' and $CactivationTime ne '') {
      ($tyear, $tmonth, $tday) = split(/\-/, $CactivationDate);
      $tyear -= 1900; $tmonth--;
      ($thour, $tmin, $tsec) = split(/:/, $CactivationTime);
      $CactivationTimeslot = timelocal($tsec, $tmin, $thour, $tday, $tmonth, $tyear);
    } else {
      $CactivationTimeslot = '';
    }

    if ($CsuspentionDate ne '' and $CsuspentionTime ne '') {
      ($tyear, $tmonth, $tday) = split(/\-/, $CsuspentionDate);
      $tyear -= 1900; $tmonth--;
      ($thour, $tmin, $tsec) = split(/:/, $CsuspentionTime);
      $CsuspentionTimeslot = timelocal($tsec, $tmin, $thour, $tday, $tmonth, $tyear);
    } else {
      $CsuspentionTimeslot = '';
    }

    $nextAction = ($action eq 'insertView' ? 'insert' : 'insertView');

    # open connection to database and query data
    $rv  = 1;

    $dbh = DBI->connect("dbi:mysql:$DATABASE:$SERVERNAMEREADWRITE:$SERVERPORTREADWRITE", "$SERVERUSERREADWRITE", "$SERVERPASSREADWRITE" ) or $rv = error_trap_DBI(*STDOUT, "Cannot connect to the database", $debug, $pagedir, $pageset, $htmlTitle, $subT...

applications/htmlroot/cgi-bin/moderator/downtimes.pl  view on Meta::CPAN


    my $localYear    = sprintf ("%04d", (localtime)[5] );
    my $localMonth   = sprintf ("%02d", (localtime)[4] );
    my $currentYear  = sprintf ("%04d", (localtime)[5] + 1900 );
    my $currentMonth = sprintf ("%02d", (localtime)[4] + 1 );
    my $currentDay   = sprintf ("%02d", (localtime)[3] );
    my $currentHour  = sprintf ("%02d", (localtime)[2] );
    my $currentMin   = sprintf ("%02d", (localtime)[1] );
    my $currentSec   = sprintf ("%02d", (localtime)[0] );

    my ($CactivationTimeslot, $CsuspentionTimeslot, $tsec, $tmin, $thour, $tday, $tmonth, $tyear);

    if ($CactivationDate ne '' and $CactivationTime ne '') {
      ($tyear, $tmonth, $tday) = split(/\-/, $CactivationDate);
      $tyear -= 1900; $tmonth--;
      ($thour, $tmin, $tsec) = split(/:/, $CactivationTime);
      $CactivationTimeslot = timelocal($tsec, $tmin, $thour, $tday, $tmonth, $tyear);
    } else {
      $CactivationTimeslot = '';
    }

    if ($CsuspentionDate ne '' and $CsuspentionTime ne '') {
      ($tyear, $tmonth, $tday) = split(/\-/, $CsuspentionDate);
      $tyear -= 1900; $tmonth--;
      ($thour, $tmin, $tsec) = split(/:/, $CsuspentionTime);
      $CsuspentionTimeslot = timelocal($tsec, $tmin, $thour, $tday, $tmonth, $tyear);
    } else {
      $CsuspentionTimeslot = '';
    }

    $nextAction = ($action eq 'insertView' ? 'insert' : 'insertView');

    # open connection to database and query data
    $rv  = 1;

    $dbh = DBI->connect("dbi:mysql:$DATABASE:$SERVERNAMEREADWRITE:$SERVERPORTREADWRITE", "$SERVERUSERREADWRITE", "$SERVERPASSREADWRITE" ) or $rv = error_trap_DBI(*STDOUT, "Cannot connect to the database", $debug, $pagedir, $pageset, $htmlTitle, $subT...

applications/htmlroot/cgi-bin/moderator/trendlineCorrectionReports.pl  view on Meta::CPAN

      my $colspan = 10 + $actionPressend;
      my $header = "<tr><th> Catalog ID </th><th> Title </th><th> uKey </th><th> Trendline </th><th> - </th><th> Average </th><th> % </th><th> + </th><th> % </th><th> Proposal </th>$actionHeader</tr>\n";

      my $hostname = '';
      (undef, undef, $hostname, undef) = split ( /\//, $ENV{HTTP_REFERER} ) if ( $ENV{HTTP_REFERER} );

      $sql = "select catalogID, catalogName from $SERVERTABLCATALOG where not catalogID = '$CATALOGID' and activated = '1' order by catalogName asc";
      ($rv, $catalogIDSelect, undef) = create_combobox_from_DBI ($rv, $dbh, $sql, 1, '', $CcatalogID, 'catalogID', $CATALOGID, '-Parent-', '', 'onChange="javascript:submitForm();"', $pagedir, $pageset, $htmlTitle, $subTitle, $sessionID, $debug);

      my ($catalogID, $uKey, $title, $test, $resultsdir, $trendline, $percentage, $tolerance, $hour, $calculated);
      $sql = "select SQL_NO_CACHE $SERVERTABLPLUGINS.catalogID, $SERVERTABLPLUGINS.uKey, concat( LTRIM(SUBSTRING_INDEX($SERVERTABLPLUGINS.title, ']', -1)), ' (', $SERVERTABLENVIRONMENT.label, ')' ) as Title, $SERVERTABLPLUGINS.test, $SERVERTABLPLUGIN...
      $sth = $dbh->prepare( $sql ) or $rv = error_trap_DBI(*STDOUT, "Cannot dbh->prepare: $sql", $debug, $pagedir, $pageset, $htmlTitle, $subTitle, 3600, '', $sessionID);
      $sth->execute() or $rv = error_trap_DBI(*STDOUT, "Cannot sth->execute: $sql", $debug, $pagedir, $pageset, $htmlTitle, $subTitle, 3600, '', $sessionID) if $rv;
      $sth->bind_columns( \$catalogID, \$uKey, \$title, \$test, \$resultsdir, \$trendline, \$percentage, \$tolerance, \$hour, \$calculated ) or $rv = error_trap_DBI(*STDOUT, "Cannot sth->bind_columns: $sql", $debug, $pagedir, $pageset, $htmlTitle, $s...

      $matchingTrendlineCorrections .= '<table width="100%" border="0" cellspacing="1" cellpadding="1" bgcolor="'. $COLORSTABLE{TABLE} .'"><tr><th align="center" colspan="'. $colspan .'"> Trendline > 0 </th></tr>'. $header;

      if ( $rv ) {
        sub matchingTrendlineCorrections {
          my ($catalogID, $uKey, $title, $test, $resultsdir, $trendline, $percentage, $tolerance, $calculated) = @_;

applications/htmlroot/cgi-bin/moderator/trendlineCorrectionReports.pl  view on Meta::CPAN

		    $tolerancePREV  = $tolerance;
          }

          matchingTrendlineCorrections ($catalogIDPREV, $uKeyPREV, $titlePREV, $testPREV, $resultsdirPREV, $trendlinePREV, $percentagePREV, $tolerancePREV, $groupMAX);
        }

        $sth->finish() or $rv = error_trap_DBI(*STDOUT, "Cannot sth->finish", $debug, $pagedir, $pageset, $htmlTitle, $subTitle, 3600, '', $sessionID);
      }

      unless ( $shortlist ) {
        $sql = "select $SERVERTABLPLUGINS.catalogID, $SERVERTABLPLUGINS.uKey, concat( LTRIM(SUBSTRING_INDEX($SERVERTABLPLUGINS.title, ']', -1)), ' (', $SERVERTABLENVIRONMENT.label, ')' ) as Title, $SERVERTABLPLUGINS.test, $SERVERTABLPLUGINS.resultsdi...
        $sth = $dbh->prepare( $sql ) or $rv = error_trap_DBI(*STDOUT, "Cannot dbh->prepare: $sql", $debug, $pagedir, $pageset, $htmlTitle, $subTitle, 3600, '', $sessionID);
        $sth->execute() or $rv = error_trap_DBI(*STDOUT, "Cannot sth->execute: $sql", $debug, $pagedir, $pageset, $htmlTitle, $subTitle, 3600, '', $sessionID) if $rv;
        $sth->bind_columns( \$catalogID, \$uKey, \$title, \$test, \$resultsdir, \$trendline, \$percentage, \$tolerance, \$calculated ) or $rv = error_trap_DBI(*STDOUT, "Cannot sth->bind_columns: $sql", $debug, $pagedir, $pageset, $htmlTitle, $subTitl...

        $matchingTrendlineCorrections .= '<tr><td '. $colspan .'">&nbsp</th></tr><tr><th align="center" colspan="'. $colspan .'"> Trendline = 0 </th></tr>'. $header;

        if ( $rv ) {
          if ( $sth->rows ) {
            while( $sth->fetch() ) {
              matchingTrendlineCorrections ($catalogID, $uKey, $title, $test, $resultsdir, $trendline, $percentage, $tolerance, $calculated);

applications/htmlroot/overlib.js  view on Meta::CPAN

// PRE-INIT
// Ignore these lines, configuration is below.
////////
var olLoaded = 0;var pmStart = 10000000; var pmUpper = 10001000; var pmCount = pmStart+1; var pmt=''; var pms = new Array(); var olInfo = new Info('4.21', 1);
var FREPLACE = 0; var FBEFORE = 1; var FAFTER = 2; var FALTERNATE = 3; var FCHAIN=4;
var olHideForm=0;  // parameter for hiding SELECT and ActiveX elements in IE5.5+ 
var olHautoFlag = 0;  // flags for over-riding VAUTO and HAUTO if corresponding
var olVautoFlag = 0;  // positioning commands are used on the command line
var hookPts = new Array(), postParse = new Array(), cmdLine = new Array(), runTime = new Array();
// for plugins
registerCommands('donothing,inarray,caparray,sticky,background,noclose,caption,left,right,center,offsetx,offsety,fgcolor,bgcolor,textcolor,capcolor,closecolor,width,border,cellpad,status,autostatus,autostatuscap,height,closetext,snapx,snapy,fixx,fixy...

////////
// DEFAULT CONFIGURATION
// Settings you want everywhere are set here. All of this can also be
// changed on your html page or through an overLIB call.
////////
if (typeof ol_fgcolor=='undefined') var ol_fgcolor="#CCCCFF";
if (typeof ol_bgcolor=='undefined') var ol_bgcolor="#333399";
if (typeof ol_textcolor=='undefined') var ol_textcolor="#000000";
if (typeof ol_capcolor=='undefined') var ol_capcolor="#FFFFFF";
if (typeof ol_closecolor=='undefined') var ol_closecolor="#9999FF";
if (typeof ol_textfont=='undefined') var ol_textfont="Verdana,Arial,Helvetica";
if (typeof ol_captionfont=='undefined') var ol_captionfont="Verdana,Arial,Helvetica";
if (typeof ol_closefont=='undefined') var ol_closefont="Verdana,Arial,Helvetica";
if (typeof ol_textsize=='undefined') var ol_textsize="1";
if (typeof ol_captionsize=='undefined') var ol_captionsize="1";
if (typeof ol_closesize=='undefined') var ol_closesize="1";
if (typeof ol_width=='undefined') var ol_width="200";
if (typeof ol_border=='undefined') var ol_border="1";
if (typeof ol_cellpad=='undefined') var ol_cellpad=2;
if (typeof ol_offsetx=='undefined') var ol_offsetx=10;

applications/htmlroot/overlib.js  view on Meta::CPAN

if (typeof ol_fullhtml=='undefined') var ol_fullhtml=0;
if (typeof ol_vpos=='undefined') var ol_vpos=BELOW;
if (typeof ol_aboveheight=='undefined') var ol_aboveheight=0;
if (typeof ol_capicon=='undefined') var ol_capicon="";
if (typeof ol_frame=='undefined') var ol_frame=self;
if (typeof ol_timeout=='undefined') var ol_timeout=0;
if (typeof ol_function=='undefined') var ol_function=null;
if (typeof ol_delay=='undefined') var ol_delay=0;
if (typeof ol_hauto=='undefined') var ol_hauto=0;
if (typeof ol_vauto=='undefined') var ol_vauto=0;
if (typeof ol_closeclick=='undefined') var ol_closeclick=0;
if (typeof ol_wrap=='undefined') var ol_wrap=0;
if (typeof ol_followmouse=='undefined') var ol_followmouse=1;
if (typeof ol_mouseoff=='undefined') var ol_mouseoff=0;
if (typeof ol_closetitle=='undefined') var ol_closetitle='Close';
if (typeof ol_compatmode=='undefined') var ol_compatmode=0;
if (typeof ol_css=='undefined') var ol_css=CSSOFF;
if (typeof ol_fgclass=='undefined') var ol_fgclass="";
if (typeof ol_bgclass=='undefined') var ol_bgclass="";
if (typeof ol_textfontclass=='undefined') var ol_textfontclass="";
if (typeof ol_captionfontclass=='undefined') var ol_captionfontclass="";

applications/htmlroot/overlib.js  view on Meta::CPAN

var o3_sticky=0;
var o3_background="";
var o3_close="Close";
var o3_hpos=RIGHT;
var o3_offsetx=2;
var o3_offsety=2;
var o3_fgcolor="";
var o3_bgcolor="";
var o3_textcolor="";
var o3_capcolor="";
var o3_closecolor="";
var o3_width=100;
var o3_border=1;
var o3_cellpad=2;
var o3_status="";
var o3_autostatus=0;
var o3_height=-1;
var o3_snapx=0;
var o3_snapy=0;
var o3_fixx=-1;
var o3_fixy=-1;

applications/htmlroot/overlib.js  view on Meta::CPAN

var o3_closesize="1";
var o3_frame=self;
var o3_timeout=0;
var o3_timerid=0;
var o3_allowmove=0;
var o3_function=null; 
var o3_delay=0;
var o3_delayid=0;
var o3_hauto=0;
var o3_vauto=0;
var o3_closeclick=0;
var o3_wrap=0;
var o3_followmouse=1;
var o3_mouseoff=0;
var o3_closetitle='';
var o3_compatmode=0;
var o3_css=CSSOFF;
var o3_fgclass="";
var o3_bgclass="";
var o3_textfontclass="";
var o3_captionfontclass="";

applications/htmlroot/overlib.js  view on Meta::CPAN

	o3_sticky=ol_sticky;
	o3_background=ol_background;
	o3_close=ol_close;
	o3_hpos=ol_hpos;
	o3_offsetx=ol_offsetx;
	o3_offsety=ol_offsety;
	o3_fgcolor=ol_fgcolor;
	o3_bgcolor=ol_bgcolor;
	o3_textcolor=ol_textcolor;
	o3_capcolor=ol_capcolor;
	o3_closecolor=ol_closecolor;
	o3_width=ol_width;
	o3_border=ol_border;
	o3_cellpad=ol_cellpad;
	o3_status=ol_status;
	o3_autostatus=ol_autostatus;
	o3_height=ol_height;
	o3_snapx=ol_snapx;
	o3_snapy=ol_snapy;
	o3_fixx=ol_fixx;
	o3_fixy=ol_fixy;

applications/htmlroot/overlib.js  view on Meta::CPAN

	o3_captionfont=ol_captionfont;
	o3_closefont=ol_closefont;
	o3_textsize=ol_textsize;
	o3_captionsize=ol_captionsize;
	o3_closesize=ol_closesize;
	o3_timeout=ol_timeout;
	o3_function=ol_function;
	o3_delay=ol_delay;
	o3_hauto=ol_hauto;
	o3_vauto=ol_vauto;
	o3_closeclick=ol_closeclick;
	o3_wrap=ol_wrap;	
	o3_followmouse=ol_followmouse;
	o3_mouseoff=ol_mouseoff;
	o3_closetitle=ol_closetitle;
	o3_css=ol_css;
	o3_compatmode=ol_compatmode;
	o3_fgclass=ol_fgclass;
	o3_bgclass=ol_bgclass;
	o3_textfontclass=ol_textfontclass;
	o3_captionfontclass=ol_captionfontclass;

applications/htmlroot/overlib.js  view on Meta::CPAN

	return txt;
}

// Makes table with caption and optional close link
function ol_content_caption(text,title,close) {
	var nameId, txt, cpIsMultiple = /,/.test(o3_cellpad);
	var closing, closeevent;

	closing = "";
	closeevent = "onmouseover";
	if (o3_closeclick == 1) closeevent = (o3_closetitle ? "title='" + o3_closetitle +"'" : "") + " onclick";
	if (o3_capicon != "") {
	  nameId = ' hspace = \"5\"'+' align = \"middle\" alt = \"\"';
	  if (typeof o3_dragimg != 'undefined' && o3_dragimg) nameId =' hspace=\"5\"'+' name=\"'+o3_dragimg+'\" id=\"'+o3_dragimg+'\" align=\"middle\" alt=\"Drag Enabled\" title=\"Drag Enabled\"';
	  o3_capicon = '<img src=\"'+o3_capicon+'\"'+nameId+' />';
	}

	if (close != "")
		closing = '<td '+(!o3_compatmode && o3_closefontclass ? 'class="'+o3_closefontclass : 'align="RIGHT')+'"><a href="javascript:return '+fnRef+'cClick();"'+((o3_compatmode && o3_closefontclass) ? ' class="' + o3_closefontclass + '" ' : ' ')+closeevent...
	txt = '<table width="'+o3_width+ '" border="0" cellpadding="'+o3_border+'" cellspacing="0" '+(o3_bgclass ? 'class="'+o3_bgclass+'"' : o3_bgcolor+' '+o3_bgbackground+' '+o3_height)+'><tr><td><table width="100%" border="0" cellpadding="2" cellspacing=...

applications/htmlroot/overlib.js  view on Meta::CPAN

			if (ar[i]==BACKGROUND) { eval(pf+'background="'+ar[++i]+'"'); continue; }
			if (ar[i]==NOCLOSE) { if (pf!='ol_') opt_NOCLOSE(); continue; }
			if (ar[i]==CAPTION) { eval(pf+"cap='"+escSglQuote(ar[++i])+"'"); continue; }
			if (ar[i]==CENTER || ar[i]==LEFT || ar[i]==RIGHT) { eval(pf+'hpos='+ar[i]); if(pf!='ol_') olHautoFlag=1; continue; }
			if (ar[i]==OFFSETX) { eval(pf+'offsetx='+ar[++i]); continue; }
			if (ar[i]==OFFSETY) { eval(pf+'offsety='+ar[++i]); continue; }
			if (ar[i]==FGCOLOR) { eval(pf+'fgcolor="'+ar[++i]+'"'); continue; }
			if (ar[i]==BGCOLOR) { eval(pf+'bgcolor="'+ar[++i]+'"'); continue; }
			if (ar[i]==TEXTCOLOR) { eval(pf+'textcolor="'+ar[++i]+'"'); continue; }
			if (ar[i]==CAPCOLOR) { eval(pf+'capcolor="'+ar[++i]+'"'); continue; }
			if (ar[i]==CLOSECOLOR) { eval(pf+'closecolor="'+ar[++i]+'"'); continue; }
			if (ar[i]==WIDTH) { eval(pf+'width='+ar[++i]); continue; }
			if (ar[i]==BORDER) { eval(pf+'border='+ar[++i]); continue; }
			if (ar[i]==CELLPAD) { i=opt_MULTIPLEARGS(++i,ar,(pf+'cellpad')); continue; }
			if (ar[i]==STATUS) { eval(pf+"status='"+escSglQuote(ar[++i])+"'"); continue; }
			if (ar[i]==AUTOSTATUS) { eval(pf +'autostatus=('+pf+'autostatus == 1) ? 0 : 1'); continue; }
			if (ar[i]==AUTOSTATUSCAP) { eval(pf +'autostatus=('+pf+'autostatus == 2) ? 0 : 2'); continue; }
			if (ar[i]==HEIGHT) { eval(pf+'height='+pf+'aboveheight='+ar[++i]); continue; } // Same param again.
			if (ar[i]==CLOSETEXT) { eval(pf+"close='"+escSglQuote(ar[++i])+"'"); continue; }
			if (ar[i]==SNAPX) { eval(pf+'snapx='+ar[++i]); continue; }
			if (ar[i]==SNAPY) { eval(pf+'snapy='+ar[++i]); continue; }

applications/htmlroot/overlib.js  view on Meta::CPAN

			if (ar[i]==CAPTIONFONT) { eval(pf+"captionfont='"+escSglQuote(ar[++i])+"'"); continue; }
			if (ar[i]==CLOSEFONT) { eval(pf+"closefont='"+escSglQuote(ar[++i])+"'"); continue; }
			if (ar[i]==TEXTSIZE) { eval(pf+'textsize="'+ar[++i]+'"'); continue; }
			if (ar[i]==CAPTIONSIZE) { eval(pf+'captionsize="'+ar[++i]+'"'); continue; }
			if (ar[i]==CLOSESIZE) { eval(pf+'closesize="'+ar[++i]+'"'); continue; }
			if (ar[i]==TIMEOUT) { eval(pf+'timeout='+ar[++i]); continue; }
			if (ar[i]==FUNCTION) { if (pf=='ol_') { if (typeof ar[i+1]!='number') { v=ar[++i]; ol_function=(typeof v=='function' ? v : null); }} else {fnMark = 0; v = null; if (typeof ar[i+1]!='number') v = ar[++i];  opt_FUNCTION(v); } continue; }
			if (ar[i]==DELAY) { eval(pf+'delay='+ar[++i]); continue; }
			if (ar[i]==HAUTO) { eval(pf+'hauto=('+pf+'hauto == 0) ? 1 : 0'); continue; }
			if (ar[i]==VAUTO) { eval(pf+'vauto=('+pf+'vauto == 0) ? 1 : 0'); continue; }
			if (ar[i]==CLOSECLICK) { eval(pf +'closeclick=('+pf+'closeclick == 0) ? 1 : 0'); continue; }
			if (ar[i]==WRAP) { eval(pf +'wrap=('+pf+'wrap == 0) ? 1 : 0'); continue; }
			if (ar[i]==FOLLOWMOUSE) { eval(pf +'followmouse=('+pf+'followmouse == 1) ? 0 : 1'); continue; }
			if (ar[i]==MOUSEOFF) { eval(pf +'mouseoff=('+pf+'mouseoff==0) ? 1 : 0'); v=ar[i+1]; if (pf != 'ol_' && eval(pf+'mouseoff') && typeof v == 'number' && (v < pmStart || v > pmUpper)) olHideDelay=ar[++i]; continue; }
			if (ar[i]==CLOSETITLE) { eval(pf+"closetitle='"+escSglQuote(ar[++i])+"'"); continue; }
			if (ar[i]==CSSOFF||ar[i]==CSSCLASS) { eval(pf+'css='+ar[i]); continue; }
			if (ar[i]==COMPATMODE) { eval(pf+'compatmode=('+pf+'compatmode==0) ? 1 : 0'); continue; }
			if (ar[i]==FGCLASS) { eval(pf+'fgclass="'+ar[++i]+'"'); continue; }
			if (ar[i]==BGCLASS) { eval(pf+'bgclass="'+ar[++i]+'"'); continue; }
			if (ar[i]==TEXTFONTCLASS) { eval(pf+'textfontclass="'+ar[++i]+'"'); continue; }
			if (ar[i]==CAPTIONFONTCLASS) { eval(pf+'captionfontclass="'+ar[++i]+'"'); continue; }

applications/htmlroot/overlib.js  view on Meta::CPAN

			bottom=ary[++j];
			left=ary[++j];
			break;
	}

	Str+= ((ary.length==1) ? ary[0] + 'px;' : top + 'px ' + right + 'px ' + bottom + 'px ' + left + 'px;');

	return Str;
}

// function will delay close by time milliseconds
function hideDelay(time) {
	if (time&&!o3_delay) {
		if (o3_timerid > 0) clearTimeout(o3_timerid);

		o3_timerid=setTimeout("cClick()",(o3_timeout=time));
	}
}

// Was originally in the placeLayer() routine; separated out for future ease
function horizontalPlacement(browserWidth, horizontalScrollAmount, widthFix) {

applications/htmlroot/overlib.js  view on Meta::CPAN

registerHook("ol_content_caption", ol_content_caption, FALTERNATE, CSSOFF);
registerHook("ol_content_background", ol_content_background, FALTERNATE, CSSOFF);
registerHook("ol_content_simple", ol_content_simple, FALTERNATE, CSSCLASS);
registerHook("ol_content_caption", ol_content_caption, FALTERNATE, CSSCLASS);
registerHook("ol_content_background", ol_content_background, FALTERNATE, CSSCLASS);
registerPostParseFunction(checkPositionFlags);
registerHook("hideObject", nbspCleanup, FAFTER);
registerHook("horizontalPlacement", horizontalPlacement, FCHAIN);
registerHook("verticalPlacement", verticalPlacement, FCHAIN);
if (olNs4||(olIe5&&isMac)||olKq) olLoaded=1;
registerNoParameterCommands('sticky,autostatus,autostatuscap,fullhtml,hauto,vauto,closeclick,wrap,followmouse,mouseoff,compatmode');
///////
// ESTABLISH MOUSECAPTURING
///////

// Capture events, alt. diffuses the overlib function.
var olCheckMouseCapture=true;
if ((olNs4 || olNs6 || olIe4)) {
	olMouseCapture();
} else {
	overlib = no_overlib;

applications/htmlroot/overlib_cssstyle.js  view on Meta::CPAN

	
	return txt;
}

// Makes table with caption and optional close link
function ol_content_caption_cssstyle(text, title, close) {
	var nameId;
	closing = "";
	closeevent = "onMouseOver";
	
	if (o3_closeclick == 1) closeevent= (o3_closetitle ? "title='" + o3_closetitle +"'" : "") + " onClick";

	if (o3_capicon!="") {
		nameId=' hspace=\"5\"'+' align=\"middle\" alt=\"\"';
		if (typeof o3_dragimg != 'undefined' && o3_dragimg) nameId = ' hspace=\"5\"'+' name=\"'+o3_dragimg+'\" id=\"'+o3_dragimg+'\" align=\"middle\" alt=\"Drag Enabled\" title=\"Drag Enabled\"';
		o3_capicon = '<img src=\"'+o3_capicon+'\"'+nameId+' />';
	}
	
	if (close != "") {
		closing = '<td align="RIGHT"><a href="javascript:return '+fnRef+'cClick();" '+closeevent+'="return '+fnRef+'cClick();" style="color: '+o3_closecolor+'; font-family: '+o3_closefont+'; font-size: '+o3_closesize+o3_closesizeunit+'; text-decoration: '+...
	}
	
	txt = '<table width="'+o3_width+ '" border="0" cellpadding="'+o3_border+'" cellspacing="0" style="background-color: '+o3_bgcolor+'; background-image: url('+o3_bgbackground+'); height: '+o3_height+o3_heightunit+';"><tr><td><table width="100%" border=...
	set_background("");

	return txt;
}

// Sets the background picture, padding and lots more. :)
function ol_content_background_cssstyle(text, picture, hasfullhtml) {

applications/htmlroot/snmptraps/etc/config.ini.php  view on Meta::CPAN

host = dtbs.citap.be
user = asnmtap
password = <PASSWORD>
name = snmptt
tableSnmptt = snmptt

;# Ignore this option, when you don`t use a table for unknown-Traps in your database
tableSnmpttUnk = snmptt_unknown


;# ----------> DO NOT MAKE changes at this section! <----------
[internal]
;# Version
version = Version 0.1.1 Final

;# Title for the SNMP-Trap Frontend
title = SNMPTraps-Frontend

;*/?>

applications/htmlroot/snmptraps/include/js/overlib.js  view on Meta::CPAN


////////
// PRE-INIT
// Ignore these lines, configuration is below.
////////
var olLoaded = 0;var pmStart = 10000000; var pmUpper = 10001000; var pmCount = pmStart+1; var pmt=''; var pms = new Array(); var olInfo = new Info('4.17', 1);
var FREPLACE = 0; var FBEFORE = 1; var FAFTER = 2; var FALTERNATE = 3; var FCHAIN=4;
var olHideForm=0;  // parameter for hiding SELECT and ActiveX elements in IE5.5+ 
var olHautoFlag = 0;  // flags for over-riding VAUTO and HAUTO if corresponding
var olVautoFlag = 0;  // positioning commands are used on the command line
registerCommands('donothing,inarray,caparray,sticky,background,noclose,caption,left,right,center,offsetx,offsety,fgcolor,bgcolor,textcolor,capcolor,closecolor,width,border,cellpad,status,autostatus,autostatuscap,height,closetext,snapx,snapy,fixx,fixy...

////////
// DEFAULT CONFIGURATION
// Settings you want everywhere are set here. All of this can also be
// changed on your html page or through an overLIB call.
////////
if (typeof ol_fgcolor=='undefined') var ol_fgcolor="#FFFFFF";
if (typeof ol_bgcolor=='undefined') var ol_bgcolor="#000000";
if (typeof ol_textcolor=='undefined') var ol_textcolor="#000000";
if (typeof ol_capcolor=='undefined') var ol_capcolor="#FFFFFF";
if (typeof ol_closecolor=='undefined') var ol_closecolor="#9999FF";
if (typeof ol_textfont=='undefined') var ol_textfont="Verdana,Arial,Helvetica";
if (typeof ol_captionfont=='undefined') var ol_captionfont="Verdana,Arial,Helvetica";
if (typeof ol_closefont=='undefined') var ol_closefont="Verdana,Arial,Helvetica";
if (typeof ol_textsize=='undefined') var ol_textsize="1";
if (typeof ol_captionsize=='undefined') var ol_captionsize="1";
if (typeof ol_closesize=='undefined') var ol_closesize="1";
if (typeof ol_width=='undefined') var ol_width="250";
if (typeof ol_border=='undefined') var ol_border="1";
if (typeof ol_cellpad=='undefined') var ol_cellpad=2;
if (typeof ol_offsetx=='undefined') var ol_offsetx=15;

applications/htmlroot/snmptraps/include/js/overlib.js  view on Meta::CPAN

if (typeof ol_fullhtml=='undefined') var ol_fullhtml=0;
if (typeof ol_vpos=='undefined') var ol_vpos=BELOW;
if (typeof ol_aboveheight=='undefined') var ol_aboveheight=0;
if (typeof ol_capicon=='undefined') var ol_capicon="";
if (typeof ol_frame=='undefined') var ol_frame=self;
if (typeof ol_timeout=='undefined') var ol_timeout=0;
if (typeof ol_function=='undefined') var ol_function=null;
if (typeof ol_delay=='undefined') var ol_delay=0;
if (typeof ol_hauto=='undefined') var ol_hauto=0;
if (typeof ol_vauto=='undefined') var ol_vauto=0;
if (typeof ol_closeclick=='undefined') var ol_closeclick=0;
if (typeof ol_wrap=='undefined') var ol_wrap=0;
if (typeof ol_followmouse=='undefined') var ol_followmouse=1;
if (typeof ol_mouseoff=='undefined') var ol_mouseoff=0;
if (typeof ol_closetitle=='undefined') var ol_closetitle='Close';
if (typeof ol_compatmode=='undefined') var ol_compatmode=0;
if (typeof ol_css=='undefined') var ol_css=CSSOFF;
if (typeof ol_fgclass=='undefined') var ol_fgclass="";
if (typeof ol_bgclass=='undefined') var ol_bgclass="";
if (typeof ol_textfontclass=='undefined') var ol_textfontclass="";
if (typeof ol_captionfontclass=='undefined') var ol_captionfontclass="";

applications/htmlroot/snmptraps/include/js/overlib.js  view on Meta::CPAN

var o3_sticky=0;
var o3_background="";
var o3_close="Close";
var o3_hpos=RIGHT;
var o3_offsetx=2;
var o3_offsety=2;
var o3_fgcolor="";
var o3_bgcolor="";
var o3_textcolor="";
var o3_capcolor="";
var o3_closecolor="";
var o3_width=100;
var o3_border=1;
var o3_cellpad=2;
var o3_status="";
var o3_autostatus=0;
var o3_height=-1;
var o3_snapx=0;
var o3_snapy=0;
var o3_fixx=-1;
var o3_fixy=-1;

applications/htmlroot/snmptraps/include/js/overlib.js  view on Meta::CPAN

var o3_closesize="1";
var o3_frame=self;
var o3_timeout=0;
var o3_timerid=0;
var o3_allowmove=0;
var o3_function=null; 
var o3_delay=0;
var o3_delayid=0;
var o3_hauto=0;
var o3_vauto=0;
var o3_closeclick=0;
var o3_wrap=0;
var o3_followmouse=1;
var o3_mouseoff=0;
var o3_closetitle='';
var o3_compatmode=0;
var o3_css=CSSOFF;
var o3_fgclass="";
var o3_bgclass="";
var o3_textfontclass="";
var o3_captionfontclass="";

applications/htmlroot/snmptraps/include/js/overlib.js  view on Meta::CPAN

	o3_sticky=ol_sticky;
	o3_background=ol_background;
	o3_close=ol_close;
	o3_hpos=ol_hpos;
	o3_offsetx=ol_offsetx;
	o3_offsety=ol_offsety;
	o3_fgcolor=ol_fgcolor;
	o3_bgcolor=ol_bgcolor;
	o3_textcolor=ol_textcolor;
	o3_capcolor=ol_capcolor;
	o3_closecolor=ol_closecolor;
	o3_width=ol_width;
	o3_border=ol_border;
	o3_cellpad=ol_cellpad;
	o3_status=ol_status;
	o3_autostatus=ol_autostatus;
	o3_height=ol_height;
	o3_snapx=ol_snapx;
	o3_snapy=ol_snapy;
	o3_fixx=ol_fixx;
	o3_fixy=ol_fixy;

applications/htmlroot/snmptraps/include/js/overlib.js  view on Meta::CPAN

	o3_captionfont=ol_captionfont;
	o3_closefont=ol_closefont;
	o3_textsize=ol_textsize;
	o3_captionsize=ol_captionsize;
	o3_closesize=ol_closesize;
	o3_timeout=ol_timeout;
	o3_function=ol_function;
	o3_delay=ol_delay;
	o3_hauto=ol_hauto;
	o3_vauto=ol_vauto;
	o3_closeclick=ol_closeclick;
	o3_wrap=ol_wrap;	
	o3_followmouse=ol_followmouse;
	o3_mouseoff=ol_mouseoff;
	o3_closetitle=ol_closetitle;
	o3_css=ol_css;
	o3_compatmode=ol_compatmode;
	o3_fgclass=ol_fgclass;
	o3_bgclass=ol_bgclass;
	o3_textfontclass=ol_textfontclass;
	o3_captionfontclass=ol_captionfontclass;

applications/htmlroot/snmptraps/include/js/overlib.js  view on Meta::CPAN


	set_background("");
	return txt;
}

// Makes table with caption and optional close link
function ol_content_caption(text,title,close) {
	var nameId;
	closing="";
	closeevent="onmouseover";
	if (o3_closeclick==1) closeevent= (o3_closetitle ? "title='" + o3_closetitle +"'" : "") + " onclick";
	if (o3_capicon!="") {
		nameId=' hspace=\"5\"'+' align=\"middle\" alt=\"\"';
		if (typeof o3_dragimg!='undefined'&&o3_dragimg) nameId=' hspace=\"5\"'+' name=\"'+o3_dragimg+'\" id=\"'+o3_dragimg+'\" align=\"middle\" alt=\"Drag Enabled\" title=\"Drag Enabled\"';
		o3_capicon='<img src=\"'+o3_capicon+'\"'+nameId+' />';
	}

	if (close != "") 
		closing='<td '+(!o3_compatmode && o3_closefontclass ? 'class="'+o3_closefontclass : 'align="RIGHT')+'"><a href="javascript:return '+fnRef+'cClick();"'+((o3_compatmode && o3_closefontclass) ? ' class="' + o3_closefontclass + '" ' : ' ')+closeevent+'...
	txt='<table width="'+o3_width+ '" border="0" cellpadding="'+o3_border+'" cellspacing="0" '+(o3_bgclass ? 'class="'+o3_bgclass+'"' : o3_bgcolor+' '+o3_bgbackground+' '+o3_height)+'><tr><td><table width="100%" border="0" cellpadding="0" cellspacing="0...

applications/htmlroot/snmptraps/include/js/overlib.js  view on Meta::CPAN

			if (ar[i]==BACKGROUND) { eval(pf+'background="'+ar[++i]+'"'); continue; }
			if (ar[i]==NOCLOSE) { if (pf!='ol_') opt_NOCLOSE(); continue; }
			if (ar[i]==CAPTION) { eval(pf+"cap='"+escSglQuote(ar[++i])+"'"); continue; }
			if (ar[i]==CENTER || ar[i]==LEFT || ar[i]==RIGHT) { eval(pf+'hpos='+ar[i]); if(pf!='ol_') olHautoFlag=1; continue; }
			if (ar[i]==OFFSETX) { eval(pf+'offsetx='+ar[++i]); continue; }
			if (ar[i]==OFFSETY) { eval(pf+'offsety='+ar[++i]); continue; }
			if (ar[i]==FGCOLOR) { eval(pf+'fgcolor="'+ar[++i]+'"'); continue; }
			if (ar[i]==BGCOLOR) { eval(pf+'bgcolor="'+ar[++i]+'"'); continue; }
			if (ar[i]==TEXTCOLOR) { eval(pf+'textcolor="'+ar[++i]+'"'); continue; }
			if (ar[i]==CAPCOLOR) { eval(pf+'capcolor="'+ar[++i]+'"'); continue; }
			if (ar[i]==CLOSECOLOR) { eval(pf+'closecolor="'+ar[++i]+'"'); continue; }
			if (ar[i]==WIDTH) { eval(pf+'width='+ar[++i]); continue; }
			if (ar[i]==BORDER) { eval(pf+'border='+ar[++i]); continue; }
			if (ar[i]==CELLPAD) { i=opt_MULTIPLEARGS(++i,ar,(pf+'cellpad')); continue; }
			if (ar[i]==STATUS) { eval(pf+"status='"+escSglQuote(ar[++i])+"'"); continue; }
			if (ar[i]==AUTOSTATUS) { eval(pf +'autostatus=('+pf+'autostatus == 1) ? 0 : 1'); continue; }
			if (ar[i]==AUTOSTATUSCAP) { eval(pf +'autostatus=('+pf+'autostatus == 2) ? 0 : 2'); continue; }
			if (ar[i]==HEIGHT) { eval(pf+'height='+pf+'aboveheight='+ar[++i]); continue; } // Same param again.
			if (ar[i]==CLOSETEXT) { eval(pf+"close='"+escSglQuote(ar[++i])+"'"); continue; }
			if (ar[i]==SNAPX) { eval(pf+'snapx='+ar[++i]); continue; }
			if (ar[i]==SNAPY) { eval(pf+'snapy='+ar[++i]); continue; }

applications/htmlroot/snmptraps/include/js/overlib.js  view on Meta::CPAN

			if (ar[i]==CAPTIONFONT) { eval(pf+"captionfont='"+escSglQuote(ar[++i])+"'"); continue; }
			if (ar[i]==CLOSEFONT) { eval(pf+"closefont='"+escSglQuote(ar[++i])+"'"); continue; }
			if (ar[i]==TEXTSIZE) { eval(pf+'textsize="'+ar[++i]+'"'); continue; }
			if (ar[i]==CAPTIONSIZE) { eval(pf+'captionsize="'+ar[++i]+'"'); continue; }
			if (ar[i]==CLOSESIZE) { eval(pf+'closesize="'+ar[++i]+'"'); continue; }
			if (ar[i]==TIMEOUT) { eval(pf+'timeout='+ar[++i]); continue; }
			if (ar[i]==FUNCTION) { if (pf=='ol_') { if (typeof ar[i+1]!='number') { v=ar[++i]; ol_function=(typeof v=='function' ? v : null); }} else {fnMark = 0; v = null; if (typeof ar[i+1]!='number') v = ar[++i];  opt_FUNCTION(v); } continue; }
			if (ar[i]==DELAY) { eval(pf+'delay='+ar[++i]); continue; }
			if (ar[i]==HAUTO) { eval(pf+'hauto=('+pf+'hauto == 0) ? 1 : 0'); continue; }
			if (ar[i]==VAUTO) { eval(pf+'vauto=('+pf+'vauto == 0) ? 1 : 0'); continue; }
			if (ar[i]==CLOSECLICK) { eval(pf +'closeclick=('+pf+'closeclick == 0) ? 1 : 0'); continue; }
			if (ar[i]==WRAP) { eval(pf +'wrap=('+pf+'wrap == 0) ? 1 : 0'); continue; }
			if (ar[i]==FOLLOWMOUSE) { eval(pf +'followmouse=('+pf+'followmouse == 1) ? 0 : 1'); continue; }
			if (ar[i]==MOUSEOFF) { eval(pf +'mouseoff=('+pf+'mouseoff==0) ? 1 : 0'); v=ar[i+1]; if (pf != 'ol_' && eval(pf+'mouseoff') && typeof v == 'number' && (v < pmStart || v > pmUpper)) olHideDelay=ar[++i]; continue; }
			if (ar[i]==CLOSETITLE) { eval(pf+"closetitle='"+escSglQuote(ar[++i])+"'"); continue; }
			if (ar[i]==CSSOFF||ar[i]==CSSCLASS) { eval(pf+'css='+ar[i]); continue; }
			if (ar[i]==COMPATMODE) { eval(pf+'compatmode=('+pf+'compatmode==0) ? 1 : 0'); continue; }
			if (ar[i]==FGCLASS) { eval(pf+'fgclass="'+ar[++i]+'"'); continue; }
			if (ar[i]==BGCLASS) { eval(pf+'bgclass="'+ar[++i]+'"'); continue; }
			if (ar[i]==TEXTFONTCLASS) { eval(pf+'textfontclass="'+ar[++i]+'"'); continue; }
			if (ar[i]==CAPTIONFONTCLASS) { eval(pf+'captionfontclass="'+ar[++i]+'"'); continue; }

applications/htmlroot/snmptraps/include/js/overlib.js  view on Meta::CPAN

		}
	}
	return pM.join();
}

// dummy function which will be overridden 
function isExclusive(args) {
	return false;
}

// function will delay close by time milliseconds
function hideDelay(time) {
	if (time&&!o3_delay) {
		if (o3_timerid > 0) clearTimeout(o3_timerid);

		o3_timerid=setTimeout("cClick()",(o3_timeout=time));
	}
}

// Was originally in the placeLayer() routine; separated out for future ease
function horizontalPlacement(browserWidth, horizontalScrollAmount, widthFix) {

applications/htmlroot/snmptraps/include/js/overlib.js  view on Meta::CPAN

registerHook("ol_content_caption", ol_content_caption, FALTERNATE, CSSOFF);
registerHook("ol_content_background", ol_content_background, FALTERNATE, CSSOFF);
registerHook("ol_content_simple", ol_content_simple, FALTERNATE, CSSCLASS);
registerHook("ol_content_caption", ol_content_caption, FALTERNATE, CSSCLASS);
registerHook("ol_content_background", ol_content_background, FALTERNATE, CSSCLASS);
registerPostParseFunction(checkPositionFlags);
registerHook("hideObject", nbspCleanup, FAFTER);
registerHook("horizontalPlacement", horizontalPlacement, FCHAIN);
registerHook("verticalPlacement", verticalPlacement, FCHAIN);
if (olNs4||(olIe5&&isMac)||olKq) olLoaded=1;
registerNoParameterCommands('sticky,autostatus,autostatuscap,fullhtml,hauto,vauto,closeclick,wrap,followmouse,mouseoff,compatmode');

applications/log4perl.cnf  view on Meta::CPAN

#   %H Hostname (if Sys::Hostname is available)
#   %l Fully qualified name of the calling method followed by the callers source 
#      the file name and line number between parentheses.
#   %L Line number within the file where the log statement was issued
#   %m The message to be logged
#   %m{chomp} The message to be logged, stripped off a trailing newline
#   %M Method or function where the logging request was issued
#   %n Newline (OS-independent)
#   %p Priority of the logging event
#   %P pid of the current process
#   %r Number of milliseconds elapsed from program start to logging event
#   %R Number of milliseconds elapsed from last logging event to current logging 
#      event 
#   %T A stack trace of functions called
#   %x The topmost NDC (see below)
#   %X{key} The entry 'key' of the MDC (see below)
#   %% A literal percent (%) sign
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# log4perl.appender.<category>.layout = PatternLayout
# log4perl.appender.<category>.layout.ConversionPattern = [%d] %H | %p | %P | %C | %c | %l - %m%n  %T%n

applications/tools/resources/CalendarPopup-combined.js  view on Meta::CPAN


// ------------------------------------------------------------------
// parseDate( date_string [, prefer_euro_format] )
//
// This function takes a date string and tries to match it to a
// number of possible date formats to get the value. It will try to
// match against the following international formats, in this order:
// y-M-d   MMM d, y   MMM d,y   y-MMM-d   d-MMM-y  MMM d
// M/d/y   M-d-y      M.d.y     MMM-d     M/d      M-d
// d/M/y   d-M-y      d.M.y     d-MMM     d/M      d-M
// A second argument may be passed to instruct the method to search
// for formats like d/M/y (european format) before M/d/y (American).
// Returns a Date object or null if no patterns match.
// ------------------------------------------------------------------
function parseDate(val) {
	var preferEuro=(arguments.length==2)?arguments[1]:false;
	generalFormats=new Array('y-M-d','MMM d, y','MMM d,y','y-MMM-d','d-MMM-y','MMM d');
	monthFirst=new Array('M/d/y','M-d-y','M.d.y','MMM-d','M/d','M-d');
	dateFirst =new Array('d/M/y','d-M-y','d.M.y','d-MMM','d/M','d-M');
	var checkList=new Array('generalFormats',preferEuro?'dateFirst':'monthFirst',preferEuro?'monthFirst':'dateFirst');
	var d=null;

applications/tools/resources/CalendarPopup-combined.js  view on Meta::CPAN

cal.setDisabledWeekDays(0,1); // To disable selecting the 1st or 2nd days of the week

// Selectively disable individual days or date ranges. Disabled days will not
// be clickable, and show as strike-through text on current browsers.
// Date format is any format recognized by parseDate() in date.js
// Pass a single date to disable:
cal.addDisabledDates("2003-01-01");
// Pass null as the first parameter to mean "anything up to and including" the
// passed date:
cal.addDisabledDates(null, "01/02/03");
// Pass null as the second parameter to mean "including the passed date and
// anything after it:
cal.addDisabledDates("Jan 01, 2003", null);
// Pass two dates to disable all dates inbetween and including the two
cal.addDisabledDates("January 01, 2003", "Dec 31, 2003");

// When the 'year' select is displayed, set the number of years back from the 
// current year to start listing years. Default is 2.
// This is also used for year drop-down, to decide how many years +/- to display
cal.setYearSelectStartOffset(2);

applications/tools/templates/master/rsync-wrapper-distributed-example.sh  view on Meta::CPAN

# ------------------------------------------------------------------------------
# rsync-wrapper-distributed.sh for asnmtap, v2.002.xxx - wrapper script for rsync
#   execution via ssh key for use with rsync-mirror-distributed.sh & rsync-mirror.conf
#
#   rsync-wrapper need to be installed onto the master server into /opt/asnmtap/applications/master and
#   rsync-mirror.sh & rsync-mirror.conf onto the slave server into /opt/asnmtap/applications/slave
#
#   Accepted rsync calls are as follows:
#     rsync --server --sender @options . $chrootDir/../../otherdir would succeed
#
#   '../' are forbidden into a directory of filename for security reasons !!!
# ------------------------------------------------------------------------------
# vi hosts.allow
# rsync: <hostname slave distributed servers>
#
# vi hosts.deny
# rsync: ALL
# ------------------------------------------------------------------------------

use strict;

applications/tools/templates/master/rsync-wrapper-failover-example.sh  view on Meta::CPAN

#   execution via ssh key for use with rsync-mirror-failover.sh
#
#   rsync-wrapper-failover.sh need to be installed onto the master server into /opt/asnmtap/applications/master and
#   rsync-mirror-failover.sh & rsync-mirror-failover.conf onto the slave server into /opt/asnmtap/applications/slave
#
#   Accepted rsync calls are as follows:
#     rsync --server --sender --delete --delete-after @options . $chrootDir/../../otherdir would succeed
#   from rsync version 2.6.7
#     rsync --server --sender @options . $chrootDir/../../otherdir would succeed
#
#   '../' are forbidden into a directory of filename for security reasons !!!
# ------------------------------------------------------------------------------
# vi hosts.allow
# rsync: <hostname slave failover servers>
#
# vi hosts.deny
# rsync: ALL
# ------------------------------------------------------------------------------

use strict;

applications/tools/templates/slave/rsync-mirror-distributed-example.conf  view on Meta::CPAN

# ------------------------------------------------------------------------------
# © Copyright 2003-2011 Alex Peeters [alex.peeters@citap.be]
# ------------------------------------------------------------------------------
# You may need to change $chrootDir into the 'rsync-wrapper-distributed.sh' script!!!
# ------------------------------------------------------------------------------
#
# Comments, starting with a '#' anywhere on the line, are ignored
# Whitespace separates arguments
# Exactly one of source or target must include a machine specification.
# '../' are forbidden into a directory of filename for security reasons !!!
#
# Here's the most common use:
#
# Send the chroot master server /tmp/master/ directory (must end with a '/') to slave server directory /tmp/slave/
# ape@asnmtap.citap.com:/tmp/master/  /tmp/slave/  -c -z
#
# Here are some other examples:
#
# Send the chroot master server /tmp/master/ directory (must end with a '/') to slave server directory /tmp/slave/home
# ape@asnmtap.citap.com:/tmp/master/  /tmp/slave/home  -c -z

applications/tools/templates/slave/rsync-mirror-failover-example.conf  view on Meta::CPAN

# ------------------------------------------------------------------------------
# © Copyright 2003-2011 Alex Peeters [alex.peeters@citap.be]
# ------------------------------------------------------------------------------
# You may need to change $chrootDir into the 'rsync-wrapper-failover.sh' script!!!
# ------------------------------------------------------------------------------
#
# Comments, starting with a '#' anywhere on the line, are ignored
# Whitespace separates arguments
# Exactly one of source or target must include a machine specification.
# '../' are forbidden into a directory of filename for security reasons !!!
#
# Here's the most common use:
#
# Send the chroot master server /tmp/master/ directory (must end with a '/') to slave server directory /tmp/slave/
# ape@asnmtap.citap.com:/tmp/master/  /tmp/slave/  -c -z
#
# Here are some other examples:
#
# Send the chroot master server /tmp/master/ directory (must end with a '/') to slave server directory /tmp/slave/home
# ape@asnmtap.citap.com:/tmp/master/  /tmp/slave/home  -c -z

etc/ppp/pap-secrets  view on Meta::CPAN

#
# /etc/ppp/pap-secrets
#
# This is a pap-secrets file to be used with the AUTO_PPP function of
# mgetty. mgetty-0.99 is preconfigured to startup pppd with the login option
# which will cause pppd to consult /etc/passwd (and /etc/shadow in turn)
# after a user has passed this file. Don't be disturbed therfore by the fact
# that this file defines logins with any password for users. /etc/passwd
# (again, /etc/shadow, too) will catch passwd mismatches.
#
# This file should block ALL users that should not be able to do AUTO_PPP.
# AUTO_PPP bypasses the usual login program so its necessary to list all
# system userids with regular passwords here.
#

lib/ASNMTAP/Asnmtap/Applications.pod  view on Meta::CPAN

 rsync -e "ssh -i /home/asnmtap/.ssh/rsync" -a /opt/asnmtap/results/test/ asnmtap@probe.citap.be:/opt/asnmtap/results/test/ -v -c -z --exclude=*-all.txt --exclude=*-nok.txt --exclude=*-KnownError --exclude=*.tmp --exclude=*.sql
   building file list ... done
   ./
   yyyymmdd-check_dummy-PROBE-01-T1-csv.txt
   ...

 /opt/asnmtap/applications/slave/rsync-mirror-distributed-probe.citap.be.sh
   building file list ... done
   yyyymmdd-check_dummy-PROBE-01-T5-csv.txt
   ...
   sent nnnn bytes received nnnn bytes nnnn.nn bytes/sec
   total size is nnnn speedup is nnnn.nn

   when problems: check value off 'KeyRsync'

=back

=item linux

=over 4

lib/ASNMTAP/Asnmtap/Applications.pod  view on Meta::CPAN

   'script $APPLICATIONPATH/slave/DisplayCT-<daemon name>.sh stop|start|restart|reload'

   'script $APPLICATIONPATH/master/CollectorCT-<daemon name>.sh stop|start|restart|reload'
   'script $APPLICATIONPATH/slave/CollectorCT-<daemon name>.sh stop|start|restart|reload'

   'remove $PIDPATH/DisplayCT-<daemon name>.pid'
   'remove $PIDPATH/CollectorCT-<daemon name>.pid'

   'killall <pid>'

 '../' are forbidden into a directory of filename for security reasons !!!

 You need to create an ssh account:

   ssh-keygen -t dsa -f /home/asnmtap/.ssh/asnmtap

   vi /home/asnmtap/.ssh/authorized_keys
   from="localhost", command="/opt/asnmtap/applications/sbin/sshWrapperASNMTAP.pl" ssh-dss AAAAB3Nza...+90k63Mx...3OmZOk= alex.peeters@citap.be
 or with
   from="localhost", command="ASNMTAP_PERL5LIB=/opt/asnmtap/cpan-shared/lib/perl5; /opt/asnmtap/applications/sbin/sshWrapperASNMTAP.pl" ssh-dss AAAAB3Nza...+90k63Mx...3OmZOk= alex.peeters@citap.be

lib/ASNMTAP/Asnmtap/Applications.pod  view on Meta::CPAN


 mysql -u root -p
 mysql> SHOW MASTER STATUS;
 #      If the master has been previously running without --log-bin enabled, the log
 #      name and position values displayed by SHOW MASTER STATUS will be empty.
 mysql> UNLOCK TABLES;
 mysql> QUIT;

 Write down the parrameters from SHOW MASTER STATUS when master already exists !!!

 Make sure the [mysqld] section of the `my.cnf' file on the master host includes a log-bin option. The section should also have a server-id=master_id option, where master_id must be an integer value from 1 to 2^32 - 1.

 vi /etc/my.cnf
 [mysqld]
   datadir=/var/lib/mysql
   socket=/var/lib/mysql/mysql.sock
   port=3306

   server-id=1
   log-bin=asnmtap
   log-slave-updates

lib/ASNMTAP/Asnmtap/Applications.pod  view on Meta::CPAN

 DUMMY-T3
 DUMMY-T4
 DUMMY-T5

=item run archiver.pl on cygwin

 Install libpng... needed, install this now

 mount -f -s -b "D:/cygwin/usr/sbin" "/usr/sbin" <-- to update the registry

 cygrunsrv --install "CYGWIN crontab" --path /usr/sbin/cron.exe -a '-D' -e CYGWIN=ntsec
 cygrunsrv --stop    "CYGWIN crontab"
 cygrunsrv --start   "CYGWIN crontab"
 cygrunsrv --remove  "CYGWIN crontab"

 0   2 * * * cd /opt/asnmtap/applications; ./archive.sh > /dev/null  <-- crontab op master server
 30 23 * * * cd /opt/asnmtap/applications/bin; ./holidayBundleSetDowntimes.sh > /dev/null  <-- crontab op master server

=item maximum timeslot interval greather then 2 hours:

asyncroon scheduling required

lib/ASNMTAP/Asnmtap/Applications.pod  view on Meta::CPAN


 more /etc/httpd/conf.d/asnmtap.conf
 ...
 <VirtualHost *:80>
   ...
   SetEnv PERL5LIB /opt/asnmtap/cpan-shared/lib/perl5
   ...
 </VirtualHost>


 # Module section  - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 vi Makefile.pl
 ...
 use lib qw(/opt/asnmtap/cpan-shared/lib/perl5/.);
 ...

 # Configuration section - - - - - - - - - - - - - - - - - - - - - - - - -
 If you're not the Perl administrator you probably don't have permission to install a module to its default location.
 Then you should install it for your own use into your home directory or other directory like so:

 perl Makefile.PL PREFIX=/opt/asnmtap/cpan-shared SITELIBEXP=/opt/asnmtap/cpan-shared/lib/perl5 LIB=/opt/asnmtap/cpan-shared/lib/perl5 INSTALLMAN1DIR=/opt/asnmtap/cpan-shared/share/man/man1 INSTALLMAN3DIR=/opt/asnmtap/cpan-shared/share/man/man3 INSTA...
 or
 perl Makefile.PL INSTALL_BASE=/opt/asnmtap/cpan-shared

 This will put modules into /opt/asnmtap/cpan-shared/lib/perl5, man pages into /opt/asnmtap/cpan-shared/man and programs into /opt/asnmtap/cpan-shared/bin.

   INSTALLARCHLIB     INSTALL_BASE/lib/perl5/$Config{archname}

lib/ASNMTAP/Asnmtap/Applications.pod  view on Meta::CPAN

 openssl req -new -x509 -days 3650 -key server-ca.key -out server-ca.crt
 # To remove the pass phrase from the key file, execute this: 
 openssl rsa -in server-ca.key -out server-ca-nopass.key
 openssl x509 -in server-ca.crt -text -noout

=item Step 2: Make a key and a certificate for the web server:

 openssl genrsa -des3 -out citap-server.key 1024
 openssl req -new -key citap-server.key -out citap-server.csr
   ...
   Common Name (eg, your name or your server's hostname) []:secure.citap.com <=== This must be the real FQDN of your server!!!
 openssl rsa -in citap-server.key -out citap-server-nopass.key
 openssl x509 -req -in citap-server.csr -out citap-server.crt -sha1 -CA server-ca.crt -CAkey server-ca.key -CAcreateserial -days 3650
 openssl x509 -in citap-server.crt -text -noout

=item Step 3: Creating Client Certificates for Authentication 

 openssl genrsa -des3 -out alex-peeters.key 1024
 openssl req -new -key alex-peeters.key -out alex-peeters.csr
 openssl x509 -req -in alex-peeters.csr -out alex-peeters.crt -sha1 -CA server-ca.crt -CAkey server-ca.key -CAcreateserial -days 3650
 openssl pkcs12 -export -in alex-peeters.crt -inkey alex-peeters.key -name "Alex Peeters" -out alex-peeters.p12

lib/ASNMTAP/Asnmtap/Applications/CGI.pm  view on Meta::CPAN

    $sessionID = $cgi->param("CGISESSID") || undef;
  }

  use CGI::Session;
  my $session = CGI::Session->new ('driver:File;serializer:Default;id:MD5', $sessionID, {Directory=>"$CGISESSPATH"});
  $sessionID = $session->id();

  if ( $level eq 'guest' or $level eq 'member' ) {
    my $cookieID = ( defined $sessionID ) ? $sessionID : '1';
    my $domain = ( ( $ENV{REMOTE_ADDR} eq $REMOTE_ADDR and $ENV{HTTP_HOST} =~ /^${REMOTE_HOST}(:\d+)?/ ) ? $REMOTE_HOST : $HTTPSSERVER );
    my $cgiCookieOutRootCgisess = $cgi->cookie(-name=>'asnmtap-root-cgisess', -value=>"$cookieID", -expires=>'+10h', -path=>"$HTTPSURL/cgi-bin", -domain=>"$domain", -secure=>'0');
    ($cfhOld) = $|; $cfhNew = select (STDOUT); $| = 1;
    print $cgi->header(-cookie=>$cgiCookieOutRootCgisess);
    $| = $cfhOld; select ($cfhNew);
  } else {
    ($cfhOld) = $|; $cfhNew = select (STDOUT); $| = 1;
    print $cgi->header;
    $| = $cfhOld; select ($cfhNew);
  }

  my $logonRequestLogoff = ($cgi->param('logonRequest') or "logon");

lib/ASNMTAP/Asnmtap/Plugins.pm  view on Meta::CPAN

   A(dmin)       : long screendebugging on for Admins
   S(erver Admin): long screendebugging on for Server Admins
" . $_[0]->{_programHelpSuffix};

  push ( @{ $_[0]->{_programGetOptions} }, 'status|S:s', 'asnmtapEnv|A:s', 'onDemand|O:s', 'logging|L:s', 'debugfile|D|dumphttp|httpdump:s', 'debug|d:s' );

  my ($_programUsageSuffix, $_programHelpSuffix);

  foreach ( @{ $_[0]->{_programGetOptions} } ) {
    for ($_) {
      /^trendline\|T([:=])i$/           && do { $_[0]->{_getOptionsType}->{trendline}   = $1; $_programUsageSuffix .= ($1 eq ':' ? ' [' : ' ') .'-T|--trendline <TRENDLINE>'. ($1 eq ':' ? ']' : ''); $_programHelpSuffix .= "-T, --trendline <TRENDLINE>\...
      /^timeout\|t([:=])i$/             && do { $_[0]->{_getOptionsType}->{timeout}     = $1; $_programUsageSuffix .= ($1 eq ':' ? ' [' : ' ') .'-t|--timeout <TIMEOUT>'. ($1 eq ':' ? ']' : ''); $_programHelpSuffix .= "-t, --timeout=<TIMEOUT>\n   time...
      /^environment\|e([:=])s$/         && do { $_[0]->{_getOptionsType}->{environment} = $1; $_programUsageSuffix .= ($1 eq ':' ? ' [' : ' ') .'-e|--environment <ENVIRONMENT>'. ($1 eq ':' ? ']' : ''); $_programHelpSuffix .= "-e, --environment=<ENVIR...
      /^proxy([:=])s$/                  && do { $_[0]->{_getOptionsType}->{proxy}       = $1; $_programUsageSuffix .= ($1 eq ':' ? ' [' : ' ') .'--proxy <username:password@proxy:port&domain[,domain]>'. ($1 eq ':' ? ']' : ''); $_programHelpSuffix .= "...
      /^host\|H([:=])s$/                && do { $_[0]->{_getOptionsType}->{host}        = $1; $_programUsageSuffix .= ($1 eq ':' ? ' [' : ' ') .'-H|--host <HOST>'. ($1 eq ':' ? ']' : ''); $_programHelpSuffix .= "-H, --host=<HOST>\n   hostname or ip a...
      /^url\|U([:=])s$/                 && do { $_[0]->{_getOptionsType}->{url}         = $1; $_programUsageSuffix .= ($1 eq ':' ? ' [' : ' ') .'-U|--url <URL>'. ($1 eq ':' ? ']' : ''); $_programHelpSuffix .= "-U, --url=<URL>\n"; last; };
      /^port\|P([:=])i$/                && do { $_[0]->{_getOptionsType}->{port}        = $1; $_programUsageSuffix .= ($1 eq ':' ? ' [' : ' ') .'-P|--port <PORT>'. ($1 eq ':' ? ']' : ''); $_programHelpSuffix .= "-P, --port=<PORT>\n"; last; };
      /^community\|C([:=])s$/           && do { $_[0]->{_getOptionsType}->{community}   = $1; $_programUsageSuffix .= ($1 eq ':' ? ' [' : ' ') .'-C|--community <SNMP COMMUNITY>'. ($1 eq ':' ? ']' : ''); $_programHelpSuffix .= "-C, --community=<SNMP C...
      /^username\|u\|loginname([:=])s$/ && do { $_[0]->{_getOptionsType}->{username}    = $1; $_programUsageSuffix .= ($1 eq ':' ? ' [' : ' ') .'-u|--username|--loginname <USERNAME>'. ($1 eq ':' ? ']' : ''); $_programHelpSuffix .= "-u, --username/--l...
      /^password\|p\|passwd([:=])s$/    && do { $_[0]->{_getOptionsType}->{password}    = $1; $_programUsageSuffix .= ($1 eq ':' ? ' [' : ' ') .'-p|--password|--passwd <PASSWORD>'. ($1 eq ':' ? ']' : ''); $_programHelpSuffix .= "-p, --password/--pass...
      /^filename\|F([:=])s$/            && do { $_[0]->{_getOptionsType}->{filename}    = $1; $_programUsageSuffix .= ($1 eq ':' ? ' [' : ' ') .'-F|--filename <FILENAME>'. ($1 eq ':' ? ']' : ''); $_programHelpSuffix .= "-F, --filename=<FILENAME>\n   ...
      /^interval\|i([:=])i$/            && do { $_[0]->{_getOptionsType}->{interval}    = $1; $_programUsageSuffix .= ($1 eq ':' ? ' [' : ' ') .'-i|--interval <SECONDS>'. ($1 eq ':' ? ']' : ''); $_programHelpSuffix .= "-i, --interval=<SECONDS>\n   in...
      /^loglevel\|l([:=])s$/            && do { $_[0]->{_getOptionsType}->{loglevel}    = $1; $_programUsageSuffix .= ($1 eq ':' ? ' [' : ' ') .'-l|--loglevel <LOGLEVEL>'. ($1 eq ':' ? ']' : ''); $_programHelpSuffix .= "-l, --loglevel=<LOGLEVEL>\n   ...
      /^year\|Y([:=])i$/                && do { $_[0]->{_getOptionsType}->{year}        = $1; $_programUsageSuffix .= ($1 eq ':' ? ' [' : ' ') .'-Y|--year <YEAR>'. ($1 eq ':' ? ']' : ''); $_programHelpSuffix .= "-Y, --year=<YEAR>\n   year, format: [1...
      /^quarter\|Q([:=])i$/             && do { $_[0]->{_getOptionsType}->{quarter}     = $1; $_programUsageSuffix .= ($1 eq ':' ? ' [' : ' ') .'-Q|--quarter <QUARTER>'. ($1 eq ':' ? ']' : ''); $_programHelpSuffix .= "-Q, --quarter=<QUARTER>\n   quar...
      /^month\|M([:=])i$/               && do { $_[0]->{_getOptionsType}->{month}       = $1; $_programUsageSuffix .= ($1 eq ':' ? ' [' : ' ') .'-M|--month <MONTH>'. ($1 eq ':' ? ']' : ''); $_programHelpSuffix .= "-M, --month=<MONTH>\n   month, where...

      /^warning\|w([:=])s$/             && do { $_[0]->{_getOptionsType}->{warning}     = $1; last; };
      /^critical\|c([:=])s$/            && do { $_[0]->{_getOptionsType}->{critical}    = $1; last; };
    }
  }

lib/ASNMTAP/Asnmtap/Plugins.pm  view on Meta::CPAN

  $_[0]->{_pluginValues}->{stateError} = $STATE{$_[0]->{_pluginValues}->{stateValue}};

  $_[0]->{_pluginValues}->{message}    = $_[0]->{_programDescription};

  $_[0]->{_pluginValues}->{alert}      = undef;
  $_[0]->{_pluginValues}->{error}      = undef;
  $_[0]->{_pluginValues}->{result}     = undef;

  $_[0]->{_pluginValues}->{performanceData} = undef;

  my ($startTimeSeconds, $startTimeMicroseconds) = gettimeofday();
  $_[0]->{_pluginValues}->{startTime}  = $startTimeSeconds .'.'. $startTimeMicroseconds;
  $_[0]->{_pluginValues}->{endTime}    = $_[0]->{_pluginValues}->{startTime};

  # Options that are unknown, ambiguous or supplied with an invalid option value are passed through in @ARGV

  if ( @ARGV ) {
    $_[0]->{_pluginValues}->{error} = "Unknown option(s) @ARGV";
    $_[0]->{_exit_} = 2;
    $_[0]->exit(0);
  }

lib/ASNMTAP/Asnmtap/Plugins.pm  view on Meta::CPAN

    my $critical = $1 if ($_[0]->{_getOptionsArgv}->{critical} =~ /^([1-9]?(?:\d*))$/ );
    $_[0]->printUsage ('Invalid critical threshold range: '. $_[0]->{_getOptionsArgv}->{critical}) unless (defined $critical);
  } elsif ( exists $_[0]->{_getOptionsType}->{critical} and $_[0]->{_getOptionsType}->{critical} eq '=' ) {
    $_[0]->printUsage ('Missing command line argument critical');
  }

  # Default _pluginValues - - - - - - - - - - - - - - - - - - - - - - - -

  $_[0]->{_pluginValues}->{message}  .= ' ('. $_[0]->{_getOptionsValues}->{environment} .')' if ( defined $_[0]->{_getOptionsValues}->{environment} );

  ($startTimeSeconds, $startTimeMicroseconds) = gettimeofday();
  $_[0]->{_pluginValues}->{startTime} = $startTimeSeconds .'.'. $startTimeMicroseconds;
  $_[0]->{_pluginValues}->{endTime}   = $_[0]->{_pluginValues}->{startTime};

  # Timing Out Slow Plugins - part 1/2 - - - - - - - - - - - - - - - - - -

  if ( exists $_[0]->{_getOptionsArgv}->{timeout} ) {
    $_[0]->{_pluginValues}->{_alarm_} = alarm (0);

    if ( $_[0]->{_pluginValues}->{_alarm_} && $_[0]->{_getOptionsArgv}->{timeout} > $_[0]->{_pluginValues}->{_alarm_} ) {
      $_[0]->{_getOptionsArgv}->{timeout} = $_[0]->{_pluginValues}->{_alarm_};
    }

lib/ASNMTAP/Asnmtap/Plugins.pm  view on Meta::CPAN


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

sub timeout { &_checkAccObjRef ( $_[0] ); &_checkSubArgs1; $_[0]->{_timeout} = $_[1] if ( defined $_[1] ); $_[0]->{_timeout}; }

# Class accessor methods  - - - - - - - - - - - - - - - - - - - - - - - -

sub setEndTime_and_getResponsTime {
  &_checkAccObjRef ( $_[0] ); &_checkSubArgs1;

  my ($endTimeSeconds, $endTimeMicroseconds) = gettimeofday();
  $_[0]->{_pluginValues}->{endTime} = "$endTimeSeconds.$endTimeMicroseconds";

  my ($startTimeSeconds, $startTimeMicroseconds) = split (/\./, $_[1]);
  $startTimeMicroseconds = 0 unless ( defined $startTimeMicroseconds );
  return ( defined $startTimeSeconds ? int ( ( ( $endTimeSeconds >= $startTimeSeconds ) ? tv_interval ( [$startTimeSeconds, $startTimeMicroseconds], [$endTimeSeconds, $endTimeMicroseconds] ) : tv_interval ( [$endTimeSeconds, $endTimeMicroseconds], [$...
}

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

sub write_debugfile {
  &_checkAccObjRef ( $_[0] ); &_checkReadOnly2;

  my $debugfile = $_[0]->{_getOptionsArgv}->{debugfile};

  if ( defined $debugfile ) {

lib/ASNMTAP/Asnmtap/Plugins.pm  view on Meta::CPAN

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

  $_[0]->pluginValues ( { stateValue => $ERRORS{UNKNOWN}, error => 'HELP, THERE IS A PROBLEM WITH THE PLUGIN' }, $TYPE{APPEND} ) if ( $_[0]->{_pluginValues}->{stateValue} == $ERRORS{DEPENDENT} or ( exists $_[0]->{_exit_} and $_[0]->{_exit_} == 2 ) );

  $_[0]->appendPerformanceData('Status='. $_[0]->{_pluginValues}->{stateValue} .';1;2;0;3') if ( defined $_[1] &&  $_[1] =~ /^[1357]$/ );

  my $duration = $_[0]->setEndTime_and_getResponsTime ($_[0]->{_pluginValues}->{startTime});
  $_[0]->appendPerformanceData('Compilation='. ($_[0]->setEndTime_and_getResponsTime ($^T) - $duration) .'ms;;;0;') if ( $_[1] =~ /^[2367]$/ );

  if ( $_[0]->{_getOptionsArgv}->{trendline} ) {
    my $responseTimeSeconds = ( $duration / 1000 );  # convert to seconds

    if ( $_[0]->{_getOptionsValues}->{debug} ) {
      my ($startTimeEpoch, undef) = split (/\./, $_[0]->{_pluginValues}->{startTime});
      my ($endTimeEpoch, undef)   = split (/\./, $_[0]->{_pluginValues}->{endTime});
      print "\nStart time   : ", scalar(localtime($startTimeEpoch)), "\n";
      print "End time     : ", scalar(localtime($endTimeEpoch)), "\n";
      print "Trendline    : ". $_[0]->{_getOptionsArgv}->{trendline} ."\n";
      print "Response time: $responseTimeSeconds\n";
    }

lib/ASNMTAP/Asnmtap/Plugins.pod  view on Meta::CPAN

    T(true)       : normal screendebugging on
    L(ong)        : long screendebugging on
    M(oderator)   : long screendebugging on for Moderators
    A(dmin)       : long screendebugging on for Admins
    S(erver Admin): long screendebugging on for Server Admins

=item reserved command line options (autoinsertions)

 -t, --timeout=<TIMEOUT>

    timeout threshold (seconds) from which an UNKNOWN status will result when timing out slow plugins

    add: new ... (_programGetOptions => ['timeout|t:i' or 'timeout|t=i'])

    autoadd [-t|--timeout <TIMEOUT>] to _programUsageSuffix

    autoadd -t, --timeout=<TIMEOUT> ... to _programHelpSuffix

 -T, --trendline=<TRENDLINE>

    trendline threshold (seconds) from which a TRENDLINE status will result for the plugin response time

    add: new ... (_programGetOptions => ['trendline|T:i' or trendline|T=i'])

    autoadd [-T|--trendline <TRENDLINE>] to _programUsageSuffix

    autoadd -T, --trendline=<TRENDLINE> ..0 to _programHelpSuffix

 -e, --environment=<ENVIRONMENT>

    P(roduction)  and set the _getOptionsValues to 'Production'

lib/ASNMTAP/Asnmtap/Plugins.pod  view on Meta::CPAN

    XML filename with the ASNMTAP/Nagios compatible test results

    add: new ... (_programGetOptions => ['filename|F:s' or 'filename|F=s'])

    autoadd [-F|--filename <FILENAME>] to _programUsageSuffix

    autoadd -F, --filename=<FILENAME> ... to _programHelpSuffix

 -i, --interval=<SECONDS>

    interval threshold (seconds) from which a CRITICAL (2x) or WARNING (1x) status will result when XML fingerprint out of time

    add: new ... (_programGetOptions => ['interval|i:i' or 'interval|i=i'])

    autoadd [-i|--interval <SECONDS>] to _programUsageSuffix

    autoadd -i, --interval=<SECONDS> ... to _programHelpSuffix

-l, --loglevel=<LOGLEVEL>

    loglevel, one of (order of decrescent verbosity): debug, verbose, notice, info, warning, err, crit, alert, emerg

lib/ASNMTAP/Asnmtap/Plugins.pod  view on Meta::CPAN

=item error

error description

=item result

returned results from the test

=item performanceData

look at section 'Performance data'

=item startTime

time set the when the class object initialization is finished

=item endTime

time of the last run of the function setEndTime_and_getResponsTime()

=back

lib/ASNMTAP/Asnmtap/Plugins.pod  view on Meta::CPAN


get_logfiledate()
get_csvfiledate()
get_csvfiletime()

get_epoch()
get_week()
get_wday()
get_hour()
get_min()
get_seconds()
get_day()
get_month()
get_year()
get_yearMonthDay()

get_timeslot()

=head1 METHODS

=head2 Object accessor methods

lib/ASNMTAP/Asnmtap/Plugins.pod  view on Meta::CPAN

=item error

scalar, the message description for the error

=item result

scalar, the returned result from the last test

=item performanceData

look at section 'Performance data'

=item startTime

the time set after the compilation and initialisation off the plugin.

scalar, format: 'seconds.microseconds'

=item endTime

is the time set by the last call off the function setEndTime_and_getResponsTime()

scalar, format: 'seconds.microseconds', default: equals to 'startTime'

=back

=item value (optional)

scalar, the value to set

=back

=item Function

lib/ASNMTAP/Asnmtap/Plugins.pod  view on Meta::CPAN

UOM (unit of measurement) is one of:

=over 4

=item a.

no unit specified - assume a number (int or float) of things (eg, users, processes, load averages)

=item b.

s - seconds (also us, ms)

=item c.

% - percentage

=item d.

B - bytes (also KB, MB, TB)

=item e.

lib/ASNMTAP/Asnmtap/Plugins/Mail.pm  view on Meta::CPAN


  if ( $self->{_mailType} ) {
    unless ( defined $parms{outOfDate} ) {
      $$asnmtapInherited->pluginValues ( { stateValue => $ERRORS{UNKNOWN}, error => 'Missing MAIL receiving_fingerprint_mails parameter {outOfDate => ...}' }, $TYPE{APPEND} );
      return ( $ERRORS{UNKNOWN} );
    }
  }

  use ASNMTAP::Asnmtap::Plugins::XML qw(&extract_XML);

  $self->[ $self->[0]{defaultArguments} = @{$self} ] = { date => undef, day => undef, month => undef, year => undef, time => undef, hour => undef, min => undef, sec => undef, numberOfMatches => undef, result => undef };

  unless ($parms{checkFingerprint} =~ /^[01]$/ ) {
    $$asnmtapInherited->pluginValues ( { stateValue => $ERRORS{UNKNOWN}, error => 'Parameter checkFingerprint must be 0 or 1' }, $TYPE{APPEND} );
    return ( $ERRORS{UNKNOWN} );
  }

  unless ($parms{receivedState} =~ /^[01]$/ ) {
    $$asnmtapInherited->pluginValues ( { stateValue => $ERRORS{UNKNOWN}, error => 'Parameter receivedState must be 0 or 1' }, $TYPE{APPEND} );
    return ( $ERRORS{UNKNOWN} );
  }

lib/ASNMTAP/Asnmtap/Plugins/Mail.pm  view on Meta::CPAN

                      use Date::Calc qw(check_date);

                      $self->{defaultArguments}->{date}  = 0;
                      $self->{defaultArguments}->{year}  = 0;
                      $self->{defaultArguments}->{month} = 0;
                      $self->{defaultArguments}->{day}   = 0;

                      $self->{defaultArguments}->{time}  = 0;
                      $self->{defaultArguments}->{hour}  = 0;
                      $self->{defaultArguments}->{min}   = 0;
                      $self->{defaultArguments}->{sec}   = 0;

                      my $currentTimeslot = timelocal ( (localtime)[0,1,2,3,4,5] );
                      my ($checkEpochtime, $checkDate, $checkTime) = ($xml->{Fingerprint}{Epochtime}, $xml->{Fingerprint}{Date}, $xml->{Fingerprint}{Time});
                      my ($checkYear, $checkMonth, $checkDay) = split (/\/|-/, $checkDate);
                      my ($checkHour, $checkMin, $checkSec) = split (/:/, $checkTime);
                      my $xmlEpochtime = timelocal ( $checkSec, $checkMin, $checkHour, $checkDay, ($checkMonth-1), ($checkYear-1900) );
                      print "$checkEpochtime, $xmlEpochtime ($checkDate, $checkTime), $currentTimeslot - $checkEpochtime = ". ($currentTimeslot - $checkEpochtime) ." > ". $parms{outOfDate} ."\n" if ( $debug );

                      unless ( check_date ( $checkYear, $checkMonth, $checkDay) or check_time($checkHour, $checkMin, $checkSec ) ) {
                        $returnCode = $ERRORS{CRITICAL};

lib/ASNMTAP/Asnmtap/Plugins/Mail.pm  view on Meta::CPAN

                        $$asnmtapInherited->pluginValues ( { stateValue => $returnCode, alert => "Epochtime difference from Date and Time into Fingerprint XML are wrong: $checkEpochtime != $xmlEpochtime ($checkDate $checkTime)" }, $TYPE{APPEND} );
                      } elsif ( $currentTimeslot - $checkEpochtime > $parms{outOfDate} * 2 ) {
                        $returnCode = $ERRORS{CRITICAL};
                        $$asnmtapInherited->pluginValues ( { stateValue => $returnCode, alert => "Result into Fingerprint XML are out of date: $checkDate $checkTime" }, $TYPE{APPEND} );
                      } elsif ( $currentTimeslot - $checkEpochtime > $parms{outOfDate} ) {
                        $returnCode = $ERRORS{WARNING};
                        $$asnmtapInherited->pluginValues ( { stateValue => $returnCode, alert => "Result into Fingerprint XML are out of date: $checkDate $checkTime" }, $TYPE{APPEND} );
                      } else {
 				        ($self->{defaultArguments}->{date}, $self->{defaultArguments}->{time}) = ($checkDate, $checkTime);
                        ($self->{defaultArguments}->{day}, $self->{defaultArguments}->{month}, $self->{defaultArguments}->{year}) = split(/[\/|-]/, $checkDate);
                        ($self->{defaultArguments}->{hour}, $self->{defaultArguments}->{min}, $self->{defaultArguments}->{sec}) = split(/:/, $checkTime);
                      }

                      $statusNotFound = ( $xml->{Fingerprint}{Status} ne $self->{_mail}->{status} );
                      my $label = $statusNotFound ? '    (?)' : '(match)';
                      print "  $label : $self->{_text}->{status} < $self->{_mail}->{status} >\n" if ( $debug );
                      unless ( $statusNotFound ) { $fingerprintFound--; last; }
                    } else {
                      if ( $debug ) {
                        my $label = ( $xml->{Fingerprint}{From} =~ /^$self->{_mail}->{from}/ ? '(match)' : '    (?)' );
                        print "  $label : $self->{_text}->{status} < $self->{_mail}->{status} >\n";

lib/ASNMTAP/Asnmtap/Plugins/Mail.pm  view on Meta::CPAN

                    unless ( $brandingNotFound ) { $fingerprintFound--; next; }
		          }
                }

	    	    if ( $timestampNotFound ) {
		          if ( $msgline =~ /^$self->{_timestamp_}/ ) {
                    print "Timestamp : $msgline\n" if ( $debug );
                    (undef, $msgline) = split(/:\s+/, $msgline, 2);
                    ($self->{defaultArguments}->{date}, $self->{defaultArguments}->{time}) = split(/\s+/, $msgline);
                    ($self->{defaultArguments}->{year}, $self->{defaultArguments}->{month}, $self->{defaultArguments}->{day}) = split(/[\/-]/, $self->{defaultArguments}->{date});
                    ($self->{defaultArguments}->{hour}, $self->{defaultArguments}->{min}, $self->{defaultArguments}->{sec}) = split(/:/, $self->{defaultArguments}->{time});
                    print '  (match) : ', $self->{_timestamp_}, ' ', $self->{defaultArguments}->{year}, '/', $self->{defaultArguments}->{month}, '/', $self->{defaultArguments}->{day}, ' ', $self->{defaultArguments}->{hour}, ':', $self->{defaultArgume...
                    $timestampNotFound = 0; $fingerprintFound--; next;
                  }
                }

	    	    if ( $fingerprintFound == 1 and $statusNotFound ) {
      		      if ( $msgline =~ /^$self->{_text}->{status}/ ) {
                    if ( $debug ) {
                      my $msglineDebug = $msgline; $msglineDebug =~ s/</< /g; $msglineDebug =~ s/>/ >/g;
                      print "Status .. : $msglineDebug\n";
                    }

lib/ASNMTAP/Asnmtap/Plugins/Mail.pm  view on Meta::CPAN

          }
        }

        $self->{defaultArguments}->{date}  = undef;
        $self->{defaultArguments}->{day}   = undef;
        $self->{defaultArguments}->{month} = undef;
        $self->{defaultArguments}->{year}  = undef;
        $self->{defaultArguments}->{time}  = undef;
        $self->{defaultArguments}->{hour}  = undef;
        $self->{defaultArguments}->{min}   = undef;
        $self->{defaultArguments}->{sec}   = undef;

        undef $head;
        $entity->purge;
        undef $entity;
      }

      undef $parser;
    }

    if ( defined $self->{defaultArguments}->{numberOfMatches} and $self->{defaultArguments}->{numberOfMatches} ) {



( run in 1.753 second using v1.01-cache-2.11-cpan-39bf76dae61 )