view release on metacpan or search on metacpan
Version 3.002.001, 2010/07/28, by Alex Peeters
ASNMTAP
- NEW 'filter-option' to search
- UPDATE cpan module SOAP::Lite to 0.710.08 (reported problems with 0.710.09 and later)
- UPDATE cpan module WSRF::Lite to 0.8.2.7
- UPDATE /applications/tools/mysql/asnmtap-3.002.001-database-schema.png
- UPDATE create_ASNMTAP_jUnit_configuration_for_jUnit.pl
- NEW autoinstall.sh
- UPDATE Applications.cfg
- NEW 'EVENTSDISPLAYDATA eventsDisplayData' between <TABLES>...</TABLES>
- NEW module ASNMTAP::PseudoHash for making perl 5.10 compatibility
replace 'use fields' with 'use ASNMTAP::PseudoHash'
replace 'fields::phash' with 'ASNMTAP::PseudoHash'
- UPDATE comments.pl -> html code optimalisation
- UPDATE display.pl -> debug: toggleDiv(), pop-up: overlib() & pop-down: nd()
- NEW $trigger, to speedup the display generation: fase I
- UPDATE trendlineCorrectionReports.pl -> faster SQL queries
- UPDATE TABLE `displayDaemons` for MySQL'
- ALTER TABLE `displayDaemons` ADD COLUMN `trigger` char(1) NOT NULL default 'F' AFTER `loop`;
- UPDATE TABLE `eventsChangesLogData` for MySQL'
- tar -P -cvzf cpan-20100211.tgz /opt/monitoring/bin /opt/monitoring/lib /opt/monitoring/man
- NEW applications/log4perl.cnf config file for Log::Log4perl
- NEW integration for Cartography (applications/custom/cartography.pm-orig) into display.pl
ASNMTAP::Asnmtap::Plugins::Nagios
- NEW check_pargs.pl
ASNMTAP::Asnmtap::Pluggins::WebTransact.pm
- NEW option for check () keepAlive = [01]
ASNMTAP::Asnmtap::Applications::CGI.pm & archiver.pl
- DEPRECATED $SERVERMYSQLVERSION = '4.x'
- Applications.cnf
#<DATABASE_ACCOUNT>
# <SERVER>
# VERSION 5.0.x # '5.0.x' or '5.1.x'
# ...
# </SERVER>
- Applications.pm
- init_email_report()
- ADDED select((select($EMAILREPORT), $| = 1)[0]); # autoflush
- archive.pl
- NEW function CSV_import_from_table
- collector.pl
- UPDATE generateConfig.pl for the autogeneration from: asnmtap-collector.sh
- when there are servers configurated in failover
- onto the active server: only the file 'Display-<pagedir>.sh' and 'Collector-<deamon>.sh' are included
- onto both servers: are both files 'CollectorCT-<deamon>.sh' included when <deamon> eq <hostname>
- UPDATE generateConfig.pl for the autogeneration from: rsync-wrapper-failover-<hostname>.sh & rsync-mirror-failover-<admin collector>.sh
Version 3.001.000, 2009/10/03, by Alex Peeters
- ASNMTAP: CATALOG databaseschema implementation
# `catalogID` =~ 'CID', aanpassen AUB
- UPDATE /applications/Applications.cfg
#<DATABASE>
...
# CATALOGID CID
#</DATABASE>
- UPDATE /applications/tools/mysql/asnmtap-3.001.000.sql
- UPDATE /applications/tools/mysql/asnmtap-3.001.000_mysql-v5.0.x.sql
- UPDATE /applications/tools/mysql/asnmtap-3.001.000-distributed.sql
- UPDATE /applications/tools/mysql/asnmtap-3.001.000-distributed_mysql-v5.0.x.sql
- insert into `holidaysBundle` (`holidayBundleID`,`holidayBundleName`,`holidayID`,`countryID`,`activated`) values (0,'ASNMTAP','/0-0-0-0-00/','BE',0);
- manualy update holidayBundleID to '?' for holidayBundleName = 'ASNMTAP' and holidayID = '/0-0-0-0-00/' !
where '?' is a not used holidayBundleID <> '0'
- NEW TABLE `catalog` for MySQL'
CREATE TABLE `catalog` (
- UPDATE applications/tools/mysql/asnmtap-3.000.021.sql
- UPDATE applications/tools/mysql/asnmtap-3.000.021_mysql-v5.0.x.sql
- UPDATE applications/tools/mysql/asnmtap-3.000.021-distributed.sql
- UPDATE applications/tools/mysql/asnmtap-3.000.021-distributed_mysql-v5.0.x.sql
Version 3.000.020, 2009/04/19, by Alex Peeters
- ASNMTAP
- UPDATE /plugins/templates/snmptt/
- NEW check_SNMPTT_oracle.pl
- NEW snmptt-oracle.conf
- NEW %ICONSUNSTABLE = ('OK'=>'green-unstable.gif','WARNING'=>'yellow-unstable.gif','CRITICAL'=>'red-unstable.gif','UNKNOWN'=>'clear-unstable.gif','DEPENDENT'=>'','OFFLINE'=>'blue-unstable.gif','NO DATA'=>'purple-unst...
- UPDATE /applications/tools/mysql/asnmtap-3.000.020.sql
- UPDATE /applications/tools/mysql/asnmtap-3.000.020_mysql-v5.0.x.sql
- UPDATE /applications/tools/mysql/asnmtap-3.000.020-distributed.sql
- UPDATE /applications/tools/mysql/asnmtap-3.000.020-distributed_mysql-v5.0.x.sql
- NEW TABLE `eventsChangesLogData` for MySQL'
CREATE TABLE `eventsChangesLogData` (
`uKey` varchar(11) NOT NULL default '',
`lastStatus` varchar(9) NOT NULL default '',
`lastTimeslot` varchar(10) NOT NULL default '',
`prevStatus` varchar(9) NOT NULL default '',
`VIRTUAL_CLUSTER_ID` int(11) unsigned NOT NULL default '0',
`UKEY` varchar(11) default NULL,
PRIMARY KEY (`QUEUE_OID`,`QUEUE_NAME`),
KEY `VIRTUAL_CLUSTER_ID` (`VIRTUAL_CLUSTER_ID`),
KEY `QUEUE_NAME` (`QUEUE_NAME`),
KEY `UKEY` (`UKEY`)
) ENGINE=MyISAM
- UPDATE /applications/Applications.cfg
#<TABLES>
...
# EVENTSCHANGESLOGDATA eventsChangesLogData
...
# <UNSTABLE>
# OK green-unstable.gif
# WARNING yellow-unstable.gif
# CRITICAL red-unstable.gif
# UNKNOWN clear-unstable.gif
# DEPENDENT
# OFFLINE blue-unstable.gif
# NO_DATA purple-unstable.gif
# IN_PROGRESS running.gif
# NO_TEST notest-unstable.gif
# TRENDLINE orange-unstable.gif
# </UNSTABLE>
- UPDATE Applications.pm, CGI.PM, Collector.pm & Display.pm
- NEW $SERVERTABLEVENTSCHNGSLGDT -> ´eventsChangesLogData´
- NEW WebTransact XML Monitoring plugin template for testing the 'Application Monitor' for Monitoring-1.1.xml
- check_template-WebTransact-XML-Monitoring-1.1.pl
- NEW common variable RUNCMDONDEMAND to Asnmtap.cnf
# RUNCMDONDEMAND localhost # localhost or probe
- version update NetAddr::IP 4.007
- version update WSRF::Lite 0.8.2.2
- version update XML::LibXML 1.63
ASNMTAP CPAN module perl 5.8.0, 5.8.5 and 5.8.6 compatible
- Making perl 5.8.8 compatible
ASNMTAP::Asnmtap
- NEW environment variable ASNMTAP_PATH used into the bash scripts
- NEW making MySQL 5.0.x compatible
- NEW asnmtap-3.000.015_mysql-v5.0.x.sql
- NEW applications/tools/mysql/asnmtap-3.000.015-distributed_mysql-v5.0.x.sql
- FIX OnDemand versus Display with 254 character limitation for MySQL >= v5.0.3 and yyyymmdd-test-ukey.sql-LOAD-DATA-FAILED
Values in VARCHAR columns are variable-length strings.
The length can be specified as a value from 0 to 255 before MySQL 5.0.3, and 0 to 65,535 in 5.0.3 and later versions.
TEXT A string with a maximum length of 65535 characters, from a variable length types that store large amounts of data.
Is similar to a larger version of VARCHAR. These types can store a large piece of data information, but is also processed much slower.
- OnDemand
CRITICAL - WebService ... (Production): 500 read timeout - 200 OK - getVersion (...:9108): 4.20063.13 - 200 OK - ping (...:9110): OK - 200 OK - monitorControls (...:9110): OK - 200 OK - getVersion (...:9110): 4.20...
- Display: afkapping op 254 characters
CRITICAL - WebService ... (Production): 500 read timeout - 200 OK - getVersion (...:9108): 4.20063.13 - 200 OK - ping (...:9110): OK - 200 OK - monitorControls (...:9110): OK - 200 OK - getVersion (...:9110): 4.20...
- v4.x : `statusMessage` varchar(254) NOT NULL default '',
- v5.0.x : `statusMessage` varchar(1024) NOT NULL default '',
add
<COMMON>
...
# <PERFPARSE>
# BIN /opt/asnmtap/perfparse/bin
# ETC /opt/asnmtap/perfparse/etc
# LIB /opt/asnmtap/perfparse/lib
# SHARE /opt/asnmtap/perfparse/share
# CGI /cgi-bin/perfparse.cgi
# ENABLED 0 # '0' or '1'
# DATABASE ~ <DATABASE_ACCOUNT><READWRITE><DATABASE>
# HOST ~ <DATABASE_ACCOUNT><READWRITE><HOST>
# PORT ~ <DATABASE_ACCOUNT><READWRITE><PORT>
# USERNAME ~ <DATABASE_ACCOUNT><READWRITE><USERNAME>
# PASSWORD ~ <DATABASE_ACCOUNT><READWRITE><PASSWORD>
# </PERFPARSE>
</COMMON>
...
replace
#<TABLES>
...
# REPORTS reports
...
#</TABLES>
with
#<TABLES>
...
# REPORTS reports
# REPORTSPERFDATA reports_perfdata
...
#</TABLES>
- NEW $SERVERTABLREPORTSPRFDT into CGI.pm
- NEW $CHARTDIRECTORLIB and $SERVERTABLREPORTSPRFDT into Applications.pm
- NEW $PERFPARSEBIN $PERFPARSEETC $PERFPARSELIB $PERFPARSESHARE $PERFPARSECGI $PERFPARSEENABLED into CGI.pm & Applications.pm
ASNMTAP::Asnmtap::Applications::Collector
- NEW $CHARTDIRECTORLIB into collector.pl
ASNMTAP::Asnmtap::Applications::CGI
- NEW $CHARTDIRECTORLIB into generateChart.pl , generateCollectorCrontabSchedulingReport.pl, generateCollectorDaemonSchedulingReport.pl & generatePluginCrontabSchedulingReport.pl
ASNMTAP::Asnmtap::Plugins
- version update Time::HiRes 1.9705
- version update WSRF::Lite 0.8.2.1
MANIFEST
- NEW check_template-WebTransact-XML-Monitoring.pl
- NEW check_template-WebTransact-XML-Monitoring.t
- NEW check_template-WebTransact-with-client-authorization.pl
- NEW check_template-WebTransact-with-client-authorization.t
README
- updated INSTALLATION procedure
Applications.cnf
#<DATABASE_ACCOUNT>
# <SERVER>
# VERSION 4.x # '4.x' or '5.0.x'
# MERGE 0 # '0' or '1'
# </SERVER>
ASNMTAP::Asnmtap::*
- optimalisation for MySQL queries
ASNMTAP::Asnmtap::Applications.pm & display.pl
- FIX sound sanity .innerHTML bug with FireFox
- UPDATE sound default set to 'off' when FireFox, otherwise default set to 'on'
- UPDATE $TcommentData =~ s/[\n\r]+(Updated|Edited|Closed) by: (?:.+), (?:.+) \((?:.+)\) on (\d{4}-\d\d-\d\d) (\d\d:\d\d:\d\d)/\n\r$1 on $2 $3/g;
-------------------------------------------------------------------------
Information about the configuration for ASNMTAP Applications can be found at:
man ASNMTAP::Asnmtap::Applications
Applications.cnf
----------------
mv $AMPATH/applications/Applications.cnf-orig $AMPATH/applications/Applications.cnf
vi $AMPATH/applications/Applications.cnf and modify at least <COMMON>...</COMMON> and <DATABASE_ACCOUNT>...</DATABASE_ACCOUNT>
...
# Common variables - - - - - - - - - - - - - - - - - - - - - - - - - -
<COMMON>
SMTPUNIXSYSTEM 1
SERVERLISTSMTP localhost
SERVERSMTP localhost
SENDMAILFROM asnmtap@localhost
HTTPSSERVER asnmtap.localhost
REMOTE_HOST localhost
REMOTE_ADDR 127.0.0.1
OPTIONS --bodyimage /opt/asnmtap/applications/htmlroot/img/logos/bodyimage.gif --charset iso-8859-1 --format pdf14 --size A4 --landscape --browserwidth 1280 --top 10mm --bottom 10mm --left 10mm --right 10mm --fontsize 10.0 --fontspacing ...
</COMMON>
...
<DATABASE_ACCOUNT>
...
</DATABASE_ACCOUNT>
...
SSH access for the 'Application Monitor'
----------------------------------------
cd ~/.ssh
chown -R asnmtap:asnmtap .ssh
# |-------|------- user for the ASNMTAP::Application
applications/Applications.cnf view on Meta::CPAN
# <PERFPARSE>
# BIN /opt/asnmtap/perfparse20/bin
# ETC /opt/asnmtap/perfparse20/etc
# LIB /opt/asnmtap/perfparse20/lib
# SHARE /opt/asnmtap/perfparse20/share
# CGI /perfparse20/perfparse.php
# ENABLED 1 # '0' or '1'
# VERSION 20 # '19' or '20'
# CONFIG perfparse20.cfg # 'perfparse.cfg' or 'perfparse20.cfg'
# DATABASE ~ <DATABASE_ACCOUNT><READWRITE><DATABASE>
# HOST ~ <DATABASE_ACCOUNT><READWRITE><HOST>
# PORT ~ <DATABASE_ACCOUNT><READWRITE><PORT>
# USERNAME ~ <DATABASE_ACCOUNT><READWRITE><USERNAME>
# PASSWORD ~ <DATABASE_ACCOUNT><READWRITE><PASSWORD>
# </PERFPARSE>
</COMMON>
<PATH>
# HTTPS /opt/asnmtap/applications/htmlroot
# IMAGES /opt/asnmtap/applications/htmlroot/img
# PDPHELP /opt/asnmtap/applications/htmlroot/pdf
# RESULTS /opt/asnmtap/results
# SSHKEY /home
# WWWKEY /var/www
</PATH>
#<DATABASE_ACCOUNT>
# <SERVER>
# VERSION 5.0.x # '5.0.x' or '5.1.x'
# MERGE 0 # '0' or '1'
# </SERVER>
# <READONLY>
# HOST localhost
# PORT 3306
# USERNAME asnmtapro
# PASSWORD <PASSWORD>
# </READONLY>
# <READWRITE>
# HOST localhost
# PORT 3306
# USERNAME asnmtap
# PASSWORD <PASSWORD>
# </READWRITE>
#</DATABASE_ACCOUNT>
#<COLORS>
# OK 99CC99
# WARNING FFFF00
# CRITICAL FF4444
# UNKNOWN FFFFFF
# DEPENDENT D8D8BF
# OFFLINE 0000FF
# NO_DATA CC00CC
# IN_PROGRESS 99CC99
# NO_TEST 99CC99
# _NIHIL_ CC00CC
# TRENDLINE ffa000
# <PIE>
# OK 0x00BA00
# WARNING 0xffff00
# CRITICAL 0xff0000
# UNKNOWN 0x99FFFF
# DEPENDENT 0xD8D8BF
# OFFLINE 0x0000FF
# NO_DATA 0xCC00CC
# IN_PROGRESS 0x99CC99
# NO_TEST 0x444444
# _NIHIL_ 0xCC00CC
# TRENDLINE 0xffa000
# </PIE>
# <RRD>
# OK 0x00BA00
# WARNING 0xffff00
# CRITICAL 0xff0000
# UNKNOWN 0x99FFFF
# DEPENDENT 0xD8D8BF
# OFFLINE 0x0000FF
# NO_DATA 0xCC00CC
# IN_PROGRESS 0x99CC99
# NO_TEST 0x000000
# _NIHIL_ 0xCC00CC
# TRENDLINE 0xffa000
# </RRD>
# <TABLE>
# TABLE 333344
# NOBLOCK 335566
# ENDBLOCK 665555
applications/Applications.cnf view on Meta::CPAN
# </TABLE>
#</COLORS>
#<ICONS>
# OK green.gif
# WARNING yellow.gif
# CRITICAL red.gif
# UNKNOWN clear.gif
# DEPENDENT
# OFFLINE blue.gif
# NO_DATA purple.gif
# IN_PROGRESS running.gif
# NO_TEST notest.gif
# TRENDLINE orange.gif
# <ACK>
# OK green-ack.gif
# WARNING yellow-ack.gif
# CRITICAL red-ack.gif
# UNKNOWN clear-ack.gif
# DEPENDENT
# OFFLINE blue-ack.gif
# NO_DATA purple-ack.gif
# IN_PROGRESS running.gif
# NO_TEST notest-ack.gif
# TRENDLINE orange-ack.gif
# </ACK>
# <UNSTABLE>
# OK green-unstable.gif
# WARNING yellow-unstable.gif
# CRITICAL red-unstable.gif
# UNKNOWN clear-unstable.gif
# DEPENDENT
# OFFLINE blue-unstable.gif
# NO_DATA purple-unstable.gif
# IN_PROGRESS running.gif
# NO_TEST notest-unstable.gif
# TRENDLINE orange-unstable.gif
# </UNSTABLE>
# <RECORD>
# maintenance maintenance.gif
# duplicate recordDuplicate.gif
# delete recordDelete.gif
# details recordDetails.gif
applications/Applications.cnf view on Meta::CPAN
# RESULTS results
#</SUBDIR>
#<URL>
# HTTPS /asnmtap
# IMAGES /asnmtap/img
# PDPHELP /asnmtap/pdf
# RESULTS /results
#</URL>
#<DATABASE>
# ASNMTAP asnmtap
# CATALOGID CID
#</DATABASE>
#<TABLES>
# CATALOG catalog
# COLLECTORDAEMONS collectorDaemons
# COMMENTS comments
# COUNTRIES countries
# CRONTABS crontabs
# DISPLAYDAEMONS displayDaemons
# DISPLAYGROUPS displayGroups
# ENVIRONMENT environment
# EVENTS events
# EVENTSCHANGESLOGDATA eventsChangesLogData
# EVENTSDISPLAYDATA eventsDisplayData
# HOLIDAYS holidays
# HOLIDAYSBUNDLE holidaysBundle
# LANGUAGE language
# PAGEDIRS pagedirs
# PLUGINS plugins
# REPORTS reports
# REPORTSPERFDATA reports_perfdata
# RESULTSDIR resultsdir
# SERVERS servers
# TIMEPERIODS timeperiods
# USERS users
# VIEWS views
#</TABLES>
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
applications/archive.pl view on Meta::CPAN
sub archiveCommentsAndEventsTables {
my ($eventsAgo, $commentsAgo) = @_;
print EMAILREPORT "\nArchive '$SERVERTABLCOMMENTS' and '$SERVERTABLEVENTS' tables:\n--------------------------------------------------\n" unless ( $debug );
# Init parameters
my ($rv, $dbh, $sth, $sql, $year, $month, $day, $timeslot, $yearMOVE, $monthMOVE, $sqlMOVE, $sqlUPDATE);
$rv = 1;
$dbh = DBI->connect("dbi:mysql:$DATABASE:$SERVERNAMEREADWRITE:$SERVERPORTREADWRITE", "$SERVERUSERREADWRITE", "$SERVERPASSREADWRITE" ) or $rv = errorTrapDBI("Cannot connect to the database", $debug);
if ($dbh and $rv) {
$year = get_year ($eventsAgo);
$month = get_month ($eventsAgo);
$day = get_day ($eventsAgo);
$timeslot = timelocal ( 0, 0, 0, $day, ($month-1), ($year-1900) );
if ($debug) {
$sql = "select SQL_NO_CACHE catalogID, id, endDate, startDate, timeslot, uKey from $SERVERTABLEVENTS force index (key_timeslot) where timeslot < '" .$timeslot. "'";
applications/archive.pl view on Meta::CPAN
print "$sqlMOVE\n" if ($debug);
$dbh->do( $sqlMOVE ) or $rv = errorTrapDBI("Cannot dbh->do: $sql", $debug) unless ( $debug );
if ( $rv ) {
$sqlMOVE = 'DELETE FROM `' .$SERVERTABLEVENTS. '` WHERE catalogID = "' .$ref->{catalogID}. '" and id = "' .$ref->{id}. '"';
print "$sqlMOVE\n" if ($debug);
$dbh->do( $sqlMOVE ) or $rv = errorTrapDBI("Cannot dbh->do: $sql", $debug) unless ( $debug );
}
} else {
if ($debug) {
print "DATABASE ERROR ... CRITICAL: Update table ${SERVERTABLEVENTS}_${yearMOVE}_${monthMOVE}' not possible for '$sqlMOVE'\n";
} else {
print EMAILREPORT "DATABASE ERROR ... CRITICAL: Update table ${SERVERTABLEVENTS}_${yearMOVE}_${monthMOVE}' not possible for '$sqlMOVE'\n";
}
}
}
$sth->finish() or $rv = errorTrapDBI("sth->finish", $debug);
}
$sql = "select SQL_NO_CACHE distinct $SERVERTABLCOMMENTS.catalogID, $SERVERTABLCOMMENTS.uKey, $SERVERTABLCOMMENTS.commentData from $SERVERTABLCOMMENTS, $SERVERTABLPLUGINS, $SERVERTABLVIEWS, $SERVERTABLDISPLAYDMNS, $SERVERTABLCRONTABS as crontabOu...
if ($debug) {
applications/archive.pl view on Meta::CPAN
print "$sqlMOVE\n" if ($debug);
$dbh->do( $sqlMOVE ) or $rv = errorTrapDBI("Cannot dbh->do: $sql", $debug) unless ( $debug );
if ( $rv ) {
$sqlMOVE = 'DELETE FROM `' .$SERVERTABLCOMMENTS. '` WHERE catalogID = "' .$ref->{catalogID}. '" and id = "' .$ref->{id}. '"';
print "$sqlMOVE\n" if ($debug);
$dbh->do( $sqlMOVE ) or $rv = errorTrapDBI("Cannot dbh->do: $sql", $debug) unless ( $debug );
}
} else {
if ($debug) {
print "DATABASE ERROR ... CRITICAL: Update table ${SERVERTABLCOMMENTS}_${yearMOVE}' not possible for '$sqlMOVE'\n";
} else {
print EMAILREPORT "DATABASE ERROR ... CRITICAL: Update table ${SERVERTABLCOMMENTS}_${yearMOVE}' not possible for '$sqlMOVE'\n";
}
}
}
$sth->finish() or $rv = errorTrapDBI("sth->finish", $debug);
}
# cleanup automatically scheduled donwtimes when sheduled OFFLINE
my ($localYear, $localMonth, $currentYear, $currentMonth, $currentDay, $currentHour, $currentMin, $currentSec) = ((localtime)[5], (localtime)[4], ((localtime)[5] + 1900), ((localtime)[4] + 1), (localtime)[3,2,1,0]);
applications/archive.pl view on Meta::CPAN
sub createCommentsAndEventsArchiveTables {
my ($daysBefore) = @_;
print EMAILREPORT "\nCreate '$SERVERTABLCOMMENTS' and '$SERVERTABLEVENTS' tables when needed:\n--------------------------------------------------\n" unless ( $debug );
# Init parameters
my ($rv, $dbh, $sql, $year, $month);
$year = get_year ($daysBefore);
$rv = 1;
$dbh = DBI->connect("dbi:mysql:$DATABASE:$SERVERNAMEREADWRITE:$SERVERPORTREADWRITE", "$SERVERUSERREADWRITE", "$SERVERPASSREADWRITE" ) or $rv = errorTrapDBI("Cannot connect to the database", $debug);
if ($dbh and $rv) {
foreach $month ('01'..'12') {
$sql = 'CREATE TABLE IF NOT EXISTS `'. $SERVERTABLEVENTS .'_'. $year .'_'. $month .'` LIKE `'. $SERVERTABLEVENTS .'`';
$rv = ! checkTableDBI ($dbh, $DATABASE, $SERVERTABLEVENTS .'_'. $year .'_'. $month, 'check', 'status', 'OK');
if ($rv) {
if ($debug) {
print "\nTable: '$SERVERTABLEVENTS', Year: '$year', Month: '$month'\n<$sql>\n";
} else {
print EMAILREPORT "\nTable: '$SERVERTABLEVENTS', Year: '$year', Month: '$month', Status: ";
$dbh->do( $sql ) or $rv = errorTrapDBI("Cannot dbh->do: $sql", $debug);
$rv = checkTableDBI ($dbh, $DATABASE, $SERVERTABLEVENTS .'_'. $year .'_'. $month, 'check', 'status', 'OK');
if ($rv) { print EMAILREPORT "Created\n"; } else { print EMAILREPORT "NOT CREATED, PLEASE VERIFY\n"; }
}
} else {
$rv = 1;
print "Table: '$SERVERTABLEVENTS', Year: '$year', Month: '$month', Status: ALREADY CREATED\n" if ($debug);
}
if ( $SERVERMYSQLMERGE eq '1' ) {
if ($debug) {
print "Table: '$SERVERTABLEVENTS', Year: '$year', Month: '$month', Status: ENGINE\n";
applications/archive.pl view on Meta::CPAN
$sql = 'ALTER TABLE `'. $SERVERTABLEVENTS .'_'. $year .'_Q'. $quarter .'` ENGINE=MERGE UNION=(`'. $SERVERTABLEVENTS .'_'. $year .'_'. sprintf ("%02d", ($quarter * 3 ) - 2) .'`, `'. $SERVERTABLEVENTS .'_'. $year .'_'. sprintf ("%02d", ($qu...
$dbh->do( $sql ) or $rv = errorTrapDBI("Cannot dbh->do: $sql", $debug);
}
if ($rv) { print EMAILREPORT "MERGED\n\n"; } else { print EMAILREPORT "NOT MERGED, PLEASE VERIFY '$sql'\n\n"; }
}
}
}
$sql = "CREATE TABLE IF NOT EXISTS `". $SERVERTABLCOMMENTS .'_'. $year ."` LIKE `$SERVERTABLCOMMENTS`";
$rv = ! checkTableDBI ($dbh, $DATABASE, $SERVERTABLCOMMENTS .'_'. $year, 'check', 'status', 'OK');
if ($rv) {
if ($debug) {
print "\nTable: '$SERVERTABLCOMMENTS', Year: '$year'\n<$sql>\n";
} else {
print EMAILREPORT "\nTable: '$SERVERTABLCOMMENTS', Year: '$year', Status: ";
$dbh->do( $sql ) or $rv = errorTrapDBI("Cannot dbh->do: $sql", $debug);
$rv = checkTableDBI ($dbh, $DATABASE, $SERVERTABLCOMMENTS .'_'. $year, 'check', 'status', 'OK');
if ($rv) { print EMAILREPORT "Created\n\n"; } else { print EMAILREPORT "NOT CREATED, PLEASE VERIFY\n\n"; }
}
} else {
print "Table: '$SERVERTABLCOMMENTS', Year: '$year', Status: ALREADY CREATED\n\n" if ($debug);
}
$dbh->disconnect or $rv = errorTrapDBI("Sorry, the database was unable to add your entry.", $debug);
}
}
applications/archive.pl view on Meta::CPAN
} elsif ( $staart eq "$command-$catalogID_uKey.sql" ) {
if ($debug) {
print "S+ <$datum><", get_yearMonthDay($gzipEpoch), "><$path><$filename>\n" if ($datum le get_yearMonthDay($gzipEpoch));
} elsif (! $doDatabase) {
# APE # TODO - REMOVE
# Init parameters
# my ($rv, $dbh, $sql);
# open connection to database and query data
# $rv = 1;
# $dbh = DBI->connect("dbi:mysql:$DATABASE:$SERVERNAMEREADWRITE:$SERVERPORTREADWRITE", "$SERVERUSERREADWRITE", "$SERVERPASSREADWRITE" ) or $rv = errorTrapDBI("Cannot connect to the database", $debug);
# 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");
}
}
CSV_cleanup_table ($dbh, \$logger, $_debug);
}
} elsif ( $staart eq "$command-$catalogID_uKey.sql.gz" ) {
if ($datum le get_yearMonthDay($removeGzipEpoch)) {
if ($debug) {
print "S- <$datum><", get_yearMonthDay($removeGzipEpoch), "><$path><$filename>\n";
} else {
applications/bin/generateReports.pl view on Meta::CPAN
$CATALOGID
$REPORTDIR
$RESULTSPATH
$REMOTE_HOST $HTTPSURL
$HTMLTOPDFPRG $HTMLTOPDFOPTNS
&create_header &create_footer
&init_email_report &send_email_report &encode_html_entities
&DBI_error_trap
&LOG_init_log4perl
$DATABASE $SERVERNAMEREADONLY $SERVERPORTREADONLY $SERVERUSERREADONLY $SERVERPASSREADONLY
$SERVERTABLENVIRONMENT $SERVERTABLPLUGINS $SERVERTABLREPORTS);
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
use vars qw($opt_y $opt_m $opt_d $opt_a $opt_u $opt_V $opt_h $opt_D $PROGNAME);
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
$PROGNAME = "generateReports.pl";
my $prgtext = "Generate Reports for the '$APPLICATION'";
applications/bin/generateReports.pl view on Meta::CPAN
if ( $debug ) { print $emailMessage; } else { print EMAILREPORT $emailMessage; }
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Init parameters
my ($rv, $dbh, $sth, $sql);
# open connection to database and query data
$rv = 1;
$dbh = DBI->connect("dbi:mysql:$DATABASE:$SERVERNAMEREADONLY:$SERVERPORTREADONLY", "$SERVERUSERREADONLY", "$SERVERPASSREADONLY" ) or $rv = DBI_error_trap(*EMAILREPORT, "Cannot connect to the database", \$logger, $debug);
if ($dbh and $rv) {
my ($id, $catalogID, $uKey, $reportTitle, $periode, $status, $errorDetails, $bar, $hourlyAverage, $dailyAverage, $showDetails, $showComments, $showPerfdata, $showTop20SlowTests, $printerFriendlyOutput, $formatOutput, $userPassword, $timeperiodID,...
$sql = "select id, $SERVERTABLREPORTS.catalogID, $SERVERTABLREPORTS.uKey, concat( LTRIM(SUBSTRING_INDEX($SERVERTABLPLUGINS.title, ']', -1)), ' (', $SERVERTABLENVIRONMENT.label, ')' ), periode, status, errorDetails, bar, hourlyAverage, dailyAverag...
$sth = $dbh->prepare( $sql ) or $rv = DBI_error_trap(*EMAILREPORT, "Cannot dbh->prepare: $sql", \$logger, $debug);
$sth->execute() or $rv = DBI_error_trap(*EMAILREPORT, "Cannot sth->execute: $sql", \$logger, $debug) if $rv;
$sth->bind_columns( \$id, \$catalogID, \$uKey, \$reportTitle, \$periode, \$status, \$errorDetails, \$bar, \$hourlyAverage, \$dailyAverage, \$showDetails, \$showComments, \$showPerfdata, \$showTop20SlowTests, \$printerFriendlyOutput, \$formatOutpu...
my @commands = (); my @pdfFilenames = ();
applications/bin/holidayBundleSetDowntimes.pl view on Meta::CPAN
use ASNMTAP::Asnmtap::Applications v3.002.003;
use ASNMTAP::Asnmtap::Applications qw(:APPLICATIONS
$RMDEFAULTUSER
$SMTPUNIXSYSTEM $SERVERLISTSMTP $SERVERSMTP $SENDMAILFROM
&init_email_report &send_email_report
&DBI_error_trap
&LOG_init_log4perl
$DATABASE $CATALOGID $SERVERNAMEREADWRITE $SERVERPORTREADWRITE $SERVERUSERREADWRITE $SERVERPASSREADWRITE
$SERVERTABLCOMMENTS $SERVERTABLENVIRONMENT $SERVERTABLHOLIDYSBNDL $SERVERTABLHOLIDYS $SERVERTABLPLUGINS $SERVERTABLUSERS);
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
use vars qw($opt_V $opt_h $opt_D $PROGNAME);
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
$PROGNAME = "holidayBundleSetDowntimes.pl";
my $prgtext = "Set Holiday Bundle Downtimes for the '$APPLICATION'";
applications/bin/holidayBundleSetDowntimes.pl view on Meta::CPAN
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
my ($emailReport, $rvOpen) = init_email_report (*EMAILREPORT, 'holidayBundleSetDowntimes.txt', $debug);
# Init parameters
my ($rv, $dbh, $sth, $sql);
# open connection to database and query data
$rv = 1;
$dbh = DBI->connect("dbi:mysql:$DATABASE:$SERVERNAMEREADWRITE:$SERVERPORTREADWRITE", "$SERVERUSERREADWRITE", "$SERVERPASSREADWRITE" ) or $rv = DBI_error_trap(*EMAILREPORT, "Cannot connect to the database", \$logger, $debug);
if ($dbh and $rv) {
my ($catalogID, $holidayBundleID, $holidayBundleName, $holidayID);
$sql = "select catalogID, holidayBundleID, holidayBundleName, holidayID from $SERVERTABLHOLIDYSBNDL where catalogID='$CATALOGID' and activated = '1' order by holidayBundleName";
$sth = $dbh->prepare( $sql ) or $rv = DBI_error_trap(*EMAILREPORT, "Cannot dbh->prepare: $sql", \$logger, $debug);
$sth->execute() or $rv = DBI_error_trap(*EMAILREPORT, "Cannot sth->execute: $sql", \$logger, $debug) if $rv;
$sth->bind_columns( \$catalogID, \$holidayBundleID, \$holidayBundleName, \$holidayID ) or $rv = DBI_error_trap(*EMAILREPORT, "Cannot sth->bind_columns: $sql", \$logger, $debug) if $rv;
if ( $rv ) {
if ( $sth->rows ) {
applications/bin/importDataThroughCatalog.pl view on Meta::CPAN
use ASNMTAP::Asnmtap::Applications v3.002.003;
use ASNMTAP::Asnmtap::Applications qw(:APPLICATIONS
$RESULTSPATH
$SMTPUNIXSYSTEM $SERVERLISTSMTP $SERVERSMTP $SENDMAILFROM
&init_email_report &send_email_report
&DBI_connect &DBI_do &DBI_execute &DBI_error_trap
&LOG_init_log4perl
$DATABASE $CATALOGID $SERVERNAMEREADWRITE $SERVERPORTREADWRITE $SERVERUSERREADWRITE $SERVERPASSREADWRITE
$SERVERTABLCATALOG $SERVERTABLCLLCTRDMNS $SERVERTABLCOMMENTS $SERVERTABLCRONTABS $SERVERTABLDISPLAYDMNS $SERVERTABLDISPLAYGRPS $SERVERTABLEVENTS $SERVERTABLEVENTSCHNGSLGDT $SERVERTABLEVENTSDISPLAYDT $SERVERTABLHO...
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
use vars qw($opt_T $opt_M $opt_V $opt_h $opt_D $PROGNAME);
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
$PROGNAME = "importDataThroughCatalog.pl";
my $prgtext = "Import Data Through Catalog for the '$APPLICATION'";
applications/bin/importDataThroughCatalog.pl view on Meta::CPAN
$debug = 1 if ($opt_D eq 'T');
$debug = 2 if ($opt_D eq 'L');
} else {
usage("Invalid debug: $opt_D\n");
}
}
if ($opt_T) {
if ($opt_T eq 'CONFIG') {
$type = 1;
} elsif ($opt_T eq 'DATA') {
$type = 2;
} elsif ($opt_T eq 'ALL') {
$type = 3;
} else {
usage("Invalid type: $opt_T\n");
}
}
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
applications/bin/importDataThroughCatalog.pl view on Meta::CPAN
} else {
print "Cannot open $tlogging-nok.txt to print debug information\n";
}
}
}
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
sub do_importDataThroughCatalog {
printDebugAll (" IN: do_importDataThroughCatalog <$PROGNAME v$version pid: <$pidfile>");
($dbh, $rv, $alarmMessage) = DBI_connect ( $DATABASE, $SERVERNAMEREADWRITE, $SERVERPORTREADWRITE, $SERVERUSERREADWRITE, $SERVERPASSREADWRITE, $alarm, \&DBI_error_trap, [*EMAILREPORT, "Cannot connect to the database"], \$logger, $debug, $boolean_deb...
if ($dbh and $rv) {
my ($catalogID, $catalogType, $databaseFQDN, $databasePort);
$sql = "select catalogID, catalogType, databaseFQDN, databasePort from $SERVERTABLCATALOG where catalogID <> '$CATALOGID' and catalogType <> 'central' and activated = '1'";
$sth = $dbh->prepare( $sql ) or $rv = DBI_error_trap(*EMAILREPORT, "Cannot dbh->prepare: $sql", \$logger, $debug);
($rv, undef) = DBI_execute ($rv, \$sth, $alarm, \&DBI_error_trap, [*EMAILREPORT, "Cannot sth->execute: $sql"], \$logger, $debug);
$sth->bind_columns( \$catalogID, \$catalogType, \$databaseFQDN, \$databasePort ) or $rv = DBI_error_trap(*EMAILREPORT, "Cannot sth->bind_columns: $sql", \$logger, $debug) if $rv;
if ( $rv ) {
my %catalog;
applications/bin/importDataThroughCatalog.pl view on Meta::CPAN
foreach my $catalogID ( keys %catalog ) {
if ($debug) {
print "+ Catalog ID: $catalogID\n";
print " - catalogType => ". $catalog{$catalogID}{catalogType} ."\n";
print " - databaseFQDN => ". $catalog{$catalogID}{databaseFQDN} ."\n";
print " - databasePort => ". $catalog{$catalogID}{databasePort} ."\n";
}
# Open connection to database and query data
my $dbhSOURCE;
($dbhSOURCE, $rv, $alarmMessage) = DBI_connect ( $DATABASE, $catalog{$catalogID}{databaseFQDN}, $catalog{$catalogID}{databasePort}, $SERVERUSERREADWRITE, $SERVERPASSREADWRITE, $alarm, \&DBI_error_trap, [*EMAILREPORT, "Cannot connect to the da...
if ($dbhSOURCE and $rv) {
print EMAILREPORT "\nCatalog ID: $catalogID\n" unless ($debug);
# config contrains: events, eventsChangesLogData & comments = = =
if ( $type == 1 or $type == 3 ) {
if ($debug) {
print "- config contrains: events, eventsChangesLogData & comments\n";
} else {
print EMAILREPORT "\n- config contrains: events, eventsChangesLogData & comments\n";
applications/bin/importDataThroughCatalog.pl view on Meta::CPAN
$sthSOURCE->finish() or $rv = DBI_error_trap(*EMAILREPORT, "Cannot sthSOURCE->finish: $sqlSOURCE", \$logger, $debug);
}
print $EMAILREPORT " ERROR: DBH/STH\n" unless ($debug or $rv);
printDebugAll (" OUT: importData <$PROGNAME v$version pid: <$pidfile>");
}
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
sub print_usage () {
print "Usage: $PROGNAME [-T <CONFIG|DATA|ALL>] [-D <debug>] [-V version] [-h help]\n";
}
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
sub print_help () {
print_revision($PROGNAME, $version);
print "ASNMTAP Import Data Through Catalog for the '$APPLICATION'
-T, --type=<CONFIG|DATA|ALL> (default: current ALL)
-M, --mode=O|D
O(nce) : run the program once
D(aemon) : run the program as a loop
-D, --debug=F|T|L
F(alse) : screendebugging off (default)
T(true) : normal screendebugging on
L(ong) : long screendebugging on
-V, --version
-h, --help
applications/collector-test.pl view on Meta::CPAN
my $tlogging = $logging . get_logfiledate();
my ($queryMySQL, $instability, $persistent, $downtime);
$queryMySQL = $instability = $persistent = $downtime = 0;
if ($doIt) {
# open connection to database and query comment data
my ($sth, $sql, $firstRecordPersistentTrue, $firstRecordPersistentFalse, $activationTimeslotPersistentTrue, $activationTimeslotPersistentFalse, $suspentionTimeslotPersistentTrue, $suspentionTimeslotPersistentFalse);
$firstRecordPersistentTrue = $firstRecordPersistentFalse = 1;
my ($dbh, $rv, $alarmMessage) = DBI_connect ( $DATABASE, $SERVERNAMEREADWRITE, $SERVERPORTREADWRITE, $SERVERUSERREADWRITE, $SERVERPASSREADWRITE, $alarm, \&errorTrapDBIdowntime, [$collectorlist, "Cannot connect to the database"], \$logger, $...
if ($dbh and $rv) {
$sql = "select SQL_NO_CACHE activationTimeslot, suspentionTimeslot, instability, persistent from $SERVERTABLCOMMENTS where catalogID = '$catalogID' and uKey = '$uniqueKey' and downtime = '1' and problemSolved = '0' order by persistent des...
$sth = $dbh->prepare( $sql ) or $rv = errorTrapDBIdowntime($collectorlist, "Cannot dbh->prepare: $sql", \$logger, $debug);
($rv, undef) = DBI_execute ($rv, \$sth, $alarm, \&errorTrapDBIdowntime, [$collectorlist, "Cannot sth->execute: $sql"], \$logger, $debug);
if ( $rv ) {
if ( $sth->rows ) {
my ($TactivationTimeslot, $TsuspentionTimeslot, $Tinstability, $Tpersistent);
$activationTimeslotPersistentTrue = $activationTimeslotPersistentFalse = 9999999999;
applications/collector-test.pl view on Meta::CPAN
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
sub insertEntryDBI {
my ($currentDate, $catalogID_uniqueKey, $catalogID, $uniqueKey, $title, $dbiFilename, $test, $interval, $status, $logging, $debug, $startDate, $startTime, $endDate, $endTime, $duration, $statusMessage, $perfdata, $filename, $insertMySQL, $queryMySQ...
return ( 1 ) unless ( $insertMySQL );
my ($sth, $lockString, $findString, $updateString, $insertString, $flushString, $unlockString, $insertEntryDBI, $updateEntryDBI);
$insertEntryDBI = 0;
$updateEntryDBI = 0;
my ($dbh, $rv, $alarmMessage) = DBI_connect ( $DATABASE, $serverName, $SERVERPORTREADWRITE, $SERVERUSERREADWRITE, $SERVERPASSREADWRITE, $alarm, \&errorTrapDBI, [$currentDate, $catalogID_uniqueKey, $catalogID, $uniqueKey, $test, $title, $status, $st...
if ($dbh and $rv) {
if ($queryMySQL) {
my $numbersEntryDBI = 0;
$findString = 'select SQL_NO_CACHE status from '.$SERVERTABLEVENTS.' where catalogID = "' .$catalogID. '" and uKey = "' .$uniqueKey. '" and step <> "0" and timeslot = "' . get_timeslot ($currentDate) . '" order by id desc';
printDebugAll ("query Entry DBI: <$findString>") if ($debug eq 'T');
$sth = $dbh->prepare($findString) or $rv = errorTrapDBI($currentDate, $catalogID_uniqueKey, $catalogID, $uniqueKey, $test, $title, $status, $startDate, $startTime, $endDate, $endTime, $duration, $statusMessage, $perfdata, $interval, $instabilit...
($rv, undef) = DBI_execute ($rv, \$sth, $alarm, \&errorTrapDBI, [$currentDate, $catalogID_uniqueKey, $catalogID, $uniqueKey, $test, $title, $status, $startDate, $startTime, $endDate, $endTime, $duration, $statusMessage, $perfdata, $interval, $i...
if ($rv) {
applications/collector-test.pl view on Meta::CPAN
push (@dataOK, "0");
push (@dataWarning, "0");
push (@dataCritical, "0");
push (@dataUnknown, "0");
push (@dataNoTest, "0");
push (@dataOffline, "0");
push (@RRDlabels, " ");
}
# db connect & sql query
my ($dbh, $rv, $alarmMessage) = DBI_connect ( $DATABASE, $serverName, $SERVERPORTREADWRITE, $SERVERUSERREADWRITE, $SERVERPASSREADWRITE, $alarm, \&errorTrapDBIgraphEntry, ["Cannot connect to the database"], \$logger, $debug, $boolean_debug_all );
if ($dbh and $rv) {
my $sth = $dbh->prepare( $findString ) or $rv = errorTrapDBIgraphEntry("Cannot dbh->prepare: $findString", \$logger, $debug);
($rv, $alarmMessage) = DBI_execute ($rv, \$sth, $alarm, \&errorTrapDBIgraphEntry, ["Cannot sth->execute: $findString"], \$logger, $debug);
unless ( $rv ) {
$title .= " - DBI_execute - alarm: $alarm - $alarmMessage";
} else {
$sth->bind_columns( \$duration, \$startTime, \$status, \$timeslot ) or $rv = errorTrapDBIgraphEntry("Cannot sth->bind_columns: $findString", \$logger, $debug);
applications/collector.pl view on Meta::CPAN
my $tlogging = $logging . get_logfiledate();
my ($queryMySQL, $instability, $persistent, $downtime);
$queryMySQL = $instability = $persistent = $downtime = 0;
if ($doIt) {
# open connection to database and query comment data
my ($sth, $sql, $firstRecordPersistentTrue, $firstRecordPersistentFalse, $activationTimeslotPersistentTrue, $activationTimeslotPersistentFalse, $suspentionTimeslotPersistentTrue, $suspentionTimeslotPersistentFalse);
$firstRecordPersistentTrue = $firstRecordPersistentFalse = 1;
my ($dbh, $rv, $alarmMessage) = DBI_connect ( $DATABASE, $SERVERNAMEREADWRITE, $SERVERPORTREADWRITE, $SERVERUSERREADWRITE, $SERVERPASSREADWRITE, $alarm, \&errorTrapDBIdowntime, [$collectorlist, "Cannot connect to the database"], \$logger, $...
if ($dbh and $rv) {
$sql = "select SQL_NO_CACHE activationTimeslot, suspentionTimeslot, instability, persistent from $SERVERTABLCOMMENTS where catalogID = '$catalogID' and uKey = '$uniqueKey' and downtime = '1' and problemSolved = '0' order by persistent des...
$sth = $dbh->prepare( $sql ) or $rv = errorTrapDBIdowntime($collectorlist, "Cannot dbh->prepare: $sql", \$logger, $debug);
($rv, undef) = DBI_execute ($rv, \$sth, $alarm, \&errorTrapDBIdowntime, [$collectorlist, "Cannot sth->execute: $sql"], \$logger, $debug);
if ( $rv ) {
if ( $sth->rows ) {
my ($TactivationTimeslot, $TsuspentionTimeslot, $Tinstability, $Tpersistent);
$activationTimeslotPersistentTrue = $activationTimeslotPersistentFalse = 9999999999;
applications/collector.pl view on Meta::CPAN
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
sub insertEntryDBI {
my ($currentDate, $catalogID_uniqueKey, $catalogID, $uniqueKey, $title, $dbiFilename, $test, $interval, $status, $logging, $debug, $startDate, $startTime, $endDate, $endTime, $duration, $statusMessage, $perfdata, $filename, $insertMySQL, $queryMySQ...
return ( 1 ) unless ( $insertMySQL );
my ($sth, $lockString, $findString, $updateString, $insertString, $flushString, $unlockString, $insertEntryDBI, $updateEntryDBI);
$insertEntryDBI = 0;
$updateEntryDBI = 0;
my ($dbh, $rv, $alarmMessage) = DBI_connect ( $DATABASE, $serverName, $SERVERPORTREADWRITE, $SERVERUSERREADWRITE, $SERVERPASSREADWRITE, $alarm, \&errorTrapDBI, [$currentDate, $catalogID_uniqueKey, $catalogID, $uniqueKey, $test, $title, $status, $st...
if ($dbh and $rv) {
if ($queryMySQL) {
my $numbersEntryDBI = 0;
$findString = 'select SQL_NO_CACHE status from '.$SERVERTABLEVENTS.' where catalogID = "' .$catalogID. '" and uKey = "' .$uniqueKey. '" and step <> "0" and timeslot = "' . get_timeslot ($currentDate) . '" order by id desc';
printDebugAll ("query Entry DBI: <$findString>") if ($debug eq 'T');
$sth = $dbh->prepare($findString) or $rv = errorTrapDBI($currentDate, $catalogID_uniqueKey, $catalogID, $uniqueKey, $test, $title, $status, $startDate, $startTime, $endDate, $endTime, $duration, $statusMessage, $perfdata, $interval, $instabilit...
($rv, undef) = DBI_execute ($rv, \$sth, $alarm, \&errorTrapDBI, [$currentDate, $catalogID_uniqueKey, $catalogID, $uniqueKey, $test, $title, $status, $startDate, $startTime, $endDate, $endTime, $duration, $statusMessage, $perfdata, $interval, $i...
if ($rv) {
applications/collector.pl view on Meta::CPAN
push (@dataOK, "0");
push (@dataWarning, "0");
push (@dataCritical, "0");
push (@dataUnknown, "0");
push (@dataNoTest, "0");
push (@dataOffline, "0");
push (@RRDlabels, " ");
}
# db connect & sql query
my ($dbh, $rv, $alarmMessage) = DBI_connect ( $DATABASE, $serverName, $SERVERPORTREADWRITE, $SERVERUSERREADWRITE, $SERVERPASSREADWRITE, $alarm, \&errorTrapDBIgraphEntry, ["Cannot connect to the database"], \$logger, $debug, $boolean_debug_all );
if ($dbh and $rv) {
my $sth = $dbh->prepare( $findString ) or $rv = errorTrapDBIgraphEntry("Cannot dbh->prepare: $findString", \$logger, $debug);
($rv, $alarmMessage) = DBI_execute ($rv, \$sth, $alarm, \&errorTrapDBIgraphEntry, ["Cannot sth->execute: $findString"], \$logger, $debug);
unless ( $rv ) {
$title .= " - DBI_execute - alarm: $alarm - $alarmMessage";
} else {
$sth->bind_columns( \$duration, \$startTime, \$status, \$timeslot ) or $rv = errorTrapDBIgraphEntry("Cannot sth->bind_columns: $findString", \$logger, $debug);
applications/custom/sde-supportRequest.pm-orig view on Meta::CPAN
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
use SOAP::Lite;
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
sub webserviceSupportRequest {
my ($catalogID, $uKey, $method, $whereClause, $fieldlist, $pagedir, $pageset, $htmlTitle, $subTitle, $refresh, $onload, $sessionID, $debug) = @_;
# DATABASE - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
my $CARTO_SERVER = 'crinaeadtbs01';
my $CARTO_DATABASE = 'carto';
my $CARTO_TABLE = 'TestRelationships';
# SOAP - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
my $tool = 'ASNMTAP';
my $cluster = 'http://itiltest1.smals-mvm.be/ivwse';
my $namespace = 'http://itiltest1.smals-mvm.be/ivwse/';
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
my ($UserID, $customer, $source) = ('MonitoringOffice', "$tool MONITORING", 'Alarm');
applications/custom/sde-supportRequest.pm-orig view on Meta::CPAN
'http://microsoft.com/wsdl/mime/textMatching/' => 'tm',
'http://infravision.com/ivwse' => 's1'
);
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
sub _getEventsData {
my ($catalogID, $uKey, $hash_valueEventsData, $pagedir, $pageset, $htmlTitle, $subTitle, $refresh, $onload, $sessionID, $debug) = @_;
my $rv = 1;
my $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, $subTit...
if ($dbh and $rv) {
my $sql = "select SQL_NO_CACHE title, duration, timeslot, endDate, endTime, status, statusMessage, filename from $SERVERTABLEVENTSDISPLAYDT where catalogID = '$catalogID' and uKey = '$uKey' and step <> '0' order by timeslot desc limit 1";
my $sth = $dbh->prepare( $sql ) or $rv = error_trap_DBI(*STDOUT, "Cannot dbh->prepare: $sql", $debug, $pagedir, $pageset, $htmlTitle, $subTitle, $refresh, $onload, $sessionID);
$sth->execute or $rv = error_trap_DBI(*STDOUT, "Cannot sth->execute: $sql", $debug, $pagedir, $pageset, $htmlTitle, $subTitle, $refresh, $onload, $sessionID) if $rv;
if ( $rv ) {
while ( my $ref = $sth->fetchrow_hashref() ) {
$$hash_valueEventsData{found} = 1;
$$hash_valueEventsData{title} = $ref->{title} if ( $ref->{title} );
applications/custom/sde-supportRequest.pm-orig view on Meta::CPAN
}
$sth->finish() or $rv = error_trap_DBI(*STDOUT, "Cannot sth->finish: $sql", $debug, $pagedir, $pageset, $htmlTitle, $subTitle, $refresh, $onload, $sessionID);
if ( $rv and exists $$hash_valueEventsData{found} and $$hash_valueEventsData{status} !~ /$STATE{$ERRORS{OK}}/ ) {
my @table = ( "$SERVERTABLEVENTSDISPLAYDT", "$SERVERTABLEVENTS USE INDEX (catalogID, uKey, key_timeslot)" );
foreach my $table ( @table ) {
if ( $$hash_valueEventsData{status} =~ /$STATE{$ERRORS{WARNING}}/ ) { # event
$sql = "select SQL_NO_CACHE endDate, endTime, timeslot, status from $table where catalogID = '$catalogID' and uKey = '$uKey' and step <> '0' and not ( status = '". $STATE{$ERRORS{WARNING}} ."' ) order by timeslot desc limit 1";
} elsif ( $$hash_valueEventsData{status} =~ /($STATE{$ERRORS{UNKNOWN}}|$STATE{$ERRORS{CRITICAL}}|$STATE{$ERRORS{'NO DATA'}})/ ) { # incident
$sql = "select SQL_NO_CACHE endDate, endTime, timeslot, status from $table where catalogID = '$catalogID' and uKey = '$uKey' and step <> '0' and not ( status = '". $STATE{$ERRORS{UNKNOWN}} ."' or status = '". $STATE{$ERRORS{CRITICAL}} ....
}
my $sth = $dbh->prepare( $sql ) or $rv = error_trap_DBI(*STDOUT, "Cannot dbh->prepare: $sql", $debug, $pagedir, $pageset, $htmlTitle, $subTitle, $refresh, $onload, $sessionID);
$sth->execute or $rv = error_trap_DBI(*STDOUT, "Cannot sth->execute: $sql", $debug, $pagedir, $pageset, $htmlTitle, $subTitle, $refresh, $onload, $sessionID) if $rv;
if ( $rv ) {
while ( my $ref = $sth->fetchrow_hashref() ) {
$$hash_valueEventsData{OUT_SCOPE}{found} = $ERRORS{$ref->{status}};
$$hash_valueEventsData{OUT_SCOPE}{timeslot} = $ref->{timeslot} if ( $ref->{timeslot} );
$$hash_valueEventsData{OUT_SCOPE}{endDate} = $ref->{endDate} if ( $ref->{endDate} );
applications/custom/sde-supportRequest.pm-orig view on Meta::CPAN
last if ( exists $$hash_valueEventsData{OUT_SCOPE}{found} );
}
}
if ( $rv and exists $$hash_valueEventsData{OUT_SCOPE}{found} and defined $$hash_valueEventsData{OUT_SCOPE}{found} ) {
my $timeRange = "timeslot > '". $$hash_valueEventsData{OUT_SCOPE}{timeslot} ."'";
foreach my $table ( @table ) {
if ( $$hash_valueEventsData{status} =~ /$STATE{$ERRORS{WARNING}}/ ) { # event
$sql = "select SQL_NO_CACHE endDate, endTime, timeslot, status from $table where catalogID = '$catalogID' and uKey = '$uKey' and step <> '0' and $timeRange and ( status = '". $STATE{$ERRORS{WARNING}} ."' ) order by timeslot asc limit ...
} elsif ( $$hash_valueEventsData{status} =~ /($STATE{$ERRORS{UNKNOWN}}|$STATE{$ERRORS{CRITICAL}}|$STATE{$ERRORS{'NO DATA'}})/ ) { # incident
$sql = "select SQL_NO_CACHE endDate, endTime, timeslot, status from $table where catalogID = '$catalogID' and uKey = '$uKey' and step <> '0' and $timeRange and ( status = '". $STATE{$ERRORS{UNKNOWN}} ."' or status = '". $STATE{$ERRORS...
}
my $sth = $dbh->prepare( $sql ) or $rv = error_trap_DBI(*STDOUT, "Cannot dbh->prepare: $sql", $debug, $pagedir, $pageset, $htmlTitle, $subTitle, $refresh, $onload, $sessionID);
$sth->execute or $rv = error_trap_DBI(*STDOUT, "Cannot sth->execute: $sql", $debug, $pagedir, $pageset, $htmlTitle, $subTitle, $refresh, $onload, $sessionID) if $rv;
if ( $rv ) {
while (my $ref = $sth->fetchrow_hashref()) {
$$hash_valueEventsData{IN_SCOPE}{found} = $ERRORS{$ref->{status}};
$$hash_valueEventsData{IN_SCOPE}{timeslot} = $ref->{timeslot} if ( $ref->{timeslot} );
$$hash_valueEventsData{IN_SCOPE}{endDate} = $ref->{endDate} if ( $ref->{endDate} );
applications/custom/sde-supportRequest.pm-orig view on Meta::CPAN
/^GetSupportRequestList$/ && do {
unless ( defined $whereClause ) {
$objectPlugins->pluginValues ( { error => 'InsertSupportRequest: whereClause NOT DEFINED' }, $TYPE{APPEND} );
$succeeded = error_SupportRequest(*STDOUT, $objectPlugins->pluginValue ('error'), $debug, $pagedir, $pageset, $htmlTitle, $subTitle, -2, $onload, $sessionID);
return ( $succeeded, $objectPlugins->pluginValue ('alert'), $objectPlugins->pluginValue ('error') );
}
%methods = (
"$method" => {
parameters => [
SOAP::Data->new(name => 'whereClause', type => 's:string', value => '<![CDATA['. $whereClause .']]>', attr => {}),
SOAP::Data->new(name => 'orderBy', type => 's:string', value => 'number', attr => {}),
], # end parameters
}, # end GetSupportRequestList
); # end my %methods
last; };
/^UpdateSupportRequest$/ && do {
unless ( defined $whereClause ) {
$objectPlugins->pluginValues ( { error => 'InsertSupportRequest: whereClause NOT DEFINED' }, $TYPE{APPEND} );
$succeeded = error_SupportRequest(*STDOUT, $objectPlugins->pluginValue ('error'), $debug, $pagedir, $pageset, $htmlTitle, $subTitle, -2, $onload, $sessionID);
applications/custom/sde-supportRequest.pm-orig view on Meta::CPAN
use Data::Dumper;
print Dumper (%valueEventsDataDisplay), "\n";
}
unless ( $rv ) {
$objectPlugins->pluginValues ( { error => '_getEventsData' }, $TYPE{APPEND} );
$succeeded = error_SupportRequest(*STDOUT, $objectPlugins->pluginValue ('error'), $debug, $pagedir, $pageset, $htmlTitle, $subTitle, -2, $onload, $sessionID);
return ( $rv, $objectPlugins->pluginValue ('alert'), $objectPlugins->pluginValue ('error') );
}
$rv = _getSupportRequestData ($CARTO_SERVER, $CARTO_DATABASE, $CARTO_TABLE, $catalogID, $uKey, \%valueSupportRequestData, $pagedir, $pageset, $htmlTitle, $subTitle, $refresh, $onload, $sessionID, $debug);
if ( $debug eq 'T' ) {
use Data::Dumper;
print Dumper (%valueSupportRequestData), "\n";
}
unless ( $rv ) {
$objectPlugins->pluginValues ( { error => '_getSupportRequestData' }, $TYPE{APPEND} );
$succeeded = error_SupportRequest(*STDOUT, $objectPlugins->pluginValue ('error'), $debug, $pagedir, $pageset, $htmlTitle, $subTitle, -2, $onload, $sessionID);
return ( $rv, $objectPlugins->pluginValue ('alert'), $objectPlugins->pluginValue ('error') );
applications/custom/sde.pm-orig view on Meta::CPAN
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
use ASNMTAP::Asnmtap::Applications::Display v3.002.003;
use ASNMTAP::Asnmtap::Applications::Display qw(:APPLICATIONS :DBDISPLAY);
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
sub getTimeperiodRelationshipsSDE {
my ($serverName, $checklist, $hash_catalogID_uKey_timeperiodID, $debug) = @_;
my $CARTO_DATABASE = 'carto';
my $CARTO_TABLE = 'TestRelationships';
my $rv = 1;
my $dbh = DBI->connect("DBI:mysql:$CARTO_DATABASE:$serverName:$SERVERPORTREADWRITE", "$SERVERUSERREADWRITE", "$SERVERPASSREADWRITE") or $rv = errorTrapDBI($checklist, "Cannot connect to the database");
if ($dbh and $rv) {
my $sql = "select SQL_NO_CACHE catalogID, uKey, priority, imw_sunday, imw_monday, imw_tuesday, imw_wednesday, imw_thursday, imw_friday, imw_saturday from $CARTO_TABLE";
print "<", $sql, ">\n" if ($debug);
my $sth = $dbh->prepare( $sql ) or $rv = errorTrapDBI($checklist, "Cannot dbh->prepare: $sql");
$sth->execute or $rv = errorTrapDBI($checklist, "Cannot sth->execute: $sql") if $rv;
if ( $rv ) {
# (localtime)[6]: weekday Number of days since Sunday (0 - 6)
applications/custom/sde.pm-orig view on Meta::CPAN
$dbh->disconnect or $rv = errorTrapDBI($checklist, "Sorry, the database was unable to add your entry.") if ($dbh and $rv);
}
}
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
sub printRelationshipsSDE {
my ($serverName, $checklist, $catalogID, $uniqueKey) = @_;
my $CARTO_DATABASE = 'carto';
my $CARTO_TABLE = 'TestRelationships';
my $dataRelationshipsSDE = '';
my $rv = 1;
my $dbh = DBI->connect("DBI:mysql:$CARTO_DATABASE:$serverName:$SERVERPORTREADWRITE", "$SERVERUSERREADWRITE", "$SERVERPASSREADWRITE") or $rv = errorTrapDBI($checklist, "Cannot connect to the database");
if ($dbh and $rv) {
my $sql = "select SQL_NO_CACHE code, invoicedOrg, service, impact, priority from $CARTO_TABLE where catalogID = '$catalogID' and uKey = '$uniqueKey'";
my $sth = $dbh->prepare( $sql ) or $rv = errorTrapDBI($checklist, "Cannot dbh->prepare: $sql");
$sth->execute or $rv = errorTrapDBI($checklist, "Cannot sth->execute: $sql") if $rv;
if ( $rv ) {
my ($code, $invoicedOrg, $service, $impact, $priority);
while( ($code, $invoicedOrg, $service, $impact, $priority) = $sth->fetchrow_array() ) {
applications/display-test.pl view on Meta::CPAN
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) {
if ($dbh and $rv) {
$lockString = 'LOCK TABLES ' .$SERVERTABLEVENTS. ' READ';
$dbh->do ( $lockString ) or $rv = errorTrapDBI($checklist, "Cannot dbh->do: $lockString");
}
}
$configNumber = $playSoundStatus = 0;
$doChecklist = ($dbh and $rv) ? 1 : 0;
applications/display-test.pl view on Meta::CPAN
$sth->execute or $rv = errorTrapDBI($checklist, "Cannot sth->execute: $sql") if $rv;
if ( $rv ) {
( $tLastStatus, $tLastTimeslot, $tPrevStatus, $tPrevTimeslot ) = $sth->fetchrow_array();
$sth->finish() or $rv = errorTrapDBI($checklist, "Cannot sth->finish: $sql");
}
$sql = "select SQL_NO_CACHE activationTimeslot, suspentionTimeslot, instability, persistent, downtime, commentData, entryDate, entryTime, activationDate, activationTime, suspentionDate, suspentionTime from $SERVERTABLCOMMENTS where catalogI...
$sth = $dbh->prepare( $sql ) or $rv = errorTrapDBI($checklist, "Cannot dbh->prepare: $sql");
$sth->execute or $rv = errorTrapDBI($checklist, "Cannot sth->execute: $sql") if $rv;
my $statusOverlib = '<NIHIL>'; # $STATE{$ERRORS{'NO DATA'}};
$instability = $downtime = 0;
if ( $rv ) {
my ($TactivationTimeslot, $TsuspentionTimeslot, $Tinstability, $Tpersistent, $Tdowntime, $TcommentData, $TentryDate, $TentryTime, $TactivationDate, $TactivationTime, $TsuspentionDate, $TsuspentionTime, $firstRecordPersistentTrue, $firstRe...
$acked = $sth->rows;
$persistent = -1;
$activationTimeslot = 9999999999;
$firstRecordPersistentTrue = $firstRecordPersistentFalse = 1;
$suspentionTimeslot = $suspentionTimeslotPersistentTrue = $suspentionTimeslotPersistentFalse = 0;
applications/display-test.pl view on Meta::CPAN
print "<", $findString, ">\n" if ($debug);
$sth = $dbh->prepare($findString) or $rv = errorTrapDBI($checklist, "Cannot dbh->prepare: $findString");
$sth->execute or $rv = errorTrapDBI($checklist, "Cannot sth->execute: $findString") if $rv;
my (@itemTimelocal, @itemStatus, @itemStarttime, @itemTimeslot, @tempStatusMessage);
@itemTimelocal = @itemStatus = @itemStarttime = @itemTimeslot = @tempStatusMessage = ();
$timeValue = $lastTimeslot;
for (; $number <= $NUMBEROFFTESTS; $number++) {
push (@itemTimelocal, $timeValue);
push (@itemStatus, ($number == 1) ? 'IN PROGRESS' : 'NO DATA');
push (@itemStarttime, sprintf ("%02d:%02d:%02d", (localtime($timeValue+$timeCorrectie))[2,1,0]));
push (@itemTimeslot, $timeValue);
push (@tempStatusMessage, undef);
$timeValue -= $step;
}
$timeValue = $lastTimeslot;
$inIMW = 1;
if ($rv) {
applications/display-test.pl view on Meta::CPAN
$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 );
}
$inIMW = inIncidentMonitoringWindow ($catalogID, $uniqueKey, $ref->{timeslot}, $ref->{startTime}, $ref->{endTime}, $ref->{endDate}, \%timeperiodID_days, \%catalogID_uKey_timeperiodID, $debug);
}
if ($dstatus ne 'OK' and $dstatus ne 'OFFLINE' and $dstatus ne 'NO DATA' and $dstatus ne 'NO TEST') {
$tempStatusMessage[$timeslot] = '<IMG SRC="'.$IMAGESURL.'/'.$statusIcon.'" WIDTH="16" HEIGHT="16" BORDER=0 title="'.$tstatus.'" alt="'.$tstatus.'"></TD><TD class="StatusMessage">'.$ref->{startTime}.'</TD><TD class="StatusMessage">'....
if ( $timeslot == 0 or ( $timeslot == 1 and $itemStatus[0] eq 'IN PROGRESS' ) ) {
$ref->{statusMessage} =~ s/'/`/g;
$ref->{statusMessage} =~ s/[\n\r]/<br>/g;
$popup .= '<TR><TD BGCOLOR=#000080 WIDTH=100 ALIGN=RIGHT VALIGN=TOP>Status</TD><TD BGCOLOR=#0000FF><IMG SRC='.$IMAGESURL.'/'.$statusIcon.' WIDTH=15 HEIGHT=15 title= alt= BORDER=0> '.$ref->{startTime}.' '.encode_html_entities('M', ...
}
}
}
}
applications/display-test.pl view on Meta::CPAN
}
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
sub build_hash_timeperiodID_days {
my ($checklist, $pagedir, $hash_timeperiodID_days, $debug) = @_;
print "build_hash_timeperiodID_days: '$checklist', '$pagedir'\n" if ($debug);
my $rv = 1;
my $dbh = DBI->connect("DBI:mysql:$DATABASE:$serverName:$SERVERPORTREADWRITE", "$SERVERUSERREADWRITE", "$SERVERPASSREADWRITE") or $rv = errorTrapDBI($checklist, "Cannot connect to the database");
return () unless ($dbh and $rv);
# (localtime)[6]: weekday Number of days since Sunday (0 - 6)
my %WDAYS = ('sunday'=>'0','monday'=>'1','tuesday'=>'2','wednesday'=>'3','thursday'=>'4','friday'=>'5','saturday'=>'6');
my $sql = "SELECT SQL_NO_CACHE DISTINCT $SERVERTABLVIEWS.catalogID, $SERVERTABLVIEWS.timeperiodID, $SERVERTABLTIMEPERIODS.sunday, $SERVERTABLTIMEPERIODS.monday, $SERVERTABLTIMEPERIODS.tuesday, $SERVERTABLTIMEPERIODS.wednesday, $SERVERTABLTIMEPERIOD...
print "<", $sql, ">\n" if ($debug);
my $sth = $dbh->prepare( $sql ) or $rv = errorTrapDBI($checklist, "Cannot dbh->prepare: $sql");
$sth->execute or $rv = errorTrapDBI($checklist, "Cannot sth->execute: $sql") if $rv;
applications/display-test.pl view on Meta::CPAN
}
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
sub build_hash_catalogID_uKey_timeperiodID {
my ($checklist, $pagedir, $hash_catalogID_uKey_timeperiodID, $debug) = @_;
print "build_hash_catalogID_uKey_timeperiodID: '$checklist', '$pagedir'\n" if ($debug);
my $rv = 1;
my $dbh = DBI->connect("DBI:mysql:$DATABASE:$serverName:$SERVERPORTREADWRITE", "$SERVERUSERREADWRITE", "$SERVERPASSREADWRITE") or $rv = errorTrapDBI($checklist, "Cannot connect to the database");
return () unless ($dbh and $rv);
my $sql = "SELECT SQL_NO_CACHE $SERVERTABLPLUGINS.catalogID, $SERVERTABLPLUGINS.uKey, $SERVERTABLVIEWS.timeperiodID FROM `$SERVERTABLDISPLAYDMNS`, `$SERVERTABLVIEWS`, `$SERVERTABLPLUGINS` WHERE $SERVERTABLDISPLAYDMNS.pagedir = '$pagedir' AND $SERVE...
print "<", $sql, ">\n" if ($debug);
my $sth = $dbh->prepare( $sql ) or $rv = errorTrapDBI($checklist, "Cannot dbh->prepare: $sql");
$sth->execute or $rv = errorTrapDBI($checklist, "Cannot sth->execute: $sql") if $rv;
if ($rv) {
while (my $ref = $sth->fetchrow_hashref()) {
applications/display-test.pl view on Meta::CPAN
sub printItemStatus {
my ($interval, $number, $status, $endTime, $acked, $timeslot, $activationTimeslot, $suspentionTimeslot, $instability, $persistent, $downtime, $suspentionTimeslotPersistentTrue, $suspentionTimeslotPersistentFalse, $catalogID_uniqueKey, $catalogID, $...
my $statusIcon = ($acked and ($activationTimeslot - $step < $timeslot) and ($suspentionTimeslot > $timeslot)) ? ( $instability ? $ICONSUNSTABLE {$status} : $ICONSACK {$status} ) : $ICONS{$status};
my ($debugInfo, $boldStart, $boldEnd);
$debugInfo = $boldStart = $boldEnd = '';
if ($number == 0) {
$printCondensedView = 1 unless ( $status eq 'IN PROGRESS' or $status eq 'OK' or $status eq 'NO TEST' or $status eq 'OFFLINE' );
if ($ERRORS{$status} <= $ERRORS{UNKNOWN} or $ERRORS{$status} == $ERRORS{'NO DATA'}) { $playSoundStatus = ($playSoundStatus > $ERRORS{$status}) ? $playSoundStatus : $ERRORS{$status}; }
} else {
my $playSoundSet = 0;
unless ( $printCondensedView or $problemSolved or $checkSkip == $inProgressNumber) {
if ( $number == 1 ) {
$verifyNumber = $VERIFYNUMBEROK;
if ( $interval and $interval < $VERIFYMINUTEOK ) {
$verifyNumber = int($VERIFYMINUTEOK / $interval);
applications/display-test.pl view on Meta::CPAN
} else {
$playSoundSet = 1;
}
} elsif ( $number == 3 and $playSoundInProgress ) {
$playSoundSet = 1;
}
if ( $playSoundSet ) {
$playSoundSet = 0;
if ( ( $ERRORS{$status} == $ERRORS{OK} or ( $ERRORS{$status} >= $ERRORS{DEPENDENT} and $ERRORS{$status} != $ERRORS{'NO DATA'} and $ERRORS{$status} != $ERRORS{TRENDLINE} ) ) and ( ( $playSoundPreviousStatus >= $ERRORS{WARNING} and $playSoundPrev...
if ( defined $tableSoundStatusCache { $catalogID_uniqueKey } ) {
if ( $tableSoundStatusCache { $catalogID_uniqueKey } ne $timeslot ) {
$playSoundStatus = ($playSoundStatus > $playSoundPreviousStatus) ? $playSoundStatus : $playSoundPreviousStatus;
$tableSoundStatusCache { $catalogID_uniqueKey } = $timeslot;
$debugInfo .= "$playSoundStatus-" if ($debug);
$boldStart = "<b>["; $boldEnd = "]</b>";
} else {
$debugInfo .= "C-" if ($debug);
}
} else {
applications/display.pl view on Meta::CPAN
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) {
if ($dbh and $rv) {
$lockString = 'LOCK TABLES ' .$SERVERTABLEVENTS. ' READ';
$dbh->do ( $lockString ) or $rv = errorTrapDBI($checklist, "Cannot dbh->do: $lockString");
}
}
$configNumber = $playSoundStatus = 0;
$doChecklist = ($dbh and $rv) ? 1 : 0;
applications/display.pl view on Meta::CPAN
$sth->execute or $rv = errorTrapDBI($checklist, "Cannot sth->execute: $sql") if $rv;
if ( $rv ) {
( $tLastStatus, $tLastTimeslot, $tPrevStatus, $tPrevTimeslot ) = $sth->fetchrow_array();
$sth->finish() or $rv = errorTrapDBI($checklist, "Cannot sth->finish: $sql");
}
$sql = "select SQL_NO_CACHE activationTimeslot, suspentionTimeslot, instability, persistent, downtime, commentData, entryDate, entryTime, activationDate, activationTime, suspentionDate, suspentionTime from $SERVERTABLCOMMENTS where catalogI...
$sth = $dbh->prepare( $sql ) or $rv = errorTrapDBI($checklist, "Cannot dbh->prepare: $sql");
$sth->execute or $rv = errorTrapDBI($checklist, "Cannot sth->execute: $sql") if $rv;
my $statusOverlib = '<NIHIL>'; # $STATE{$ERRORS{'NO DATA'}};
$instability = $downtime = 0;
if ( $rv ) {
my ($TactivationTimeslot, $TsuspentionTimeslot, $Tinstability, $Tpersistent, $Tdowntime, $TcommentData, $TentryDate, $TentryTime, $TactivationDate, $TactivationTime, $TsuspentionDate, $TsuspentionTime, $firstRecordPersistentTrue, $firstRe...
$acked = $sth->rows;
$persistent = -1;
$activationTimeslot = 9999999999;
$firstRecordPersistentTrue = $firstRecordPersistentFalse = 1;
$suspentionTimeslot = $suspentionTimeslotPersistentTrue = $suspentionTimeslotPersistentFalse = 0;
applications/display.pl view on Meta::CPAN
print "<", $findString, ">\n" if ($debug);
$sth = $dbh->prepare($findString) or $rv = errorTrapDBI($checklist, "Cannot dbh->prepare: $findString");
$sth->execute or $rv = errorTrapDBI($checklist, "Cannot sth->execute: $findString") if $rv;
my (@itemTimelocal, @itemStatus, @itemStarttime, @itemTimeslot, @tempStatusMessage);
@itemTimelocal = @itemStatus = @itemStarttime = @itemTimeslot = @tempStatusMessage = ();
$timeValue = $lastTimeslot;
for (; $number <= $NUMBEROFFTESTS; $number++) {
push (@itemTimelocal, $timeValue);
push (@itemStatus, ($number == 1) ? 'IN PROGRESS' : 'NO DATA');
push (@itemStarttime, sprintf ("%02d:%02d:%02d", (localtime($timeValue+$timeCorrectie))[2,1,0]));
push (@itemTimeslot, $timeValue);
push (@tempStatusMessage, undef);
$timeValue -= $step;
}
$timeValue = $lastTimeslot;
$inIMW = 1;
if ($rv) {
applications/display.pl view on Meta::CPAN
$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 );
}
$inIMW = inIncidentMonitoringWindow ($catalogID, $uniqueKey, $ref->{timeslot}, $ref->{startTime}, $ref->{endTime}, $ref->{endDate}, \%timeperiodID_days, \%catalogID_uKey_timeperiodID, $debug);
}
if ($dstatus ne 'OK' and $dstatus ne 'OFFLINE' and $dstatus ne 'NO DATA' and $dstatus ne 'NO TEST') {
$tempStatusMessage[$timeslot] = '<IMG SRC="'.$IMAGESURL.'/'.$statusIcon.'" WIDTH="16" HEIGHT="16" BORDER=0 title="'.$tstatus.'" alt="'.$tstatus.'"></TD><TD class="StatusMessage">'.$ref->{startTime}.'</TD><TD class="StatusMessage">'....
if ( $timeslot == 0 or ( $timeslot == 1 and $itemStatus[0] eq 'IN PROGRESS' ) ) {
$ref->{statusMessage} =~ s/'/`/g;
$ref->{statusMessage} =~ s/[\n\r]/<br>/g;
$popup .= '<TR><TD BGCOLOR=#000080 WIDTH=100 ALIGN=RIGHT VALIGN=TOP>Status</TD><TD BGCOLOR=#0000FF><IMG SRC='.$IMAGESURL.'/'.$statusIcon.' WIDTH=15 HEIGHT=15 title= alt= BORDER=0> '.$ref->{startTime}.' '.encode_html_entities('M', ...
}
}
}
}
applications/display.pl view on Meta::CPAN
}
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
sub build_hash_timeperiodID_days {
my ($checklist, $pagedir, $hash_timeperiodID_days, $debug) = @_;
print "build_hash_timeperiodID_days: '$checklist', '$pagedir'\n" if ($debug);
my $rv = 1;
my $dbh = DBI->connect("DBI:mysql:$DATABASE:$serverName:$SERVERPORTREADWRITE", "$SERVERUSERREADWRITE", "$SERVERPASSREADWRITE") or $rv = errorTrapDBI($checklist, "Cannot connect to the database");
return () unless ($dbh and $rv);
# (localtime)[6]: weekday Number of days since Sunday (0 - 6)
my %WDAYS = ('sunday'=>'0','monday'=>'1','tuesday'=>'2','wednesday'=>'3','thursday'=>'4','friday'=>'5','saturday'=>'6');
my $sql = "SELECT SQL_NO_CACHE DISTINCT $SERVERTABLVIEWS.catalogID, $SERVERTABLVIEWS.timeperiodID, $SERVERTABLTIMEPERIODS.sunday, $SERVERTABLTIMEPERIODS.monday, $SERVERTABLTIMEPERIODS.tuesday, $SERVERTABLTIMEPERIODS.wednesday, $SERVERTABLTIMEPERIOD...
print "<", $sql, ">\n" if ($debug);
my $sth = $dbh->prepare( $sql ) or $rv = errorTrapDBI($checklist, "Cannot dbh->prepare: $sql");
$sth->execute or $rv = errorTrapDBI($checklist, "Cannot sth->execute: $sql") if $rv;
applications/display.pl view on Meta::CPAN
}
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
sub build_hash_catalogID_uKey_timeperiodID {
my ($checklist, $pagedir, $hash_catalogID_uKey_timeperiodID, $debug) = @_;
print "build_hash_catalogID_uKey_timeperiodID: '$checklist', '$pagedir'\n" if ($debug);
my $rv = 1;
my $dbh = DBI->connect("DBI:mysql:$DATABASE:$serverName:$SERVERPORTREADWRITE", "$SERVERUSERREADWRITE", "$SERVERPASSREADWRITE") or $rv = errorTrapDBI($checklist, "Cannot connect to the database");
return () unless ($dbh and $rv);
my $sql = "SELECT SQL_NO_CACHE $SERVERTABLPLUGINS.catalogID, $SERVERTABLPLUGINS.uKey, $SERVERTABLVIEWS.timeperiodID FROM `$SERVERTABLDISPLAYDMNS`, `$SERVERTABLVIEWS`, `$SERVERTABLPLUGINS` WHERE $SERVERTABLDISPLAYDMNS.pagedir = '$pagedir' AND $SERVE...
print "<", $sql, ">\n" if ($debug);
my $sth = $dbh->prepare( $sql ) or $rv = errorTrapDBI($checklist, "Cannot dbh->prepare: $sql");
$sth->execute or $rv = errorTrapDBI($checklist, "Cannot sth->execute: $sql") if $rv;
if ($rv) {
while (my $ref = $sth->fetchrow_hashref()) {
applications/display.pl view on Meta::CPAN
sub printItemStatus {
my ($interval, $number, $status, $endTime, $acked, $timeslot, $activationTimeslot, $suspentionTimeslot, $instability, $persistent, $downtime, $suspentionTimeslotPersistentTrue, $suspentionTimeslotPersistentFalse, $catalogID_uniqueKey, $catalogID, $...
my $statusIcon = ($acked and ($activationTimeslot - $step < $timeslot) and ($suspentionTimeslot > $timeslot)) ? ( $instability ? $ICONSUNSTABLE {$status} : $ICONSACK {$status} ) : $ICONS{$status};
my ($debugInfo, $boldStart, $boldEnd);
$debugInfo = $boldStart = $boldEnd = '';
if ($number == 0) {
$printCondensedView = 1 unless ( $status eq 'IN PROGRESS' or $status eq 'OK' or $status eq 'NO TEST' or $status eq 'OFFLINE' );
if ($ERRORS{$status} <= $ERRORS{UNKNOWN} or $ERRORS{$status} == $ERRORS{'NO DATA'}) { $playSoundStatus = ($playSoundStatus > $ERRORS{$status}) ? $playSoundStatus : $ERRORS{$status}; }
} else {
my $playSoundSet = 0;
unless ( $printCondensedView or $problemSolved or $checkSkip == $inProgressNumber) {
if ( $number == 1 ) {
$verifyNumber = $VERIFYNUMBEROK;
if ( $interval and $interval < $VERIFYMINUTEOK ) {
$verifyNumber = int($VERIFYMINUTEOK / $interval);
applications/display.pl view on Meta::CPAN
} else {
$playSoundSet = 1;
}
} elsif ( $number == 3 and $playSoundInProgress ) {
$playSoundSet = 1;
}
if ( $playSoundSet ) {
$playSoundSet = 0;
if ( ( $ERRORS{$status} == $ERRORS{OK} or ( $ERRORS{$status} >= $ERRORS{DEPENDENT} and $ERRORS{$status} != $ERRORS{'NO DATA'} and $ERRORS{$status} != $ERRORS{TRENDLINE} ) ) and ( ( $playSoundPreviousStatus >= $ERRORS{WARNING} and $playSoundPrev...
if ( defined $tableSoundStatusCache { $catalogID_uniqueKey } ) {
if ( $tableSoundStatusCache { $catalogID_uniqueKey } ne $timeslot ) {
$playSoundStatus = ($playSoundStatus > $playSoundPreviousStatus) ? $playSoundStatus : $playSoundPreviousStatus;
$tableSoundStatusCache { $catalogID_uniqueKey } = $timeslot;
$debugInfo .= "$playSoundStatus-" if ($debug);
$boldStart = "<b>["; $boldEnd = "]</b>";
} else {
$debugInfo .= "C-" if ($debug);
}
} else {
applications/htmlroot/cgi-bin/admin/countries.pl view on Meta::CPAN
print "<pre>pagedir : $pagedir<br>pageset : $pageset<br>debug : $debug<br>CGISESSID : $sessionID<br>page no : $pageNo<br>page offset : $pageOffset<br>order by : $orderBy<br>action : $action<br>country ID ...
if ( defined $sessionID and ! defined $errorUserAccessControl ) {
my ($matchingCountries, $navigationBar);
my $urlWithAccessParameters = $ENV{SCRIPT_NAME} . "?pagedir=$pagedir&pageset=$pageset&debug=$debug&CGISESSID=$sessionID&pageNo=$pageNo&pageOffset=$pageOffset";
# 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, $subTit...
if ($dbh and $rv) {
$formDisabledAll = $formDisabledPrimaryKey = '';
if ($action eq 'duplicateView' or $action eq 'insertView') {
$htmlTitle = "Insert Country";
$submitButton = "Insert";
$nextAction = "insert" if ($rv);
} elsif ($action eq 'insert') {
$htmlTitle = "Check if Country $CcountryID exist before to insert";
applications/htmlroot/cgi-bin/admin/crontabs.pl view on Meta::CPAN
print "<pre>pagedir : $pagedir<br>pageset : $pageset<br>debug : $debug<br>CGISESSID : $sessionID<br>page no : $pageNo<br>page offset : $pageOffset<br>order by : $orderBy<br>action ...
if ( defined $sessionID and ! defined $errorUserAccessControl ) {
my ($catalogIDSelect, $collectorDaemonSelect, $matchingCrontabs, $navigationBar);
my $urlWithAccessParameters = $ENV{SCRIPT_NAME} . "?pagedir=$pagedir&pageset=$pageset&debug=$debug&CGISESSID=$sessionID&catalogID=$CcatalogID";
# 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, $subTit...
if ($dbh and $rv) {
$formDisabledAll = $formDisabledPrimaryKey = '';
if ($action eq 'duplicateView' or $action eq 'insertView') {
$htmlTitle = "Insert Crontab";
$submitButton = "Insert";
$nextAction = "insert" if ($rv);
$CcatalogID = $CATALOGID if ($action eq 'insertView');
} elsif ($action eq 'insert') {
applications/htmlroot/cgi-bin/admin/generateConfig.pl view on Meta::CPAN
# HTML - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
my $onload = ( ( $action =~ /^(check|generate|compare|install)View$/ ) ? "ONLOAD=\"if (document.images) document.Progress.src='".$IMAGESURL."/spacer.gif';\"" : '' );
print_header (*STDOUT, $pagedir, $pageset, $htmlTitle, $subTitle, 3600, $onload, 'F', '', $sessionID);
print " <br>\n";
print "<IMG SRC=\"".$IMAGESURL."/gears.gif\" HSPACE=\"0\" VSPACE=\"0\" BORDER=\"0\" NAME=\"Progress\" title=\"Please Wait ...\" alt=\"Please Wait ...\">" if ( $onload );
$rv = 1;
if ($action eq 'checkView' or $action eq 'generateView') {
# open connection to database and query data
$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...
if ($dbh and $rv) {
my ($serverID, $displayDaemon, $collectorDaemon, $resultsdir, $groupTitle, $pagedirs, $catalogID, $uKey, $test, $interval, $title, $helpPluginFilename, $environment, $trendline, $minute, $hour, $dayOfTheMonth, $monthOfTheYear, $dayOfTheWeek, $a...
my ($prevServerID, $prevTypeMonitoring, $prevTypeServers, $prevTypeActiveServer, $prevMasterFQDN, $prevMasterASNMTAP_PATH, $prevMasterRSYNC_PATH, $prevMasterSSH_PATH, $prevSlaveFQDN, $prevSlaveASNMTAP_PATH, $prevSlaveRSYNC_PATH, $prevSlaveSSH_P...
my ($centralServerID, $centralTypeMonitoring, $centralTypeServers, $centralTypeActiveServer, $centralMasterFQDN, $centralMasterASNMTAP_PATH, $centralMasterRSYNC_PATH, $centralMasterSSH_PATH, $centralMasterDatabaseFQDN, $centralSlaveFQDN, $centr...
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
my ($warning, $error, $count, $sqlTmp, $sthTmp, $actionItem);
applications/htmlroot/cgi-bin/admin/generateConfig.pl view on Meta::CPAN
$sth->finish() or $rv = error_trap_DBI(*STDOUT, "Cannot sth->finish: $sql", $debug, $pagedir, $pageset, $htmlTitle, $subTitle, -1, '', $sessionID);
}
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
}
$dbh->disconnect or $rv = error_trap_DBI(*STDOUT, "Sorry, the database was unable to add your entry.", $debug, $pagedir, $pageset, $htmlTitle, $subTitle, -1, '', $sessionID);
}
} elsif ($action eq 'compareView') {
# open connection to database and query data
$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...
if ($dbh and $rv) {
my ( $masterFQDN, $masterASNMTAP_PATH, $masterRSYNC_PATH, $masterSSH_PATH, $slaveFQDN, $slaveASNMTAP_PATH, $slaveRSYNC_PATH, $slaveSSH_PATH );
$sql = "SELECT masterFQDN, masterASNMTAP_PATH, masterRSYNC_PATH, masterSSH_PATH, slaveFQDN, slaveASNMTAP_PATH, slaveRSYNC_PATH, slaveSSH_PATH FROM $SERVERTABLSERVERS where catalogID = '$CATALOGID' and activated = 1";
$sth = $dbh->prepare( $sql ) or $rv = error_trap_DBI(*STDOUT, "Cannot dbh->prepare: $sql", $debug, $pagedir, $pageset, $htmlTitle, $subTitle, -1, '', $sessionID);
$sth->execute() or $rv = error_trap_DBI(*STDOUT, "Cannot sth->execute: $sql", $debug, $pagedir, $pageset, $htmlTitle, $subTitle, -1, '', $sessionID) if $rv;
$sth->bind_columns( \$masterFQDN, \$masterASNMTAP_PATH, \$masterRSYNC_PATH, \$masterSSH_PATH, \$slaveFQDN, \$slaveASNMTAP_PATH, \$slaveRSYNC_PATH, \$slaveSSH_PATH ) or $rv = error_trap_DBI(*STDOUT, "Cannot sth->bind_columns: $sql", $debug, $pag...
if ($rv) {
if ( $sth->rows ) {
applications/htmlroot/cgi-bin/admin/generateConfig.pl view on Meta::CPAN
if ($compareDiff eq '') {
$compareView .= "\n <tr bgcolor=\"$COLORSTABLE{NOBLOCK}\"><td>The generated and installed configurations are identical.</td></tr>";
} else {
$compareView .= "\n $compareDiff";
}
$compareView .= "\n </table>";
} elsif ($action eq 'installView') {
# open connection to database and query data
$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...
if ($dbh and $rv) {
my ( $masterFQDN, $masterASNMTAP_PATH, $masterRSYNC_PATH, $masterSSH_PATH, $slaveFQDN, $slaveASNMTAP_PATH, $slaveRSYNC_PATH, $slaveSSH_PATH );
$sql = "SELECT masterFQDN, masterASNMTAP_PATH, masterRSYNC_PATH, masterSSH_PATH, slaveFQDN, slaveASNMTAP_PATH, slaveRSYNC_PATH, slaveSSH_PATH FROM $SERVERTABLSERVERS where catalogID = '$CATALOGID' and activated = 1";
$sth = $dbh->prepare( $sql ) or $rv = error_trap_DBI(*STDOUT, "Cannot dbh->prepare: $sql", $debug, $pagedir, $pageset, $htmlTitle, $subTitle, -1, '', $sessionID);
$sth->execute() or $rv = error_trap_DBI(*STDOUT, "Cannot sth->execute: $sql", $debug, $pagedir, $pageset, $htmlTitle, $subTitle, -1, '', $sessionID) if $rv;
$sth->bind_columns( \$masterFQDN, \$masterASNMTAP_PATH, \$masterRSYNC_PATH, \$masterSSH_PATH, \$slaveFQDN, \$slaveASNMTAP_PATH, \$slaveRSYNC_PATH, \$slaveSSH_PATH ) or $rv = error_trap_DBI(*STDOUT, "Cannot sth->bind_columns: $sql", $debug, $pag...
if ($rv) {
if ( $sth->rows ) {
applications/htmlroot/cgi-bin/admin/holidays.pl view on Meta::CPAN
print "<pre>pagedir : $pagedir<br>pageset : $pageset<br>debug : $debug<br>CGISESSID : $sessionID<br>page no : $pageNo<br>page offset : $pageOffset<br>order by : $orderBy<br>action : $action<br>catalog ID ...
if ( defined $sessionID and ! defined $errorUserAccessControl ) {
my ($catalogIDSelect, $countryIDSelect, $matchingHolidays, $navigationBar);
my $urlWithAccessParameters = $ENV{SCRIPT_NAME} . "?pagedir=$pagedir&pageset=$pageset&debug=$debug&CGISESSID=$sessionID&pageNo=$pageNo&pageOffset=$pageOffset&catalogID=$CcatalogID";
# 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, $subTit...
if ($dbh and $rv) {
$formDisabledAll = $formDisabledPrimaryKey = '';
if ($action eq 'duplicateView' or $action eq 'insertView') {
$htmlTitle = "Insert Holiday";
$submitButton = "Insert";
$nextAction = "insert" if ($rv);
$CcatalogID = $CATALOGID if ($action eq 'insertView');
} elsif ($action eq 'insert') {
applications/htmlroot/cgi-bin/admin/holidaysBundle.pl view on Meta::CPAN
print "<pre>pagedir : $pagedir<br>pageset : $pageset<br>debug : $debug<br>CGISESSID : $sessionID<br>page no : $pageNo<br>page offset : $pageOffset<br>order by : $orderBy<br>actio...
if ( defined $sessionID and ! defined $errorUserAccessControl ) {
my ($catalogIDSelect, $countryIDSelect, $holidaysSelect, $matchingHolidaysBundle, $matchingPlugins, $navigationBar);
my $urlWithAccessParameters = $ENV{SCRIPT_NAME} . "?pagedir=$pagedir&pageset=$pageset&debug=$debug&CGISESSID=$sessionID&pageNo=$pageNo&pageOffset=$pageOffset&catalogID=$CcatalogID";
# 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, $subTit...
if ($dbh and $rv) {
$formDisabledAll = $formDisabledNoCountryID = $formDisabledPrimaryKey = '';
if ($CcountryIDreload) {
if ($action eq 'insert' or $action eq 'insertView') {
$action = 'insertView';
} elsif ($action eq 'edit' or $action eq 'editView') {
$action = 'editView';
} else {
applications/htmlroot/cgi-bin/admin/languages.pl view on Meta::CPAN
print "<pre>pagedir : $pagedir<br>pageset : $pageset<br>debug : $debug<br>CGISESSID : $sessionID<br>page no : $pageNo<br>page offset : $pageOffset<br>order by : $orderBy<br>action : $action<br>unique key ...
if ( defined $sessionID and ! defined $errorUserAccessControl ) {
my ($matchingLanguages, $navigationBar);
my $urlWithAccessParameters = $ENV{SCRIPT_NAME} . "?pagedir=$pagedir&pageset=$pageset&debug=$debug&CGISESSID=$sessionID&pageNo=$pageNo&pageOffset=$pageOffset";
# 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, $subTit...
if ($dbh and $rv) {
$formDisabledAll = $formDisabledPrimaryKey = '';
if ($action eq 'duplicateView' or $action eq 'insertView') {
$htmlTitle = "Insert Language";
$submitButton = "Insert";
$nextAction = "insert" if ($rv);
} elsif ($action eq 'insert') {
$htmlTitle = "Check if Language $CkeyLanguage exist before to insert";
applications/htmlroot/cgi-bin/admin/plugins.pl view on Meta::CPAN
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
my ($catalogIDSelect, $environmentSelect, $holidayBundleSelect, $pagedirsSelect, $resultsdirSelect, $matchingPlugins, $navigationBar, $matchingViewsCrontabs, $generatePluginCrontabSchedulingReport);
my $urlWithAccessParameters = $ENV{SCRIPT_NAME} . "?pagedir=$pagedir&pageset=$pageset&debug=$debug&CGISESSID=$sessionID&pageNo=$pageNo&pageOffset=$pageOffset&filter=$filter&catalogID=$CcatalogID";
# 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, $subTit...
if ($dbh and $rv) {
$formDisabledAll = $formDisabledUniqueKey = '';
if ($action eq 'duplicateView' or $action eq 'insertView') {
$htmlTitle = "Insert Plugin";
$submitButton = "Insert";
$nextAction = "insert" if ($rv);
$CcatalogID = $CATALOGID if ($action eq 'insertView');
} elsif ($action eq 'insert') {
applications/htmlroot/cgi-bin/admin/reports.pl view on Meta::CPAN
# Debug information
print "<pre>pagedir : $pagedir<br>pageset : $pageset<br>debug : $debug<br>CGISESSID : $sessionID<br>page no : $pageNo<br>page offset : $pageOffset<br>order by : $orderBy<br>action : $action<br>catalog ID ...
if ( defined $sessionID and ! defined $errorUserAccessControl ) {
my ($catalogIDSelect, $matchingReports, $navigationBar);
my $urlWithAccessParameters = $ENV{SCRIPT_NAME} . "?pagedir=$pagedir&pageset=$pageset&debug=$debug&CGISESSID=$sessionID&pageNo=$pageNo&pageOffset=$pageOffset&catalogID=$CcatalogID";
# 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, $subTit...
if ($dbh and $rv) {
$formDisabledAll = ''; $formDisabledPrimaryKey = "disabled";
if ($action eq 'duplicateView' or $action eq 'insertView') {
$htmlTitle = "Insert Report";
$submitButton = "Insert";
$nextAction = "insert" if ($rv);
$CcatalogID = $CATALOGID if ($action eq 'insertView');
} elsif ($action eq 'insert') {
applications/htmlroot/cgi-bin/admin/reports_perfdata.pl view on Meta::CPAN
print "<pre>pagedir : $pagedir<br>pageset : $pageset<br>debug : $debug<br>CGISESSID : $sessionID<br>page no : $pageNo<br>page offset : $pageOffset<br>order by : $orderBy<br>action : $action<br>uKey Reload ...
if ( defined $sessionID and ! defined $errorUserAccessControl ) {
my ($catalogIDSelect, $matchingReportsPerfdata, $navigationBar);
my $urlWithAccessParameters = $ENV{SCRIPT_NAME} . "?pagedir=$pagedir&pageset=$pageset&debug=$debug&CGISESSID=$sessionID&pageNo=$pageNo&pageOffset=$pageOffset&catalogID=$CcatalogID";
# 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, $subTit...
if ($dbh and $rv) {
$formDisabledAll = $formDisabledNoMetricID = $formDisabledPrimaryKey = '';
if ( $CuKeyReload ) {
if ($action eq 'insert' or $action eq 'insertView') {
$action = "insertView";
} elsif ($action eq 'edit' or $action eq 'editView') {
$action = "editView";
} else {
applications/htmlroot/cgi-bin/admin/reports_perfdata.pl view on Meta::CPAN
$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);
$sql = "select SQL_NO_CACHE count(uKey) from $SERVERTABLREPORTSPRFDT where catalogID = '$CcatalogID'";
($rv, $numberRecordsIntoQuery) = do_action_DBI ($rv, $dbh, $sql, $pagedir, $pageset, $htmlTitle, $subTitle, $sessionID, $debug);
$navigationBar = record_navigation_bar ($pageNo, $numberRecordsIntoQuery, $RECORDSONPAGE, $ENV{SCRIPT_NAME} . "?pagedir=$pagedir&pageset=$pageset&debug=$debug&CGISESSID=$sessionID&action=listView&catalogID=$CcatalogID&or...
$navigationBar .= record_navigation_bar_alpha ($rv, $dbh, $SERVERTABLREPORTSPRFDT, 'uKey', "catalogID = '$CcatalogID'", $numberRecordsIntoQuery, $RECORDSONPAGE, $ENV{SCRIPT_NAME} . "?pagedir=$pagedir&pageset=$pageset&debug=$debug&CG...
$sql = "select $DATABASE.$SERVERTABLREPORTSPRFDT.catalogID, $DATABASE.$SERVERTABLREPORTSPRFDT.uKey, $DATABASE.$SERVERTABLREPORTSPRFDT.metric_id, concat( LTRIM(SUBSTRING_INDEX($DATABASE.$SERVERTABLPLUGINS.title, ']', -1)), ' (', $DATABASE.$SERVE...
$header = "<th><a href=\"$urlWithAccessParameters&action=listView&orderBy=catalog desc, title desc\"><IMG SRC=\"$IMAGESURL/$ICONSRECORD{up}\" ALT=\"Up\" BORDER=0></a> Catalog <a href=\"$urlWithAccessParameters&action=listView&or...
$header .= "<th><a href=\"$urlWithAccessParameters&action=listView&orderBy=metric_id desc, title asc\"><IMG SRC=\"$IMAGESURL/$ICONSRECORD{up}\" ALT=\"Up\" BORDER=0></a> Metric <a href=\"$urlWithAccessParameters&action=listView&o...
($rv, $matchingReportsPerfdata, $nextAction) = record_navigation_table ($rv, $dbh, $sql, 'Report Perfdata', 'catalogID|uKey|metric_id', '0|1|2', '2', '', '', $orderBy, $header, $navigationBar, $iconAdd, $iconDelete, $iconDetails, $iconEdit, $ne...
}
if (!$CuKeyReload and ($action eq 'deleteView' or $action eq 'displayView' or $action eq 'duplicateView' or $action eq 'editView')) {
$sql = "select catalogID, uKey, metric_id, times, percentiles, unit, activated from $SERVERTABLREPORTSPRFDT WHERE catalogID='$CcatalogID' and uKey='$CuKey' and metric_id='$Cmetric_id'";
$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;
applications/htmlroot/cgi-bin/admin/reports_perfdata.pl view on Meta::CPAN
if ($action eq 'insertView' or $action eq 'deleteView' or $action eq 'duplicateView' or $action eq 'displayView' or $action eq 'editView') {
if ($CuKey eq 'none' or $action eq 'insertView' or $action eq 'duplicateView' or $action eq 'editView') {
$sql = "select uKey, concat( LTRIM(SUBSTRING_INDEX(title, ']', -1)), ' (', $SERVERTABLENVIRONMENT.label, ')' ) as optionValueTitle from $SERVERTABLPLUGINS, $SERVERTABLENVIRONMENT where $SERVERTABLPLUGINS.catalogID = '$CcatalogID' and $SERVERT...
} else {
$sql = "select uKey, concat( LTRIM(SUBSTRING_INDEX(title, ']', -1)), ' (', $SERVERTABLENVIRONMENT.label, ')' ) from $SERVERTABLPLUGINS, $SERVERTABLENVIRONMENT where uKey = '$CuKey' and $SERVERTABLPLUGINS.catalogID = '$CcatalogID' and $SERVERT...
}
($rv, $uKeySelect, $htmlTitle) = create_combobox_from_DBI ($rv, $dbh, $sql, 1, $nextAction, $CuKey, 'uKey', 'none', '-Select-', $formDisabledPrimaryKey, 'onChange="javascript:submitForm();"', $pagedir, $pageset, $htmlTitle, $subTitle, $sessionI...
if ( $CuKey ne 'none' ) {
my $sqlWherePERFDATA;
my $catalogID_uKey = ( ( $CcatalogID eq 'CID' ) ? '' : $CcatalogID .'_' ) . $CuKey;
if ( $PERFPARSEVERSION eq '20' ) {
$sqlWherePERFDATA = "where service_id in (select service_id from $PERFPARSEDATABASE.perfdata_service where service_description = '$catalogID_uKey')";
} else {
$sqlWherePERFDATA = "where service_description = '$catalogID_uKey'";
}
if ( $rv ) {
$sql = "select metric_id, metric from $PERFPARSEDATABASE.perfdata_service_metric $sqlWherePERFDATA and metric not regexp '^(Compilation|Execution|Duration)\$' and unit regexp '^(s|ms)\$' order by metric";
($rv, $metric_idSelect, undef) = create_combobox_from_DBI ($rv, $dbh, $sql, 1, $nextAction, $Cmetric_id, 'metric_id', 'none', '-Select-', $formDisabledPrimaryKey, '', $pagedir, $pageset, $htmlTitle, $subTitle, $sessionID, $debug);
}
$formDisabledNoMetricID = '';
} else {
$metric_idSelect = "Application missing";
$formDisabledNoMetricID = 'disabled';
}
}
applications/htmlroot/cgi-bin/admin/resultsdirs.pl view on Meta::CPAN
print "<pre>pagedir : $pagedir<br>pageset : $pageset<br>debug : $debug<br>CGISESSID : $sessionID<br>page no : $pageNo<br>page offset : $pageOffset<br>order by : $orderBy<br>action ...
if ( defined $sessionID and ! defined $errorUserAccessControl ) {
my ($catalogIDSelect, $matchingResultsdir, $navigationBar);
my $urlWithAccessParameters = $ENV{SCRIPT_NAME} . "?pagedir=$pagedir&pageset=$pageset&debug=$debug&CGISESSID=$sessionID&catalogID=$CcatalogID";
# 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, $subTit...
if ($dbh and $rv) {
$formDisabledAll = $formDisabledPrimaryKey = '';
if ($action eq 'duplicateView' or $action eq 'insertView') {
$htmlTitle = "Insert Resultsdir";
$submitButton = "Insert";
$nextAction = "insert" if ($rv);
$CcatalogID = $CATALOGID if ($action eq 'insertView');
} elsif ($action eq 'insert') {
applications/htmlroot/cgi-bin/admin/timeperiods.pl view on Meta::CPAN
print "<pre>pagedir : $pagedir<br>pageset : $pageset<br>debug : $debug<br>CGISESSID : $sessionID<br>page no : $pageNo<br>page offset : $pageOffset<br>order by : $orderBy<br>action : $action<br>catalog ID ...
if ( defined $sessionID and ! defined $errorUserAccessControl ) {
my ($catalogIDSelect, $matchingTimeperiods, $navigationBar);
my $urlWithAccessParameters = $ENV{SCRIPT_NAME} . "?pagedir=$pagedir&pageset=$pageset&debug=$debug&CGISESSID=$sessionID&pageNo=$pageNo&pageOffset=$pageOffset&catalogID=$CcatalogID";
# 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, $subTit...
if ($dbh and $rv) {
$formDisabledAll = ''; $formDisabledPrimaryKey = 'disabled';
if ($action eq 'duplicateView' or $action eq 'insertView') {
$htmlTitle = "Insert Timeperiod";
$submitButton = "Insert";
$nextAction = "insert" if ($rv);
$CcatalogID = $CATALOGID if ($action eq 'insertView');
} elsif ($action eq 'insert') {
applications/htmlroot/cgi-bin/admin/users.pl view on Meta::CPAN
print "<pre>pagedir : $pagedir<br>pageset : $pageset<br>debug : $debug<br>CGISESSID : $sessionID<br>page no : $pageNo<br>page offset : $pageOffset<br>order by : $orderBy<br>actio...
if ( defined $sessionID and ! defined $errorUserAccessControl ) {
my ($catalogIDSelect, $keyLanguageSelect, $pagedirsSelect, $matchingUsers, $navigationBar);
my $urlWithAccessParameters = $ENV{SCRIPT_NAME} . "?pagedir=$pagedir&pageset=$pageset&debug=$debug&CGISESSID=$sessionID&pageNo=$pageNo&pageOffset=$pageOffset&catalogID=$CcatalogID";
# 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, $subTit...
if ($dbh and $rv) {
$formDisabledAll = $formDisabledRemoteUser = '';
if ($action eq 'duplicateView' or $action eq 'insertView') {
$htmlTitle = "Insert User";
$submitButton = "Insert";
$nextAction = "insert" if ($rv);
$CcatalogID = $CATALOGID if ($action eq 'insertView');
} elsif ($action eq 'insert') {
applications/htmlroot/cgi-bin/admin/views.pl view on Meta::CPAN
print "<pre>pagedir : $pagedir<br>pageset : $pageset<br>debug : $debug<br>CGISESSID : $sessionID<br>page no : $pageNo<br>page offset : $pageOffset<br>order by : $orderBy<br>action ...
if ( defined $sessionID and ! defined $errorUserAccessControl ) {
my ($catalogIDSelect, $displayDaemonSelect, $displayGroupSelect, $matchingViews, $navigationBar);
my $urlWithAccessParameters = $ENV{SCRIPT_NAME} . "?pagedir=$pagedir&pageset=$pageset&debug=$debug&CGISESSID=$sessionID&pageNo=$pageNo&pageOffset=$pageOffset&catalogID=$CcatalogID";
# 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, $subTit...
if ($dbh and $rv) {
$formDisabledAll = $formDisabledPrimaryKey = '';
if ($action eq 'duplicateView' or $action eq 'insertView') {
$htmlTitle = "Insert View";
$submitButton = "Insert";
$nextAction = "insert" if ($rv);
$CcatalogID = $CATALOGID if ($action eq 'insertView');
} elsif ($action eq 'insert') {
applications/htmlroot/cgi-bin/comments.pl view on Meta::CPAN
# Serialize the URL Access Parameters into a string
my $urlAccessParameters = "pagedir=$pagedir&pageset=$pageset&debug=$debug&CGISESSID=$sessionID&pageNo=$pageNo&pageOffset=$pageOffset&action=$action&catalogID=$CcatalogID&id=$Cid&uKey=$CuKey&title=$Ctitle&entryDate=$CentryDate&entryTime=$CentryTim...
# Debug information
print "<pre>pagedir : $pagedir<br>pageset : $pageset<br>debug : $debug<br>CGISESSID : $sessionID<br>page no : $pageNo<br>page offset : $pageOffset<br>action : $action<br>catalog ID : $CcatalogID<br>id ...
# 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) {
if ($action eq 'insertView' or $action eq 'createView' or $action eq 'historyView') {
if ($CuKey eq 'none') {
$sql = "select uKey, concat( LTRIM(SUBSTRING_INDEX(title, ']', -1)), ' (', $SERVERTABLENVIRONMENT.label, ')' ) as optionValueTitle from $SERVERTABLPLUGINS, $SERVERTABLENVIRONMENT where catalogID = '$CcatalogID' and $SERVERTABLPLUGINS.enviro...
} else {
$sql = "select uKey, concat( LTRIM(SUBSTRING_INDEX(title, ']', -1)), ' (', $SERVERTABLENVIRONMENT.label, ')' ) from $SERVERTABLPLUGINS, $SERVERTABLENVIRONMENT where uKey = '$CuKey' and catalogID = '$CcatalogID' and $SERVERTABLPLUGINS.enviro...
}
($rv, $uKeySelect, $htmlTitle) = create_combobox_from_DBI ($rv, $dbh, $sql, 0, ($supportRequest ? 'create' : 'insert'), $CuKey, 'uKey', 'none', '-Select-', '', '', $pagedir, $pageset, $htmlTitle, $subTitle, $sessionID, $debug);
applications/htmlroot/cgi-bin/comments.pl view on Meta::CPAN
} elsif ($action eq 'history') {
$htmlTitle = "$Ctitle: history id's listed";
$nextAction = "history" if ($rv);
}
}
$dbh->disconnect or $rv = error_trap_DBI(*STDOUT, "Sorry, the database was unable to add your entry.", $debug, $pagedir, $pageset, $htmlTitle, $subTitle, 3600, '', $sessionID);
}
if ( $rv ) {
$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, $su...
if ($action eq 'insertView' or $action eq 'createView' or $action eq 'historyView') {
my ($remoteUser, $givenName, $familyName);
if (($action eq 'insertView' or $action eq 'createView') and defined $remoteUserLoggedOn) {
$CremoteUser = $remoteUserLoggedOn;
$sql = "select remoteUser, email from $SERVERTABLUSERS where catalogID = '$CcatalogID' and remoteUser = '$CremoteUser'";
} else {
my $andActivated = ($action eq 'insertView' or $action eq 'createView') ? "and activated = 1" : '';
$sql = "select remoteUser, email from $SERVERTABLUSERS where catalogID = '$CcatalogID' and pagedir REGEXP '/$pageDir/' and remoteUser <> 'admin' and remoteUser <> 'sadmin' $andActivated order by email";
applications/htmlroot/cgi-bin/detailedStatisticsReportGenerationAndCompareResponsetimeTrends.pl view on Meta::CPAN
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 ) {
$uKey1 = $uKey2 = $uKey3 = 'none' if ( $CcatalogIDreload );
$sqlQuery = "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, $sqlQuery, 1, '', $CcatalogID, 'catalogID', $CATALOGID, '-Parent-', '', 'onChange="javascript:submitForm();"', $pagedir, $pageset, $htmlTitle, $subTitle, $sessionID, $debug);
$sqlQuery = "select uKey, concat( LTRIM(SUBSTRING_INDEX(title, ']', -1)), ' (', $SERVERTABLENVIRONMENT.label, ')' ) as optionValueTitle from $SERVERTABLPLUGINS, $SERVERTABLENVIRONMENT where $SERVERTABLPLUGINS.catalogID = '$CcatalogID' and $SERVER...
$sth = $dbh->prepare( $sqlQuery ) or $rv = error_trap_DBI(*STDOUT, "Cannot dbh->prepare: $sqlQuery", $debug, $pagedir, $pageset, $htmlTitle, $subTitle, 3600, '', $sessionID);
$sth->execute() or $rv = error_trap_DBI(*STDOUT, "Cannot sth->execute: $sqlQuery", $debug, $pagedir, $pageset, $htmlTitle, $subTitle, 3600, '', $sessionID) if $rv;
applications/htmlroot/cgi-bin/detailedStatisticsReportGenerationAndCompareResponsetimeTrends.pl view on Meta::CPAN
if ($perfdata eq 'on' and ! defined $errorMessage) {
# Performance Data Detail - - - - - - - - - - - - - - - - - - -
$perfdataDetailList = "<H1>Performance Data Details</H1>\n";
unless ( $PERFPARSEENABLED ) {
$perfdataDetailList .= "<table border=\"0\" cellpadding=\"1\" cellspacing=\"1\" bgcolor=\"$COLORSTABLE{TABLE}\"><tr><td width=\"400\">Performance Data not enabled!</td></tr></table>";
} else {
my ($sthPERFPARSE, $metric_id, $metric, $times, $percentiles, $unit, $Unit, $periodePERFPARSE, $countPERFPARSE, $valuePERFPARSE) = ( $dbh );
my $toggle = 0;
my $sqlWherePERFDATA;
if ( $PERFPARSEVERSION eq '20' ) {
my $catalogID_uKey = ( ( $CcatalogID eq 'CID' ) ? '' : $CcatalogID .'_' ) . $uKey1;
$sqlQuery = "select service_id from $PERFPARSEDATABASE.perfdata_service where service_description = '$catalogID_uKey'";
$sqlWherePERFDATA = "where $DATABASE.$SERVERTABLREPORTSPRFDT.metric_id = $PERFPARSEDATABASE.perfdata_service_metric.metric_id and $PERFPARSEDATABASE.perfdata_service_metric.service_id in ($sqlQuery)";
} else {
$sqlWherePERFDATA = "where $DATABASE.$SERVERTABLREPORTSPRFDT.catalogID='$CcatalogID' and $DATABASE.$SERVERTABLREPORTSPRFDT.uKey='$uKey1' and $DATABASE.$SERVERTABLREPORTSPRFDT.activated='1' and $DATABASE.$SERVERTABLREPORTSPRFDT.metric_id...
}
$sqlQuery = "select $DATABASE.$SERVERTABLREPORTSPRFDT.metric_id, $PERFPARSEDATABASE.perfdata_service_metric.metric, $DATABASE.$SERVERTABLREPORTSPRFDT.times, $DATABASE.$SERVERTABLREPORTSPRFDT.percentiles, $DATABASE.$SERVERTABLREPORTSPRFDT....
$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( \$metric_id, \$metric, \$times, \$percentiles, \$unit, \$Unit ) or $rv = error_trap_DBI("", "Cannot sth->bind_columns: $sqlQuery", $debug, '', "", '', "", -1, '', $sessionID) if $rv;
if ( $rv ) {
if ($sth->rows) {
my $sqlPeriodePERFDATA = $sqlPeriode;
if ( $PERFPARSEVERSION eq '20' ) {
$sqlPeriodePERFDATA =~ s/^AND startDate BETWEEN '(\d+-\d+-\d+)' AND '(\d+-\d+-\d+)'/AND FROM_UNIXTIME\(ctime\) BETWEEN '$1 00:00:00' AND '$2 23:59:59'/g;
$sqlPeriodePERFDATA =~ s/(startDate|startTime) BETWEEN/TIME\(FROM_UNIXTIME\(ctime\)\) BETWEEN/g;
$sqlPeriodePERFDATA =~ s/(startDate|startTime)/FROM_UNIXTIME\(ctime\)/g;
} else {
$sqlPeriodePERFDATA =~ s/^AND startDate BETWEEN '(\d+-\d+-\d+)' AND '(\d+-\d+-\d+)'/AND ctime BETWEEN '$1 00:00:00' AND '$2 23:59:59'/g;
$sqlPeriodePERFDATA =~ s/(startDate|startTime) BETWEEN/TIME\(ctime\) BETWEEN/g;
$sqlPeriodePERFDATA =~ s/(startDate|startTime)/ctime/g;
}
my $groupPERFDATA = ( $inputType eq 'fromto' ) ? 'dayofmonth' : $inputType; # 'dayofmonth' < 4.1.1 <= 'dayofmonth' or 'day' !!!
my $percentagePERFDATA = ( $inputType eq 'fromto' and $startDate ne $endDate ) ? 0 : 1;
$perfdataDetailList .= "<table border=\"0\" cellpadding=\"1\" cellspacing=\"1\" bgcolor=\"$COLORSTABLE{TABLE}\">\n";
while( $sth->fetch() ) {
$perfdataDetailList .= "<tr><th> $groupPERFDATA </th><th align=\"left\"> $metric </th><th> Expression </th></tr>\n";
$times = ( defined $times and $times ne '' ) ? '0,'. $times : '0';
my $sqlValuePERFDATA = '';
my $countRows = 0;
if ( $unit =~ /(?:s|ms)/ and $Unit =~ /(?:s|ms)/ ) {
foreach my $time (split (/,/, $times)) {
$toggle = ( $toggle ) ? 0 : 1;
my $value = $time;
if ( $value ) {
if ( $unit ne $Unit ) {
if ( $Unit eq 'ms' ) {
$value *= 1000;
} elsif ( $Unit eq 's' ) {
$value /= 1000;
}
}
$sqlValuePERFDATA = 'and value <= '. $value;
}
my $sqlWherePERFDATA;
if ( $PERFPARSEVERSION eq '20' ) {
$sqlWherePERFDATA = "WHERE metric_id = '$metric_id'";
} else {
my $catalogID_uKey1 = ( ( $CcatalogID eq 'CID' ) ? '' : $CcatalogID .'_' ) . $uKey1;
$sqlWherePERFDATA = "WHERE host_name = '$Title' and service_description = '$catalogID_uKey1' and metric = '$metric'";
}
my $sqlPERFDATA = "SELECT ";
$sqlPERFDATA .= ( $PERFPARSEVERSION eq '20' ) ? "$groupPERFDATA(FROM_UNIXTIME(ctime))" :" $groupPERFDATA(ctime)";
$sqlPERFDATA .= ", count(ctime) FROM $PERFPARSEDATABASE.perfdata_service_bin $sqlWherePERFDATA $sqlPeriodePERFDATA $sqlValuePERFDATA group by ";
$sqlPERFDATA .= ( $PERFPARSEVERSION eq '20' ) ? "$groupPERFDATA(FROM_UNIXTIME(ctime))" : "$groupPERFDATA(ctime)";
$sthPERFPARSE = $dbh->prepare( $sqlPERFDATA ) or $rv = error_trap_DBI("", "Cannot dbh->prepare: $sqlPERFDATA", $debug, '', "", '', "", -1, '', $sessionID);
$sthPERFPARSE->execute() or $rv = error_trap_DBI("", "Cannot sth->execute: $sqlPERFDATA", $debug, '', "", '', "", -1, '', $sessionID) if $rv;
$sthPERFPARSE->bind_columns( \$periodePERFPARSE, \$countPERFPARSE ) or $rv = error_trap_DBI("", "Cannot sth->bind_columns: $sqlPERFDATA", $debug, '', "", '', "", -1, '', $sessionID) if $rv;
my $expresionPERFPARSE = ( $debug eq 'T' ? "($value $Unit) " : '' );
my $bgcolor = ( $toggle ) ? $COLORSTABLE{ENDBLOCK} : $COLORSTABLE{STARTBLOCK};
$perfdataDetailList .= "<tr bgcolor=\"$bgcolor\"><td colspan=\"2\"> $sqlPERFDATA </td><td> <= $time $unit $expresionPERFPARSE</td></tr>\n" if ( $debug eq 'T' );
if ( $rv ) {
if ($sthPERFPARSE->rows) {
while( $sthPERFPARSE->fetch() ) {
unless ( $value ) {
$countRows = $countPERFPARSE;
} else {
if ( $percentagePERFDATA ) {
my $percentage = sprintf "%.2f", ( ( $countPERFPARSE / $countRows ) * 100 );
$percentage = "( $countPERFPARSE / $countRows ) * 100 = $percentage" if ( $debug eq 'T' );
$perfdataDetailList .= "<tr bgcolor=\"$bgcolor\"><td align=\"right\"> $periodePERFPARSE </td><td align=\"right\"> $percentage % </td><td> <= $time $unit $expresionPERFPARSE</td><...
} else {
$perfdataDetailList .= "<tr bgcolor=\"$bgcolor\"><td align=\"right\"> $periodePERFPARSE </td><td align=\"right\"> $countPERFPARSE # </td><td> <= $time $unit $expresionPERFPARSE</...
}
}
}
} elsif ( $debug eq 'T' ) {
$perfdataDetailList .= "<tr bgcolor=\"$bgcolor\"><td align=\"right\"> </td><td align=\"right\"> 0 ". ( $percentagePERFDATA ? '%' : '#' ) ." </td><td> <= $time $unit $expresionPERFPARSE</td>...
}
$sthPERFPARSE->finish() or $rv = error_trap_DBI("", "Cannot sth->finish", $debug, '', "", '', "", -1, '', $sessionID);
}
}
if ( $percentagePERFDATA ) {
foreach my $percentile (split (/,/, $percentiles)) {
$toggle = ( $toggle ) ? 0 : 1;
my ($IR, $FR) = split (/\./, sprintf "%.2f", ( ( $percentile / 100 ) * ( $countRows + 1 ) ) );
my $limit = ( $FR eq '00' ) ? 1 : 2;
my $offset = $IR - 1;
$FR = sprintf "0.%d", $FR;
my $sqlWherePERFDATA;
if ( $PERFPARSEVERSION eq '20' ) {
$sqlWherePERFDATA = "WHERE metric_id = '$metric_id'";
} else {
my $catalogID_uKey1 = ( ( $CcatalogID eq 'CID' ) ? '' : $CcatalogID .'_' ) . $uKey1;
$sqlWherePERFDATA = "WHERE host_name = '$Title' and service_description = '$catalogID_uKey1' and metric = '$metric'";
}
my $sqlPERFDATA = "SELECT ";
$sqlPERFDATA .= ( $PERFPARSEVERSION eq '20' ) ? "$groupPERFDATA(FROM_UNIXTIME(ctime))" : "$groupPERFDATA(ctime)";
$sqlPERFDATA .= ", value FROM $PERFPARSEDATABASE.perfdata_service_bin $sqlWherePERFDATA $sqlPeriodePERFDATA order by value limit $offset, $limit";
$sthPERFPARSE = $dbh->prepare( $sqlPERFDATA ) or $rv = error_trap_DBI("", "Cannot dbh->prepare: $sqlPERFDATA", $debug, '', "", '', "", -1, '', $sessionID);
$sthPERFPARSE->execute() or $rv = error_trap_DBI("", "Cannot sth->execute: $sqlPERFDATA", $debug, '', "", '', "", -1, '', $sessionID) if $rv;
$sthPERFPARSE->bind_columns( \$periodePERFPARSE, \$valuePERFPARSE ) or $rv = error_trap_DBI("", "Cannot sth->bind_columns: $sqlPERFDATA", $debug, '', "", '', "", -1, '', $sessionID) if $rv;
my $bgcolor = ( $toggle ) ? $COLORSTABLE{ENDBLOCK} : $COLORSTABLE{STARTBLOCK};
$perfdataDetailList .= "<tr bgcolor=\"$bgcolor\"><td colspan=\"2\"> ( ( $percentile / 100 ) * ( $countRows + 1 ) ), IR: $IR, FR: $FR, offset: $offset, limit: $limit & # $countRows <br> $sqlPERFDATA </td><td...
if ( $rv ) {
if ($sthPERFPARSE->rows) {
my ($value1, $value2);
while( $sthPERFPARSE->fetch() ) {
$value1 = $valuePERFPARSE unless (defined $value1);
$value2 = $valuePERFPARSE if (defined $value1);
}
applications/htmlroot/cgi-bin/generateChart.pl view on Meta::CPAN
} elsif ( $numberOfDays > 7 ) {
$rv = 0; $errorMessage = "Hourly Average Not Available";
} else {
($yearFrom, $monthFrom, $dayFrom) = split (/-/, $tmpStartDate) if (defined $tmpStartDate);
($yearTo, $monthTo, $dayTo) = split (/-/, $tmpEndDate) if (defined $tmpEndDate);
}
}
if ( $rv ) {
# open connection to database and query data
$dbh = DBI->connect("DBI:mysql:$DATABASE:$SERVERNAMEREADONLY:$SERVERPORTREADONLY", "$SERVERUSERREADONLY", "$SERVERPASSREADONLY" ) or ($rv, $errorMessage, $dbiErrorCode, $dbiErrorString) = error_trap_DBI("Cannot connect to the database", $debug, '',...
if ( $dbh and $rv ) {
if ( $uKey1 eq 'none' ) {
$rv = 0; $errorMessage = "URL Access Parameters Error: Application 1";
} else {
($rv, $errorMessage, $dbiErrorCode, $dbiErrorString, $applicationTitle1, $trendvalue, undef) = get_title( $dbh, $rv, $CcatalogID, $uKey1, $debug, 0, $sessionID );
}
if ( $rv ) { if ( $uKey2 ne 'none' ) { ($rv, $errorMessage, $dbiErrorCode, $dbiErrorString, $applicationTitle2, undef, undef) = get_title( $dbh, $rv, $CcatalogID, $uKey2, $debug, 0, $sessionID ); } }
if ( $rv ) { if ( $uKey3 ne 'none' ) { ($rv, $errorMessage, $dbiErrorCode, $dbiErrorString, $applicationTitle3, undef, undef) = get_title( $dbh, $rv, $CcatalogID, $uKey3, $debug, 0, $sessionID ); } }
applications/htmlroot/cgi-bin/generateChart.pl view on Meta::CPAN
$labels{$label} *= 8 if ($uKey1 eq 'KBO-WI-P-01'); # KBO-WI specific
} elsif ($label eq 'WARNING') {
push (@icons, "$IMAGESPATH/$ICONS{WARNING}");
$labels{$label} *= 8 if ($uKey1 eq 'KBO-WI-P-01'); # KBO-WI specific
} elsif ($label eq 'CRITICAL') {
push (@icons, "$IMAGESPATH/$ICONS{CRITICAL}");
} elsif ($label eq 'UNKNOWN') {
push (@icons, "$IMAGESPATH/$ICONS{UNKNOWN}");
} elsif ($label eq 'NO TEST') {
push (@icons, "$IMAGESPATH/$ICONS{'NO TEST'}");
} elsif ($label eq 'NO DATA') {
push (@icons, "$IMAGESPATH/$ICONS{'NO DATA'}");
} elsif ($label eq 'OFFLINE') {
push (@icons, "$IMAGESPATH/$ICONS{OFFLINE}");
}
push (@data, $labels{$label});
}
} else {
$hight = 380; $rv = 0; $errorMessage = "NO DATA FOR THIS PERIOD (1)";
}
$sth->finish() or ($rv, $errorMessage, $dbiErrorCode, $dbiErrorString) = error_trap_DBI("", "Cannot sth->finish", $debug, '', "", '', "", 0, '', $sessionID);
}
} elsif ( $selChart eq "ErrorDetails" ) {
my ($title, $statusmessage, $aantal, %problemSummary);
$sql = create_sql_query_events_from_range_year_month ($inputType, $sqlStartDate, $sqlEndDate, "select SQL_NO_CACHE title, statusmessage, count(statusmessage) as aantal", $forceIndex, "WHERE catalogID = '$CcatalogID' and uKey = '$uKey1'", ...
$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( \$title, \$statusmessage, \$aantal ) or ($rv, $errorMessage, $dbiErrorCode, $dbiErrorString) = error_trap_DBI("", "Cannot sth->bind_columns: $sql", $debug, '', "", '', "", 0, '', $sessionID) if $rv;
applications/htmlroot/cgi-bin/generateChart.pl view on Meta::CPAN
$counter = 1;
} else {
push (@labels, "");
$counter++;
}
}
$AreaBOffset += 36 if ($moreDays);
} else {
$hight = 380; $rv = 0; $errorMessage = "NO DATA FOR THIS PERIOD (2)";
}
$sth->finish() or ($rv, $errorMessage, $dbiErrorCode, $dbiErrorString) = error_trap_DBI("", "Cannot sth->finish", $debug, '', "", '', "", 0, '', $sessionID);
}
} elsif ( $selChart eq "HourlyAverage" or $selChart eq "DailyAverage" ) {
($rv, $errorMessage, $dbiErrorCode, $dbiErrorString) = getAverage( 1, $dbh, $rv, $uKey1, $sqlStartDate, $sqlEndDate, $sqlPeriode, $selChart, $debug );
}
}
if ( $rv and $uKey2 ne 'none' ) {
applications/htmlroot/cgi-bin/generateChart.pl view on Meta::CPAN
while( $sth->fetch() ) {
push (@avg, $average);
if ( $selChart eq "HourlyAverage" ) {
push (@labels, $startDate .":". $hour);
} else {
push (@labels, $startDate);
}
}
} else {
$hight = 380; $rv = 0; $errorMessage = "NO DATA FOR THIS PERIOD (3)";
}
$sth->finish() or ($rv, $errorMessage, $dbiErrorCode, $dbiErrorString) = error_trap_DBI("", "Cannot sth->finish", $debug, '', "", '', "", 0, '', $sessionID);
}
if ( $number == 1 ) {
@avg1 = @avg; @labels1 = @labels;
} elsif ( $number == 2 ) {
@avg2 = @avg; @labels2 = @labels;
} elsif ( $number == 3 ) {
applications/htmlroot/cgi-bin/getArchivedDebug.pl view on Meta::CPAN
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 {
my ($rv, $dbh, $sth, $sql, $title, $resultsdir, $catalogIDSelect, $uKeySelect, $debugsSelect);
# 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, $subTitl...
if ( $dbh and $rv ) {
$uKey = '<NIHIL>' if ( $CcatalogIDreload );
$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);
$sql = "select distinct $SERVERTABLPLUGINS.uKey, concat( LTRIM(SUBSTRING_INDEX($SERVERTABLPLUGINS.title, ']', -1)), ' (', $SERVERTABLENVIRONMENT.label, ')' ) as optionValueTitle from $SERVERTABLPLUGINS, $SERVERTABLENVIRONMENT where $SERVERTABLP...
($rv, $uKeySelect, undef) = create_combobox_from_DBI ($rv, $dbh, $sql, 1, '', $uKey, 'uKey', '', '', '', '', $pagedir, $pageset, $htmlTitle, $subTitle, $sessionID, $debug);