view release on metacpan or search on metacpan
applications/archive.pl view on Meta::CPAN
print EMAILREPORT "A- <$datum><", get_yearMonthDay($removeAllNokEpoch), "> unlink <$path><$filename>\n";
unlink ($path.'/'.$filename);
}
}
} elsif ( $staart eq "$command-$catalogID_uKey-csv.txt" ) {
if ($datum le get_yearMonthDay($gzipEpoch)) {
if ($debug) {
print "C+ <$datum><", get_yearMonthDay($gzipEpoch), "><$path><$filename>\n";
} else {
print EMAILREPORT "C+ <$datum><", get_yearMonthDay($gzipEpoch), "> gzip <$path><$filename>\n";
my ($status, $stdout, $stderr) = call_system ('gzip --force '.$path.'/'.$filename, $debug);
print EMAILREPORT "C+ E R R O R: <$stderr>\n" unless ( $status );
}
}
} elsif ( $staart eq "$command-$catalogID_uKey-csv.txt.gz" ) {
if ($datum le get_yearMonthDay($removeGzipEpoch)) {
if ($debug) {
print "C- <$datum><", get_yearMonthDay($removeGzipEpoch), "><$path><$filename>\n";
} else {
print EMAILREPORT "C- <$datum><", get_yearMonthDay($removeGzipEpoch), "> unlink <$path><$filename>\n";
unlink ($path.'/'.$filename);
}
applications/archive.pl view on Meta::CPAN
my ($jaar, $week) = split(/w/, $datum);
my $jaarWeekFilename = int($jaar.$week);
my ( $tWeek, $tYear ) = get_week ('yesterday');
my $jaarWeekYesterday = int(get_year('yesterday'). $tWeek);
if ( $jaarWeekFilename lt $jaarWeekYesterday ) {
if ($debug) {
print "CW+<$jaarWeekYesterday><$jaarWeekFilename><$path><$filename>\n";
} else {
print EMAILREPORT "CW+<$jaarWeekYesterday><$jaarWeekFilename> gzip <$path><$filename>\n";
my ($status, $stdout, $stderr) = call_system ('gzip --force '.$path.'/'.$filename, $debug);
print EMAILREPORT "CW+ E R R O R: <$stderr>\n" unless ( $status );
}
}
} elsif ( $staart eq "$command-$catalogID_uKey-csv-week.txt.gz" ) {
my ($jaar, $week) = split(/w/, $datum);
my $jaarWeekFilename = int($jaar.$week);
my ( $tWeek, $tYear ) = get_week ('-'. $removeGzipWeeksAgo. ' weeks');
my $jaarWeekRemove = int(get_year('-'. $removeGzipWeeksAgo. ' weeks') .$tWeek);
if ( $jaarWeekFilename le $jaarWeekRemove ) {
if ($debug) {
applications/archive.pl view on Meta::CPAN
# if ($dbh and $rv) {
# $sql = "LOAD DATA LOW_PRIORITY LOCAL INFILE '$path/$filename' INTO TABLE $SERVERTABLEVENTS FIELDS TERMINATED BY ',' ENCLOSED BY '\"' LINES TERMINATED BY '\\n'";
# $dbh->do( $sql ) or $rv = errorTrapDBI("Cannot dbh->do: $sql", $debug);
# if ( $rv ) {
# my $mysqlInfo = $dbh->{mysql_info};
# my ($records, $deleted, $skipped, $warnings) = ($mysqlInfo =~ /^Records:\s+(\d+)\s+Deleted:\s+(\d+)\s+Skipped:\s+(\d+)\s+Warnings: (\d+)$/);
# if ($deleted eq '0' and $skipped eq '0' and $warnings eq '0') {
# print EMAILREPORT "S+ LOAD DATA ... : $records record(s) added for $filename\n";
# my ($status, $stdout, $stderr) = call_system ('gzip --force '.$path.'/'.$filename, $debug);
# print EMAILREPORT "S+ E R R O R: <$stderr>\n" unless ( $status );
# } else {
# print EMAILREPORT "S+ LOAD DATA ... WARNING for $filename: $mysqlInfo, <$records> <$deleted> <$skipped> <$warnings>\n";
# rename("$path/$filename", "$path/$filename-LOAD-DATA-FAILED");
# }
# }
# $dbh->disconnect or $rv = errorTrapDBI("Sorry, the database was unable to add your entry.", $debug);
# }
my $_debug = ( ( $debug eq 'T' ) ? 1 : 0);
my $dbh = CSV_prepare_table ("$path/", $filename, '', $SERVERTABLEVENTS, \@EVENTS, \%EVENTS, \$logger, $_debug);
my $rv = CSV_import_from_table (1, $dbh, $SERVERTABLEVENTS, \@EVENTS, 'id', $doForce, \$logger, $_debug);
if ( $rv ) {
if ($debug) {
print "S+ IMPORT CSV DATA ... OK: ALL records imported from $path/$filename\n";
} else {
print EMAILREPORT "S+ IMPORT CSV DATA ... OK: ALL records imported from $path/$filename\n";
my ($status, $stdout, $stderr) = call_system ('gzip --force '.$path.'/'.$filename, $debug);
print EMAILREPORT "S+ E R R O R: <$stderr>\n" unless ( $status );
}
} else {
if ($debug) {
print "S- IMPORT CSV DATA ... CRITICAL: ZERO records imported from $path/$filename\n";
} else {
print EMAILREPORT "S- IMPORT CSV DATA ... CRITICAL: ZERO records imported from $path/$filename\n";
rename("$path/$filename", "$path/$filename-LOAD-DATA-FAILED");
}
}
applications/archive.pl view on Meta::CPAN
if (defined $restant) {
$datum = substr($datum, 0, 8);
if ( $extentie ) {
if ( $extentie eq 'htm' ) {
if ($datum le get_yearMonthDay($gzipDebugEpoch)) {
if ($debug) {
print "HT+<$datum><".get_yearMonthDay($gzipDebugEpoch)."><$debugPath><$debugFilename>\n";
} else {
print EMAILREPORT "HT+<$datum><".get_yearMonthDay($gzipDebugEpoch)."> gzip <$debugPath><$debugFilename>\n";
my ($status, $stdout, $stderr) = call_system ('gzip --force '.$debugPath.'/'.$debugFilename, $debug);
print EMAILREPORT "HT+ E R R O R: <$stderr>\n" unless ( $status );
}
}
} elsif ( $extentie eq 'htm.gz' ) {
if ($datum le get_yearMonthDay($removeDebugEpoch)) {
if ($debug) {
print "HT-<$datum><".get_yearMonthDay($removeDebugEpoch)."><$debugPath><$debugFilename>\n";
} else {
print EMAILREPORT "HT-<$datum><".get_yearMonthDay($removeDebugEpoch)."> unlink <$debugPath><$debugFilename>\n";
unlink ($debugPath.'/'.$debugFilename);
}
applications/archive.pl view on Meta::CPAN
if ( $sessionExists ) {
if (defined $session{ASNMTAP}) {
if ($session{ASNMTAP} eq 'LEXY') {
print " : <$removeCgisessEpoch><" .$session{_SESSION_CTIME}. ">\n" if ($debug >= 2);
if ($removeCgisessEpoch > $session{_SESSION_CTIME}) {
if ($debug) {
print "CS <$cgisessPathFilename><" .$session{_SESSION_CTIME}. ">\n";
} else {
print EMAILREPORT "CS unlink <$cgisessPathFilename><" .$session{_SESSION_CTIME}. ">\n";
my ($status, $stdout, $stderr) = call_system ('rm -f '.$cgisessPathFilename, $debug); # unlink ($cgisessPathFilename);
}
} else {
print "CS-<$cgisessPathFilename><$removeCgisessEpoch><" .$session{_SESSION_CTIME}. ">\n" if ($debug >= 2);
}
} else {
print "CS-<$cgisessPathFilename> ASNMTAP not LEXY>\n" if ($debug >= 2);
}
} else {
if ($removeCgisessEpoch > $session{_SESSION_CTIME}) {
if ($debug) {
applications/bin/generateCollectorDaemonSchedulingReports.pl view on Meta::CPAN
if ( -e "$pdfFilename" ) {
$emailMessage .= " > $pdfFilename already generated\n";
} else {
$emailMessage .= " > $pdfFilename will be generated\n";
if ($HTMLTOPDFPRG eq 'HTMLDOC') {
$ENV{HTMLDOC_NOCGI} = 1;
select(STDOUT); $| = 1;
}
my ($status, $stdout, $stderr) = call_system ("$command", $debug);
unless ( $status == 0 and $stdout eq '' and $stderr eq '' ) {
$emailMessage .= $pdfFilename. " generation failed\n";
$emailMessage .= "call_system: command: $command, status: $status, stdout: $stdout, stderr: $stderr\n" if ( $debug );
} else {
$emailMessage .= $pdfFilename. " generated\n";
}
}
$emailMessage .= "\n";
if ( $debug ) { print $emailMessage; } else { print EMAILREPORT $emailMessage; }
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
my ($rc) = send_email_report (*EMAILREPORT, $emailReport, $rvOpen, $prgtext, $debug);
exit;
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
sub create_dir {
my ($directory) = @_;
unless ( -e "$directory" ) { # create $directory
my ($status, $stdout, $stderr) = call_system ("mkdir $directory", $debug);
if (!$status and ($stdout ne '' or $stderr ne '')) {
my $error = " > create_dir: mkdir $directory: status: $status, stdout: $stdout, stderr: $stderr\n";
if ( $debug ) { print $error; } else { print EMAILREPORT $error; }
}
}
}
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
sub print_usage () {
print "Usage: $PROGNAME [-D <debug>] [-V version] [-h help]\n";
}
applications/bin/generateReports.pl view on Meta::CPAN
$dbh->disconnect or $rv = DBI_error_trap(*EMAILREPORT, "Sorry, the database was unable to add your entry.", \$logger, $debug);
my $teller = 0;
$emailMessage .= "\n";
foreach my $command (@commands) {
if ($HTMLTOPDFPRG eq 'HTMLDOC') {
$ENV{HTMLDOC_NOCGI} = 1;
select(STDOUT); $| = 1;
}
my ($status, $stdout, $stderr) = call_system ("$command", $debug);
unless ( $status == 0 and $stdout eq '' and $stderr eq '' ) {
$emailMessage .= $pdfFilenames[$teller]. " generation failed\n";
$emailMessage .= "call_system: command: $command, status: $status, stdout: $stdout, stderr: $stderr\n" if ( $debug );
} else {
$emailMessage .= $pdfFilenames[$teller]. " generated\n";
}
$teller++;
}
if ( $debug ) { print $emailMessage; } else { print EMAILREPORT $emailMessage; }
}
}
applications/bin/generateReports.pl view on Meta::CPAN
my ($rc) = send_email_report (*EMAILREPORT, $emailReport, $rvOpen, $prgtext, $debug);
exit;
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
sub create_dir {
my ($directory) = @_;
unless ( -e "$directory" ) { # create $directory
my ($status, $stdout, $stderr) = call_system ("mkdir $directory", $debug);
if (!$status and ($stdout ne '' or $stderr ne '')) {
my $error = " > create_dir: mkdir $directory: status: $status, stdout: $stdout, stderr: $stderr\n";
if ( $debug ) { print $error; } else { print EMAILREPORT $error; }
}
}
}
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
sub print_usage () {
print "Usage: $PROGNAME [-y <year>] [-m <month>] [-d <day>] [-a <days after>] [-u <uKey>] [-D <debug>] [-V version] [-h help]\n";
}
applications/collector-test.pl view on Meta::CPAN
close(PID);
}
}
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
sub create_dir {
my ($directory) = @_;
unless ( -e "$directory" ) { # create $directory
my ($systemAction, $stdout, $stderr, $exit_value, $signal_num, $dumped_core);
$systemAction = "mkdir $directory";
if ($CAPTUREOUTPUT) {
use IO::CaptureOutput qw(capture_exec);
($stdout, $stderr) = capture_exec("$systemAction");
} else {
system ("$systemAction"); $stdout = $stderr = '';
}
$exit_value = $? >> 8;
$signal_num = $? & 127;
$dumped_core = $? & 128;
unless ( $exit_value == 0 && $signal_num == 0 && $dumped_core == 0 && $stderr eq '' ) {
printDebugAll (" create_dir ---- : mkdir $directory: <$exit_value><$signal_num><$dumped_core><$stderr>");
printDebugNOK (" create_dir ---- : mkdir $directory: <$exit_value><$signal_num><$dumped_core><$stderr>");
}
}
}
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
sub call_system {
my ($asnmtapEnv, $currentDate, $catalogID_uniqueKey, $catalogID, $uniqueKey, $resultsdir, $title, $system_action, $status, $interval, $instability, $persistent, $downtime, $debug, $dbiFilename, $logging, $httpdump, $dumphttp, $queryMySQL) = @_;
my $rvOpen;
my $action = '';
my $httpdumpFilename = '';
my $httpdumpFilenameTmp = '';
my $debugFilename = '<NIHIL>';
my $dumphttpRename = '<NIHIL>';
my ($stdout, $stderr, $exit_value, $signal_num, $dumped_core);
my ($loggedStatus, $returnStatus, $startDate, $startTime, $endDate, $endTime, $msgCommand);
$startDate = get_csvfiledate();
$startTime = get_csvfiletime();
($msgCommand, undef) = split(/\.pl/, $system_action);
if ($dumphttp ne 'N') {
$httpdumpFilename = $httpdump . get_datetime() .'-'. $msgCommand .'-'. $catalogID_uniqueKey;
$httpdumpFilenameTmp = $httpdumpFilename .'.tmp';
}
applications/collector-test.pl view on Meta::CPAN
my $systemAction = "cd $PLUGINPATH; ./$system_action --status=$status --debug=$debug --logging=$logging --asnmtapEnv='$asnmtapEnv'";
$systemAction .= " --dumphttp=$httpdumpFilenameTmp" if ($dumphttp ne 'N');
my $_handler = $SIG{ALRM};
my $alarm = $interval * 60;
$SIG{ALRM} = sub { $CHILD_OFF = $alarm; warn "ASNMTAP::Asnmtap::Applications::Collector::CHILD_OFF = $alarm\n" };
alarm ( $alarm );
if ($CAPTUREOUTPUT) {
use IO::CaptureOutput qw(capture_exec);
($stdout, $stderr) = capture_exec("$systemAction");
my (@returnStatus) = split (/\n/, $stdout);
$returnStatus = $returnStatus[-1];
} else {
system ("$systemAction"); $stdout = $stderr = '';
}
$exit_value = $? >> 8;
$signal_num = $? & 127;
$dumped_core = $? & 128;
# print "$CAPTUREOUTPUT -> <$returnStatus> < $stdout >< $stderr >< $exit_value >< $signal_num >< $dumped_core >\n";
alarm (0);
$CHILD_OFF = 0;
$SIG{ALRM} = $_handler ? $_handler : 'DEFAULT';
} else {
$exit_value = -1;
$signal_num = 1;
$dumped_core = 0;
$stdout = $stderr = '';
}
if ($exit_value >= 0 && $exit_value <= 4 && $signal_num == 0 && $dumped_core == 0) {
$action = "Success";
if ($exit_value == 0) {
$dumphttpRename = "OK";
printDebugAll (" OK ------------ : <$PROGNAME v$version -C $collectorlist>");
} elsif ($exit_value == 1) {
$dumphttpRename = "WARNING";
applications/collector-test.pl view on Meta::CPAN
$debugFilename = $httpdumpFilename .'-'. $dumphttpRename .'.htm';
rename("$httpdumpFilenameTmp", "$debugFilename");
}
} else {
unlink ($httpdumpFilenameTmp) if (-e "$httpdumpFilenameTmp");
}
}
} else {
$action = 'Failed';
$dumphttpRename = 'UNKNOWN';
printDebugAll (" call_system --- : $system_action: <$exit_value><$signal_num><$dumped_core><$stderr>");
printDebugNOK (" call_system --- : $system_action: <$exit_value><$signal_num><$dumped_core><$stderr>");
if ( $exit_value == -1 ) {
$returnStatus = "$dumphttpRename - $title: PLUGIN '$msgCommand.pl' doesn't exist - contact administrators";
} elsif ( $boolean_signal_kill ) {
$returnStatus = "$dumphttpRename - $title: TIMING OUT SLOW PLUGIN";
my $httpdumpFilenameTmpKnownError = $httpdumpFilenameTmp .'-KnownError';
unlink ($httpdumpFilenameTmpKnownError) if (-e "$httpdumpFilenameTmpKnownError");
unlink ($httpdumpFilenameTmp) if (-e "$httpdumpFilenameTmp");
} else {
applications/collector-test.pl view on Meta::CPAN
$eTitle .= ' from '. $catalogID;
if ( $perfParseMethode eq 'PULP' ) {
$perfParseCommand = "$APPLICATIONPATH/sbin/perfparse_asnmtap_pulp_command.pl $PREFIXPATH/log/perfdata-asnmtap.log \"$perfParseTimeslot\t$eTitle\t$catalogID_uniqueKey\t$outputData\t$dumphttpRename\t$performanceData\"";
} else {
$perfParseCommand = "printf \"%b\" \"$perfParseTimeslot\t$eTitle\t$catalogID_uniqueKey\t$outputData\t$dumphttpRename\t$performanceData\n\" | $PERFPARSEBIN/perfparse-log2mysql -c $PERFPARSEETC/$PERFPARSECONFIG";
}
if ($CAPTUREOUTPUT) {
use IO::CaptureOutput qw(capture_exec);
($stdout, $stderr) = capture_exec("$perfParseCommand");
} else {
system ("$perfParseCommand"); $stdout = $stderr = '';
}
$exit_value = $? >> 8;
$signal_num = $? & 127;
$dumped_core = $? & 128;
printDebugNOK (" perfParse ----- : $perfParseCommand: <$exit_value><$signal_num><$dumped_core><$stderr>") unless ( $exit_value == 0 && $signal_num == 0 && $dumped_core == 0 && $stderr eq '' );
}
}
insertEntryDBI ($currentDate, $catalogID_uniqueKey, $catalogID, $uniqueKey, $title, $dbiFilename.$msgCommand.'-'.$catalogID_uniqueKey.'-sql', $system_action, $interval, $dumphttpRename, $logging, $debug, $startDate, $startTime, $endDate, $endTime, ...
return $action;
}
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
sub printDebugAll {
applications/collector.pl view on Meta::CPAN
close(PID);
}
}
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
sub create_dir {
my ($directory) = @_;
unless ( -e "$directory" ) { # create $directory
my ($systemAction, $stdout, $stderr, $exit_value, $signal_num, $dumped_core);
$systemAction = "mkdir $directory";
if ($CAPTUREOUTPUT) {
use IO::CaptureOutput qw(capture_exec);
($stdout, $stderr) = capture_exec("$systemAction");
} else {
system ("$systemAction"); $stdout = $stderr = '';
}
$exit_value = $? >> 8;
$signal_num = $? & 127;
$dumped_core = $? & 128;
unless ( $exit_value == 0 && $signal_num == 0 && $dumped_core == 0 && $stderr eq '' ) {
printDebugAll (" create_dir ---- : mkdir $directory: <$exit_value><$signal_num><$dumped_core><$stderr>");
printDebugNOK (" create_dir ---- : mkdir $directory: <$exit_value><$signal_num><$dumped_core><$stderr>");
}
}
}
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
sub call_system {
my ($asnmtapEnv, $currentDate, $catalogID_uniqueKey, $catalogID, $uniqueKey, $resultsdir, $title, $system_action, $status, $interval, $instability, $persistent, $downtime, $debug, $dbiFilename, $logging, $httpdump, $dumphttp, $queryMySQL) = @_;
my $rvOpen;
my $action = '';
my $httpdumpFilename = '';
my $httpdumpFilenameTmp = '';
my $debugFilename = '<NIHIL>';
my $dumphttpRename = '<NIHIL>';
my ($stdout, $stderr, $exit_value, $signal_num, $dumped_core);
my ($loggedStatus, $returnStatus, $startDate, $startTime, $endDate, $endTime, $msgCommand);
$startDate = get_csvfiledate();
$startTime = get_csvfiletime();
($msgCommand, undef) = split(/\.pl/, $system_action);
if ($dumphttp ne 'N') {
$httpdumpFilename = $httpdump . get_datetime() .'-'. $msgCommand .'-'. $catalogID_uniqueKey;
$httpdumpFilenameTmp = $httpdumpFilename .'.tmp';
}
applications/collector.pl view on Meta::CPAN
my $systemAction = "cd $PLUGINPATH; ./$system_action --status=$status --debug=$debug --logging=$logging --asnmtapEnv='$asnmtapEnv'";
$systemAction .= " --dumphttp=$httpdumpFilenameTmp" if ($dumphttp ne 'N');
my $_handler = $SIG{ALRM};
my $alarm = $interval * 60;
$SIG{ALRM} = sub { $CHILD_OFF = $alarm; warn "ASNMTAP::Asnmtap::Applications::Collector::CHILD_OFF = $alarm\n" };
alarm ( $alarm );
if ($CAPTUREOUTPUT) {
use IO::CaptureOutput qw(capture_exec);
($stdout, $stderr) = capture_exec("$systemAction");
my (@returnStatus) = split (/\n/, $stdout);
$returnStatus = $returnStatus[-1];
} else {
system ("$systemAction"); $stdout = $stderr = '';
}
$exit_value = $? >> 8;
$signal_num = $? & 127;
$dumped_core = $? & 128;
# print "$CAPTUREOUTPUT -> <$returnStatus> < $stdout >< $stderr >< $exit_value >< $signal_num >< $dumped_core >\n";
alarm (0);
$CHILD_OFF = 0;
$SIG{ALRM} = $_handler ? $_handler : 'DEFAULT';
} else {
$exit_value = -1;
$signal_num = 1;
$dumped_core = 0;
$stdout = $stderr = '';
}
if ($exit_value >= 0 && $exit_value <= 4 && $signal_num == 0 && $dumped_core == 0) {
$action = "Success";
if ($exit_value == 0) {
$dumphttpRename = "OK";
printDebugAll (" OK ------------ : <$PROGNAME v$version -C $collectorlist>");
} elsif ($exit_value == 1) {
$dumphttpRename = "WARNING";
applications/collector.pl view on Meta::CPAN
$debugFilename = $httpdumpFilename .'-'. $dumphttpRename .'.htm';
rename("$httpdumpFilenameTmp", "$debugFilename");
}
} else {
unlink ($httpdumpFilenameTmp) if (-e "$httpdumpFilenameTmp");
}
}
} else {
$action = 'Failed';
$dumphttpRename = 'UNKNOWN';
printDebugAll (" call_system --- : $system_action: <$exit_value><$signal_num><$dumped_core><$stderr>");
printDebugNOK (" call_system --- : $system_action: <$exit_value><$signal_num><$dumped_core><$stderr>");
if ( $exit_value == -1 ) {
$returnStatus = "$dumphttpRename - $title: PLUGIN '$msgCommand.pl' doesn't exist - contact administrators";
} elsif ( $boolean_signal_kill ) {
$returnStatus = "$dumphttpRename - $title: TIMING OUT SLOW PLUGIN";
my $httpdumpFilenameTmpKnownError = $httpdumpFilenameTmp .'-KnownError';
unlink ($httpdumpFilenameTmpKnownError) if (-e "$httpdumpFilenameTmpKnownError");
unlink ($httpdumpFilenameTmp) if (-e "$httpdumpFilenameTmp");
} else {
applications/collector.pl view on Meta::CPAN
$eTitle .= ' from '. $catalogID;
if ( $perfParseMethode eq 'PULP' ) {
$perfParseCommand = "$APPLICATIONPATH/sbin/perfparse_asnmtap_pulp_command.pl $PREFIXPATH/log/perfdata-asnmtap.log \"$perfParseTimeslot\t$eTitle\t$catalogID_uniqueKey\t$outputData\t$dumphttpRename\t$performanceData\"";
} else {
$perfParseCommand = "printf \"%b\" \"$perfParseTimeslot\t$eTitle\t$catalogID_uniqueKey\t$outputData\t$dumphttpRename\t$performanceData\n\" | $PERFPARSEBIN/perfparse-log2mysql -c $PERFPARSEETC/$PERFPARSECONFIG";
}
if ($CAPTUREOUTPUT) {
use IO::CaptureOutput qw(capture_exec);
($stdout, $stderr) = capture_exec("$perfParseCommand");
} else {
system ("$perfParseCommand"); $stdout = $stderr = '';
}
$exit_value = $? >> 8;
$signal_num = $? & 127;
$dumped_core = $? & 128;
printDebugNOK (" perfParse ----- : $perfParseCommand: <$exit_value><$signal_num><$dumped_core><$stderr>") unless ( $exit_value == 0 && $signal_num == 0 && $dumped_core == 0 && $stderr eq '' );
}
}
insertEntryDBI ($currentDate, $catalogID_uniqueKey, $catalogID, $uniqueKey, $title, $dbiFilename.$msgCommand.'-'.$catalogID_uniqueKey.'-sql', $system_action, $interval, $dumphttpRename, $logging, $debug, $startDate, $startTime, $endDate, $endTime, ...
return $action;
}
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
sub printDebugAll {
applications/display-test.pl view on Meta::CPAN
close(PID);
}
}
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
sub create_dir {
my ($directory) = @_;
unless ( -e "$directory" ) { # create $directory
my ($status, $stdout, $stderr) = call_system ("mkdir $directory", 0);
print " create_dir ---- : mkdir $directory: $status, $stdout, $stderr\n" if ( ! $status or $stderr ne '' );
}
}
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
sub errorTrapDBI {
my ($checklist, $error_message) = @_;
print $error_message, "\nERROR: $DBI::err ($DBI::errstr)\n";
applications/display.pl view on Meta::CPAN
close(PID);
}
}
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
sub create_dir {
my ($directory) = @_;
unless ( -e "$directory" ) { # create $directory
my ($status, $stdout, $stderr) = call_system ("mkdir $directory", 0);
print " create_dir ---- : mkdir $directory: $status, $stdout, $stderr\n" if ( ! $status or $stderr ne '' );
}
}
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
sub errorTrapDBI {
my ($checklist, $error_message) = @_;
print $error_message, "\nERROR: $DBI::err ($DBI::errstr)\n";
applications/htmlroot/cgi-bin/admin/generateConfig.pl view on Meta::CPAN
# }
return ($statusMessage);
}
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
sub do_system_call {
my ($command, $debug) = @_;
my ($stdout, $stderr, $exit_value, $signal_num, $dumped_core, $status, $statusMessage);
if ($CAPTUREOUTPUT) {
use IO::CaptureOutput qw(capture_exec);
($stdout, $stderr) = capture_exec("$command");
} else {
system ("$command"); $stdout = $stderr = '';
}
if ( $debug eq 'T' ) {
$exit_value = $? >> 8;
$signal_num = $? & 127;
$dumped_core = $? & 128;
$statusMessage = "<tr bgcolor=\"$COLORSTABLE{STARTBLOCK}\"><td>$command: ";
$statusMessage .= ( $exit_value == 0 && $signal_num == 0 && $dumped_core == 0 && $stderr eq '' ) ? 'Success' : "Failed '$stderr'";
$statusMessage .= "</td></tr>";
} else {
$statusMessage = '';
}
return ($statusMessage);
}
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
applications/htmlroot/cgi-bin/htmlToPdf.pl view on Meta::CPAN
if ( $debug eq 'T' ) {
$message = $command;
} else {
$ENV{HTMLDOC_NOCGI} = 1;
select(STDOUT); $| = 1;
print "Content-Type: application/pdf\n";
print "Content-disposition: attachment; filename=GeneratedReport.pdf\n\n";
my ($status, $stdout, $stderr) = call_system ("$command", $debug);
print $stdout;
}
} else {
$message = "$HTMLtoPDFprg not supported";
}
}
if ( defined $message ) {
print "Content-Type: Text/HTML\n\n";
print_header (*STDOUT, $pagedir, $pageset, $htmlTitle, $subTitle, 3600, '', 'F', '', $sessionID);
applications/htmlroot/cgi-bin/runCmdOnDemand.pl view on Meta::CPAN
print "<P class=\"RunCmdOnDemandHtmlTitle\">$htmlTitle:<br> <font class=\"RunCmdOnDemandCommand\">$commandMaskedPassword --onDemand=Y --debug=$debug --asnmtapEnv='F|F|F'</font></P><IMG SRC=\"".$IMAGESURL."/gears.gif\" HSPACE=\"0\" VSPACE=\"0\" ...
my ($capture_long, $capture_html, $capture_text, $capture_debug, $capture_array, @WebTransactResponses, @capture_array);
$capture_long = $capture_html = $capture_text = $capture_debug = $capture_array = 0;
# my $capture_exec = ( $RUNCMDONDEMAND eq 'probe' ) ? "$SSHCOMMAND -i '$SSHKEYPATH/$SSHLOGONNAME/.ssh/asnmtap.id' -o 'StrictHostKeyChecking=no' $SSHLOGONNAME\@$FQDN \"if [ -d /opt/monitoring/asnmtap/plugins/ ]; then cd /opt/monitoring/asnmtap/plu...
my $capture_exec = ( $RUNCMDONDEMAND eq 'probe' ) ? "$SSHCOMMAND -i '$SSHKEYPATH/$SSHLOGONNAME/asnmtap.id' -o 'StrictHostKeyChecking=no' $SSHLOGONNAME\@$FQDN \"if [ -d /opt/monitoring/asnmtap/plugins/ ]; then cd /opt/monitoring/asnmtap/plugins/...
if ( 1 == 1 ) {
@capture_array = `$capture_exec`;
} else {
my ($stdout, $stderr, $exit_value, $signal_num, $dumped_core);
if ($CAPTUREOUTPUT) {
use IO::CaptureOutput qw(capture_exec);
($stdout, $stderr) = capture_exec("$capture_exec");
} else {
system ("$capture_exec"); $stdout = $stderr = '';
}
$exit_value = $? >> 8;
$signal_num = $? & 127;
$dumped_core = $? & 128;
@capture_array = split (/\n/, $stdout);
print "< $capture_exec >< $exit_value >< $signal_num >< $dumped_core >< $stdout >< $stderr >\n" if ($debug eq 'S');
}
for (; $capture_array < @capture_array -1; $capture_array++) {
my $capture = $capture_array[$capture_array];
$capture =~ s/\r$//g;
$capture =~ s/\n$//g;
if ( $capture =~ /^--> URL: (?:GET|POST)/ ) {
$capture_long = $capture_html = $capture_text = $capture_debug = 0;
print "<tr><th class=\"RunCmdOnDemandCaptureHeader\">$capture</th></tr>\n";
applications/log4perl.cnf view on Meta::CPAN
log4perl.appender.LOGHOLIDAYBUNDLE = Log::Log4perl::Appender::File
log4perl.appender.LOGHOLIDAYBUNDLE.filename = /opt/monitoring/asnmtap/log/holiday-bundle-set-downtimes.log
log4perl.appender.LOGHOLIDAYBUNDLE.mode = append
log4perl.appender.LOGHOLIDAYBUNDLE.Threshold = OFF
log4perl.appender.LOGHOLIDAYBUNDLE.layout = PatternLayout
log4perl.appender.LOGHOLIDAYBUNDLE.layout.ConversionPattern = [%d] %H | %p | %P | %C | %c | %l - %m%n
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
log4perl.appender.LOGSCREEN = Log::Log4perl::Appender::Screen
log4perl.appender.LOGSCREEN.stderr = 0
log4perl.appender.LOGSCREEN.layout = PatternLayout
log4perl.appender.LOGSCREEN.layout.ConversionPattern = [%d] %H | %p | %P | %C | %c | %l - %m%n
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Define DBIx::Log4perl to output DEBUG and above msgs to /opt/asnmtap/log/MySQL.log using the simple layout
log4perl.logger.DBIx.Log4perl = DEBUG, MySQL
log4perl.appender.MySQL = Log::Log4perl::Appender::File
log4perl.appender.MySQL.filename = /opt/monitoring/asnmtap/log/MySQL.log
log4perl.appender.MySQL.mode = append
applications/sbin/sshWrapperASNMTAP.pl view on Meta::CPAN
# if ssh fails and exits out of the script earlier input would never
# be seen. In fact 'exec' call was replaced with 'system' call for the
# reason that exec did not return to the shell and the print output was
# never seen because the close was never reached.
# close and reopen output file to empty print queue to this point
close (SSHOUT);
$rvOpen = open (SSHOUT, "+>>$filename");
unless ($rvOpen) { print STDERR "Couldn't reopen log '$filename'!\n"; exit 0; }
my ($stdout, $stderr, $exit_value, $signal_num, $dumped_core);
print "EXECUTE '$command'\n" if ($debug);
if ($CAPTUREOUTPUT) {
use IO::CaptureOutput qw(capture_exec);
($stdout, $stderr) = capture_exec($command);
} else {
system ($command); $stdout = $stderr = '';
}
$exit_value = $? >> 8;
$signal_num = $? & 127;
$dumped_core = $? & 128;
$now = localtime;
if ( $exit_value == 0 && $signal_num == 0 && $dumped_core == 0 && $stderr eq '' ) {
if ($debug) {
print SSHOUT ("$now '$command' COMPLETED\n");
print "'$command' COMPLETED\n";
}
} else {
print SSHOUT ("$now '$command' FAILED: $stderr\n\n"); close (SSHOUT);
print STDERR "'$command' FAILED: $stderr\n"; exit 0;
}
print SSHOUT ("\n");
close (SSHOUT);
exit 1;
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
applications/tools/templates/master/rsync-wrapper-distributed-example.sh view on Meta::CPAN
# close and reopen output file to empty print queue to this point
close (SSHOUT);
$rvOpen = open (SSHOUT, "+>>$filename");
unless ( $rvOpen ) {
print STDERR "Couldn't reopen log '$filename'!\n";
exit 0;
}
my ($stdout, $stderr, $exit_value, $signal_num, $dumped_core);
#remove the first argument which is the rsync command and use absolute path
shift @rsync_argv;
# if ($captureOutput) {
# use IO::CaptureOutput qw(capture_exec);
# ($stdout, $stderr) = capture_exec("$rsyncPath @rsync_argv");
# } else {
system ("$rsyncPath @rsync_argv"); $stdout = $stderr = '';
# }
$exit_value = $? >> 8;
$signal_num = $? & 127;
$dumped_core = $? & 128;
$now = localtime;
if ( $exit_value == 0 && $signal_num == 0 && $dumped_core == 0 && $stderr eq '' ) {
print SSHOUT ("$now RSYNC COMPLETE\n\n") if ($debug);
} else {
print SSHOUT ("$now RSYNC FAILED: $stderr\n\n");
}
} else {
print SSHOUT ("$now RSYNC REQUEST FAILED INSPECTION - SKIPPING RSYNC\n");
}
close (SSHOUT);
# ------------------------------------------------------------------------------
applications/tools/templates/master/rsync-wrapper-distributed-template.sh view on Meta::CPAN
# close and reopen output file to empty print queue to this point
close (SSHOUT);
$rvOpen = open (SSHOUT, "+>>$filename");
unless ( $rvOpen ) {
print STDERR "Couldn't reopen log '$filename'!\n";
exit 0;
}
my ($stdout, $stderr, $exit_value, $signal_num, $dumped_core);
#remove the first argument which is the rsync command and use absolute path
shift @rsync_argv;
# if ($captureOutput) {
# use IO::CaptureOutput qw(capture_exec);
# ($stdout, $stderr) = capture_exec("$rsyncPath @rsync_argv");
# } else {
system ("$rsyncPath @rsync_argv"); $stdout = $stderr = '';
# }
$exit_value = $? >> 8;
$signal_num = $? & 127;
$dumped_core = $? & 128;
$now = localtime;
if ( $exit_value == 0 && $signal_num == 0 && $dumped_core == 0 && $stderr eq '' ) {
print SSHOUT ("$now RSYNC COMPLETE\n\n") if ($debug);
} else {
print SSHOUT ("$now RSYNC FAILED: $stderr\n\n");
}
} else {
print SSHOUT ("$now RSYNC REQUEST FAILED INSPECTION - SKIPPING RSYNC\n");
}
close (SSHOUT);
# ------------------------------------------------------------------------------
applications/tools/templates/master/rsync-wrapper-failover-example.sh view on Meta::CPAN
# close and reopen output file to empty print queue to this point
close (SSHOUT);
$rvOpen = open (SSHOUT, "+>>$filename");
unless ( $rvOpen ) {
print STDERR "Couldn't reopen log '$filename'!\n";
exit 0;
}
my ($stdout, $stderr, $exit_value, $signal_num, $dumped_core);
#remove the first argument which is the rsync command and use absolute path
shift @rsync_argv;
# if ($captureOutput) {
# use IO::CaptureOutput qw(capture_exec);
# ($stdout, $stderr) = capture_exec("$rsyncPath @rsync_argv");
# } else {
system ("$rsyncPath @rsync_argv"); $stdout = $stderr = '';
# }
$exit_value = $? >> 8;
$signal_num = $? & 127;
$dumped_core = $? & 128;
$now = localtime;
if ( $exit_value == 0 && $signal_num == 0 && $dumped_core == 0 && $stderr eq '' ) {
print SSHOUT ("$now RSYNC COMPLETE\n\n") if ($debug);
} else {
print SSHOUT ("$now RSYNC FAILED: $stderr\n\n");
}
} else {
print SSHOUT ("$now RSYNC REQUEST FAILED INSPECTION - SKIPPING RSYNC\n");
}
close (SSHOUT);
# ------------------------------------------------------------------------------
applications/tools/templates/master/rsync-wrapper-failover-template.sh view on Meta::CPAN
# close and reopen output file to empty print queue to this point
close (SSHOUT);
$rvOpen = open (SSHOUT, "+>>$filename");
unless ( $rvOpen ) {
print STDERR "Couldn't reopen log '$filename'!\n";
exit 0;
}
my ($stdout, $stderr, $exit_value, $signal_num, $dumped_core);
#remove the first argument which is the rsync command and use absolute path
shift @rsync_argv;
# if ($captureOutput) {
# use IO::CaptureOutput qw(capture_exec);
# ($stdout, $stderr) = capture_exec("$rsyncPath @rsync_argv");
# } else {
system ("$rsyncPath @rsync_argv"); $stdout = $stderr = '';
# }
$exit_value = $? >> 8;
$signal_num = $? & 127;
$dumped_core = $? & 128;
$now = localtime;
if ( $exit_value == 0 && $signal_num == 0 && $dumped_core == 0 && $stderr eq '' ) {
print SSHOUT ("$now RSYNC COMPLETE\n\n") if ($debug);
} else {
print SSHOUT ("$now RSYNC FAILED: $stderr\n\n");
}
} else {
print SSHOUT ("$now RSYNC REQUEST FAILED INSPECTION - SKIPPING RSYNC\n");
}
close (SSHOUT);
# ------------------------------------------------------------------------------
lib/ASNMTAP/Asnmtap.pm view on Meta::CPAN
print "Send email to $SENDEMAILTO if you have questions regarding\nuse of this software. To submit patches or suggest improvements, send\nemail to $SENDEMAILTO\n\n";
exit ( (ref $_[0]) =~ /^ASNMTAP::Asnmtap::Plugins/ ? $ERRORS{UNKNOWN} : 0 );
}
# = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
sub call_system {
&_checkAccObjRef ( $_[0] ); &_checkSubArgs1;
my ($stdout, $stderr);
if ( $CAPTUREOUTPUT ) {
use IO::CaptureOutput qw(capture_exec);
($stdout, $stderr) = capture_exec ( $_[1] );
chomp($stdout); chomp($stderr);
} else {
$stdout = $stderr = ''; system ( $_[1] );
}
my $exit_value = $? >> 8;
my $signal_num = $? & 127;
my $dumped_core = $? & 128;
my $status = ( $exit_value == 0 && $signal_num == 0 && $dumped_core == 0 && $stderr eq '' ) ? 1 : 0;
if ( $_[0]->{_debug} ) {
print ref $_[0], ": command : $_[1]\n",
ref $_[0], ": exit value : $exit_value\n",
ref $_[0], ": signal number: $signal_num\n",
ref $_[0], ": dumped core : $dumped_core\n",
ref $_[0], ": status : $status\n",
ref $_[0], ": stdout : '$stdout'\n",
ref $_[0], ": stderr : '$stderr'\n";
}
return ( $status, $stdout, $stderr );
}
# Destructor - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
sub DESTROY { print (ref ($_[0]), "::DESTROY: ()\n") if ( $_[0]->{_debug} ); }
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1;
lib/ASNMTAP/Asnmtap.pod view on Meta::CPAN
=item Arguments
command, scalar
=item Function
system call for command
=item Return
returns success, stdout and stderr
=back
=back
=head1 EXPORT
=head2 TAGS
=over 4
lib/ASNMTAP/Asnmtap/Applications.pm view on Meta::CPAN
my $format = shift;
printf($format, @_);
exit $ERRORS{UNKNOWN};
}
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
sub call_system {
my ($system_action, $debug) = @_;
my ($stdout, $stderr, $exit_value, $signal_num, $dumped_core, $status);
if ($CAPTUREOUTPUT) {
use IO::CaptureOutput qw(capture_exec);
($stdout, $stderr) = capture_exec("$system_action");
chomp($stdout); chomp($stderr);
} else {
system ("$system_action"); $stdout = $stderr = '';
}
$exit_value = $? >> 8;
$signal_num = $? & 127;
$dumped_core = $? & 128;
$status = ( $exit_value == 0 && $signal_num == 0 && $dumped_core == 0 && $stderr eq '' ) ? 1 : 0;
print "< $system_action >< $exit_value >< $signal_num >< $dumped_core >< $status >< $stdout >< $stderr >\n" if ($debug);
return ($status, $stdout, $stderr);
}
# = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
sub read_table;
sub get_session_param;
sub get_trendline_from_test;
# = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
lib/ASNMTAP/Asnmtap/Applications.pm view on Meta::CPAN
log4perl.logger = TRACE, LOGFILE, LOGSCREEN
log4perl.appender.LOGFILE = Log::Log4perl::Appender::File
log4perl.appender.LOGFILE.filename = $LOGPATH/root.log
log4perl.appender.LOGFILE.mode = append
log4perl.appender.LOGFILE.Threshold = ERROR
log4perl.appender.LOGFILE.layout = PatternLayout
log4perl.appender.LOGFILE.layout.ConversionPattern = [%d] %F %L %c - %m%n
log4perl.appender.LOGSCREEN = Log::Log4perl::Appender::Screen
log4perl.appender.LOGSCREEN.stderr = 0
log4perl.appender.LOGSCREEN.layout = PatternLayout
log4perl.appender.LOGSCREEN.layout.ConversionPattern = [%d] %F %L %c - %m%n
log4perl.logger.DBIx.Log4perl = TRACE, MySQL
log4perl.appender.MySQL = Log::Log4perl::Appender::File
log4perl.appender.MySQL.filename = $LOGPATH/MySQL.log
log4perl.appender.MySQL.mode = append
log4perl.appender.MySQL.layout = Log::Log4perl::Layout::SimpleLayout
);
}
lib/ASNMTAP/Asnmtap/Plugins.pm view on Meta::CPAN
$_[0]->_getOptions ();
$_[0]->SUPER::printHelp ();
}
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
sub call_system {
&_checkAccObjRef ( $_[0] ); &_checkReadOnly2;
return ( $ERRORS{DEPENDENT} ) unless ( defined $_[1] );
my ($status, $stdout, $stderr) = $_[0]->SUPER::call_system ( $_[1] );
if ( $status ) {
if ( $_[0]->{_getOptionsValues}->{debug} ) {
$_[0]->pluginValues ( { stateValue => $ERRORS{OK}, alert => $_[1] .': OK', result => ( defined $stdout ? $stdout : undef ) }, $TYPE{APPEND} );
} else {
$_[0]->pluginValues ( { stateValue => $ERRORS{OK}, result => ( defined $stdout ? $stdout : undef ) }, $TYPE{APPEND} );
}
return ( $ERRORS{OK} );
} else {
if ( $_[0]->{_getOptionsValues}->{debug} ) {
$_[0]->pluginValues ( { stateValue => $ERRORS{UNKNOWN}, result => ( defined $stderr ? $stderr : undef ) }, $TYPE{APPEND} );
} else {
$_[0]->pluginValues ( { stateValue => $ERRORS{UNKNOWN}, error => $_[1] .': '. $stderr, result => ( defined $stderr ? $stderr : undef ) }, $TYPE{APPEND} );
}
return ( $ERRORS{UNKNOWN} );
}
}
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
sub exit {
&_checkAccObjRef ( $_[0] ); &_checkSubArgs1;
lib/ASNMTAP/Asnmtap/Plugins.pod view on Meta::CPAN
=item Arguments
command, scalar
=item Function
system call for command
=item Return
returns stateValue => $ERRORS{OK..UNKNOWN}, alert => stdout and error => stderr
=back
=item exit()
=over 4
=item Arguments (optional)
=over 4
t/Asnmtap.t view on Meta::CPAN
is ( $objectAsnmtap->getOptionsValue ('commandLineOption'), undef, 'ASNMTAP::Asnmtap::getOptionsValue(\'commandLineOption\')' );
is ( $objectAsnmtap->debug(), 0, 'ASNMTAP::Asnmtap::debug()' );
is ( $objectAsnmtap->debug(1), 1, 'ASNMTAP::Asnmtap::debug(1)' );
is ( $objectAsnmtap->debug(2), 1, 'ASNMTAP::Asnmtap::debug(2)' );
is ( $objectAsnmtap->debug(0), 0, 'ASNMTAP::Asnmtap::debug()' );
is ( $objectAsnmtap->dumpData(1), 1, 'ASNMTAP::Asnmtap::dumpData(1)' );
is ( $objectAsnmtap->dumpData(), 0, 'ASNMTAP::Asnmtap::dumpData(1)' );
my ( $status, $stdout, $stderr ) = $objectAsnmtap->call_system("echo 'ASNMTAP'");
ok ( $status == 1, 'ASNMTAP::Asnmtap::call_system("echo \'ASNMTAP\'")' );
( $status, $stdout, $stderr ) = $objectAsnmtap->call_system("ASNMTAP 'ASNMTAP'");
ok ( $status == 0, 'ASNMTAP::Asnmtap::call_system("ASNMTAP \'ASNMTAP\'")' );
}
t/Asnmtap/Plugins.t view on Meta::CPAN
caDir => 'CA CERT PEER VERIFICATION DIR',
pkcs12File => 'CLIENT PKCS12 CERT SUPPORT FILE',
pkcs12Password => 'CLIENT PKCS12 CERT SUPPORT PASSWORD'},
_timeout => 30,
_debug => 0);
isa_ok( $objectPlugins, 'ASNMTAP::Asnmtap::Plugins' );
can_ok( $objectPlugins, qw(programName programDescription programVersion getOptionsArgv getOptionsValue debug dumpData printRevision printRevision printUsage printHelp) );
can_ok( $objectPlugins, qw(appendPerformanceData browseragent SSLversion clientCertificate pluginValue pluginValues proxy timeout setEndTime_and_getResponsTime write_debugfile call_system exit) );
my ($returnCode, $errorStatus, $status, $stdout, $stderr);
$returnCode = $objectPlugins->browseragent () eq 'Mozilla/5.0 (compatible; ASNMTAP; U; ASNMTAP 3.002.003 postfix; nl-BE; rv:3.002.003) Gecko/yyyymmdd libwww-perl/5.813' ? 1 : 0;
ok ($returnCode, 'ASNMTAP::Asnmtap::Plugins::browseragent(): get');
$returnCode = $objectPlugins->browseragent ( 'Mozilla/4.7' ) eq 'Mozilla/4.7' ? 1 : 0;
ok ($returnCode, 'ASNMTAP::Asnmtap::Plugins::browseragent(): set');
$returnCode = $objectPlugins->SSLversion ( 2 ) == 2 ? 1 : 0;
ok ($returnCode, 'ASNMTAP::Asnmtap::Plugins::SSLversion(): set 2');
t/Asnmtap/Plugins/Nagios.t view on Meta::CPAN
caDir => 'CA CERT PEER VERIFICATION DIR',
pkcs12File => 'CLIENT PKCS12 CERT SUPPORT FILE',
pkcs12Password => 'CLIENT PKCS12 CERT SUPPORT PASSWORD'},
_timeout => 30,
_debug => 0);
isa_ok( $objectNagios, 'ASNMTAP::Asnmtap::Plugins::Nagios' );
can_ok( $objectNagios, qw(programName programDescription programVersion getOptionsArgv getOptionsValue debug dumpData printRevision printRevision printUsage printHelp) );
can_ok( $objectNagios, qw(appendPerformanceData browseragent SSLversion clientCertificate pluginValue pluginValues proxy timeout setEndTime_and_getResponsTime write_debugfile call_system exit) );
my ($returnCode, $errorStatus, $status, $stdout, $stderr);
$returnCode = $objectNagios->browseragent () eq 'Mozilla/5.0 (compatible; ASNMTAP; U; ASNMTAP 3.002.003 postfix; nl-BE; rv:3.002.003) Gecko/yyyymmdd libwww-perl/5.813' ? 1 : 0;
ok ($returnCode, 'ASNMTAP::Asnmtap::Plugins::Nagios::browseragent(): get');
$returnCode = $objectNagios->browseragent ( 'Mozilla/4.7' ) eq 'Mozilla/4.7' ? 1 : 0;
ok ($returnCode, 'ASNMTAP::Asnmtap::Plugins::Nagios::browseragent(): set');
$returnCode = $objectNagios->SSLversion ( 2 ) == 2 ? 1 : 0;
ok ($returnCode, 'ASNMTAP::Asnmtap::Plugins::Nagios::SSLversion(): set 2');