view release on metacpan or search on metacpan
- , 'Log::Dispatch' => '2.26'
- , 'Log::Dispatch::FileRotate' => '1.19'
- , 'Log::Log4perl::Layout::XMLLayout' => 'x.x'
Version 3.002.003, 2011/xx/yy, by Alex Peeters
ASNMTAP
- Nagios.pm
BUGFIX: convert_from_KB_to_metric for GB
BUGFIX: DESTROY created new reference to dead object 'ASNMTAP::Asnmtap::Plugins::Nagios' during global destruction.
- WebTransact.pm
UPDATE: added Content_Type: 'multipart/form-data' for qs-fixed
- change code to use 'perfdata'
- UPDATE: asnmtap-3.002.003_mysql-v5.0.x-trigger-events.sql
- UPDATE: asnmtap-3.002.003_mysql-v5.0.x-trigger-eventsUpdate.sql
- runCmdOnDemand.pl & WebTransact.pm
- replace <BODY onload="..."> with <BODY>
- SOAP.pm
NEW: encodingStyle
NEW: error 'Missing SOAP Envelope or Body'
UPDATE: soapaction
- create_ASNMTAP_weblogic_configuration_for_SNMP.pl
UPDATE: added status to e-mail subject
Version 3.002.002, 2010/09/22, by Alex Peeters
ASNMTAP
- UPDATE asnmtap-3.002.002_mysql-v5.0.x-trigger-events.sql
- optimalisatie DBI connection problems
- NEW /cgi-bin/moderator/comments.pl
Set multiple comments by drag and drop list
Database schema v3.002.002
- UPDATE /applications/tools/mysql/asnmtap-3.002.002_mysql-v5.0.x.sql
- UPDATE /applications/tools/mysql/asnmtap-3.002.002-distributed_mysql-v5.0.x.sql
- ALTER TABLE `events` ADD COLUMN `perfdata` text AFTER `statusMessage`;
- ALTER TABLE `eventsDisplayData` ADD COLUMN `perfdata` text AFTER `statusMessage`;
- ALTER TABLE `views` ADD COLUMN `timeperiodID` INT(11) NOT NULL DEFAULT '1' AFTER `displayGroupID`;
- ALTER TABLE `views` ADD INDEX `timeperiodID` (`timeperiodID`);
- ALTER TABLE `views` ADD INDEX `views_ibfk_4` (`catalogID`, `timeperiodID`);
- ALTER TABLE `views` ADD CONSTRAINT `views_ibfk_4` FOREIGN KEY (`catalogID`,`timeperiodID`) REFERENCES `timeperiods` (`catalogID`,`timeperiodID`);
Help Plugin docs
- update new help plugin doc file type 'http(s)://'
SNMPTraps-Frontend for Nagios & ASNMTAP
- UPDATE class.mysqlDB.php: replace 'INSERT INTO' with 'REPLACE INTO'
XML plugin templates
- UPDATE new command line option 'uKey'
ASNMTAP::Asnmtap::Applications::CSV VARIABLES
- UPDATE our @EVENTS = ('catalogID', 'id', 'uKey', 'replicationStatus', 'test', 'title', 'status', 'startDate', 'startTime', 'endDate', 'endTime', 'duration', 'statusMessage', 'perfdata', 'step', 'timeslot', 'instabilit...
views.pl
- added 'Incident Monitoring Window'
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
- NEW catalog.pl
- UPDATE rsync 3.06 compatible
- UPDATE autogenerated rsync *.conf with --exclude *.sql
- UPDATE autogenerated 'Collector Start/Stop scripts' optimalisation
- UPDATE runStatusOnDemand.pl with follow up for importDataThroughCatalog.pid
- UPDATE optimalisation display.pl regarding encode html entities for the 'statusMessage'
- UPDATE archive.pl, check_SNMPTT_probe.pl, check_snmptt_traps.pl, check_jUnit.pl & snmptt_traps_remove_pending_and_duplicated.pl
'INSERT INTO' with 'REPLACE INTO' before 'DELETE'
Version 3.001.001, 2009/10/23, by Alex Peeters
- UPDATE /applications/tools/mysql/asnmtap-3.001.001-database-schema.png
- UPDATE TABLE `events` for MySQL
- MySQL 4.x
- SELECT CONCAT('alter table ', TABLE_SCHEMA , '.', table_name, ' MODIFY `test` varchar(254) NOT NULL default \'\';') FROM INFORMATION_SCHEMA.tables WHERE ENGINE = 'MYISAM' AND table_type='BASE TABLE' AND table_name...
- TO GENERATE THE NEXT CODE FOR ALL YEARS
- ALTER TABLE `events_yyyy_01` MODIFY `test` varchar(254) NOT NULL default '';
...
- ALTER TABLE `events_yyyy_12` MODIFY `test` varchar(254) NOT NULL default '';
- MySQL 5.0.x
- SELECT CONCAT('alter table ', TABLE_SCHEMA , '.', table_name, ' MODIFY `test` varchar(512) NOT NULL default \'\';') FROM INFORMATION_SCHEMA.tables WHERE ENGINE = 'MYISAM' AND table_type='BASE TABLE' AND table_name...
- TO GENERATE THE NEXT CODE FOR ALL YEARS
- DROP TABLE `events_yyyy_Q4`;
- CREATE TABLE IF NOT EXISTS `events_yyyy_Q4` LIKE `events_yyyy_10`;
- ALTER TABLE `events_yyyy_Q4` ENGINE=MERGE UNION=(`events_yyyy_10`, `events_yyyy_11`, `events_yyyy_12`) INSERT_METHOD=LAST;
- 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` (
`catalogID` varchar(5) NOT NULL default 'CID',
`catalogName` varchar(64) NOT NULL default '',
`catalogType` ENUM('central','federated','probe','distributed') NOT NULL DEFAULT 'probe',
`databaseFQDN` varchar(64) NOT NULL default 'localhost',
`databasePort` varchar(4) NOT NULL default '3306',
`lastEventsID` int(11) NOT NULL default '0',
`lastCommentsID` int(11) NOT NULL default '0',
`activated` tinyint(1) NOT NULL default '0',
PRIMARY KEY (`catalogID`)
) ENGINE=InnoDB;
- insert into `catalog` (`catalogID`,`catalogName`,`catalogType`,`databaseFQDN`,`databasePort`,`lastEventsID`,`lastCommentsID`,`activated`) values ('CID','Central System Enterprise','central','localhost','3306',0,...
- UPDATE TABLE `servers` for MySQL'
- ALTER TABLE `servers` ADD COLUMN `typeActiveServer` char(1) NOT NULL DEFAULT 'M' AFTER `typeMonitoring`;
# ------------------------------------
- ALTER TABLE `collectorDaemons` DROP FOREIGN KEY `collectorDaemons_ibfk_2`;
- ALTER TABLE `comments` DROP FOREIGN KEY `comments_ibfk_1`;
- ALTER TABLE `comments` DROP FOREIGN KEY `comments_ibfk_2`;
- ALTER TABLE `crontabs` DROP FOREIGN KEY `crontabs_ibfk_1`;
- ALTER TABLE `crontabs` DROP FOREIGN KEY `crontabs_ibfk_2`;
- ALTER TABLE `plugins` ADD INDEX `catalogID` (`catalogID`);
- ALTER TABLE `plugins` ADD INDEX `uKey` (`uKey`);
- ALTER TABLE `plugins` ADD PRIMARY KEY (`catalogID`,`uKey`);
- ALTER TABLE `reports` ADD UNIQUE KEY `id` (`id`);
- ALTER TABLE `reports` DROP PRIMARY KEY;
- ALTER TABLE `reports` ADD COLUMN `catalogID` varchar(5) NOT NULL default 'CID' FIRST;
- ALTER TABLE `reports` ADD INDEX `catalogID` (`catalogID`);
- ALTER TABLE `reports` ADD PRIMARY KEY (`catalogID`,`id`);
- ALTER TABLE `reports_perfdata` DROP PRIMARY KEY;
- ALTER TABLE `reports_perfdata` ADD COLUMN `catalogID` varchar(5) NOT NULL default 'CID' FIRST;
- ALTER TABLE `reports_perfdata` ADD INDEX `catalogID` (`catalogID`);
- ALTER TABLE `reports_perfdata` ADD PRIMARY KEY (`catalogID`,`uKey`,`metric_id`);
- ALTER TABLE `resultsdir` DROP PRIMARY KEY;
- ALTER TABLE `resultsdir` ADD COLUMN `catalogID` varchar(5) NOT NULL default 'CID' FIRST;
- ALTER TABLE `resultsdir` ADD INDEX `catalogID` (`catalogID`);
- ALTER TABLE `resultsdir` ADD PRIMARY KEY (`catalogID`,`resultsdir`);
- ALTER TABLE `servers` DROP PRIMARY KEY;
- ALTER TABLE `servers` ADD COLUMN `catalogID` varchar(5) NOT NULL default 'CID' FIRST;
- ALTER TABLE `servers` ADD INDEX `catalogID` (`catalogID`);
- ALTER TABLE `servers` ADD PRIMARY KEY (`catalogID`,`serverID`);
- ALTER TABLE `displayDaemons` ADD CONSTRAINT `displayDaemons_ibfk_2` FOREIGN KEY (`catalogID`,`serverID`) REFERENCES `servers` (`catalogID`,`serverID`);
- ALTER TABLE `eventsChangesLogData` ADD INDEX `eventsChangesLogData_ibfk_1` (`catalogID`,`uKey`);
- ALTER TABLE `eventsChangesLogData` ADD CONSTRAINT `eventsChangesLogData_ibfk_1` FOREIGN KEY (`catalogID`,`uKey`) REFERENCES `plugins` (`catalogID`,`uKey`);
- ALTER TABLE `holidays` ADD CONSTRAINT `holidays_ibfk_1` FOREIGN KEY (`countryID`) REFERENCES `countries` (`countryID`);
- ALTER TABLE `holidaysBundle` ADD CONSTRAINT `holidaysBundle_ibfk_1` FOREIGN KEY (`countryID`) REFERENCES `countries` (`countryID`);
- ALTER TABLE `plugins` ADD CONSTRAINT `plugins_ibfk_1` FOREIGN KEY (`catalogID`,`resultsdir`) REFERENCES `resultsdir` (`catalogID`,`resultsdir`);
- ALTER TABLE `plugins` ADD INDEX `plugins_ibfk_2` (`catalogID`,`holidayBundleID`);
- ALTER TABLE `plugins` ADD CONSTRAINT `plugins_ibfk_2` FOREIGN KEY (`catalogID`,`holidayBundleID`) REFERENCES `holidaysBundle` (`catalogID`,`holidayBundleID`);
- ALTER TABLE `reports` ADD CONSTRAINT `reports_ibfk_1` FOREIGN KEY (`catalogID`,`uKey`) REFERENCES `plugins` (`catalogID`,`uKey`);
- ALTER TABLE `reports` ADD CONSTRAINT `reports_ibfk_2` FOREIGN KEY (`catalogID`,`timeperiodID`) REFERENCES `timeperiods` (`catalogID`,`timeperiodID`);
- ALTER TABLE `reports_perfdata` ADD CONSTRAINT `reports_perfdata_ibfk_1` FOREIGN KEY (`catalogID`,`uKey`) REFERENCES `plugins` (`catalogID`,`uKey`);
- ALTER TABLE `titles` ADD CONSTRAINT `titles_ibfk_1` FOREIGN KEY (`keyLanguage`) REFERENCES `language` (`keyLanguage`);
- ALTER TABLE `users` ADD CONSTRAINT `users_ibfk_1` FOREIGN KEY (`keyLanguage`) REFERENCES `language` (`keyLanguage`);
- ALTER TABLE `views` ADD CONSTRAINT `views_ibfk_1` FOREIGN KEY (`catalogID`,`displayDaemon`) REFERENCES `displayDaemons` (`catalogID`,`displayDaemon`);
- ALTER TABLE `views` ADD CONSTRAINT `views_ibfk_2` FOREIGN KEY (`catalogID`,`displayGroupID`) REFERENCES `displayGroups` (`catalogID`,`displayGroupID`);
- ALTER TABLE `views` ADD CONSTRAINT `views_ibfk_3` FOREIGN KEY (`catalogID`,`uKey`) REFERENCES `plugins` (`catalogID`,`uKey`);
# ------------------------------------
# START HIGH IMPACT !
# ------------------------------------
- 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 '',
`prevTimeslot` varchar(10) NOT NULL default '',
PRIMARY KEY (`uKey`)
) ENGINE=InnoDB;
- UPDATE create_weblogic_configuration_database_with_SNMP-3.000.020.SQL
- UPDATE create_weblogic_configuration_database_with_SNMP-3.000.020_mysql-v5.0.x.SQL
- NEW TABLE `QUEUES` for MySQL'
CREATE TABLE `QUEUES` (
`QUEUE_NAME` varchar(64) NOT NULL default '',
`QUEUE_OID` varchar(254) default NULL,
`ENV` varchar(4) default NULL,
`ACTIVATED` tinyint(1) unsigned default '1',
`CURRENT_TIMESTAMP` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
`VIRTUAL_CLUSTER_ID` int(11) unsigned NOT NULL default '0',
`UKEY` varchar(11) default NULL,
PRIMARY KEY (`QUEUE_OID`,`QUEUE_NAME`),
replace '[a-z|A-Z|0-9|-]' with '[a-zA-Z0-9-]'
- plugins/templates
NEW /dtd/Monitoring-1.1.dtd
NEW /dtd/Fingerprint-1.0-and-monitoring-1.0-xml-validator.html
NEW /dtd/Fingerprint-1.0-and-monitoring-1.1-xml-validator.html
NEW /xml/Monitoring-1.1.xml
NEW /xml/Monitoring-1.1-doNotValidate.xml
NEW /xml/Monitoring-1.1-errorParsing.xml
- /cgi-bin/runCmdOnDemand.pl
On Demand test now launched on the same probe as the collector that runs the test
- check_MySQL-database-replication.pl
- Added Slave IO detection
- /plugins/junit, making weblogic 10 compatible
- UPDATE check_jUnit.pl
- UPDATE create_ASNMTAP_jUnit_configuration_for_jUnit.pl
- UPDATE create_ASNMTAP_jUnit_configuration_for_jUnit-3.000.019_mysql.SQL
- UPDATE create_ASNMTAP_jUnit_configuration_for_jUnit-3.000.019_mysql-v5.0.x.SQL
- UPDATE TABLE `BASE_SERVICES` for 'MySQL'
- ALTER TABLE `BASE_SERVICES` CHANGE COLUMN `STATUS` `STATUS` enum('ASNMTAP','NEW','MAINTENANCE','EOL') NOT NULL default 'NEW';
- UPDATE TABLE `SERVER` for 'MySQL'
- ALTER TABLE `SERVER` ADD COLUMN `WEBLOGIC_VERSION` enum('8','10') default '10' AFTER `ENV`;
- CREATE TABLE IF NOT EXISTS `events_2008_Q4` LIKE `events_2008_10`;
- ALTER TABLE `events_2008_Q4` ENGINE=MERGE UNION=(`events_2008_10`, `events_2008_11`, `events_2008_12`) INSERT_METHOD=LAST;
- ALTER TABLE `comments` ADD COLUMN `instability` tinyint(1) NOT NULL default '0' AFTER `remoteUser`;
- ALTER TABLE `comments_2008` ADD COLUMN `instability` tinyint(1) NOT NULL default '0' AFTER `remoteUser`;
- SNMPTT making Weblogic 10 compatible:
- /plugins/snmptt/
- FIX create_ASNMTAP_weblogic_configuration_for_SNMP.pl: my $pluginTest = 'check_SNMPTT_weblogic.pl';
- UPDATE create_ASNMTAP_weblogic_configuration_for_SNMP.pl
- UPDATE create_NCPL_weblogic_configuration_for_SNMP.pl
- UPDATE create_weblogic_configuration_database_with_SNMP.pl
- UPDATE create_weblogic_configuration_for_SNMPTT.pl
- /plugins/templates/snmptt/
- UPDATE check_SNMPTT_weblogic.pl
- UPDATE snmptt-bea-weblogic.conf
- UPDATE create_weblogic_configuration_database_with_SNMP-3.000.019.SQL
- PRIMARY KEY + `trapMBeanType_MATCH`
- UPDATE create_weblogic_configuration_database_with_SNMP-3.000.019_mysql-v5.0.x.SQL
- PRIMARY KEY + `trapMBeanType_MATCH`
Version 3.000.018, 2008/07/07, by Alex Peeters.
- security update
Version 3.000.017, 2008/06/09, by Alex Peeters with contributions from Yves Van den Hove.
Makefile.PL
- version update Bundle::DBI: 1.604
- version update CGI: 3.37
- version update CGI::Session: 4.30
- ALTER TABLE `snmptt_archive` CHANGE COLUMN `formatline` `formatline` varchar(1024) default NULL;
- ALTER TABLE `snmptt_unknown` CHANGE COLUMN `formatline` `formatline` varchar(1024) default NULL;
- ALTER TABLE `snmptt_unknown_archive` CHANGE COLUMN `formatline` `formatline` varchar(1024) default NULL;
- UPDATE TABLE `wls_snmptt_CONFIG`
- ALTER TABLE `wls_snmptt_CONFIG` CHANGE COLUMN `trapMBeanType` `trapMBeanType` varchar(128) NOT NULL default '';
- ALTER TABLE `wls_snmptt_CONFIG` CHANGE COLUMN `trapAttributeName` `trapAttributeName` varchar(128) NOT NULL default '';
- ALTER TABLE `wls_snmptt_CONFIG` CHANGE COLUMN `trapMonitorType` `trapMonitorType` varchar(128) NOT NULL default '';
- ALTER TABLE `wls_snmptt_CONFIG` ADD COLUMN `trapLogSeverity` varchar(128) NOT NULL default '' AFTER `trapMonitorType_MATCH`, ADD COLUMN `trapLogSeverity_MATCH` char(2) default NULL AFTER `trapLogSeverity`, ADD COL...
- ALTER TABLE `wls_snmptt_CONFIG` DROP PRIMARY KEY, ADD PRIMARY KEY (`trapMBeanType`,`trapAttributeName`,`trapMonitorType`, `trapLogSeverity`, `trapLogMessage`, `event_name`,`category`,`sources_list`,`mode`);
- UPDATE snmptt-bea-weblogic.conf
- UPDATE create_weblogic_configuration_database_with_SNMP-3.000.016.SQL
- UPDATE create_weblogic_configuration_database_with_SNMP-3.000.016_mysql-v5.0.x.SQL
ASNMTAP::Asnmtap::Plugins::Mail.pm
- FIX regarding MIME-Encoding 'quoted-printable' into MIME-tools-5.425
ASNMTAP::Asnmtap::Plugins::Nagios
- NEW Makefile.PL Net::Ifconfig::Wrapper
ASNMTAP::Asnmtap::Plugins::WebTransact
- UPDATE POD with 'Qs_var => [..., submain => RET_SUBMAIN, title1 => RET_TITLE1]'
Version 3.000.015, 2007/10/21, by Alex Peeters with contributions from Yves Van den Hove.
Makefile.PL
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 '',
alter table events_yyyy_mm change statusMessage statusMessage varchar(1024);
- IMPROVED perfparse_crontab.sh
- NEW perfparse_crontab_failed.sh (Yves Van den Hove)
- NEW perfparse_debug.sh by (Yves Van den Hove)
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
/moderator/collectorDaemonSchedulingReports.pl
- FIX Use of uninitialized value in split at line 79.
/moderator/plugins.pl
- NEW Plugins (to edit short description, trendline, holiday bundle and uploading plugindoc)
/moderator/trendlineCorrectionReports.pl
- FIX Use of uninitialized value in split at line 93.
- FIX Possible precedence problem on bitwise & operator at line 117.
- FIX switch startdate with enddate
/admin/reports.pl
- ADD show comments
- NEW Select 'Reports Perfdata'
/admin/reports_perfdata.pl
- NEW Reports Perfdata (to define the 'Performance Times' that are used by the automatically generated Reports)
/sadmin/crontabs.pl
- FIX 'select SQL_NO_CACHE count(id) from crontabs' with 'select SQL_NO_CACHE count(lineNumber) from crontabs'
/sadmin/plugins.pl
- ADD short desription
- FIX $notActivated = ($Cactivated) ? '' : ' not'; with $notActivated = ($CTactivated) ? '' : ' not';
integration with jUnit
- NEW /plugins/jUnit/
- NEW check_jUnit.pl
- NEW create_ASNMTAP_jUnit_configuration_for_jUnit.pl
integration with SNMPTT
- NEW /plugins/snmptt/
- NEW check_SNMPTT_weblogic.pl
- NEW create_ASNMTAP_weblogic_configuration_for_SNMP.pl
- NEW create_weblogic_configuration_for_SNMPTT.pl
- FIX snmptt_traps_remove_pending_and_duplicated.pl
- NEW /plugins/templates/snmptt/
- UPDATE create_weblogic_configuration_database_with_SNMP-3.000.015.SQL
- NEW create_weblogic_configuration_database_with_SNMP-3.000.015_mysql-v5.0.x.SQL
- NEW snmptt-bea-weblogic.conf
- NEW snmptt-3.000.015.sql
- NEW snmptt.ini
integration with NagTrap
- NEW /applications/htmlroot/snmptraps
table plugins
- ADD `shortDesription` text,
table reports
- ADD `showComments` tinyint(1) NOT NULL default '0',
- ADD `showPerfdata` tinyint(1) NOT NULL default '0',
table reports_perfdata
- NEW table reports_perfdata
Version 3.000.014, 2007/06/10, Makefile.PL
- version update CPAN 1.9101
- version update CPANPLUS 0.78
- version update Config::General 2.32
- version update DateTime 0.37
- version update Email::Simple 1.999
- version update ExtUtils::MakeMaker 6.32
- version update IO::Socket::SSL 1.040
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;
ASNMTAP::Asnmtap::Applications::CGI.pm & archiver.pl
- NEW $SERVERMYSQLVERSION = '4.x # '4.x' or '5.0.x'
- NEW $SERVERMYSQLMERGE = '0' # '0' or '1'
- UPDATE create_sql_query_events_from_range_year_month with MERGE when $SERVERMYSQLMERGE = 1 for much faster year and quarter statistics
ASNMTAP::Asnmtap::Plugins
- NEW create_NCPL_weblogic_configuration_for_SNMP.pl
- NEW create_weblogic_configuration_database_with_SNMP.pl
- NEW create_weblogic_configuration_database_with_SNMP.SQL
ASNMTAP::Asnmtap::Plugins::Mail.pm
- FIX regarding MIME-Encoding '7bit' and code optimalisation
- NEW MIME-Encoding: '8bit', 'binhex', 'binary', 'x-gzip64', 'x-uu' & 'x-uuencode'
- overview MIME-Encoding: '7bit', '8bit', 'quoted-printable', 'base64', 'binhex', 'binary', 'x-gzip64', 'x-uu' & 'x-uuencode'
ASNMTAP::Asnmtap::Plugins::Nagios
- NEW check_network_interface_status.pl
- NEW snmptt_traps_remove_pending_and_duplicated.pl
ASNMTAP::Asnmtap::SOAP.pm
- NEW added basic authentication and credentials
- NEW added soapaction and readable
- UPDATE advanced debug information
- UPDATE making rsync version 2.6.7
/applications/bin/
- UPDATE generateCollectorDaemonSchedulingReports.sh
- UPDATE generateReports.sh
- UPDATE holidayBundleSetDowntimes.sh
/applications/sbin/
- NEW bash_stop_root.sh
- UPDATE perfparse_crontab.sh
/plugins/templates/
- UPDATE check_MySQL-database-replication.pl
ASNMTAP::Asnmtap
- replace '#!/usr/bin perl' with '#!/usr/local/bin/perl'
ASNMTAP::Asnmtap::Applications
- FIX <\\/embed> added
- FIX verify empty cgisess file at get_session_param () used by archive.pl
- added Birthday, Firework, Halloween, Snowflake, Valentine, ... for view '/asnmtap/nav/index' or '/asnmtap/nav/test'
NEW applications/htmlroot/JSFX_Browser.js
NEW applications/htmlroot/JSFX_Falling.js
NEW applications/htmlroot/JSFX_Fireworks.js
NEW applications/htmlroot/JSFX_Fireworks2.js
- NEW timeperiods.pl
ASNMTAP::Asnmtap::Plugins and ASNMTAP::Asnmtap::Plugins::WebTransact
- FIX debug information must be into the debug file '*.html' or '*.html-KnownError' but never into both
- added info regarding keep_alive and SSL session resume
- added do not proxy requests to the given domains. Calling no_proxy without any domains clears the list of domains.
ASNMTAP::Asnmtap::Plugins::Nagios
- NEW check_fs-stat.pl
ASNMTAP::Asnmtap::Plugins::SOAP
- add TYPE_ERROR_RETURN
ASNMTAP::Asnmtap::Plugins::WebTransact & runCmdOnDemand.pl
- ADDED remove password from Basic Authentication URL before putting into database!
Version 3.000.012, 2006/12/20, Central and Distributed support
- added common variable TYPEMONITORING to Asnmtap.cnf
fixRights.sh
- updated: script om rechten (chmod en chown) te zetten
Makefile.PL
- version update CPAN 1.8802 & CPANPLUS 0.076
- version update ExtUtils::MakeMaker 6.31
- version update Module::AutoInstall 1.03
- replace round(avg(duration), 2) with round(avg(time_to_sec(duration)), 2) because of wrong averages
display.pl
- possibility for sound on/off
- onderdrukking ledige groepen in full view
- vermelden op welke probe een test wordt uitgevoerd
- onderdrukken niet persistent downtimes in condenced view
- mask password for '--dnPass=', used by check_template-ldap.pl
- environment icons, exclaim popup window for plugins and comments
- 'In Progress'-animated icon replaced with 'In Progress'-static icon for faster display!
- de debugrapporten onderaan de view enkel aanklikbaar maken als de file via rsync al aanwezig is op het moment van de display generatie, ter voorkoming van 404 errors.
- add console messages: 'No Monitored Applications', 'All Monitored Applications are OK', '..., probably collector/config problems!' & , '..., probably database problems!'
displayDaemons.pl
- add 'ServerID' into general view
detailedStatisticsReportGenerationAndCompareResponsetimeTrends.pl
- add a checkbox, to choose output destination: HTML/PDF
getArchivedReport.pl & getArchivedResults.pl
- YYYY/MM/DD notatie met voorloopnullen voor maand en dag
generateConfig.pl
- check for 'help plugin filenames' without plugin reference
- check for plugins without or with missing 'help plugin filename'
- looking after existing plugins that are not defined into the database plugins
- verify that the defined plugins into the table plugins, exists and are executable
- generate automatic the Rsync Mirror Distributed & Failover Scripts / Collector Daemon
generateReports.pl
ATTENTION --> - tested with HTMLDOC v1.8.27 and added --user-password password support
- een plugin die disabled is waarvoor een rapport gevraagd wordt niet uitvoeren
- specify F for --daysAfter means that the specified date will be used as the reportdate
generateReports.pl & generateCollectorDaemonSchedulingReports.pl
- ... already generated / will be generated
- ... generated / generation failed
generatedReports.pl, plugins & reports.pl
`trendline` smallint(6) NOT NULL default '0',
+ `percentage` tinyint(1) NOT NULL default '25',
+ `tolerance` tinyint(1) NOT NULL default '5',
`step` smallint(6) NOT NULL default '0',
...
Version 3.000.009, 2006/06/01, ASNMTAP::Asnmtap::Plugins::WebTransact
- RFC 1738 optimalisations
- add '500 SSL negotiation failed'
- add Perfdata_Label => 'IMAGE URL' to _download_images()
ASNMTAP::Asnmtap::Applications
- email SUBJECT changed to Display/Collector for the 'Application Monitoring'@HOSTNAME: ...
NPTest, v1.11
- Will die if signal received from a testCmd
archiver.pl
- FIX First day current week epoch date
command.pl
- FIX regarding date.utc() - The month (0=Jan - 11=Dec)
- replaced 'suspentionDate.substring(5, 7);' with 'suspentionDate.substring(5, 7) - 1;'
generateCollectorDaemonSchedulingReports.pl
- NEW, generating automatically Collector Daemon Scheduling PDF Reports
- http://asnmtap.citap.be/results/_ASNMTAP/reports/yyyymmdd-collectorDaemonSchedulingReports.pl-_ASNMTAP-FQDN-Daily.pdf
database asnmtap, table plugins and crontab
- `arguments` from varchar(100) to varchar(254)
- `argumentsOndemand` from varchar(100) to varchar(254)
Version 3.000.008, 2006/05/01, ASNMTAP::Asnmtap::Plugins::Mail
- add 7bit mime decoding
ASNMTAP::Asnmtap::Plugins::WebTransact
- making W3C XHTML compatible
- add gzip decompression
- add Keep-Alive support for HTTP/1.1
Tested on:
- Cygwin
- Solaris 2.8-2.9
- Freebsd 6.1
- Linux 2.4.21-37.EL (Centos 3.x)
- Linux 2.6.9-22.0.2.EL (Centos 4.x)
Version 3.000.005, 2006/02/26
- check_MySQL-database-replication.pl (MySQL database replication)
- Bit::Vector 6.3
- Date::Calc 5.4
- Bundle::DBI
- Bundle::DBD::mysql
- ASNMTAP::Time
- Date::Calc instead of unix data command
- Making ASNMTAP CPAN module perl 5.8.0, 5.8.5 and 5.8.6 compatible
For perl versions before 5.8.5, then you must change into Asnmtap.cnf from 'CAPTUREOUTPUT 1' to 'CAPTUREOUTPUT 0' !!!
- ASNMTAP::Asnmtap::getOptionsType() added
- ASNMTAP CPAN module ASNMTAP::Asnmtap::Plugins::Modem added
All : IO::Handle 1.20
ASNMTAP Web Access is now possible
----------------------------------
1) Server Administrator at http://asnmtap.citap.com/asnmtap/cgi-bin/sadmin/index.pl
- Servers (to define the different application monitoring servers)
- Pagedirs (where the Display writes the different views)
- Resultdirs (where the Collector writes the returned data from a plugin)
- Display Groups (to define the group titles that are used by the Display)
- Display Daemons (to define the different daemons used for the Display)
- Collector Daemons (to define the different daemons used for the Collector)
- Plugins (to define the plugins that are executed by the Collector)
- Views (to define the different views used by the Display daemons)
- Crontabs (to define the different crontabs used by the Collector daemons)
Perfparse integration
---------------------
download latest snapshot from http://wiki.perfparse.org/cvs_snapshots/
bzip2 -d perfparse-06-mm-dd.tar.bz2
tar -xvf perfparse-06-mm-dd.tar
cd perfparse-all
./configure --prefix=/opt/asnmtap/perfparse --with-imagedir=/opt/asnmtap/applications/htmlroot/img/ --with-cgidir=/opt/asnmtap/applications/htmlroot/cgi-bin --with-http_image_path=/asnmtap/img --with-data-source=asnmtap
make
make install-strip
SNMPTT integration
------------------
Install net-snmp 5.4.x
... TODO ... NO PART OF NORMAL SETUP ...
MySQL 5.0.x
SQLyog -> Db -> Import from SQL Statements ... -> \opt\asnmtap-3.001.xxx\plugins\templates\snmptt\snmptt-3.002.003-v5.0.x.sql
SQLyog -> Db -> Import from SQL Statements ... -> \opt\asnmtap-3.001.xxx\plugins\templates\snmptt\create_weblogic_configuration_database_with_SNMP-3.002.003_mysql-v5.0.x.SQL
or
mysql -u root -p < /opt/asnmtap/plugins/templates/snmptt/snmptt-3.002.003-v5.0.x.sql
mysql -u root -p < /opt/asnmtap/plugins/templates/snmptt/create_weblogic_configuration_database_with_SNMP-3.002.003_mysql-v5.0.x.SQL
... TODO ... NO PART OF NORMAL SETUP ...
NagTrap integration
-------------------
... TODO ... NO PART OF NORMAL SETUP ...
more /opt/asnmtap/applications/htmlroot/snmptraps/.htaccess
AuthName "CITAP's Nagios Access"
Changes History of this package
README Get you started with this package
MANIFEST This file
MANIFEST.SKIP MANIFEST.SKIP file
AUTHORS Authors File
INSTALL Installation DOC
META.yml Module meta-data (added by MakeMaker)
Makefile.PL Makefile generator
Asnmtap.cnf General config file for ASNMTAP
fixRights.sh Fix Rights
autoinstall.sh Auto Install
applications/etc/.exists
applications/htmlroot/nav/.exists
applications/slave/.exists
applications/master/.exists
applications/tmp/.exists
t/Asnmtap/Plugins.t
t/Asnmtap/Plugins/IO.t
t/Asnmtap/Plugins/Mail.t
t/Asnmtap/Plugins/Modem.t
t/Asnmtap/Plugins/Nagios.t
t/Asnmtap/Plugins/SOAP.t
t/Asnmtap/Plugins/XML.t
t/Asnmtap/Plugins/WebTransact.t
t/Templates/Plugins/check_dummy.t
t/Templates/Plugins/check_MySQL-database-replication.t
t/Templates/Plugins/check_template.t
t/Templates/Plugins/IO/check_template-IO.t
t/Templates/Plugins/Mail/check_template-mail.t
t/Templates/Plugins/Mail/check_template-mail-fingerprint-xml.t
t/Templates/Plugins/Mail/check_template-mail-xml-fingerprint-xml.t
t/Templates/Plugins/Mail/check_template-mail-xml-fingerprint-xml-monitoring.t
t/Templates/Plugins/Mail/check_template-mail-xml-fingerprint-xml-monitoring-1.1.t
t/Templates/Plugins/Mail/check_template-mail-xml.t
t/Templates/Plugins/Modem/check_template-ras.t
t/Templates/Plugins/Nagios/check_template-ftp.t
t/Templates/Plugins/Nagios/check_template-ldap.t
t/Templates/Plugins/Nagios/check_template-nagios.t
t/Templates/Plugins/Nagios/check_xml-monitoring.t
t/Templates/Plugins/Nagios/check_xml.t
t/Templates/Plugins/SOAP/check_template-SOAP.t
t/Templates/Plugins/WebTransact/check_template-WebTransact-Perfdata.t
t/Templates/Plugins/WebTransact/check_template-WebTransact-with-client-authorization.t
t/Templates/Plugins/WebTransact/check_template-WebTransact-with-client-certificate.t
t/Templates/Plugins/WebTransact/check_template-WebTransact-XML-Monitoring.t
t/Templates/Plugins/WebTransact/check_template-WebTransact-XML-Monitoring-1.1.t
t/Templates/Plugins/WebTransact/check_template-WebTransact-XML-Monitoring-1.2.t
t/Templates/Plugins/WebTransact/check_template-WebTransact-XML-Cactus-parser.t
t/Templates/Plugins/WebTransact/check_template-WebTransact-XML.t
t/Templates/Plugins/WebTransact/check_template-WebTransact.t
t/Templates/Plugins/XML/check_template-XML.t
applications/htmlroot/cgi-bin/admin/countries.pl
applications/htmlroot/cgi-bin/admin/crontabs.pl
applications/htmlroot/cgi-bin/admin/generateConfig.pl
applications/htmlroot/cgi-bin/admin/holidays.pl
applications/htmlroot/cgi-bin/admin/holidaysBundle.pl
applications/htmlroot/cgi-bin/admin/index.pl
applications/htmlroot/cgi-bin/admin/languages.pl
applications/htmlroot/cgi-bin/admin/plugins.pl
applications/htmlroot/cgi-bin/admin/reports.pl
applications/htmlroot/cgi-bin/admin/reports_perfdata.pl
applications/htmlroot/cgi-bin/admin/resultsdirs.pl
applications/htmlroot/cgi-bin/admin/timeperiods.pl
applications/htmlroot/cgi-bin/admin/users.pl
applications/htmlroot/cgi-bin/admin/views.pl
applications/htmlroot/cgi-bin/moderator/collectorCrontabSchedulingReports.pl
applications/htmlroot/cgi-bin/moderator/collectorDaemonSchedulingReports.pl
applications/htmlroot/cgi-bin/moderator/comments.pl
applications/htmlroot/cgi-bin/moderator/downtimes.pl
applications/htmlroot/cgi-bin/moderator/generateCollectorCrontabSchedulingReport.pl
applications/htmlroot/img/blue-unstable.gif
applications/htmlroot/img/cal.gif
applications/htmlroot/img/clear.gif
applications/htmlroot/img/clear-ack.gif
applications/htmlroot/img/clear-unstable.gif
applications/htmlroot/img/cupido.gif
applications/htmlroot/img/daemonReload.gif
applications/htmlroot/img/daemonRestart.gif
applications/htmlroot/img/daemonStart.gif
applications/htmlroot/img/daemonStop.gif
applications/htmlroot/img/data.gif
applications/htmlroot/img/down.gif
applications/htmlroot/img/exclaim.gif
applications/htmlroot/img/fw0/0.gif
applications/htmlroot/img/fw0/1.gif
applications/htmlroot/img/fw0/2.gif
applications/htmlroot/img/fw0/3.gif
applications/htmlroot/img/fw0/4.gif
applications/htmlroot/img/fw0/5.gif
applications/htmlroot/img/fw0/6.gif
applications/htmlroot/img/fw0/7.gif
applications/htmlroot/snmptraps/include/js/overlib.js
applications/htmlroot/snmptraps/include/xml/language/DE/error.xml
applications/htmlroot/snmptraps/include/xml/language/DE/main.xml
applications/htmlroot/snmptraps/include/xml/language/EN/error.xml
applications/htmlroot/snmptraps/include/xml/language/EN/main.xml
applications/htmlroot/sound/attention.wav
applications/htmlroot/sound/critical.wav
applications/htmlroot/sound/nodata.wav
applications/htmlroot/sound/unknown.wav
applications/htmlroot/sound/warning.wav
applications/sbin/bash_stop_root.sh
applications/sbin/perfparse_asnmtap_pulp_command.pl
applications/sbin/perfparse_crontab.sh
applications/sbin/perfparse_crontab_failed.sh
applications/sbin/perfparse_debug.sh
applications/sbin/purge_table.pl
applications/sbin/sshWrapperASNMTAP.pl
applications/tools/mysql/asnmtap-3.002.003_mysql-v5.0.x.sql
applications/tools/mysql/asnmtap-3.002.003_mysql-v5.0.x-trigger-events.sql
applications/tools/mysql/asnmtap-3.002.003_mysql-v5.0.x-trigger-eventsUpdate.sql
applications/tools/mysql/asnmtap-3.002.003_mysql-v5.0.x-trigger-eventsDisplayData.sql
applications/tools/mysql/asnmtap-3.002.003-distributed_mysql-v5.0.x.sql
applications/tools/mysql/asnmtap-3.002.003-database-schema.png
applications/tools/mysql/MySQLBackup.sh
applications/tools/resources/CalendarPopup-combined-compact.js
applications/tools/resources/CalendarPopup-combined.js
applications/tools/templates/CollectorCT-template.sh
applications/tools/templates/DisplayCT-template.sh
applications/tools/templates/FOOTER.html
applications/tools/templates/HEADER.html
plugins/nagios/templates/xml/nagios-1.0.xml-dtd
plugins/jUnit/check_jUnit.pl
plugins/jUnit/create_ASNMTAP_jUnit_configuration_for_jUnit.pl
plugins/snmptt/check_SNMPTT_oracle.pl
plugins/snmptt/check_SNMPTT_probe.pl
plugins/snmptt/check_SNMPTT_weblogic.pl
plugins/snmptt/create_ASNMTAP_weblogic_configuration_for_SNMP.pl
plugins/snmptt/create_NCPL_weblogic_configuration_for_SNMP.pl
plugins/snmptt/create_weblogic_configuration_database_with_SNMP.pl
plugins/snmptt/create_weblogic_configuration_for_SNMPTT.pl
plugins/snmptt/snmptt_traps_remove_pending_and_duplicated.pl
plugins/templates/check_dummy.pl
plugins/templates/check_file-counter.pl
plugins/templates/check_MySQL-database-replication.pl
plugins/templates/check_sendAndReceiveMail.pl
plugins/templates/check_template.pl
plugins/templates/check_template-cluster.pl
plugins/templates/check_template-IO.pl
plugins/templates/check_template-mail.pl
plugins/templates/check_template-mail-fingerprint-xml.pl
plugins/templates/check_template-mail-xml-fingerprint-xml.pl
plugins/templates/check_template-mail-xml-fingerprint-xml-monitoring.pl
plugins/templates/check_template-mail-xml-fingerprint-xml-monitoring-1.1.pl
plugins/templates/check_template-mail-xml.pl
plugins/templates/check_template-mail-fingerprint.pl
plugins/templates/check_template-modem.pl
plugins/templates/check_template-ras.pl
plugins/templates/check_template-SOAP.pl
plugins/templates/check_template-SNMPTT.pl
plugins/templates/check_template-WebTransact.pl
plugins/templates/check_template-WebTransact-Perfdata.pl
plugins/templates/check_template-WebTransact-with-client-authorization.pl
plugins/templates/check_template-WebTransact-with-client-certificate.pl
plugins/templates/check_template-WebTransact-XML.pl
plugins/templates/check_template-WebTransact-XML-Cactus-parser.pl
plugins/templates/check_template-WebTransact-XML-Monitoring.pl
plugins/templates/check_template-WebTransact-XML-Monitoring-1.1.pl
plugins/templates/check_template-WebTransact-XML-Monitoring-1.2.pl
plugins/templates/check_template-XML.pl
plugins/templates/dtd/email-upgrade-1.0.dtd
plugins/templates/dtd/FingerprintEmail-1.0.dtd
plugins/templates/dtd/Monitoring-1.0.dtd
plugins/templates/dtd/Monitoring-1.1.dtd
plugins/templates/dtd/Monitoring-1.2.dtd
plugins/templates/dtd/Fingerprint-1.0-and-monitoring-1.0-xml-validator.html
plugins/templates/dtd/Fingerprint-1.0-and-monitoring-1.1-xml-validator.html
plugins/templates/dtd/Fingerprint-1.0-and-monitoring-1.2-xml-validator.html
plugins/templates/jUnit/create_ASNMTAP_jUnit_configuration_for_jUnit-3.002.003_mysql-v5.0.x.SQL
plugins/templates/snmptt/create_weblogic_configuration_database_with_SNMP-3.002.003_mysql-v5.0.x.SQL
plugins/templates/snmptt/snmptt-bea-weblogic.conf
plugins/templates/snmptt/snmptt-oracle.conf
plugins/templates/snmptt/snmptt-3.002.003-v5.0.x.sql
plugins/templates/snmptt/snmptt.ini
plugins/templates/xml/email-upgrade-1.0.xml
plugins/templates/xml/FingerprintEmail-1.0.xml
plugins/templates/xml/Monitoring-1.0.xml
plugins/templates/xml/Monitoring-1.0-doNotValidate.xml
plugins/templates/xml/Monitoring-1.0-errorParsing.xml
Makefile.PL view on Meta::CPAN
[ '/etc/ppp/resolv/ASNMTAP', 'R' ],
[ '/usr/bin/plog', 'R' ],
[ '/usr/bin/poff', 'R' ],
[ '/usr/bin/pon', 'R' ],
]
],
[ '*001104', 'SOAP support', 'ASNMTAP::Asnmtap::Plugins::SOAP', { 'ASNMTAP::Asnmtap::Plugins' => '*0011', 'SOAP::Lite' => '0.710.08', 'WSRF::Lite' => '0.8.2.7', 'DateTime' => '0.37', 'DateTime::Format::Epoch' => '0.10', 'DateTime::For...
[ '*001105', 'WebTransact support', 'ASNMTAP::Asnmtap::Plugins::WebTransact', { 'ASNMTAP::Asnmtap::Plugins' => '*0011', 'Bundle::LWP' => '1.11', 'CGI' => '3.37', 'Compress::Zlib' => '2.010', 'Crypt::SSLeay' => '0.56', 'Digest::MD5' => '2.36', 'IO::...
[ '*001106', 'XML support', 'ASNMTAP::Asnmtap::Plugins::XML', { 'ASNMTAP::Asnmtap::Plugins' => '*0011', 'XML::Parser' => '2.36', 'XML::LibXML' => '1.70', 'XML::Simple' => '2.18' }, 2, [], [] ],
[ '*001199', 'Testing Templates', 'ASNMTAP::Asnmtap::Plugins::NPTest', { 'ASNMTAP::Asnmtap::Plugins' => '*0011', 'Cwd' => '3.25', 'Data::Dumper' => '2.121', 'File::Basename' => '2.73', 'IO' => '1.23' }, 1, [], [] ],
[ '', 'unbless data structure', 'Data::Structure::Util', { 'Test::Builder::Tester' => '1.13', 'Test::Pod' => '1.22', 'Clone' =>'0.18', 'File::Find::Rule' => '0.28', 'Data::Structure::Util' => '0.11' }, 4, [], [] ],
[ '', 'FTP template', 'check_template-ftp.pl', { 'Net::FTP' => '2.75' }, 4, [], [] ],
[ '', 'LDAP template', 'check_template-ldap.pl', { 'Convert::ASN1' => '0.19', 'URI::ldap' => '1.11', 'Digest::MD5' => '2.36', 'XML::Parser' => '2.36', 'Net::LDAP' => '0.34' }, 4, [], [] ],
[ '', 'MySQL template', 'check_MySQL-database-replication.pl', { 'Bit::Vector' => '6.3', 'Date::Calc' => '5.4', 'Bundle::DBI' => '1.604', 'Bundle::DBD::mysql' => '4.004', 'DBIx::Log4perl' => '0.18', 'Log::Log4perl' => '1.26' }, 4, []...
[ '', 'SFTP template', 'check_template-sftp.pl', { 'Net::SFTP::Foreign' => '1.61' }, 4, [], [] ]
);
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
my %has_module_cache = ();
# Allow us to suppress all program installation with the -n (library only) option.
# This is for those that don't want to mess with the configuration section of this file.
use Getopt::Std;
- , 'Log::Dispatch' => '2.26'
- , 'Log::Dispatch::FileRotate' => '1.19'
- , 'Log::Log4perl::Layout::XMLLayout' => 'x.x'
Version 3.002.003, 2011/xx/yy, by Alex Peeters
ASNMTAP
- Nagios.pm
BUGFIX: convert_from_KB_to_metric for GB
BUGFIX: DESTROY created new reference to dead object 'ASNMTAP::Asnmtap::Plugins::Nagios' during global destruction.
- WebTransact.pm
UPDATE: added Content_Type: 'multipart/form-data' for qs-fixed
- change code to use 'perfdata'
- UPDATE: asnmtap-3.002.003_mysql-v5.0.x-trigger-events.sql
- UPDATE: asnmtap-3.002.003_mysql-v5.0.x-trigger-eventsUpdate.sql
- runCmdOnDemand.pl & WebTransact.pm
- replace <BODY onload="..."> with <BODY>
- SOAP.pm
NEW: encodingStyle
NEW: error 'Missing SOAP Envelope or Body'
UPDATE soapaction
- create_ASNMTAP_weblogic_configuration_for_SNMP.pl
UPDATE: added status to e-mail subject
- XML::Simple: 2.14
ASNMTAP::Asnmtap::Plugins::NPTest
- Cwd: 3.25
- Data::Dumper: 2.12
- File::Basename: 2.73
HOWTO:
1) How can i unbless a data structure:
use Data::Structure::Util qw(unbless);
unbless($WSListResults);
Dependencies Data::Structure::Util
- Clone
- File::Find::Rule
- Test::Builder::Tester
- Test::Pod
applications/Applications.cnf view on Meta::CPAN
#</ICONS>
#<SOUND>
# 0 attention.wav
# 1 warning.wav
# 2 critical.wav
# 3 unknown.wav
# 4 attention.wav
# 5 attention.wav
# 6 attention.wav
# 7 nodata.wav
# 8 attention.wav
# 9 warning.wav
#</SOUND>
# -----------------------------------------------------------------------
# DON'T TOUCH BELOW HERE UNLESS YOU KNOW WHAT YOU ARE DOING!
# -----------------------------------------------------------------------
#<SUBDIR>
# CONFIG config
applications/Applications.cnf view on Meta::CPAN
# 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 print_help ();
sub print_usage ();
Getopt::Long::Configure('bundling');
GetOptions (
"A:s" => \$opt_A, "archivelist:s" => \$opt_A,
"c:s" => \$opt_c, "cgisess:s" => \$opt_c,
"r:s" => \$opt_r, "reports:s" => \$opt_r,
"d:s" => \$opt_d, "database:s" => \$opt_d,
"y:s" => \$opt_y, "yearsago:s" => \$opt_y,
"f:s" => \$opt_f, "force:s" => \$opt_f,
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
"D:s" => \$opt_D, "debug:s" => \$opt_D,
"V" => \$opt_V, "version" => \$opt_V,
"h" => \$opt_h, "help" => \$opt_h
);
if ($opt_V) { print_revision($PROGNAME, $version); exit $ERRORS{OK}; }
if ($opt_h) { print_help(); exit $ERRORS{OK}; }
applications/archive.pl view on Meta::CPAN
$doReports = ($opt_r eq 'F') ? 0 : 1;
} else {
usage("Invalid reports: $opt_r\n");
}
}
if ($opt_d) {
if ($opt_d eq 'F' || $opt_d eq 'T') {
$doDatabase = ($opt_d eq 'F') ? 0 : 1;
} else {
usage("Invalid database: $opt_d\n");
}
}
if ($opt_y) {
if ($opt_y eq 'c') {
$doYearsAgo = 0;
} elsif ($opt_y >= 0 and $opt_y < 10) {
$doYearsAgo = $opt_y;
} else {
usage("Invalid yearsago: $opt_y\n");
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
my ($localYear, $localMonth, $currentYear, $currentMonth, $currentDay, $currentHour, $currentMin, $currentSec) = ((localtime)[5], (localtime)[4], ((localtime)[5] + 1900), ((localtime)[4] + 1), (localtime)[3,2,1,0]);
my $solvedDate = "$currentYear-$currentMonth-$currentDay";
my $solvedTime = "$currentHour:$currentMin:$currentSec";
my $solvedTimeslot = timelocal($currentSec, $currentMin, $currentHour, $currentDay, $localMonth, $localYear);
my $sqlUPDATE = 'UPDATE ' .$SERVERTABLCOMMENTS. ' SET replicationStatus="U", problemSolved="1", solvedDate="' .$solvedDate. '", solvedTime="' .$solvedTime. '", solvedTimeslot="' .$solvedTimeslot. '" where catalogID="'. $CATALOGID. '" and problemS...
print "$sqlUPDATE\n" if ($debug);
$dbh->do ( $sqlUPDATE ) or $rv = errorTrapDBI("Cannot dbh->do: $sqlUPDATE", $debug) unless ( $debug );
$dbh->disconnect or $rv = errorTrapDBI("Sorry, the database was unable to add your entry.", $debug);
}
}
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
sub checkTableDBI {
my ($dbh, $database, $table, $op, $msg_type, $msg_text) = @_;
print "-> <$database.$table>, <$op>, <$msg_type>, <$msg_text>\n" if ($debug);
my ($Table, $Op, $Msg_type, $Msg_text) = '';
my $rv = 1;
my $sql = "check table $table";
my $sth = $dbh->prepare($sql) or $rv = errorTrapDBI("dbh->prepare: $sql", $debug);
$rv = $sth->execute() or $rv = errorTrapDBI("sth->execute: $sql", $debug) if $rv;
if ( $rv ) {
while (my $ref = $sth->fetchrow_hashref()) {
$Table = $ref->{Table};
$Op = $ref->{Op};
$Msg_type = $ref->{Msg_type};
$Msg_text = $ref->{Msg_text};
print "<- <$Table>, <$Op>, <$Msg_type>, <$Msg_text>\n" if ($debug);
}
$sth->finish() or $rv = errorTrapDBI("sth->finish", $debug);
$rv = ($rv and "$database.$table" eq $Table and $op eq $Op and $msg_type eq $Msg_type and $msg_text eq $Msg_text) ? 1 : 0;
}
return ($rv);
}
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
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 {
applications/archive.pl view on Meta::CPAN
} 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);
}
}
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
sub doBackupCsvSqlErrorWeekDebugReport {
my ($RESULTSPATH, $DEBUGDIR, $REPORTDIR, $gzipEpoch, $removeAllNokEpoch, $removeGzipEpoch, $removeDebugEpoch, $removeReportsEpoch, $removeWeeksEpoch, $firstDayOfWeekEpoch, $yesterdayEpoch, $currentEpoch) = @_;
print EMAILREPORT "\nDo backup, csv, sql, error, week, and debug files:\n--------------------------------------------------\n" unless ( $debug );
my ($darchivelist, $dtest, $pagedir, $ttest, $command, $rvOpendir, $path, $filename, $debugPath, $debugFilename, $reportPath, $reportFilename, $weekFilename);
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 {
applications/archive.pl view on Meta::CPAN
print "ASNMTAP Archiver for the '$APPLICATION'
-A, --archivelist=<filename>
FILENAME : filename from the archivelist for the html output loop (default undef)
-c, --cgisess=F|T
F(alse) : don't remove the cgisess files
T(true) : remove the cgisess files (default)
-r, --reports=F|T
F(alse) : don't backup Csv, Sql, Error, Week, Debug reports
T(true) : remove backup Csv, Sql, Error, Week, Debug reports (default)
-d, --database=F|T
F(alse) : don't archive the '$SERVERTABLEVENTS' and '$SERVERTABLCOMMENTS' tables (default)
T(true) : archive the '$SERVERTABLEVENTS' and '$SERVERTABLCOMMENTS' tables
-y, --yearsago=<years ago>
YEARS AGO: c => current year or 1..9 => the number of years ago that the '$SERVERTABLEVENTS'
and '$SERVERTABLCOMMENTS' tables need to be created
-f, --force=F|T
F(alse) : don't force CSV import (default)
T(true) : force CSV import
-D, --debug=F|T|L
F(alse) : screendebugging off (default)
applications/bin/generateReports.pl view on Meta::CPAN
$urlAccessParametersYear = "inputType=year&year=$yearReportYear";
}
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 = ();
if ( $rv ) {
if ( $sth->rows ) {
while( $sth->fetch() ) {
$emailMessage = ($debug >= 2) ? "--> $id, $catalogID, $uKey, $reportTitle, $periode, $status, $errorDetails, $bar, $hourlyAverage, $dailyAverage, $showDetails, $showComments, $showPerfdata, $showTop20SlowTests, $printerFriendlyOutput, $form...
my ($urlAccessParameters, $periodeMessage);
if ($periode eq 'D') {
$periodeMessage = "Day_$arrayDays[$dayReportDayOfWeek]";
$emailMessage .= " -> Daily\n" if ($debug >= 2);
$urlAccessParameters = $urlAccessParametersDay if (defined $urlAccessParametersDay);
} elsif ($periode eq 'W') {
$periodeMessage = "Week_$weekReportWeek";
$emailMessage .= " -> Weekly\n" if ($debug >= 2);
$urlAccessParameters = $urlAccessParametersWeek if (defined $urlAccessParametersWeek);
applications/bin/generateReports.pl view on Meta::CPAN
$urlAccessParameters .= "&uKey1=$uKey&uKey2=none&uKey3=none";
$urlAccessParameters .= "&detailed=on";
$urlAccessParameters .= "&statuspie=on" if($status);
$urlAccessParameters .= "&errorpie=on" if($errorDetails);
$urlAccessParameters .= "&bar=on" if($bar);
$urlAccessParameters .= "&hourlyAvg=on" if($hourlyAverage);
$urlAccessParameters .= "&dailyAvg=on" if($dailyAverage);
$urlAccessParameters .= "&timeperiodID=$timeperiodID";
$urlAccessParameters .= "&details=on" if($showDetails);
$urlAccessParameters .= "&comments=on" if($showComments);
$urlAccessParameters .= "&perfdata=on" if($showPerfdata);
$urlAccessParameters .= "&topx=on" if($showTop20SlowTests);
$urlAccessParameters .= "&pf=on" if($printerFriendlyOutput);
$sql = "select test, resultsdir from $SERVERTABLPLUGINS where catalogID = '$catalogID' and ukey = '$uKey' order by uKey";
my $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;
if ( $rv ) {
($test, $resultsdir) = $sth->fetchrow_array() or $rv = DBI_error_trap(*EMAILREPORT, "Cannot sth->execute: $sql", \$logger, $debug) if $rv;
$sth->finish() or $rv = DBI_error_trap(*EMAILREPORT, "Cannot sth->execute: $sql", \$logger, $debug);
applications/bin/generateReports.pl view on Meta::CPAN
}
}
if ( $debug ) { print $emailMessage; } else { print EMAILREPORT $emailMessage; }
}
}
$sth->finish() or $rv = DBI_error_trap(*EMAILREPORT, "Cannot sth->finish: $sql", \$logger, $debug);
}
$dbh->disconnect or $rv = DBI_error_trap(*EMAILREPORT, "Sorry, the database was unable to add your entry.", \$logger, $debug);
my $teller = 0;
$emailMessage .= "\n";
foreach my $command (@commands) {
if ($HTMLTOPDFPRG eq 'HTMLDOC') {
$ENV{HTMLDOC_NOCGI} = 1;
select(STDOUT); $| = 1;
}
my ($status, $stdout, $stderr) = call_system ("$command", $debug);
applications/bin/holidayBundleSetDowntimes.pl view on Meta::CPAN
my $logger = LOG_init_log4perl ( 'holiday::bundle::set::downtimes', undef, $debug );
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
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/holidayBundleSetDowntimes.pl view on Meta::CPAN
my $message = "Geachte, Cher,\n\n$holidayBundles\n-- Administrator\n\n$APPLICATION\n$DEPARTMENT\n$BUSINESS\n";
my $returnCode = sending_mail ( $SERVERLISTSMTP, $sendEmailTo, $SENDMAILFROM, $subject, $message, $debug );
print "Problem sending email to the '$APPLICATION' members\n" unless ( $returnCode );
}
}
}
$sth->finish() or $rv = DBI_error_trap(*EMAILREPORT, "Cannot sth->finish: $sql", \$logger, $debug);
}
$dbh->disconnect or $rv = DBI_error_trap(*EMAILREPORT, "Sorry, the database was unable to add your entry.", \$logger, $debug);
}
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
my ($rc) = send_email_report (*EMAILREPORT, $emailReport, $rvOpen, $prgtext, $debug);
exit;
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
sub print_usage () {
applications/bin/importDataThroughCatalog.pl view on Meta::CPAN
$type = 2;
} elsif ($opt_T eq 'ALL') {
$type = 3;
} else {
usage("Invalid type: $opt_T\n");
}
}
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
my $logger = LOG_init_log4perl ( 'import::data::through::catalog', undef, $boolean_debug_all );
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
my $boolean_daemonQuit = 0;
my $boolean_signal_hup = 0;
my $boolean_daemonControl = !$booleanQuit;
my $pidfile = $PIDPATH .'/importDataThroughCatalog.pid';
# Init parameters
my ($rv, $dbh, $sth, $sql, $alarmMessage);
if ($mode eq 'D') {
printDebugAll ("Uitvoeren import data through catalog - : <$PROGNAME v$version pid: <$pidfile>");
unless (fork) { # unless ($pid = fork) {
unless (fork) {
# if ($boolean_daemonControl) { sleep until getppid == 1; }
printDebugAll ("Main daemon control loop for: <$PROGNAME v$version pid: <$pidfile>\n");
write_pid();
if ($boolean_daemonControl) {
printDebugAll (print "Set daemon catch signals for: <$PROGNAME v$version pid: <$pidfile>\n");
applications/bin/importDataThroughCatalog.pl view on Meta::CPAN
$currSecs = int((localtime)[0]);
} until ($currSecs < $prevSecs);
} until ($boolean_daemonQuit);
exit 0;
}
exit 0;
}
printDebugAll ("Einde ... import data through catalog - : <$PROGNAME v$version pid: <$pidfile>");
# if ($boolean_daemonControl) { waitpid($pid,0); }
} else {
my ($emailReport, $rvOpen) = init_email_report (*EMAILREPORT, 'importDataThroughCatalog.txt', $debug);
printDebugAll ("Start collector - : <$mode> <$PROGNAME v$version");
do_importDataThroughCatalog ();
printDebugAll ("Einde collector - : <$mode> <$PROGNAME v$version") if ($debug eq 'T');
my ($rc) = send_email_report (*EMAILREPORT, $emailReport, $rvOpen, $prgtext, $debug);
}
exit;
applications/bin/importDataThroughCatalog.pl view on Meta::CPAN
sleep 1;
$prevSecs = $currSecs;
$currSecs = int((localtime)[0]);
} until ($currSecs < $prevSecs);
unlink $pidfile;
printDebugAll (" Done");
$boolean_daemonQuit = 1;
use Sys::Hostname;
my $subject = "$prgtext\@". hostname() .": import data through catalog successfully stopped at ". get_datetimeSignal();
my $returnCode = sending_mail ( $SERVERLISTSMTP, $SENDEMAILTO, $SENDMAILFROM, $subject, $subject ."\n", 0 );
print "Problem sending email to the '$APPLICATION' server administrators\n" unless ( $returnCode );
exit 1;
}
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
sub signalHUP {
printDebugAll ("kill -HUP <$PROGNAME v$version pid: <$pidfile>");
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;
if ( $sth->rows ) {
while( $sth->fetch() ) {
print "- $catalogID, $catalogType, $databaseFQDN, $databasePort\n" if ($debug);
$catalog{$catalogID}{catalogType} = $catalogType;
$catalog{$catalogID}{databaseFQDN} = $databaseFQDN;
$catalog{$catalogID}{databasePort} = $databasePort;
}
}
$sth->finish() or $rv = DBI_error_trap(*EMAILREPORT, "Cannot sth->finish: $sql", \$logger, $debug);
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
# 5'- - - - - - - - - - - - - - - - - - - - - - - - - - - - -
importData (*EMAILREPORT, $dbhSOURCE, $dbh, 0, $SERVERTABLCRONTABS, "catalogID = '$catalogID'", 'lineNumber', 'uKey');
importData (*EMAILREPORT, $dbhSOURCE, $dbh, 0, $SERVERTABLVIEWS, "catalogID = '$catalogID'", 'uKey', 'displayDaemon');
# 6'- - - - - - - - - - - - - - - - - - - - - - - - - - - - -
importData (*EMAILREPORT, $dbhSOURCE, $dbh, 0, $SERVERTABLREPORTS, "catalogID = '$catalogID'", 'id');
importData (*EMAILREPORT, $dbhSOURCE, $dbh, 0, $SERVERTABLREPORTSPRFDT, "catalogID = '$catalogID'", 'uKey', 'metric_id');
}
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
$dbhSOURCE->disconnect or $rv = DBI_error_trap(*EMAILREPORT, "Sorry, the database was unable to add your entry.", \$logger, $debug);
}
}
}
$dbh->disconnect or $rv = DBI_error_trap(*EMAILREPORT, "Sorry, the database was unable to add your entry.", \$logger, $debug);
}
printDebugAll ("OUT: do_importDataThroughCatalog <$PROGNAME v$version pid: <$pidfile>");
}
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
sub importData {
my ($EMAILREPORT, $dbhSOURCE, $dbh, $replicationStatus, $table, $whereCLAUSE, @primaryKeys) = @_;
applications/bin/importDataThroughCatalog.pl view on Meta::CPAN
my $updateRecord = $sthVERIFY->fetchrow_array();
$sthVERIFY->finish() or $rv = DBI_error_trap(*EMAILREPORT, "Cannot sthVERIFY->finish: $sqlVERIFY", \$logger, $debug);
if ( $updateRecord ) {
$action = "UPDATE `$table` SET";
$where = $whereReplicationStatus;
} else {
$action = "INSERT INTO `$table` SET";
}
foreach my $databaseField ( @{$sthSOURCE->{NAME}} ) {
my $value = ( ( defined $ref->{$databaseField} ) ? $ref->{$databaseField} : '' );
$action .= " $table.$databaseField = \"$value\",";
}
chop $action if (defined $action);
my $sql = "$action $where";
print " - $sql\n" if ($debug);
($rv, undef, undef) = DBI_do ($rv, \$dbh, $sql, $alarm, \&DBI_error_trap, [*EMAILREPORT, "Cannot dbh->do: $sql"], \$logger, $debug);
if ( $rv and $replicationStatus ) {
$sql = "UPDATE `$table` SET replicationStatus = 'R' $whereReplicationStatus";
applications/collector-test.pl view on Meta::CPAN
$title =~ s/^[\[[\S+|\s+]*\]\s+]{0,1}([\S+|\s+]*)/$1/g;
$logging = $RESULTSPATH .'/'. $resultsdir .'/';
$httpdump = $RESULTSPATH .'/'. $resultsdir .'/'. $DEBUGDIR .'/';
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
$activationTimeslotPersistentFalse = ($activationTimeslotPersistentFalse < int($TactivationTimeslot)) ? $activationTimeslotPersistentFalse : int($TactivationTimeslot);
$suspentionTimeslotPersistentFalse = ($suspentionTimeslotPersistentFalse > int($TsuspentionTimeslot)) ? $suspentionTimeslotPersistentFalse : int($TsuspentionTimeslot);
}
}
}
$sth->finish() or $rv = errorTrapDBIdowntime($collectorlist, "Cannot sth->finish: $sql", \$logger, $debug) if $rv;
}
$dbh->disconnect or $rv = errorTrapDBIdowntime($collectorlist, "Sorry, the database was unable to add your entry.", \$logger, $debug);
} else {
$logger->info(" DBI_connect - Cannot connect to the database - alarm: $alarm - alarmMessage: $alarmMessage") if ( defined $logger and $logger->is_info() );
}
unless ( $firstRecordPersistentTrue and $firstRecordPersistentFalse ) {
my $currentDowntimeTimeslot = timelocal (0, (localtime)[1,2,3,4,5]);
print "$catalogID_uniqueKey\ncurrentTimeslot : $currentDowntimeTimeslot\n" if ($debug eq 'T');
unless ( $firstRecordPersistentTrue ) {
if ($debug eq 'T') {
print "activationTimeslotPersistentTrue : $activationTimeslotPersistentTrue\n";
print "suspentionTimeslotPersistentTrue : $suspentionTimeslotPersistentTrue\n";
applications/collector-test.pl view on Meta::CPAN
$queryMySQL = 1;
printDebugAll ("no TEST: call_system <$catalogID_uniqueKey><$command>") if ($debug eq 'T');
}
}
$action = call_system ($asnmtapEnv, $currentDate, $catalogID_uniqueKey, $catalogID, $uniqueKey, $resultsdir, $title, $command, $status, int($tinterval), $instability, $persistent, $downtime, $debug, $logging, $tlogging, $httpdump, $dumpht...
}
}
if ($doOffline or $downtime) {
print "Write 'Offline/No Test' status to mysql databases on: ", get_csvfiletime(), "\n" if ($debug eq 'T');
my ($startDate, $startTime, $endDate, $endTime, $msgCommand);
$startDate = get_csvfiledate();
$startTime = get_csvfiletime();
$endDate = $startDate;
$endTime = $startTime;
($msgCommand, undef) = split(/\.pl/, $command);
my $insertData = 1;
my $status = 'OFFLINE';
applications/collector-test.pl view on Meta::CPAN
if ( $boolean_perfParseInstalled ) {
if (defined $performanceData) {
my $perfParseTimeslot = get_timeslot ($currentDate);
my $perfParseCommand;
my $environment = (($system_action =~ /\-\-environment=([PASTDL])/) ? $1 : 'P');
my $eTitle = $title .' ('. $ENVIRONMENT{$environment} .')' if (defined $environment);
$eTitle .= ' from '. $catalogID;
if ( $perfParseMethode eq 'PULP' ) {
$perfParseCommand = "$APPLICATIONPATH/sbin/perfparse_asnmtap_pulp_command.pl $PREFIXPATH/log/perfdata-asnmtap.log \"$perfParseTimeslot\t$eTitle\t$catalogID_uniqueKey\t$outputData\t$dumphttpRename\t$performanceData\"";
} else {
$perfParseCommand = "printf \"%b\" \"$perfParseTimeslot\t$eTitle\t$catalogID_uniqueKey\t$outputData\t$dumphttpRename\t$performanceData\n\" | $PERFPARSEBIN/perfparse-log2mysql -c $PERFPARSEETC/$PERFPARSECONFIG";
}
if ($CAPTUREOUTPUT) {
use IO::CaptureOutput qw(capture_exec);
($stdout, $stderr) = capture_exec("$perfParseCommand");
} else {
system ("$perfParseCommand"); $stdout = $stderr = '';
}
applications/collector-test.pl view on Meta::CPAN
close(NOKDEBUG);
} else {
print "Cannot open $tlogging-nok.txt to print debug information\n";
}
}
}
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
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) {
while (my $ref = $sth->fetchrow_hashref()) {
$numbersEntryDBI++;
if ( $ref->{status} eq '<NIHIL>' or $ref->{status} eq 'OFFLINE' or $ref->{status} eq 'NO TEST' ) { $updateEntryDBI = 1; }
}
$insertEntryDBI = 1 unless ( $numbersEntryDBI );
printDebugAll ("query Entry DBI: # <$numbersEntryDBI> insert <$insertEntryDBI> change <$updateEntryDBI>") if ($debug eq 'T');
}
$sth->finish() or $rv = errorTrapDBI($currentDate, $catalogID_uniqueKey, $catalogID, $uniqueKey, $test, $title, $status, $startDate, $startTime, $endDate, $endTime, $duration, $statusMessage, $perfdata, $interval, $instability, $persistent, $do...
} else {
$insertEntryDBI = 1;
}
} else {
$logger->info(" DBI_connect - Cannot connect to the database - alarm: $alarm - alarmMessage: $alarmMessage") if ( defined $logger and $logger->is_info() );
}
if ($insertEntryDBI or $updateEntryDBI) {
if ($lockMySQL) {
if ($dbh and $rv) {
$lockString = 'LOCK TABLES ' .$SERVERTABLEVENTS. ' WRITE, ' .$SERVERTABLEVENTSCHNGSLGDT. ' WRITE';
($rv, undef, undef) = DBI_do ($rv, \$dbh, $lockString, $alarm, \&errorTrapDBI, [$currentDate, $catalogID_uniqueKey, $catalogID, $uniqueKey, $test, $title, $status, $startDate, $startTime, $endDate, $endTime, $duration, $statusMessage, $perfda...
}
}
if ($dbh and $rv) {
$statusMessage =~ s/"/'/g;
if ($updateEntryDBI) {
$updateString = 'UPDATE ' .$SERVERTABLEVENTS. ' SET catalogID="' .$catalogID. '", uKey="' .$uniqueKey. '", replicationStatus="U", test="' .$test. '", title="' .$title. '", status="' .$status. '", startDate="' .$startDate. '", startTime="' .$s...
($rv, undef, undef) = DBI_do ($rv, \$dbh, $updateString, $alarm, \&errorTrapDBI, [$currentDate, $catalogID_uniqueKey, $catalogID, $uniqueKey, $test, $title, $status, $startDate, $startTime, $endDate, $endTime, $duration, $statusMessage, $perf...
} elsif ($insertEntryDBI) {
$insertString = 'INSERT INTO ' .$SERVERTABLEVENTS. ' SET catalogID="' .$catalogID. '", uKey="' .$uniqueKey. '", replicationStatus="I", test="' .$test. '", title="' .$title. '", status="' .$status. '", startDate="' .$startDate. '", startTime="...
($rv, undef, undef) = DBI_do ($rv, \$dbh, $insertString, $alarm, \&errorTrapDBI, [$currentDate, $catalogID_uniqueKey, $catalogID, $uniqueKey, $test, $title, $status, $startDate, $startTime, $endDate, $endTime, $duration, $statusMessage, $perf...
}
my ( $lastStatus, $lastTimeslot, $prevStatus, $prevTimeslot ) = ( $status, get_timeslot ($currentDate), '', '' );
my $sql = "select SQL_NO_CACHE lastStatus, lastTimeslot from $SERVERTABLEVENTSCHNGSLGDT where catalogID = '$catalogID' and uKey = '$uniqueKey'";
my $sth = $dbh->prepare( $sql ) or $rv = errorTrapDBI($currentDate, $catalogID_uniqueKey, $catalogID, $uniqueKey, $test, $title, $status, $startDate, $startTime, $endDate, $endTime, $duration, $statusMessage, $perfdata, $interval, $instability,...
($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 ) {
if ( $sth->rows ) {
($prevStatus, $prevTimeslot) = $sth->fetchrow_array() or $rv = errorTrapDBI($currentDate, $catalogID_uniqueKey, $catalogID, $uniqueKey, $test, $title, $status, $startDate, $startTime, $endDate, $endTime, $duration, $statusMessage, $perfdata, $...
$sth->finish() or $rv = errorTrapDBI($currentDate, $catalogID_uniqueKey, $catalogID, $uniqueKey, $test, $title, $status, $startDate, $startTime, $endDate, $endTime, $duration, $statusMessage, $perfdata, $interval, $instability, $persistent,...
$updateString = 'UPDATE ' .$SERVERTABLEVENTSCHNGSLGDT. ' SET replicationStatus="U", lastStatus="' .$lastStatus. '", lastTimeslot="' .$lastTimeslot. '", prevStatus="' .$prevStatus. '", prevTimeslot="' .$prevTimeslot. '" where catalogID="' .$...
($rv, undef, undef) = DBI_do ($rv, \$dbh, $updateString, $alarm, \&errorTrapDBI, [$currentDate, $catalogID_uniqueKey, $catalogID, $uniqueKey, $test, $title, $status, $startDate, $startTime, $endDate, $endTime, $duration, $statusMessage, $pe...
} else {
$insertString = 'INSERT INTO ' .$SERVERTABLEVENTSCHNGSLGDT. ' SET catalogID="' .$catalogID. '", uKey="' .$uniqueKey. '", replicationStatus="I", lastStatus="' .$lastStatus. '", lastTimeslot="' .$lastTimeslot. '", prevStatus="' .$prevStatus. ...
($rv, undef, undef) = DBI_do ($rv, \$dbh, $insertString, $alarm, \&errorTrapDBI, [$currentDate, $catalogID_uniqueKey, $catalogID, $uniqueKey, $test, $title, $status, $startDate, $startTime, $endDate, $endTime, $duration, $statusMessage, $pe...
}
}
}
if ($lockMySQL) {
if ($dbh and $rv) {
$unlockString = 'UNLOCK TABLES';
($rv, undef, undef) = DBI_do ($rv, \$dbh, $unlockString, $alarm, \&errorTrapDBI, [$currentDate, $catalogID_uniqueKey, $catalogID, $uniqueKey, $test, $title, $status, $startDate, $startTime, $endDate, $endTime, $duration, $statusMessage, $perf...
}
}
}
if ($dbh and $rv) {
$dbh->disconnect or $rv = errorTrapDBI($currentDate, $catalogID_uniqueKey, $catalogID, $uniqueKey, $test, $title, $status, $startDate, $startTime, $endDate, $endTime, $duration, $statusMessage, $perfdata, $interval, $instability, $persistent, $do...
my $environment = (($test =~ /\-\-environment=([PASTDL])/) ? $1 : 'P');
$rv = graphEntryDBI ($catalogID, $uniqueKey, $title, $environment, $dbiFilename, $interval, 121, 6, 1, 0, get_trendline_from_test ($test), 0, $debug) if ($interval > 0);
}
return $rv;
}
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
sub errorTrapDBI {
my ($currentDate, $catalogID_uniqueKey, $catalogID, $uniqueKey, $test, $title, $status, $startDate, $startTime, $endDate, $endTime, $duration, $statusMessage, $perfdata, $interval, $instability, $persistent, $downtime, $filename, $error_message, $l...
print $error_message, "\nERROR: $DBI::err ($DBI::errstr)\n";
my $tlogging = $logging . get_logfiledate();
my ($msgCommand, undef) = split(/\.pl/, $test);
# APE # TODO - REMOVE
# my $rvOpen = open(DEBUG,">>$tlogging-$msgCommand-$catalogID_uniqueKey.sql");
# if ($rvOpen) {
# print DEBUG '"', $catalogID, '","","', $uniqueKey, '","I","', $test, '","', $title, '","', $status, '","', $startDate, '","', $startTime, '","', $endDate, '","', $endTime, '","', $duration, '","', $statusMessage, '","', $perfdata, '","', $inter...
# close(DEBUG);
# } else {
# print "Cannot open $tlogging-$msgCommand-$catalogID_uniqueKey.sql to print debug information\n";
# }
my %VALUES = (
'catalogID' => $catalogID,
'id' => 0,
'uKey' => $uniqueKey,
'replicationStatus' => 'I',
'test' => $test,
'title' => $title,
'status' => $status,
'startDate' => $startDate,
'startTime' => $startTime,
'endDate' => $endDate,
'endTime' => $endTime,
'duration' => $duration,
'statusMessage' => $statusMessage,
'perfdata' => $perfdata,
'step' => $interval * 60,
'timeslot' => get_timeslot ($currentDate),
'instability' => $instability,
'persistent' => $persistent,
'downtime' => $downtime,
'filename' => $filename
);
my $_debug = ( ( $debug eq 'T' ) ? 1 : 0);
my $dbh = CSV_prepare_table ($logging, get_logfiledate() . "-$msgCommand-$catalogID_uniqueKey", '.sql', $SERVERTABLEVENTS, \@EVENTS, \%EVENTS, \$logger, $_debug);
applications/collector-test.pl view on Meta::CPAN
my $width = 893;
my $hight = 558;
my $xOffset = 74;
my $yOffset = 28;
my $yMarkColor = 0xFFFFDC;
my $background = 0xF7F7F7;
print "Generating RRD alike graph\n" if ($debug eq 'T');
my (@dataOK, @dataCritical, @dataWarning, @dataUnknown, @dataNoTest, @dataOffline, @RRDlabels);
my ($step, $lastTimeslot, $firstTimeslot, $duration, $startTime, $status, $timeslot, $findString);
$step = $interval * 60;
$lastTimeslot = timelocal (0, (localtime)[1,2,3,4,5]);
$firstTimeslot = $lastTimeslot - ($step * ($limitTest));
$findString = "select SQL_NO_CACHE duration, startTime, status, timeslot from $SERVERTABLEVENTS force index (uKey) where catalogID = '$catalogID' and uKey = '$uniqueKey' and step <> '0' and (timeslot between '$firstTimeslot' and '$lastTimeslot')...
print "$findString\n" if ($debug eq 'T');
# data en labels in array zetten
my ($counter, $seconden, $ttimeslot);
for ( $counter = 0; $counter < $limitTest; $counter++) {
push (@dataOK, "0");
push (@dataWarning, "0");
push (@dataCritical, "0");
push (@dataUnknown, "0");
push (@dataNoTest, "0");
push (@dataOffline, "0");
push (@RRDlabels, " ");
}
# 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-test.pl view on Meta::CPAN
while( $sth->fetch() ) {
$seconden = int(substr($duration, 6, 2)) + int(substr($duration, 3, 2)*60) + int(substr($duration, 0, 2)*3600);
$seconden += 0.5 if ($seconden == 0); # correction for to fast testresults
$ttimeslot = abs((($lastTimeslot - $timeslot) / $step) - $limitTest);
if ($ttimeslot >= 0) {
$status = 'UNKNOWN' if ($status eq '<NIHIL>');
if ($status eq 'OK') {
$dataOK[$ttimeslot] = ($seconden < $limitTrendline) ? $seconden : $limitTrendline;
} elsif ($status eq 'CRITICAL') {
$dataCritical[$ttimeslot] = '-5';
} elsif ($status eq 'WARNING'){
$dataWarning[$ttimeslot] = '-5';
} elsif ($status eq 'UNKNOWN'){
$dataUnknown[$ttimeslot] = '-5';
} elsif ($status eq 'NO TEST') {
$dataNoTest[$ttimeslot] = '-5';
} elsif ($status eq 'OFFLINE') {
$dataOffline[$ttimeslot] = '-5';
}
}
$RRDlabels[int($limitTest - $counter - 1)] = substr($startTime, 0, 5) unless ( $counter % $xLabelStep );
$counter++;
}
}
$sth->finish() or $rv = errorTrapDBIgraphEntry("Cannot sth->finish: $findString", \$logger, $debug);
}
$dbh->disconnect or $rv = errorTrapDBIgraphEntry("Sorry, the database was unable to add your entry.", \$logger, $debug);
} else {
$title .= " - DBI_connect - Cannot connect to the database - alarm: $alarm - alarmMessage: $alarmMessage";
$logger->info(" DBI_connect - Cannot connect to the database - alarm: $alarm - alarmMessage: $alarmMessage") if ( defined $logger and $logger->is_info() );
}
# Create a XYChart object of size $width x $hight pixels, using 0xf0e090 as background color, with a black border, and 0 pixel 3D border effect
my $c = new XYChart($width, $hight, $background, 0x0, 0);
# Set the plotarea at (xOffset, yOffset) and of size $width - 95 x $hight - 78 pixels, with white background. Set border and grid line colors.
$c->setPlotArea($xOffset, $yOffset, $width - 95, $hight - 78, 0xffffff, -1, 0xa08040, $c->dashLineColor(0x0, 0x0101), $c->dashLineColor(0x0, 0x0101))->setGridWidth(1);
# Add a title box to the chart using 10 pts Arial Bold Italic font. The text is white (0x000000)
$c->addText($width/2, 14, "$title", "arialbi.ttf", 10, 0x000000, 5, 0);
applications/collector-test.pl view on Meta::CPAN
# Set the axes width to 1 pixels
$c->yAxis()->setWidth(1);
$c->xAxis()->setWidth(1);
# Add a title to the y axis
$c->yAxis()->setTitle("Response time", "arial.ttf", 9);
# Set the margins at the two ends of the axis during auto-scaling, and whether to start the axis from zero
$c->yAxis()->setAutoScale(0, 0, 0);
# Add a mark line ore zone to the chart and add the first two data sets to the chart as a stacked bar group
if ($yMarkValue) {
if ($markOrZone) {
$c->yAxis()->addMark($yMarkValue, $yMarkColor);
} else {
$c->yAxis()->addZone($yMarkValue, 3600, $yMarkColor);
$c->yAxis()->addZone(0, -6, $yMarkColor);
}
$layer->addDataSet(\@dataOK, $layer->yZoneColor($yMarkValue, $COLORSRRD {OK}, $COLORSRRD {TRENDLINE}), " Duration");
} else {
$c->yAxis()->addZone(0, -6, $yMarkColor) unless ( $markOrZone );
$layer->addDataSet(\@dataOK, $COLORSRRD {OK}, " Duration");
}
$layer->addDataSet(\@dataWarning, $COLORSRRD {WARNING}, " Warning");
$layer->addDataSet(\@dataCritical, $COLORSRRD {CRITICAL}, " Critical");
$layer->addDataSet(\@dataUnknown, $COLORSRRD {UNKNOWN}, " Unknown");
$layer->addDataSet(\@dataNoTest, $COLORSRRD {"NO TEST"}, " No test");
$layer->addDataSet(\@dataOffline, $COLORSRRD {OFFLINE}, " Offline");
# Set the sub-bar gap to 0, so there is no gap between stacked bars with a group
$layer->setBarGap(-1.7E-100, 0);
# Set the bar border to transparent
if ($withBorder) {
$layer->setBorderColor(0xF0F0F0);
} else {
$layer->setBorderColor($perlchartdir::Transparent);
}
applications/collector.pl view on Meta::CPAN
$title =~ s/^[\[[\S+|\s+]*\]\s+]{0,1}([\S+|\s+]*)/$1/g;
$logging = $RESULTSPATH .'/'. $resultsdir .'/';
$httpdump = $RESULTSPATH .'/'. $resultsdir .'/'. $DEBUGDIR .'/';
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
$activationTimeslotPersistentFalse = ($activationTimeslotPersistentFalse < int($TactivationTimeslot)) ? $activationTimeslotPersistentFalse : int($TactivationTimeslot);
$suspentionTimeslotPersistentFalse = ($suspentionTimeslotPersistentFalse > int($TsuspentionTimeslot)) ? $suspentionTimeslotPersistentFalse : int($TsuspentionTimeslot);
}
}
}
$sth->finish() or $rv = errorTrapDBIdowntime($collectorlist, "Cannot sth->finish: $sql", \$logger, $debug) if $rv;
}
$dbh->disconnect or $rv = errorTrapDBIdowntime($collectorlist, "Sorry, the database was unable to add your entry.", \$logger, $debug);
} else {
$logger->info(" DBI_connect - Cannot connect to the database - alarm: $alarm - alarmMessage: $alarmMessage") if ( defined $logger and $logger->is_info() );
}
unless ( $firstRecordPersistentTrue and $firstRecordPersistentFalse ) {
my $currentDowntimeTimeslot = timelocal (0, (localtime)[1,2,3,4,5]);
print "$catalogID_uniqueKey\ncurrentTimeslot : $currentDowntimeTimeslot\n" if ($debug eq 'T');
unless ( $firstRecordPersistentTrue ) {
if ($debug eq 'T') {
print "activationTimeslotPersistentTrue : $activationTimeslotPersistentTrue\n";
print "suspentionTimeslotPersistentTrue : $suspentionTimeslotPersistentTrue\n";
applications/collector.pl view on Meta::CPAN
$queryMySQL = 1;
printDebugAll ("no TEST: call_system <$catalogID_uniqueKey><$command>") if ($debug eq 'T');
}
}
$action = call_system ($asnmtapEnv, $currentDate, $catalogID_uniqueKey, $catalogID, $uniqueKey, $resultsdir, $title, $command, $status, int($tinterval), $instability, $persistent, $downtime, $debug, $logging, $tlogging, $httpdump, $dumpht...
}
}
if ($doOffline or $downtime) {
print "Write 'Offline/No Test' status to mysql databases on: ", get_csvfiletime(), "\n" if ($debug eq 'T');
my ($startDate, $startTime, $endDate, $endTime, $msgCommand);
$startDate = get_csvfiledate();
$startTime = get_csvfiletime();
$endDate = $startDate;
$endTime = $startTime;
($msgCommand, undef) = split(/\.pl/, $command);
my $insertData = 1;
my $status = 'OFFLINE';
applications/collector.pl view on Meta::CPAN
if ( $boolean_perfParseInstalled ) {
if (defined $performanceData) {
my $perfParseTimeslot = get_timeslot ($currentDate);
my $perfParseCommand;
my $environment = (($system_action =~ /\-\-environment=([PASTDL])/) ? $1 : 'P');
my $eTitle = $title .' ('. $ENVIRONMENT{$environment} .')' if (defined $environment);
$eTitle .= ' from '. $catalogID;
if ( $perfParseMethode eq 'PULP' ) {
$perfParseCommand = "$APPLICATIONPATH/sbin/perfparse_asnmtap_pulp_command.pl $PREFIXPATH/log/perfdata-asnmtap.log \"$perfParseTimeslot\t$eTitle\t$catalogID_uniqueKey\t$outputData\t$dumphttpRename\t$performanceData\"";
} else {
$perfParseCommand = "printf \"%b\" \"$perfParseTimeslot\t$eTitle\t$catalogID_uniqueKey\t$outputData\t$dumphttpRename\t$performanceData\n\" | $PERFPARSEBIN/perfparse-log2mysql -c $PERFPARSEETC/$PERFPARSECONFIG";
}
if ($CAPTUREOUTPUT) {
use IO::CaptureOutput qw(capture_exec);
($stdout, $stderr) = capture_exec("$perfParseCommand");
} else {
system ("$perfParseCommand"); $stdout = $stderr = '';
}
applications/collector.pl view on Meta::CPAN
close(NOKDEBUG);
} else {
print "Cannot open $tlogging-nok.txt to print debug information\n";
}
}
}
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
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) {
while (my $ref = $sth->fetchrow_hashref()) {
$numbersEntryDBI++;
if ( $ref->{status} eq '<NIHIL>' or $ref->{status} eq 'OFFLINE' or $ref->{status} eq 'NO TEST' ) { $updateEntryDBI = 1; }
}
$insertEntryDBI = 1 unless ( $numbersEntryDBI );
printDebugAll ("query Entry DBI: # <$numbersEntryDBI> insert <$insertEntryDBI> change <$updateEntryDBI>") if ($debug eq 'T');
}
$sth->finish() or $rv = errorTrapDBI($currentDate, $catalogID_uniqueKey, $catalogID, $uniqueKey, $test, $title, $status, $startDate, $startTime, $endDate, $endTime, $duration, $statusMessage, $perfdata, $interval, $instability, $persistent, $do...
} else {
$insertEntryDBI = 1;
}
} else {
$logger->info(" DBI_connect - Cannot connect to the database - alarm: $alarm - alarmMessage: $alarmMessage") if ( defined $logger and $logger->is_info() );
}
if ($insertEntryDBI or $updateEntryDBI) {
if ($lockMySQL) {
if ($dbh and $rv) {
$lockString = 'LOCK TABLES ' .$SERVERTABLEVENTS. ' WRITE, ' .$SERVERTABLEVENTSCHNGSLGDT. ' WRITE';
($rv, undef, undef) = DBI_do ($rv, \$dbh, $lockString, $alarm, \&errorTrapDBI, [$currentDate, $catalogID_uniqueKey, $catalogID, $uniqueKey, $test, $title, $status, $startDate, $startTime, $endDate, $endTime, $duration, $statusMessage, $perfda...
}
}
if ($dbh and $rv) {
$statusMessage =~ s/"/'/g;
if ($updateEntryDBI) {
$updateString = 'UPDATE ' .$SERVERTABLEVENTS. ' SET catalogID="' .$catalogID. '", uKey="' .$uniqueKey. '", replicationStatus="U", test="' .$test. '", title="' .$title. '", status="' .$status. '", startDate="' .$startDate. '", startTime="' .$s...
($rv, undef, undef) = DBI_do ($rv, \$dbh, $updateString, $alarm, \&errorTrapDBI, [$currentDate, $catalogID_uniqueKey, $catalogID, $uniqueKey, $test, $title, $status, $startDate, $startTime, $endDate, $endTime, $duration, $statusMessage, $perf...
} elsif ($insertEntryDBI) {
$insertString = 'INSERT INTO ' .$SERVERTABLEVENTS. ' SET catalogID="' .$catalogID. '", uKey="' .$uniqueKey. '", replicationStatus="I", test="' .$test. '", title="' .$title. '", status="' .$status. '", startDate="' .$startDate. '", startTime="...
($rv, undef, undef) = DBI_do ($rv, \$dbh, $insertString, $alarm, \&errorTrapDBI, [$currentDate, $catalogID_uniqueKey, $catalogID, $uniqueKey, $test, $title, $status, $startDate, $startTime, $endDate, $endTime, $duration, $statusMessage, $perf...
}
my ( $lastStatus, $lastTimeslot, $prevStatus, $prevTimeslot ) = ( $status, get_timeslot ($currentDate), '', '' );
my $sql = "select SQL_NO_CACHE lastStatus, lastTimeslot from $SERVERTABLEVENTSCHNGSLGDT where catalogID = '$catalogID' and uKey = '$uniqueKey'";
my $sth = $dbh->prepare( $sql ) or $rv = errorTrapDBI($currentDate, $catalogID_uniqueKey, $catalogID, $uniqueKey, $test, $title, $status, $startDate, $startTime, $endDate, $endTime, $duration, $statusMessage, $perfdata, $interval, $instability,...
($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 ) {
if ( $sth->rows ) {
($prevStatus, $prevTimeslot) = $sth->fetchrow_array() or $rv = errorTrapDBI($currentDate, $catalogID_uniqueKey, $catalogID, $uniqueKey, $test, $title, $status, $startDate, $startTime, $endDate, $endTime, $duration, $statusMessage, $perfdata, $...
$sth->finish() or $rv = errorTrapDBI($currentDate, $catalogID_uniqueKey, $catalogID, $uniqueKey, $test, $title, $status, $startDate, $startTime, $endDate, $endTime, $duration, $statusMessage, $perfdata, $interval, $instability, $persistent,...
$updateString = 'UPDATE ' .$SERVERTABLEVENTSCHNGSLGDT. ' SET replicationStatus="U", lastStatus="' .$lastStatus. '", lastTimeslot="' .$lastTimeslot. '", prevStatus="' .$prevStatus. '", prevTimeslot="' .$prevTimeslot. '" where catalogID="' .$...
($rv, undef, undef) = DBI_do ($rv, \$dbh, $updateString, $alarm, \&errorTrapDBI, [$currentDate, $catalogID_uniqueKey, $catalogID, $uniqueKey, $test, $title, $status, $startDate, $startTime, $endDate, $endTime, $duration, $statusMessage, $pe...
} else {
$insertString = 'INSERT INTO ' .$SERVERTABLEVENTSCHNGSLGDT. ' SET catalogID="' .$catalogID. '", uKey="' .$uniqueKey. '", replicationStatus="I", lastStatus="' .$lastStatus. '", lastTimeslot="' .$lastTimeslot. '", prevStatus="' .$prevStatus. ...
($rv, undef, undef) = DBI_do ($rv, \$dbh, $insertString, $alarm, \&errorTrapDBI, [$currentDate, $catalogID_uniqueKey, $catalogID, $uniqueKey, $test, $title, $status, $startDate, $startTime, $endDate, $endTime, $duration, $statusMessage, $pe...
}
}
}
if ($lockMySQL) {
if ($dbh and $rv) {
$unlockString = 'UNLOCK TABLES';
($rv, undef, undef) = DBI_do ($rv, \$dbh, $unlockString, $alarm, \&errorTrapDBI, [$currentDate, $catalogID_uniqueKey, $catalogID, $uniqueKey, $test, $title, $status, $startDate, $startTime, $endDate, $endTime, $duration, $statusMessage, $perf...
}
}
}
if ($dbh and $rv) {
$dbh->disconnect or $rv = errorTrapDBI($currentDate, $catalogID_uniqueKey, $catalogID, $uniqueKey, $test, $title, $status, $startDate, $startTime, $endDate, $endTime, $duration, $statusMessage, $perfdata, $interval, $instability, $persistent, $do...
my $environment = (($test =~ /\-\-environment=([PASTDL])/) ? $1 : 'P');
$rv = graphEntryDBI ($catalogID, $uniqueKey, $title, $environment, $dbiFilename, $interval, 121, 6, 1, 0, get_trendline_from_test ($test), 0, $debug) if ($interval > 0);
}
return $rv;
}
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
sub errorTrapDBI {
my ($currentDate, $catalogID_uniqueKey, $catalogID, $uniqueKey, $test, $title, $status, $startDate, $startTime, $endDate, $endTime, $duration, $statusMessage, $perfdata, $interval, $instability, $persistent, $downtime, $filename, $error_message, $l...
print $error_message, "\nERROR: $DBI::err ($DBI::errstr)\n";
my $tlogging = $logging . get_logfiledate();
my ($msgCommand, undef) = split(/\.pl/, $test);
# APE # TODO - REMOVE
# my $rvOpen = open(DEBUG,">>$tlogging-$msgCommand-$catalogID_uniqueKey.sql");
# if ($rvOpen) {
# print DEBUG '"', $catalogID, '","","', $uniqueKey, '","I","', $test, '","', $title, '","', $status, '","', $startDate, '","', $startTime, '","', $endDate, '","', $endTime, '","', $duration, '","', $statusMessage, '","', $perfdata, '","', $inter...
# close(DEBUG);
# } else {
# print "Cannot open $tlogging-$msgCommand-$catalogID_uniqueKey.sql to print debug information\n";
# }
my %VALUES = (
'catalogID' => $catalogID,
'id' => 0,
'uKey' => $uniqueKey,
'replicationStatus' => 'I',
'test' => $test,
'title' => $title,
'status' => $status,
'startDate' => $startDate,
'startTime' => $startTime,
'endDate' => $endDate,
'endTime' => $endTime,
'duration' => $duration,
'statusMessage' => $statusMessage,
'perfdata' => $perfdata,
'step' => $interval * 60,
'timeslot' => get_timeslot ($currentDate),
'instability' => $instability,
'persistent' => $persistent,
'downtime' => $downtime,
'filename' => $filename
);
my $_debug = ( ( $debug eq 'T' ) ? 1 : 0);
my $dbh = CSV_prepare_table ($logging, get_logfiledate() . "-$msgCommand-$catalogID_uniqueKey", '.sql', $SERVERTABLEVENTS, \@EVENTS, \%EVENTS, \$logger, $_debug);
applications/collector.pl view on Meta::CPAN
my $width = 893;
my $hight = 558;
my $xOffset = 74;
my $yOffset = 28;
my $yMarkColor = 0xFFFFDC;
my $background = 0xF7F7F7;
print "Generating RRD alike graph\n" if ($debug eq 'T');
my (@dataOK, @dataCritical, @dataWarning, @dataUnknown, @dataNoTest, @dataOffline, @RRDlabels);
my ($step, $lastTimeslot, $firstTimeslot, $duration, $startTime, $status, $timeslot, $findString);
$step = $interval * 60;
$lastTimeslot = timelocal (0, (localtime)[1,2,3,4,5]);
$firstTimeslot = $lastTimeslot - ($step * ($limitTest));
$findString = "select SQL_NO_CACHE duration, startTime, status, timeslot from $SERVERTABLEVENTS force index (uKey) where catalogID = '$catalogID' and uKey = '$uniqueKey' and step <> '0' and (timeslot between '$firstTimeslot' and '$lastTimeslot')...
print "$findString\n" if ($debug eq 'T');
# data en labels in array zetten
my ($counter, $seconden, $ttimeslot);
for ( $counter = 0; $counter < $limitTest; $counter++) {
push (@dataOK, "0");
push (@dataWarning, "0");
push (@dataCritical, "0");
push (@dataUnknown, "0");
push (@dataNoTest, "0");
push (@dataOffline, "0");
push (@RRDlabels, " ");
}
# 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
while( $sth->fetch() ) {
$seconden = int(substr($duration, 6, 2)) + int(substr($duration, 3, 2)*60) + int(substr($duration, 0, 2)*3600);
$seconden += 0.5 if ($seconden == 0); # correction for to fast testresults
$ttimeslot = abs((($lastTimeslot - $timeslot) / $step) - $limitTest);
if ($ttimeslot >= 0) {
$status = 'UNKNOWN' if ($status eq '<NIHIL>');
if ($status eq 'OK') {
$dataOK[$ttimeslot] = ($seconden < $limitTrendline) ? $seconden : $limitTrendline;
} elsif ($status eq 'CRITICAL') {
$dataCritical[$ttimeslot] = '-5';
} elsif ($status eq 'WARNING'){
$dataWarning[$ttimeslot] = '-5';
} elsif ($status eq 'UNKNOWN'){
$dataUnknown[$ttimeslot] = '-5';
} elsif ($status eq 'NO TEST') {
$dataNoTest[$ttimeslot] = '-5';
} elsif ($status eq 'OFFLINE') {
$dataOffline[$ttimeslot] = '-5';
}
}
$RRDlabels[int($limitTest - $counter - 1)] = substr($startTime, 0, 5) unless ( $counter % $xLabelStep );
$counter++;
}
}
$sth->finish() or $rv = errorTrapDBIgraphEntry("Cannot sth->finish: $findString", \$logger, $debug);
}
$dbh->disconnect or $rv = errorTrapDBIgraphEntry("Sorry, the database was unable to add your entry.", \$logger, $debug);
} else {
$title .= " - DBI_connect - Cannot connect to the database - alarm: $alarm - alarmMessage: $alarmMessage";
$logger->info(" DBI_connect - Cannot connect to the database - alarm: $alarm - alarmMessage: $alarmMessage") if ( defined $logger and $logger->is_info() );
}
# Create a XYChart object of size $width x $hight pixels, using 0xf0e090 as background color, with a black border, and 0 pixel 3D border effect
my $c = new XYChart($width, $hight, $background, 0x0, 0);
# Set the plotarea at (xOffset, yOffset) and of size $width - 95 x $hight - 78 pixels, with white background. Set border and grid line colors.
$c->setPlotArea($xOffset, $yOffset, $width - 95, $hight - 78, 0xffffff, -1, 0xa08040, $c->dashLineColor(0x0, 0x0101), $c->dashLineColor(0x0, 0x0101))->setGridWidth(1);
# Add a title box to the chart using 10 pts Arial Bold Italic font. The text is white (0x000000)
$c->addText($width/2, 14, "$title", "arialbi.ttf", 10, 0x000000, 5, 0);
applications/collector.pl view on Meta::CPAN
# Set the axes width to 1 pixels
$c->yAxis()->setWidth(1);
$c->xAxis()->setWidth(1);
# Add a title to the y axis
$c->yAxis()->setTitle("Response time", "arial.ttf", 9);
# Set the margins at the two ends of the axis during auto-scaling, and whether to start the axis from zero
$c->yAxis()->setAutoScale(0, 0, 0);
# Add a mark line ore zone to the chart and add the first two data sets to the chart as a stacked bar group
if ($yMarkValue) {
if ($markOrZone) {
$c->yAxis()->addMark($yMarkValue, $yMarkColor);
} else {
$c->yAxis()->addZone($yMarkValue, 3600, $yMarkColor);
$c->yAxis()->addZone(0, -6, $yMarkColor);
}
$layer->addDataSet(\@dataOK, $layer->yZoneColor($yMarkValue, $COLORSRRD {OK}, $COLORSRRD {TRENDLINE}), " Duration");
} else {
$c->yAxis()->addZone(0, -6, $yMarkColor) unless ( $markOrZone );
$layer->addDataSet(\@dataOK, $COLORSRRD {OK}, " Duration");
}
$layer->addDataSet(\@dataWarning, $COLORSRRD {WARNING}, " Warning");
$layer->addDataSet(\@dataCritical, $COLORSRRD {CRITICAL}, " Critical");
$layer->addDataSet(\@dataUnknown, $COLORSRRD {UNKNOWN}, " Unknown");
$layer->addDataSet(\@dataNoTest, $COLORSRRD {"NO TEST"}, " No test");
$layer->addDataSet(\@dataOffline, $COLORSRRD {OFFLINE}, " Offline");
# Set the sub-bar gap to 0, so there is no gap between stacked bars with a group
$layer->setBarGap(-1.7E-100, 0);
# Set the bar border to transparent
if ($withBorder) {
$layer->setBorderColor(0xF0F0F0);
} else {
$layer->setBorderColor($perlchartdir::Transparent);
}
applications/custom/cartography.pm-orig view on Meta::CPAN
sub printLinkToCartography {
my ($serverName, $checklist, $catalogID, $uniqueKey) = @_;
# modify the value of $url with the link to your cartography tool - - -
my $url = 'http://cartography.citap.be/index.htm?entry';
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
my $value = "${catalogID}_${uniqueKey}";
$value =~ s/-/_/g;
my $dataLinkToCartography = "<TR><TD BGCOLOR=#000080 ALIGN=RIGHT COLSPAN=2>Cartography</TD></TR>";
$dataLinkToCartography .= "<TR><TD BGCOLOR=#000080 WIDTH=100 ALIGN=RIGHT>Link</TD><TD BGCOLOR=#0000FF><a href=${url}=${value} target=_blank>Click Here</a></TD></TR>";
return $dataLinkToCartography;
}
# End cartography.pm -----------------------------------------------------------------------------
1;
applications/custom/display.pm-orig view on Meta::CPAN
if ($statusMessage =~ /\+Q4\+/ ) { $break = ($errorMessage) ? '<BR>' : ''; $errorMessage .= $break . 'Q4: LOGIN.'; }
if ($statusMessage =~ /\+Q5\+/ ) { $break = ($errorMessage) ? '<BR>' : ''; $errorMessage .= $break . 'Q5: SEARCH.'; }
if ($statusMessage =~ /\+Q6\+/ ) { $break = ($errorMessage) ? '<BR>' : ''; $errorMessage .= $break . 'Q6: DOWNLOAD.'; }
if ($statusMessage =~ /\+Q7\+/ ) { $break = ($errorMessage) ? '<BR>' : ''; $errorMessage .= $break . 'Q7: LOGOUT.'; }
# ***************************************************************************
# Error codes indicate an error with KBO-BCE WI *
# ***************************************************************************
} elsif ($statusMessage =~ /KBO-BCE WI/ ) {
if ($statusMessage =~ /\+BIS\+/ ) { $errorMessage = 'Backend KSZ/BCSS not accessible, if needed call \'KSZ/BCSS\''; }
if ($statusMessage =~ /\+KBO-WI-BIS\+/ ) { $break = ($errorMessage) ? '<BR>' : ''; $errorMessage .= $break . 'KBO-WI-BIS @ ACCENTURE not available, if needed call \'Accenture\''; }
if ($statusMessage =~ /\+NIS\+/ ) { $break = ($errorMessage) ? '<BR>' : ''; $errorMessage .= $break . 'NIS database @ ACCENTURE not available, if needed call \'Accenture\''; }
if ($statusMessage =~ /\+KBO-WI-NIS\+/ ) { $break = ($errorMessage) ? '<BR>' : ''; $errorMessage .= $break . 'KBO-WI-NIS @ ACCENTURE not available, if needed call \'Accenture\''; }
if ($statusMessage =~ /\+RR\+/ ) { $break = ($errorMessage) ? '<BR>' : ''; $errorMessage .= $break . 'RIJKSREGISTER not available, if needed call \'RR/RN\''; }
if ($statusMessage =~ /\+KBO-WI-RR\+/ ) { $break = ($errorMessage) ? '<BR>' : ''; $errorMessage .= $break . 'KBO-WI-RR @ ACCENTURE not available, if needed call \'Accenture\''; }
if ($statusMessage =~ /\+KBO\+/ ) { $break = ($errorMessage) ? '<BR>' : ''; $errorMessage .= $break . 'KBO-WI problems, if needed call \'KBO/CBE\''; }
if ($statusMessage =~ /\+KBO-WI-KBO\+/ ) { $break = ($errorMessage) ? '<BR>' : ''; $errorMessage .= $break . 'KBO-WI-KBO @ ACCENTURE not available, if needed call \'Accenture\''; }
unless ( $errorMessage ) {
if ($statusMessage =~ /TOKEN AUTHENTIFICATIE/ ) {
$errorMessage = 'Problem with \'Authentification Software\' from \'Accenture\', call Accenture';
} elsif ($statusMessage =~ /Er is een fout voorgekomen/ ) {
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);
last if ( exists $$hash_valueEventsData{IN_SCOPE}{found} );
}
}
}
}
}
$dbh->disconnect or $rv = error_trap_DBI(*STDOUT, "Sorry, the database was unable to add your entry.", $debug, $pagedir, $pageset, $htmlTitle, $subTitle, $refresh, $onload, $sessionID) if ($dbh and $rv);
}
return $rv;
}
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
sub _getSupportRequestData {
my ($serverName, $database, $table, $catalogID, $uKey, $hash_valueSupportRequestData, $pagedir, $pageset, $htmlTitle, $subTitle, $refresh, $onload, $sessionID, $debug) = @_;
$$hash_valueSupportRequestData{code} = '?';
$$hash_valueSupportRequestData{slaID} = '?';
$$hash_valueSupportRequestData{impact} = 'High';
$$hash_valueSupportRequestData{invoicedOrg} = '?';
$$hash_valueSupportRequestData{service} = '?';
$$hash_valueSupportRequestData{priority} = 'P01';
my $rv = 1;
my $dbh = DBI->connect("DBI:mysql:$database:$serverName:$SERVERPORTREADONLY", "$SERVERUSERREADONLY", "$SERVERPASSREADONLY") or $rv = error_trap_DBI(*STDOUT, "Cannot connect to the database", $debug, $pagedir, $pageset, $htmlTitle, $subTitle, $ref...
if ($dbh and $rv) {
my $sql = "select SQL_NO_CACHE code, slaID, invoicedOrg, service, impact, priority from $table where catalogID = '$catalogID' and uKey = '$uKey'";
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_valueSupportRequestData{code} = $ref->{code} if ( $ref->{code} );
$$hash_valueSupportRequestData{slaID} = $ref->{slaID} if ( $ref->{slaID} );
$$hash_valueSupportRequestData{impact} = $ref->{impact} if ( $ref->{impact} );
$$hash_valueSupportRequestData{invoicedOrg} = $ref->{invoicedOrg} if ( $ref->{invoicedOrg} );
$$hash_valueSupportRequestData{service} = $ref->{service} if ( $ref->{service} );
$$hash_valueSupportRequestData{priority} = $ref->{priority} if ( $ref->{priority} );
}
$sth->finish() or $rv = error_trap_DBI(*STDOUT, "Cannot sth->finish: $sql", $debug, $pagedir, $pageset, $htmlTitle, $subTitle, $refresh, $onload, $sessionID);
}
$dbh->disconnect or $rv = error_trap_DBI(*STDOUT, "Sorry, the database was unable to add your entry.", $debug, $pagedir, $pageset, $htmlTitle, $subTitle, $refresh, $onload, $sessionID) if ($dbh and $rv);
}
return $rv;
}
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
sub _actionOnSoapResponse {
my ($asnmtapInherited, $som, $arguments) = @_;
my $root = $som->dataof ('/Envelope/Body');
my $WebServiceResults = $root->value;
if ( $asnmtapInherited->getOptionsValue('debug') ) {
use Data::Dumper;
print Dumper ($WebServiceResults), "\n";
}
my $response = $arguments->{method} .'Response';
my $returnCode = ( ( exists $WebServiceResults->{ $response } ) ? ( ( defined $WebServiceResults->{ $response } and $WebServiceResults->{ $response } ne '' ) ? $ERRORS{OK} : $ERRORS{WARNING} ) : $ERRORS{CRITICAL} );
unless ( $returnCode ) {
if ( $arguments->{method} eq 'InsertSupportRequest' ) {
# ...
} else { # $arguments->{method} =~ /^GetSupportRequest(?:List)*$/
if ( exists $WebServiceResults->{$response}->{SupportRequest} ) {
sub processGetSupportRequestResponse {
my ($supportRequest, $arguments, $counter) = @_;
if ( defined $supportRequest->{Number} ) {
my ($header, $data) = ('', '');
if ( defined $arguments->{fieldlist}->{'*'} ) {
while (my ($key, $value) = each %{ $supportRequest } ) {
$header .= '"'. $key .'",' unless ($counter);
$data .= '"'. $value .'",';
}
} else {
foreach my $key (sort keys %{ $arguments->{fieldlist} } ) {
my $value = $arguments->{fieldlist}->{$key};
if ( defined $supportRequest->{$value} ) {
$header .= '"'. $value .'",' unless ($counter);
$data .= '"'. $supportRequest->{$value} .'",';
}
}
}
unless ($counter) {
chop $header;
$header .= "\n";
}
chop $data;
$data .= "\n";
print $header, $data;
$counter++;
}
return ($counter);
}
if ( ref $WebServiceResults->{$response}->{SupportRequest} eq 'ARRAY' ) {
my $counter = 0;
foreach my $supportRequest ( @{$WebServiceResults->{$response}->{SupportRequest}} ) {
applications/custom/sde-supportRequest.pm-orig view on Meta::CPAN
asnmtapInherited => \$objectPlugins,
custom => \&_actionOnSoapResponse,
customArguments => \%customArguments,
proxy => $FQDN .'/Service.asmx',
namespace => $namespace,
method => SOAP::Data->name("$method")->attr( {'xmlns' => $namespace} ),
soapaction => $method,
registerNamespace => \%soapService_NS,
params => \@{$methods{$method}{parameters}},
cookies => 1,
perfdataLabel => $method .'\@'. $FQDN,
TYPE_ERROR_RETURN => 'APPEND'
);
last unless ( $returnCode );
}
$succeeded = 'SR <#>' unless ( $objectPlugins->pluginValue ( 'stateValue' ) );
my $alert = $objectPlugins->pluginValue ('alert');
my $error = $objectPlugins->pluginValue ('error');
undef $objectPlugins;
applications/custom/sde.pm-orig view on Meta::CPAN
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
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
$$hash_catalogID_uKey_timeperiodID{$ref->{catalogID}}->{$ref->{uKey}}->{SDE_IMW}->{$WDAYS{wednesday}} = ( $ref->{imw_wednesday} ) ? $ref->{imw_wednesday} : '';
$$hash_catalogID_uKey_timeperiodID{$ref->{catalogID}}->{$ref->{uKey}}->{SDE_IMW}->{$WDAYS{thursday}} = ( $ref->{imw_thursday} ) ? $ref->{imw_thursday} : '';
$$hash_catalogID_uKey_timeperiodID{$ref->{catalogID}}->{$ref->{uKey}}->{SDE_IMW}->{$WDAYS{friday}} = ( $ref->{imw_friday} ) ? $ref->{imw_friday} : '';
$$hash_catalogID_uKey_timeperiodID{$ref->{catalogID}}->{$ref->{uKey}}->{SDE_IMW}->{$WDAYS{saturday}} = ( $ref->{imw_saturday} ) ? $ref->{imw_saturday} : '';
}
}
$sth->finish() or $rv = errorTrapDBI($checklist, "Cannot sth->finish: $sql");
}
$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() ) {
$dataRelationshipsSDE .= "<TR><TD BGCOLOR=#000080 ALIGN=RIGHT COLSPAN=2>SDE</TD></TR>";
$dataRelationshipsSDE .= "<TR><TD BGCOLOR=#000080 WIDTH=100 ALIGN=RIGHT>Invoiced Organisation</TD><TD BGCOLOR=#0000FF>$invoicedOrg</TD></TR>";
$dataRelationshipsSDE .= "<TR><TD BGCOLOR=#000080 WIDTH=100 ALIGN=RIGHT>Service</TD><TD BGCOLOR=#0000FF>$service</TD></TR>";
$dataRelationshipsSDE .= "<TR><TD BGCOLOR=#000080 WIDTH=100 ALIGN=RIGHT>Code/CI</TD><TD BGCOLOR=#0000FF>$code</TD></TR>";
$dataRelationshipsSDE .= "<TR><TD BGCOLOR=#000080 WIDTH=100 ALIGN=RIGHT>Impact</TD><TD BGCOLOR=#0000FF>$impact</TD></TR>";
$dataRelationshipsSDE .= "<TR><TD BGCOLOR=#000080 WIDTH=100 ALIGN=RIGHT>Priority</TD><TD BGCOLOR=#0000FF>$priority</TD></TR>";
}
$sth->finish() or $rv = errorTrapDBI($checklist, "Cannot sth->finish: $sql");
}
$dbh->disconnect or $rv = errorTrapDBI($checklist, "Sorry, the database was unable to add your entry.") if ($dbh and $rv);
}
return $dataRelationshipsSDE;
}
# End sde.pm -------------------------------------------------------------------------------------
1;
applications/display-test.pl view on Meta::CPAN
if ($opt_l eq 'F' || $opt_l eq 'T') {
$lockMySQL = ($opt_l eq 'F') ? 0 : 1;
} else {
usage("Invalid lockMySQL: $opt_l\n");
}
}
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
my ($dchecklist, $dtest, $dfetch, $tinterval, $tgroep, $resultsdir, $ttest, $firstTimeslot, $lastTimeslot, $rvOpen);
my (@fetch, $dstart, $tstart, $start, $step, $names, $data, $rows, $columns, $line, $val, @vals);
my ($command, $tstatus, $tduration, $timeValue, $prevGroep, @multiarrayFullCondensedView, @multiarrayMinimalCondensedView);
my ($rv, $dbh, $sth, $lockString, $findString, $unlockString, $doChecklist, $timeCorrectie, $timeslot);
my ($groupFullView, $groupCondensedView, $emptyFullView, $emptyCondencedView, $emptyMinimalCondencedView, $itemFullCondensedView);
my ($checkOk, $checkSkip, $configNumber, $printCondensedView, $problemSolved, $verifyNumber, $inProgressNumber);
my ($playSoundInProgress, $playSoundPreviousStatus, $playSoundStatus, %tableSoundStatusCache);
my ($prevHour, $currHour, %timeperiodID_days, %catalogID_uKey_timeperiodID) = (-1, -1);
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
my $boolean_daemonQuit = 0;
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->finish() or $rv = errorTrapDBI($checklist, "Cannot sth->finish: $sql");
}
$step = $tinterval * 60;
$lastTimeslot = get_timeslot ($creationDate);
$firstTimeslot = $lastTimeslot - ($step * $NUMBEROFFTESTS);
$timeCorrectie = 0;
if ( $trigger ) {
$findString = 'select SQL_NO_CACHE title, duration, timeslot, startTime, endTime, endDate, status, statusMessage, perfdata, filename from '.$SERVERTABLEVENTSDISPLAYDT.' where catalogID="' .$catalogID. '" and uKey = "'.$uniqueKey.'" and s...
} else {
$findString = 'select SQL_NO_CACHE title, duration, timeslot, startTime, endTime, endDate, status, statusMessage, perfdata, filename from '.$SERVERTABLEVENTS.' force index (uKey) where catalogID="' .$catalogID. '" and uKey = "'.$uniqueKe...
}
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;
applications/display-test.pl view on Meta::CPAN
if ($dstatus eq 'OK' and $trendline) {
my $tSeconden = int(substr($ref->{duration}, 6, 2)) + int(substr($ref->{duration}, 3, 2)*60) + int(substr($ref->{duration}, 0, 2)*3600);
$tstatus = 'TRENDLINE' if ($tSeconden > $trendline);
}
$itemStatus[$timeslot] = $tstatus;
$itemStarttime[$timeslot] = $ref->{startTime};
$itemTimeslot[$timeslot] = $ref->{timeslot};
unless ( defined $ref->{perfdata} and $ref->{perfdata} ne '' ) { # remove performance data
# ($ref->{statusMessage}, undef) = split(/\|/, $ref->{statusMessage}, 2);
my $statusMessage = reverse $ref->{statusMessage};
my ($_statusMessage, undef) = reverse split(/\|/, $statusMessage, 2);
$ref->{statusMessage} = reverse $_statusMessage;
}
if ( -e $RESULTSPATH .'/'. $ref->{filename} ) {
$ref->{filename} = $RESULTSURL .'/'. $ref->{filename};
} else {
if ( -e $ref->{filename} ) {
applications/display-test.pl view on Meta::CPAN
printGroepCV($prevGroep, 1, 0);
if ($lockMySQL) {
if ($dbh and $rv) {
$unlockString = 'UNLOCK TABLES';
$dbh->do ( $unlockString ) or $rv = errorTrapDBI($checklist, "Cannot dbh->do: $unlockString");
}
}
$dbh->disconnect or $rv = errorTrapDBI($checklist, "Sorry, the database was unable to add your entry.") if ($dbh and $rv);
}
printGroepFooter('', 0);
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
$emptyMinimalCondencedView = ( scalar ( @multiarrayMinimalCondensedView ) ? 0 : 1 );
unless ( $emptyMinimalCondencedView ) {
@multiarrayMinimalCondensedView = ( sort { $b->[2] <=> $a->[2] } @multiarrayMinimalCondensedView );
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
$$hash_timeperiodID_days{$ref->{catalogID}}->{$ref->{timeperiodID}}->{$WDAYS{wednesday}} = ( $ref->{wednesday} ) ? $ref->{wednesday} : '';
$$hash_timeperiodID_days{$ref->{catalogID}}->{$ref->{timeperiodID}}->{$WDAYS{thursday}} = ( $ref->{thursday} ) ? $ref->{thursday} : '';
$$hash_timeperiodID_days{$ref->{catalogID}}->{$ref->{timeperiodID}}->{$WDAYS{friday}} = ( $ref->{friday} ) ? $ref->{friday} : '';
$$hash_timeperiodID_days{$ref->{catalogID}}->{$ref->{timeperiodID}}->{$WDAYS{saturday}} = ( $ref->{saturday} ) ? $ref->{saturday} : '';
}
}
$sth->finish() or $rv = errorTrapDBI($checklist, "Cannot sth->finish: $sql");
}
$dbh->disconnect or $rv = errorTrapDBI($checklist, "Sorry, the database was unable to add your entry.") if ($dbh and $rv);
if ($debug) {
use Data::Dumper;
print Dumper ( $hash_timeperiodID_days ), "\n\n";
}
}
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
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()) {
$$hash_catalogID_uKey_timeperiodID{$ref->{catalogID}}->{$ref->{uKey}}->{ASNMTAP} = $ref->{timeperiodID};
}
$sth->finish() or $rv = errorTrapDBI($checklist, "Cannot sth->finish: $sql");
}
$dbh->disconnect or $rv = errorTrapDBI($checklist, "Sorry, the database was unable to add your entry.") if ($dbh and $rv);
if (-s "$APPLICATIONPATH/custom/sde.pm") {
require "$APPLICATIONPATH/custom/sde.pm";
getTimeperiodRelationshipsSDE( $serverName, $checklist, $hash_catalogID_uKey_timeperiodID, $debug );
}
if ($debug) {
use Data::Dumper;
print Dumper ( $hash_catalogID_uKey_timeperiodID ), "\n\n";
}
applications/display-test.pl view on Meta::CPAN
if ( $emptyFullView ) {
$emptyMinimalCondencedViewMessage = $emptyCondencedViewMessage = $emptyFullViewMessage = 'Contact ASAP the server administrators, probably collector/config problems!';
} else {
$emptyCondencedViewMessage = 'All Monitored Applications are OK' if ( $emptyCondencedView );
$emptyMinimalCondencedViewMessage = 'All Monitored Applications are OK' if ( $emptyMinimalCondencedView );
}
} elsif ( $emptyFullView and $emptyCondencedView and $emptyMinimalCondencedView ) {
if ( $doChecklist ) {
$emptyMinimalCondencedViewMessage = $emptyCondencedViewMessage = $emptyFullViewMessage = 'No Monitored Applications';
} else {
$emptyMinimalCondencedViewMessage = $emptyCondencedViewMessage = $emptyFullViewMessage = 'Contact ASAP the server administrators, probably database problems!';
}
}
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
if (defined $emptyFullViewMessage) {
print HTML '<TR><TD class="StatusHeader" COLSPAN="', $colspanDisplayTime, '"><BR><H1>', $emptyFullViewMessage, '</H1></TD></TR>', "\n", '</TABLE>', "\n";
} else {
print HTML '<TR><TD class="StatusHeader" COLSPAN="', $colspanDisplayTime, '">', $STATUSHEADER01, '</TD></TR>', "\n", '</TABLE>', "\n";
}
applications/display-test.pl view on Meta::CPAN
# -p user:pasword\@proxy
if ($parameters =~ /-p / and ($parameters !~ /-u / and $parameters !~ /--username=/)) {
$parameters =~ s/(-p \w*:)\w*(\@\w+)/$1********$2/g;
}
# --password=
if ($parameters =~ /--password=/) {
$parameters =~ s/(--password=)\w+/$1********/g;
}
# --username= or -u and --password= or -p (database plugins)
if ($parameters =~ /-p / and ($parameters =~ /-u / or $parameters =~ /--username=/)) {
$parameters =~ s/(-p )\w+/$1********/g;
}
# --username= or -U and --password= or -P (ftp plugins)
if ($parameters =~ /-P / and ($parameters =~ /-U / or $parameters =~ /--username=/)) {
$parameters =~ s/(-P )\w+/$1********/g;
}
# j_username= or j_password= (J2EE based Applications)
applications/display.pl view on Meta::CPAN
if ($opt_l eq 'F' || $opt_l eq 'T') {
$lockMySQL = ($opt_l eq 'F') ? 0 : 1;
} else {
usage("Invalid lockMySQL: $opt_l\n");
}
}
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
my ($dchecklist, $dtest, $dfetch, $tinterval, $tgroep, $resultsdir, $ttest, $firstTimeslot, $lastTimeslot, $rvOpen);
my (@fetch, $dstart, $tstart, $start, $step, $names, $data, $rows, $columns, $line, $val, @vals);
my ($command, $tstatus, $tduration, $timeValue, $prevGroep, @multiarrayFullCondensedView, @multiarrayMinimalCondensedView);
my ($rv, $dbh, $sth, $lockString, $findString, $unlockString, $doChecklist, $timeCorrectie, $timeslot);
my ($groupFullView, $groupCondensedView, $emptyFullView, $emptyCondencedView, $emptyMinimalCondencedView, $itemFullCondensedView);
my ($checkOk, $checkSkip, $configNumber, $printCondensedView, $problemSolved, $verifyNumber, $inProgressNumber);
my ($playSoundInProgress, $playSoundPreviousStatus, $playSoundStatus, %tableSoundStatusCache);
my ($prevHour, $currHour, %timeperiodID_days, %catalogID_uKey_timeperiodID) = (-1, -1);
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
my $boolean_daemonQuit = 0;
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->finish() or $rv = errorTrapDBI($checklist, "Cannot sth->finish: $sql");
}
$step = $tinterval * 60;
$lastTimeslot = get_timeslot ($creationDate);
$firstTimeslot = $lastTimeslot - ($step * $NUMBEROFFTESTS);
$timeCorrectie = 0;
if ( $trigger ) {
$findString = 'select SQL_NO_CACHE title, duration, timeslot, startTime, endTime, endDate, status, statusMessage, perfdata, filename from '.$SERVERTABLEVENTSDISPLAYDT.' where catalogID="' .$catalogID. '" and uKey = "'.$uniqueKey.'" and s...
} else {
$findString = 'select SQL_NO_CACHE title, duration, timeslot, startTime, endTime, endDate, status, statusMessage, perfdata, filename from '.$SERVERTABLEVENTS.' force index (uKey) where catalogID="' .$catalogID. '" and uKey = "'.$uniqueKe...
}
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;
applications/display.pl view on Meta::CPAN
if ($dstatus eq 'OK' and $trendline) {
my $tSeconden = int(substr($ref->{duration}, 6, 2)) + int(substr($ref->{duration}, 3, 2)*60) + int(substr($ref->{duration}, 0, 2)*3600);
$tstatus = 'TRENDLINE' if ($tSeconden > $trendline);
}
$itemStatus[$timeslot] = $tstatus;
$itemStarttime[$timeslot] = $ref->{startTime};
$itemTimeslot[$timeslot] = $ref->{timeslot};
unless ( defined $ref->{perfdata} and $ref->{perfdata} ne '' ) { # remove performance data
# ($ref->{statusMessage}, undef) = split(/\|/, $ref->{statusMessage}, 2);
my $statusMessage = reverse $ref->{statusMessage};
my ($_statusMessage, undef) = reverse split(/\|/, $statusMessage, 2);
$ref->{statusMessage} = reverse $_statusMessage;
}
if ( -e $RESULTSPATH .'/'. $ref->{filename} ) {
$ref->{filename} = $RESULTSURL .'/'. $ref->{filename};
} else {
if ( -e $ref->{filename} ) {
applications/display.pl view on Meta::CPAN
printGroepCV($prevGroep, 1, 0);
if ($lockMySQL) {
if ($dbh and $rv) {
$unlockString = 'UNLOCK TABLES';
$dbh->do ( $unlockString ) or $rv = errorTrapDBI($checklist, "Cannot dbh->do: $unlockString");
}
}
$dbh->disconnect or $rv = errorTrapDBI($checklist, "Sorry, the database was unable to add your entry.") if ($dbh and $rv);
}
printGroepFooter('', 0);
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
$emptyMinimalCondencedView = ( scalar ( @multiarrayMinimalCondensedView ) ? 0 : 1 );
unless ( $emptyMinimalCondencedView ) {
@multiarrayMinimalCondensedView = ( sort { $b->[2] <=> $a->[2] } @multiarrayMinimalCondensedView );
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
$$hash_timeperiodID_days{$ref->{catalogID}}->{$ref->{timeperiodID}}->{$WDAYS{wednesday}} = ( $ref->{wednesday} ) ? $ref->{wednesday} : '';
$$hash_timeperiodID_days{$ref->{catalogID}}->{$ref->{timeperiodID}}->{$WDAYS{thursday}} = ( $ref->{thursday} ) ? $ref->{thursday} : '';
$$hash_timeperiodID_days{$ref->{catalogID}}->{$ref->{timeperiodID}}->{$WDAYS{friday}} = ( $ref->{friday} ) ? $ref->{friday} : '';
$$hash_timeperiodID_days{$ref->{catalogID}}->{$ref->{timeperiodID}}->{$WDAYS{saturday}} = ( $ref->{saturday} ) ? $ref->{saturday} : '';
}
}
$sth->finish() or $rv = errorTrapDBI($checklist, "Cannot sth->finish: $sql");
}
$dbh->disconnect or $rv = errorTrapDBI($checklist, "Sorry, the database was unable to add your entry.") if ($dbh and $rv);
if ($debug) {
use Data::Dumper;
print Dumper ( $hash_timeperiodID_days ), "\n\n";
}
}
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
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()) {
$$hash_catalogID_uKey_timeperiodID{$ref->{catalogID}}->{$ref->{uKey}}->{ASNMTAP} = $ref->{timeperiodID};
}
$sth->finish() or $rv = errorTrapDBI($checklist, "Cannot sth->finish: $sql");
}
$dbh->disconnect or $rv = errorTrapDBI($checklist, "Sorry, the database was unable to add your entry.") if ($dbh and $rv);
if (-s "$APPLICATIONPATH/custom/sde.pm") {
require "$APPLICATIONPATH/custom/sde.pm";
getTimeperiodRelationshipsSDE( $serverName, $checklist, $hash_catalogID_uKey_timeperiodID, $debug );
}
if ($debug) {
use Data::Dumper;
print Dumper ( $hash_catalogID_uKey_timeperiodID ), "\n\n";
}
applications/display.pl view on Meta::CPAN
if ( $emptyFullView ) {
$emptyMinimalCondencedViewMessage = $emptyCondencedViewMessage = $emptyFullViewMessage = 'Contact ASAP the server administrators, probably collector/config problems!';
} else {
$emptyCondencedViewMessage = 'All Monitored Applications are OK' if ( $emptyCondencedView );
$emptyMinimalCondencedViewMessage = 'All Monitored Applications are OK' if ( $emptyMinimalCondencedView );
}
} elsif ( $emptyFullView and $emptyCondencedView and $emptyMinimalCondencedView ) {
if ( $doChecklist ) {
$emptyMinimalCondencedViewMessage = $emptyCondencedViewMessage = $emptyFullViewMessage = 'No Monitored Applications';
} else {
$emptyMinimalCondencedViewMessage = $emptyCondencedViewMessage = $emptyFullViewMessage = 'Contact ASAP the server administrators, probably database problems!';
}
}
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
if (defined $emptyFullViewMessage) {
print HTML '<TR><TD class="StatusHeader" COLSPAN="', $colspanDisplayTime, '"><BR><H1>', $emptyFullViewMessage, '</H1></TD></TR>', "\n", '</TABLE>', "\n";
} else {
print HTML '<TR><TD class="StatusHeader" COLSPAN="', $colspanDisplayTime, '">', $STATUSHEADER01, '</TD></TR>', "\n", '</TABLE>', "\n";
}
applications/display.pl view on Meta::CPAN
# -p user:pasword\@proxy
if ($parameters =~ /-p / and ($parameters !~ /-u / and $parameters !~ /--username=/)) {
$parameters =~ s/(-p \w*:)\w*(\@\w+)/$1********$2/g;
}
# --password=
if ($parameters =~ /--password=/) {
$parameters =~ s/(--password=)\w+/$1********/g;
}
# --username= or -u and --password= or -p (database plugins)
if ($parameters =~ /-p / and ($parameters =~ /-u / or $parameters =~ /--username=/)) {
$parameters =~ s/(-p )\w+/$1********/g;
}
# --username= or -U and --password= or -P (ftp plugins)
if ($parameters =~ /-P / and ($parameters =~ /-U / or $parameters =~ /--username=/)) {
$parameters =~ s/(-P )\w+/$1********/g;
}
# j_username= or j_password= (J2EE based Applications)
applications/htmlroot/cgi-bin/admin/countries.pl view on Meta::CPAN
my $urlAccessParameters = "pagedir=$pagedir&pageset=$pageset&debug=$debug&CGISESSID=$sessionID&pageNo=$pageNo&pageOffset=$pageOffset&orderBy=$orderBy&action=$action&countryID=$CcountryID&countryName=$CcountryName&activated=$Cactivated";
# 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>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/countries.pl view on Meta::CPAN
$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;
if ( $rv ) {
($CcountryID, $CcountryName, $Cactivated) = $sth->fetchrow_array() or $rv = error_trap_DBI(*STDOUT, "Cannot $sth->fetchrow_array: $sql", $debug, $pagedir, $pageset, $htmlTitle, $subTitle, 3600, '', $sessionID) if ($sth->rows);
$Cactivated = ($Cactivated == 1) ? 'on' : 'off';
$sth->finish() or $rv = error_trap_DBI(*STDOUT, "Cannot sth->finish: $sql", $debug, $pagedir, $pageset, $htmlTitle, $subTitle, 3600, '', $sessionID);
}
}
$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 ) {
# HTML - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
if ($action eq 'duplicateView' or $action eq 'editView' or $action eq 'insertView') {
print_header (*STDOUT, $pagedir, $pageset, $htmlTitle, $subTitle, 3600, '', 'F', '', $sessionID);
print <<HTML;
<script language="JavaScript1.2" type="text/javascript">
applications/htmlroot/cgi-bin/admin/crontabs.pl view on Meta::CPAN
my $urlAccessParameters = "pagedir=$pagedir&pageset=$pageset&debug=$debug&CGISESSID=$sessionID&pageNo=$pageNo&pageOffset=$pageOffset&orderBy=$orderBy&action=$action&catalogID=$CcatalogID&catalogIDreload=$CcatalogIDreload&lineNumber=$ClineNumber&uKey=...
# 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 ...
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/crontabs.pl view on Meta::CPAN
} else {
$sql = "select uKey, concat( title, ' (', $SERVERTABLENVIRONMENT.label, ')' ) from $SERVERTABLPLUGINS, $SERVERTABLENVIRONMENT where uKey = '$CuKey' and catalogID = '$CcatalogID' and $SERVERTABLPLUGINS.environment = $SERVERTABLENVIRONMENT.envi...
}
($rv, $uKeySelect, $htmlTitle) = create_combobox_from_DBI ($rv, $dbh, $sql, 1, $nextAction, $CuKey, 'uKey', 'none', '-Select-', $formDisabledPrimaryKey, '', $pagedir, $pageset, $htmlTitle, $subTitle, $sessionID, $debug);
$sql = "select collectorDaemon, groupName from $SERVERTABLCLLCTRDMNS where catalogID = '$CcatalogID' order by groupName";
($rv, $collectorDaemonSelect, undef) = create_combobox_from_DBI ($rv, $dbh, $sql, 1, '', $CcollectorDaemon, 'collectorDaemon', 'none', '-Select-', $formDisabledAll, '', $pagedir, $pageset, $htmlTitle, $subTitle, $sessionID, $debug);
}
$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 ) {
# HTML - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
if ($action eq 'duplicateView' or $action eq 'editView' or $action eq 'insertView' or $action eq 'crontabView') {
print_header (*STDOUT, $pagedir, $pageset, $htmlTitle, $subTitle, 3600, '', 'F', '', $sessionID);
my $crontabFormatDigits = '(?:[0-9]{1,2})';
my $crontabValueDigitsMin = '(?:[0-9]|[1-5][0-9])';
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
$matchingRsyncMirror .= "\n <tr><td>No records found for any RsyncMirror</td></tr>";
}
$matchingRsyncMirror .= "\n </table>";
$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 ) {
while( $sth->fetch() ) {
$ASNMTAP_PATH { 'M' } { $masterFQDN } = $masterASNMTAP_PATH if ( defined $masterFQDN and $masterFQDN and defined $masterASNMTAP_PATH and $masterASNMTAP_PATH );
$ASNMTAP_PATH { 'S'} { $slaveFQDN } = $slaveASNMTAP_PATH if ( defined $slaveFQDN and $slaveFQDN and defined $slaveASNMTAP_PATH and $slaveASNMTAP_PATH );
}
}
$sth->finish() or $rv = error_trap_DBI(*STDOUT, "Cannot sth->finish: $sql", $debug, $pagedir, $pageset, $htmlTitle, $subTitle, -1, '', $sessionID) if $rv;
}
$dbh->disconnect or $rv = error_trap_DBI(*STDOUT, "Sorry, the database was unable to add your entry.", $debug, $pagedir, $pageset, $htmlTitle, $subTitle, -1, '', $sessionID);
}
$compareView .= "\n <table width=\"100%\" align=\"center\" border=\"0\" cellpadding=\"1\" cellspacing=\"1\" bgcolor=\"$COLORSTABLE{TABLE}\">";
$compareView .= "\n <tr><th>Compare Configurations</th></tr>";
my $compareDiff = system_call ("$DIFFCOMMAND -braq -I 'generated on 20[0-9][0-9]/[0-9][0-9]/[0-9][0-9] [0-9][0-9]:[0-9][0-9]:[0-9][0-9]'", "$APPLICATIONPATH/tmp/$CONFIGDIR/generated $APPLICATIONPATH/tmp/$CONFIGDIR/installed", $debug);
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 ) {
while( $sth->fetch() ) {
$ASNMTAP_PATH { 'M' } { $masterFQDN } = $masterASNMTAP_PATH if ( defined $masterFQDN and $masterFQDN and defined $masterASNMTAP_PATH and $masterASNMTAP_PATH );
$ASNMTAP_PATH { 'S'} { $slaveFQDN } = $slaveASNMTAP_PATH if ( defined $slaveFQDN and $slaveFQDN and defined $slaveASNMTAP_PATH and $slaveASNMTAP_PATH );
}
}
$sth->finish() or $rv = error_trap_DBI(*STDOUT, "Cannot sth->finish: $sql", $debug, $pagedir, $pageset, $htmlTitle, $subTitle, -1, '', $sessionID) if $rv;
}
$dbh->disconnect or $rv = error_trap_DBI(*STDOUT, "Sorry, the database was unable to add your entry.", $debug, $pagedir, $pageset, $htmlTitle, $subTitle, -1, '', $sessionID);
}
$installView .= "\n <table width=\"100%\" align=\"center\" border=\"0\" cellpadding=\"1\" cellspacing=\"1\" bgcolor=\"$COLORSTABLE{TABLE}\">";
$installView .= "\n <tr><th>Install Configuration</th></tr>";
if ( -e "$APPLICATIONPATH/tmp/$CONFIGDIR/generated" ) {
my $compareDiff = system_call ("$DIFFCOMMAND -braq -E 'generated on 20[0-9][0-9]/[0-9][0-9]/[0-9][0-9] [0-9][0-9]:[0-9][0-9]:[0-9][0-9]'", "$APPLICATIONPATH/tmp/$CONFIGDIR/generated $APPLICATIONPATH/tmp/$CONFIGDIR/installed", $debug);
if ($compareDiff eq '') {
$installView .= "\n <tr bgcolor=\"$COLORSTABLE{NOBLOCK}\"><td>The generated and installed configurations are identical.</td></tr>";
applications/htmlroot/cgi-bin/admin/generateConfig.pl view on Meta::CPAN
}
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
print_legend (*STDOUT);
print '</BODY>', "\n", '</HTML>', "\n";
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
sub createCollectorCTscript {
my ($typeMonitoringCharDorC, $typeServersCharMorS, $typeActiveServer, $serverFQDN, $serverAdminCollectorFQDN, $serverASNMTAP_PATH , $serverRSYNC_PATH , $serverSSH_PATH, $databaseFQDN, $subdir, $collectorDaemon, $mode, $dumphttp, $status, $debugDaem...
my ($hostnameAdminCollector, undef) = split (/\./, $serverAdminCollectorFQDN, 2);
return ('') if ( "CollectorCT-$collectorDaemon.sh" eq "CollectorCT-${hostnameAdminCollector}.sh" );
my $filename = "$APPLICATIONPATH/tmp/$CONFIGDIR/generated/$typeMonitoringCharDorC$typeServersCharMorS-$typeActiveServer-$serverFQDN/$subdir/CollectorCT-$collectorDaemon.sh";
my $command = "cat $APPLICATIONPATH/tools/templates/CollectorCT-template.sh >> $filename";
my $rvOpen = open(CollectorCT, ">$filename");
if ($rvOpen) {
print CollectorCT <<STARTUPFILE;
#!/bin/bash
# ---------------------------------------------------------------
# © Copyright $COPYRIGHT Alex Peeters [alex.peeters\@citap.be]
# ---------------------------------------------------------------
# This shell script takes care of starting and stopping
AMNAME=\"Collector ASNMTAP $collectorDaemon\"
AMPATH=$serverASNMTAP_PATH/applications
AMCMD=collector.pl
AMPARA=\"--hostname=$databaseFQDN --mode=$mode --collectorlist=CollectorCT-$collectorDaemon --dumphttp=$dumphttp --status=$status --debug=$debugDaemon --screenDebug=$debugAllScreen --allDebug=$debugAllFile --nokDebug=$debugNokFile\"
PIDPATH=$serverASNMTAP_PATH/pid
PIDNAME=CollectorCT-$collectorDaemon.pid
if [ -f ~/.profile ]; then
source ~/.profile
fi
if [ -f ~/.bash_profile ]; then
source ~/.bash_profile
fi
applications/htmlroot/cgi-bin/admin/generateConfig.pl view on Meta::CPAN
close (AsnmtapCollectorCTscript);
}
$statusMessage .= "<tr bgcolor=\"$COLORSTABLE{ENDBLOCK}\"><td><a href=\"/$CONFIGDIR/generated/$typeMonitoringCharDorC$typeServersCharMorS-$typeActiveServer-$serverFQDN/$subdir/asnmtap-collector.sh\" target=\"_blank\">asnmtap-collector.sh ($subdir)<...
return ($statusMessage);
}
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
sub createDisplayCTscript {
my ($typeMonitoringCharDorC, $typeServersCharMorS, $typeActiveServer, $serverFQDN, $serverASNMTAP_PATH , $serverRSYNC_PATH , $serverSSH_PATH, $databaseFQDN, $subdir, $displayDaemon, $pagedirs, $loop, $trigger, $displayTime, $lockMySQL, $debugDaemon...
my $filename = "$APPLICATIONPATH/tmp/$CONFIGDIR/generated/$typeMonitoringCharDorC$typeServersCharMorS-$typeActiveServer-$serverFQDN/$subdir/DisplayCT-$displayDaemon.sh";
my $command = "cat $APPLICATIONPATH/tools/templates/DisplayCT-template.sh >> $filename";
my $rvOpen = open(DisplayCT, ">$filename");
if ($rvOpen) {
print DisplayCT <<STARTUPFILE;
#!/bin/bash
# ---------------------------------------------------------------
# © Copyright $COPYRIGHT Alex Peeters [alex.peeters\@citap.be]
# ---------------------------------------------------------------
# This shell script takes care of starting and stopping
AMNAME=\"Display ASNMTAP $displayDaemon\"
AMPATH=$serverASNMTAP_PATH/applications
AMCMD=display.pl
AMPARA=\"--hostname=$databaseFQDN --checklist=DisplayCT-$displayDaemon --pagedir=$pagedirs --loop=$loop --trigger=$trigger --displayTime=$displayTime --lockMySQL=$lockMySQL --debug=$debugDaemon\"
PIDPATH=$serverASNMTAP_PATH/pid
PIDNAME=DisplayCT-$displayDaemon.pid
SOUNDCACHENAME=DisplayCT-$displayDaemon-sound-status.cache
if [ -f ~/.profile ]; then
source ~/.profile
fi
if [ -f ~/.bash_profile ]; then
source ~/.bash_profile
applications/htmlroot/cgi-bin/admin/holidays.pl view on Meta::CPAN
my $urlAccessParameters = "pagedir=$pagedir&pageset=$pageset&debug=$debug&CGISESSID=$sessionID&pageNo=$pageNo&pageOffset=$pageOffset&orderBy=$orderBy&action=$action&catalogID=$CcatalogID&catalogIDreload=$CcatalogIDreload&holidayID=$CholidayID&formule...
# 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, $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/holidays.pl view on Meta::CPAN
$Cactivated = ($Cactivated == 1) ? 'on' : 'off';
$sth->finish() or $rv = error_trap_DBI(*STDOUT, "Cannot sth->finish: $sql", $debug, $pagedir, $pageset, $htmlTitle, $subTitle, 3600, '', $sessionID);
}
}
if ($action eq 'deleteView' or $action eq 'displayView' or $action eq 'duplicateView' or $action eq 'editView' or $action eq 'insertView') {
$sql = "select countryID, countryName from $SERVERTABLCOUNTRIES where activated = '1' order by countryName";
($rv, $countryIDSelect, undef) = create_combobox_from_DBI ($rv, $dbh, $sql, 1, '', $CcountryID, 'countryID', 'none', '-Select-', $formDisabledPrimaryKey, '', $pagedir, $pageset, $htmlTitle, $subTitle, $sessionID, $debug);
}
$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 ) {
# HTML - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
if ($action eq 'duplicateView' or $action eq 'editView' or $action eq 'insertView') {
print_header (*STDOUT, $pagedir, $pageset, $htmlTitle, $subTitle, 3600, "onload=\"javascript:enableDisableFields();\"", 'F', '', $sessionID);
print <<HTML;
<script language="JavaScript1.2" type="text/javascript">
applications/htmlroot/cgi-bin/admin/holidaysBundle.pl view on Meta::CPAN
my $urlAccessParameters = "pagedir=$pagedir&pageset=$pageset&debug=$debug&CGISESSID=$sessionID&pageNo=$pageNo&pageOffset=$pageOffset&orderBy=$orderBy&action=$action&catalogID=$CcatalogID&catalogIDreload=$CcatalogIDreload&holidayBundleID=$CholidayBund...
# 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>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/holidaysBundle.pl view on Meta::CPAN
} else {
$matchingPlugins .= "<tr><td>No records found</td></tr>\n";
}
$sth->finish() or $rv = error_trap_DBI(*STDOUT, "Cannot sth->finish: $sql", $debug, $pagedir, $pageset, $htmlTitle, $subTitle, 3600, '', $sessionID);
}
$matchingPlugins .= "</table>\n";
}
$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 ) {
# HTML - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
if ($action eq 'duplicateView' or $action eq 'editView' or $action eq 'insertView') {
print_header (*STDOUT, $pagedir, $pageset, $htmlTitle, $subTitle, 3600, '', 'F', '', $sessionID);
print <<HTML;
<script language="JavaScript1.2" type="text/javascript">
applications/htmlroot/cgi-bin/admin/index.pl view on Meta::CPAN
<tr><td class="StatusItem"> </td></tr>
<tr><td class="StatusItem"><a href="languages.pl?pagedir=$pagedir&pageset=$pageset&debug=F&CGISESSID=$sessionID">Languages</a></td></tr>
<tr><td class="StatusItem"><a href="countries.pl?pagedir=$pagedir&pageset=$pageset&debug=F&CGISESSID=$sessionID">Countries</a></td></tr>
<tr><td class="StatusItem"><a href="timeperiods.pl?pagedir=$pagedir&pageset=$pageset&debug=F&CGISESSID=$sessionID">Timeperiods</a></td></tr>
<tr><td class="StatusItem"> </td></tr>
<tr><td class="StatusItem"><a href="holidays.pl?pagedir=$pagedir&pageset=$pageset&debug=F&CGISESSID=$sessionID">Holidays</a></td></tr>
<tr><td class="StatusItem"><a href="holidaysBundle.pl?pagedir=$pagedir&pageset=$pageset&debug=F&CGISESSID=$sessionID">Holidays Bundle</a></td></tr>
<tr><td class="StatusItem"> </td></tr>
<tr><td class="StatusItem"><a href="users.pl?pagedir=$pagedir&pageset=$pageset&debug=F&CGISESSID=$sessionID">Users</a></td></tr>
<tr><td class="StatusItem"> </td></tr>
<tr><td class="StatusItem"><a href="reports_perfdata.pl?pagedir=$pagedir&pageset=$pageset&debug=F&CGISESSID=$sessionID">Reports Perfdata (to define the 'Performance Times' that are used by the automatically generated Reports)</a></td><...
<tr><td class="StatusItem"><a href="reports.pl?pagedir=$pagedir&pageset=$pageset&debug=F&CGISESSID=$sessionID">Reports (to define the 'Detailed Statistics & Report Generation' that are generated by the Archiver)</a></td></tr>
<tr><td class="StatusItem"> </td></tr>
<tr><td class="StatusItem"><a href="resultsdirs.pl?pagedir=$pagedir&pageset=$pageset&debug=F&CGISESSID=$sessionID">Resultdirs (where the Collector writes the returned data from a plugin)</a></td></tr>
<tr><td class="StatusItem"> </td></tr>
<tr><td class="StatusItem"><a href="plugins.pl?pagedir=$pagedir&pageset=$pageset&debug=F&CGISESSID=$sessionID">Plugins (to define the plugins that are executed by the Collector)</a></td></tr>
<tr><td class="StatusItem"> </td></tr>
<tr><td class="StatusItem"><a href="views.pl?pagedir=$pagedir&pageset=$pageset&debug=F&CGISESSID=$sessionID">Views (to define the different views used by the Display daemons)</a></td></tr>
<tr><td class="StatusItem"><a href="crontabs.pl?pagedir=$pagedir&pageset=$pageset&debug=F&CGISESSID=$sessionID">Crontabs (to define the different crontabs used by the Collector daemons)</a></td></tr>
<tr><td class="StatusItem"> </td></tr>
<tr><td class="StatusItem"><a href="generateConfig.pl?pagedir=$pagedir&pageset=$pageset&debug=F&CGISESSID=$sessionID">Configurations (for the Archiver, Display, Collector and Rsync Mirroring)</a></td></tr>
</table>
</td></tr></table>
<br>
applications/htmlroot/cgi-bin/admin/languages.pl view on Meta::CPAN
my $urlAccessParameters = "pagedir=$pagedir&pageset=$pageset&debug=$debug&CGISESSID=$sessionID&pageNo=$pageNo&pageOffset=$pageOffset&orderBy=$orderBy&action=$action&keyLanguage=$CkeyLanguage&languageName=$ClanguageName&languageFamily=$ClanguageFamily...
# 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>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/languages.pl view on Meta::CPAN
$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;
if ( $rv ) {
($CkeyLanguage, $ClanguageName, $ClanguageFamily, $ClanguageActive) = $sth->fetchrow_array() or $rv = error_trap_DBI(*STDOUT, "Cannot $sth->fetchrow_array: $sql", $debug, $pagedir, $pageset, $htmlTitle, $subTitle, 3600, '', $sessionID) if ($s...
$ClanguageActive = ($ClanguageActive == 1) ? 'on' : 'off';
$sth->finish() or $rv = error_trap_DBI(*STDOUT, "Cannot sth->finish: $sql", $debug, $pagedir, $pageset, $htmlTitle, $subTitle, 3600, '', $sessionID);
}
}
$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 ) {
# HTML - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
if ($action eq 'duplicateView' or $action eq 'editView' or $action eq 'insertView') {
print_header (*STDOUT, $pagedir, $pageset, $htmlTitle, $subTitle, 3600, '', 'F', '', $sessionID);
print <<HTML;
<script language="JavaScript1.2" type="text/javascript">
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/plugins.pl view on Meta::CPAN
} else {
$matchingViewsCrontabs .= "<tr><td>No records found</td></tr>\n";
}
$sth->finish() or $rv = error_trap_DBI(*STDOUT, "Cannot sth->finish: $sql", $debug, $pagedir, $pageset, $htmlTitle, $subTitle, 3600, '', $sessionID);
}
$matchingViewsCrontabs .= "</table>\n";
}
$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 ) {
# HTML - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
if ($action eq 'duplicateView' or $action eq 'editView' or $action eq 'insertView') {
print_header (*STDOUT, $pagedir, $pageset, $htmlTitle, $subTitle, 3600, '', 'F', '', $sessionID);
print <<HTML;
<script language="JavaScript1.2" type="text/javascript">
applications/htmlroot/cgi-bin/admin/plugins.pl view on Meta::CPAN
if ( document.plugins.resultsdir.options[document.plugins.resultsdir.selectedIndex].value == 'none' ) {
document.plugins.resultsdir.focus();
alert('Please create/select a results subdir!');
return false;
}
return true;
}
</script>
<form action="$ENV{SCRIPT_NAME}" method="post" name="plugins" enctype="multipart/form-data" onSubmit="return validateForm();">
HTML
} elsif ($action eq 'listView') {
print_header (*STDOUT, $pagedir, $pageset, $htmlTitle, $subTitle, 3600, '', 'F', '', $sessionID);
print <<HTML;
<script language="JavaScript1.2" type="text/javascript">
function submitForm() {
document.plugins.catalogIDreload.value = 1;
document.plugins.submit();
return true;
applications/htmlroot/cgi-bin/admin/plugins.pl view on Meta::CPAN
function validateForm() {
if ( document.plugins.filter.value != null || document.plugins.filter.value != "") {
document.plugins.pageNo.value = 1;
document.plugins.pageOffset.value = 0 ;
}
return true;
}
</script>
<form action="$ENV{SCRIPT_NAME}" method="post" name="plugins" enctype="multipart/form-data" onSubmit="return validateForm();">
HTML
} elsif ($action eq 'deleteView') {
print_header (*STDOUT, $pagedir, $pageset, $htmlTitle, $subTitle, 3600, '', 'F', '', $sessionID);
print "<form action=\"" . $ENV{SCRIPT_NAME} . "\" method=\"post\" name=\"plugins\">\n";
$pageNo = 1; $pageOffset = 0;
} else {
print_header (*STDOUT, $pagedir, $pageset, $htmlTitle, $subTitle, 3600, '', 'F', '', $sessionID);
}
if ($action eq 'deleteView' or $action eq 'duplicateView' or $action eq 'editView' or $action eq 'insertView' or $action eq 'listView') {
applications/htmlroot/cgi-bin/admin/reports.pl view on Meta::CPAN
my $CreportTitle = (defined $cgi->param('reportTitle')) ? $cgi->param('reportTitle') : '';
my $Cperiode = (defined $cgi->param('periode')) ? $cgi->param('periode') : 'none';
my $CtimeperiodID = (defined $cgi->param('timeperiodID')) ? $cgi->param('timeperiodID') : 'none';
my $Cstatus = (defined $cgi->param('status')) ? $cgi->param('status') : 'off';
my $CerrorDetails = (defined $cgi->param('errorDetails')) ? $cgi->param('errorDetails') : 'off';
my $Cbar = (defined $cgi->param('bar')) ? $cgi->param('bar') : 'off';
my $ChourlyAverage = (defined $cgi->param('hourlyAverage')) ? $cgi->param('hourlyAverage') : 'off';
my $CdailyAverage = (defined $cgi->param('dailyAverage')) ? $cgi->param('dailyAverage') : 'off';
my $CshowDetails = (defined $cgi->param('showDetails')) ? $cgi->param('showDetails') : 'off';
my $CshowComments = (defined $cgi->param('showComments')) ? $cgi->param('showComments') : 'off';
my $CshowPerfdata = (defined $cgi->param('showPerfdata')) ? $cgi->param('showPerfdata') : 'off';
my $CshowTop20SlowTests = (defined $cgi->param('showTop20SlowTests')) ? $cgi->param('showTop20SlowTests') : 'off';
my $CprinterFriendlyOutput = (defined $cgi->param('printerFriendlyOutput')) ? $cgi->param('printerFriendlyOutput') : 'off';
my $CformatOutput = (defined $cgi->param('formatOutput')) ? $cgi->param('formatOutput') : 'none';
my $CuserPassword = (defined $cgi->param('userPassword')) ? $cgi->param('userPassword') : '';
my $Cactivated = (defined $cgi->param('activated')) ? $cgi->param('activated') : 'off';
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
my $htmlTitle = $APPLICATION;
# Init parameters
my ($rv, $dbh, $sth, $sql, $header, $numberRecordsIntoQuery, $nextAction, $formDisabledAll, $formDisabledPrimaryKey, $submitButton, $uKeySelect);
# User Session and Access Control
my ($sessionID, $iconAdd, $iconDelete, $iconDetails, $iconEdit, $iconQuery, $iconTable, $errorUserAccessControl, undef, undef, undef, undef, undef, undef, undef, undef, undef, undef, undef, $subTitle) = user_session_and_access_control (1, 'admin', $c...
# Serialize the URL Access Parameters into a string
my $urlAccessParameters = "pagedir=$pagedir&pageset=$pageset&debug=$debug&CGISESSID=$sessionID&pageNo=$pageNo&pageOffset=$pageOffset&orderBy=$orderBy&action=$action&catalogID=$CcatalogID&catalogIDreload=$CcatalogIDreload&id=$Cid&uKey=$CuKey&reportTit...
# 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.pl view on Meta::CPAN
$nextAction = "insertView";
} else {
$htmlTitle = "Report $Cid from $CcatalogID inserted";
my $dummyStatus = ($Cstatus eq 'on') ? 1 : 0;
my $dummyErrorDetails = ($CerrorDetails eq 'on') ? 1 : 0;
my $dummyBar = ($Cbar eq 'on') ? 1 : 0;
my $dummyHourlyAverage = ($ChourlyAverage eq 'on') ? 1 : 0;
my $dummyDailyAverage = ($CdailyAverage eq 'on') ? 1 : 0;
my $dummyShowDetails = ($CshowDetails eq 'on') ? 1 : 0;
my $dummyShowComments = ($CshowComments eq 'on') ? 1 : 0;
my $dummyShowPerfdata = ($CshowPerfdata eq 'on') ? 1 : 0;
my $dummyShowTop20SlowTests = ($CshowTop20SlowTests eq 'on') ? 1 : 0;
my $dummyPrinterFriendlyOutput = ($CprinterFriendlyOutput eq 'on') ? 1 : 0;
my $dummyActivated = ($Cactivated eq 'on') ? 1 : 0;
$sql = 'INSERT INTO ' .$SERVERTABLREPORTS. ' SET catalogID="' .$CcatalogID. '", uKey="' .$CuKey. '", reportTitle="' .$CreportTitle. '", periode="' .$Cperiode. '", timeperiodID="' .$CtimeperiodID. '", status="' .$dummyStatus. '", errorDetails=...
$dbh->do ( $sql ) or $rv = error_trap_DBI(*STDOUT, "Cannot dbh->do: $sql", $debug, $pagedir, $pageset, $htmlTitle, $subTitle, 3600, '', $sessionID);
$nextAction = "listView" if ($rv);
}
} elsif ($action eq 'deleteView') {
$formDisabledAll = "disabled";
$htmlTitle = "Delete Report $Cid from $CcatalogID";
$submitButton = "Delete";
$nextAction = "delete" if ($rv);
} elsif ($action eq 'delete') {
$sql = "select id, $SERVERTABLREPORTS.uKey from $SERVERTABLREPORTS, $SERVERTABLREPORTSPRFDT where $SERVERTABLREPORTS.catalogID = '$CcatalogID' and id = '$Cid' and $SERVERTABLREPORTS.catalogID = $SERVERTABLREPORTSPRFDT.catalogID and $SERVERTABLR...
applications/htmlroot/cgi-bin/admin/reports.pl view on Meta::CPAN
$nextAction = "edit" if ($rv);
} elsif ($action eq 'edit') {
$htmlTitle = "Report $Cid from updated $CcatalogID";
my $dummyStatus = ($Cstatus eq 'on') ? 1 : 0;
my $dummyErrorDetails = ($CerrorDetails eq 'on') ? 1 : 0;
my $dummyBar = ($Cbar eq 'on') ? 1 : 0;
my $dummyHourlyAverage = ($ChourlyAverage eq 'on') ? 1 : 0;
my $dummyDailyAverage = ($CdailyAverage eq 'on') ? 1 : 0;
my $dummyShowDetails = ($CshowDetails eq 'on') ? 1 : 0;
my $dummyShowComments = ($CshowComments eq 'on') ? 1 : 0;
my $dummyShowPerfdata = ($CshowPerfdata eq 'on') ? 1 : 0;
my $dummyShowTop20SlowTests = ($CshowTop20SlowTests eq 'on') ? 1 : 0;
my $dummyPrinterFriendlyOutput = ($CprinterFriendlyOutput eq 'on') ? 1 : 0;
my $dummyActivated = ($Cactivated eq 'on') ? 1 : 0;
$sql = 'UPDATE ' .$SERVERTABLREPORTS. ' SET catalogID="' .$CcatalogID. '", uKey="' .$CuKey. '", reportTitle="' .$CreportTitle. '", periode="' .$Cperiode. '", timeperiodID="' .$CtimeperiodID. '", status="' .$dummyStatus. '", errorDetails="' .$du...
$dbh->do ( $sql ) or $rv = error_trap_DBI(*STDOUT, "Cannot dbh->do: $sql", $debug, $pagedir, $pageset, $htmlTitle, $subTitle, 3600, '', $sessionID);
$nextAction = "listView" if ($rv);
} elsif ($action eq 'listView') {
$htmlTitle = "All reports listed";
$formDisabledPrimaryKey = '';
if ( $CcatalogIDreload ) {
$pageNo = 1;
$pageOffset = 0;
}
applications/htmlroot/cgi-bin/admin/reports.pl view on Meta::CPAN
$navigationBar .= record_navigation_bar_alpha ($rv, $dbh, $SERVERTABLREPORTS, 'reportTitle', "catalogID = '$CcatalogID'", $numberRecordsIntoQuery, $RECORDSONPAGE, $ENV{SCRIPT_NAME} . "?pagedir=$pagedir&pageset=$pageset&debug=$debug&...
$sql = "select $SERVERTABLREPORTS.catalogID, $SERVERTABLREPORTS.id, $SERVERTABLREPORTS.uKey, $SERVERTABLREPORTS.reportTitle, $SERVERTABLREPORTS.periode, $SERVERTABLTIMEPERIODS.timeperiodName, $SERVERTABLREPORTS.formatOutput, $SERVERTABLREPORTS....
$header = "<th><a href=\"$urlWithAccessParameters&action=listView&orderBy=catalogID desc, reportTitle desc\"><IMG SRC=\"$IMAGESURL/$ICONSRECORD{up}\" ALT=\"Up\" BORDER=0></a> Catalog ID <a href=\"$urlWithAccessParameters&action=list...
$header .= "<th><a href=\"$urlWithAccessParameters&action=listView&orderBy=timeperiodName desc, reportTitle asc\"><IMG SRC=\"$IMAGESURL/$ICONSRECORD{up}\" ALT=\"Up\" BORDER=0></a> SLA Window <a href=\"$urlWithAccessParameters&action...
($rv, $matchingReports, $nextAction) = record_navigation_table ($rv, $dbh, $sql, 'Report', 'catalogID|id', '0|1', '1|2', '4#N=>Never|D=>Daily|W=>Weekly|M=>Monthly|Q=>Quarterly|Y=>Yearly', '', $orderBy, $header, $navigationBar, $iconAdd, $iconDe...
}
if ($action eq 'deleteView' or $action eq 'displayView' or $action eq 'duplicateView' or $action eq 'editView') {
$sql = "select catalogID, id, uKey, reportTitle, periode, timeperiodID, status, errorDetails, bar, hourlyAverage, dailyAverage, showDetails, showComments, showPerfdata, showTop20SlowTests, printerFriendlyOutput, formatOutput, userPassword, acti...
$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;
if ( $rv ) {
($CcatalogID, $Cid, $CuKey, $CreportTitle, $Cperiode, $CtimeperiodID, $Cstatus, $CerrorDetails, $Cbar, $ChourlyAverage, $CdailyAverage, $CshowDetails, $CshowComments, $CshowPerfdata, $CshowTop20SlowTests, $CprinterFriendlyOutput, $CformatOutp...
if ($action eq 'duplicateView') {
$CcatalogID = $CATALOGID;
$Cid = 'new';
}
$Cstatus = ($Cstatus == 1) ? 'on' : 'off';
$CerrorDetails = ($CerrorDetails == 1) ? 'on' : 'off';
$Cbar = ($Cbar == 1) ? 'on' : 'off';
$ChourlyAverage = ($ChourlyAverage == 1) ? 'on' : 'off';
$CdailyAverage = ($CdailyAverage == 1) ? 'on' : 'off';
$CshowDetails = ($CshowDetails == 1) ? 'on' : 'off';
$CshowComments = ($CshowComments == 1) ? 'on' : 'off';
$CshowPerfdata = ($CshowPerfdata == 1) ? 'on' : 'off';
$CshowTop20SlowTests = ($CshowTop20SlowTests == 1) ? 'on' : 'off';
$CprinterFriendlyOutput = ($CprinterFriendlyOutput == 1) ? 'on' : 'off';
$Cactivated = ($Cactivated == 1) ? 'on' : 'off';
$sth->finish() or $rv = error_trap_DBI(*STDOUT, "Cannot sth->finish: $sql", $debug, $pagedir, $pageset, $htmlTitle, $subTitle, 3600, '', $sessionID);
}
}
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, undef) = create_combobox_from_DBI ($rv, $dbh, $sql, 1, '', $CuKey, 'uKey', 'none', '-Select-', $formDisabledAll, '', $pagedir, $pageset, $htmlTitle, $subTitle, $sessionID, $debug);
}
$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 ) {
# HTML - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
if ($action eq 'duplicateView' or $action eq 'editView' or $action eq 'insertView') {
print_header (*STDOUT, $pagedir, $pageset, $htmlTitle, $subTitle, 3600, "onload=\"javascript:enableDisableFields();\"", 'F', '', $sessionID);
print <<HTML;
<script language="JavaScript1.2" type="text/javascript">
applications/htmlroot/cgi-bin/admin/reports.pl view on Meta::CPAN
HTML
if ($action eq 'deleteView' or $action eq 'displayView' or $action eq 'duplicateView' or $action eq 'editView' or $action eq 'insertView') {
my $statusChecked = ($Cstatus eq 'on') ? " checked" : '';
my $errorDetailsChecked = ($CerrorDetails eq 'on') ? " checked" : '';
my $barChecked = ($Cbar eq 'on') ? " checked" : '';
my $hourlyAverageChecked = ($ChourlyAverage eq 'on') ? " checked" : '';
my $dailyAverageChecked = ($CdailyAverage eq 'on') ? " checked" : '';
my $showDetailsChecked = ($CshowDetails eq 'on') ? " checked" : '';
my $showCommentsChecked = ($CshowComments eq 'on') ? " checked" : '';
my $showPerfdataChecked = ($CshowPerfdata eq 'on') ? " checked" : '';
my $showTop20SlowTestsChecked = ($CshowTop20SlowTests eq 'on') ? " checked" : '';
my $printerFriendlyOutputChecked = ($CprinterFriendlyOutput eq 'on') ? " checked" : '';
my $activatedChecked = ($Cactivated eq 'on') ? " checked" : '';
my $formatPeriodeSelect = create_combobox_from_keys_and_values_pairs ('N=>Never|D=>Daily|W=>Weekly|M=>Monthly|Q=>Quarterly|Y=>Yearly', 'K', 0, $Cperiode, 'periode', 'none', '-Select-', $formDisabledAll, 'onChange="javascript:enableDisableFields...
my $slaWindowSelect = '';
($rv, $slaWindowSelect, undef) = create_combobox_from_DBI ($rv, $dbh, "select timeperiodID, timeperiodName from $SERVERTABLTIMEPERIODS where catalogID = '$CcatalogID' and activated = 1 order by timeperiodName", 1, '', $CtimeperiodID, 'timeperio...
my $formatOutputSelect = create_combobox_from_keys_and_values_pairs ('pdf=>PDF', 'V', 0, $CformatOutput, 'formatOutput', 'none', '-Select-', $formDisabledAll, '', $debug);
applications/htmlroot/cgi-bin/admin/reports.pl view on Meta::CPAN
<tr><td>Daily Average: </td><td>
<input type="checkbox" name="dailyAverage" $dailyAverageChecked $formDisabledAll>
</td></tr>
<tr><td>Show Details: </td><td>
<input type="checkbox" name="showDetails" $showDetailsChecked $formDisabledAll>
</td></tr>
<tr><td>Show Comments: </td><td>
<input type="checkbox" name="showComments" $showCommentsChecked $formDisabledAll>
</td></tr>
<tr><td>Show Performance Data: </td><td>
<input type="checkbox" name="showPerfdata" $showPerfdataChecked $formDisabledAll>
</td></tr>
<tr><td>Show Top 20 Slow Tests: </td><td>
<input type="checkbox" name="showTop20SlowTests" $showTop20SlowTestsChecked $formDisabledAll>
</td></tr>
<tr><td>Printer Friendly Output: </td><td>
<input type="checkbox" name="printerFriendlyOutput" $printerFriendlyOutputChecked $formDisabledAll>
</td></tr>
<tr><td><b>Format Output: </b></td><td>
$formatOutputSelect
</td></tr>
applications/htmlroot/cgi-bin/admin/reports_perfdata.pl view on Meta::CPAN
#!/usr/bin/env perl
# ---------------------------------------------------------------------------------------------------------
# © Copyright 2003-2011 Alex Peeters [alex.peeters@citap.be]
# ---------------------------------------------------------------------------------------------------------
# 2011/mm/dd, v3.002.003, reports_perfdata.pl for ASNMTAP::Asnmtap::Applications::CGI
# ---------------------------------------------------------------------------------------------------------
use strict;
use warnings; # Must be used in test mode only. This reduces a little process speed
#use diagnostics; # Must be used in test mode only. This reduces a lot of process speed
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
BEGIN { if ( $ENV{ASNMTAP_PERL5LIB} ) { eval 'use lib ( "$ENV{ASNMTAP_PERL5LIB}" )'; } }
applications/htmlroot/cgi-bin/admin/reports_perfdata.pl view on Meta::CPAN
use ASNMTAP::Asnmtap::Applications::CGI v3.002.003;
use ASNMTAP::Asnmtap::Applications::CGI qw(:APPLICATIONS :CGI :ADMIN :DBPERFPARSE :DBREADWRITE :DBTABLES);
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
use vars qw($PROGNAME);
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
$PROGNAME = "reports_perfdata.pl";
my $prgtext = "Reports Perfdata";
my $version = do { my @r = (q$Revision: 3.002.003$ =~ /\d+/g); sprintf "%d."."%03d" x $#r, @r }; # must be all on one line or MakeMaker will get confused.
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# URL Access Parameters
my $cgi = new CGI;
my $pagedir = (defined $cgi->param('pagedir')) ? $cgi->param('pagedir') : '<NIHIL>'; $pagedir =~ s/\+/ /g;
my $pageset = (defined $cgi->param('pageset')) ? $cgi->param('pageset') : 'admin'; $pageset =~ s/\+/ /g;
my $debug = (defined $cgi->param('debug')) ? $cgi->param('debug') : 'F';
my $pageNo = (defined $cgi->param('pageNo')) ? $cgi->param('pageNo') : 1;
applications/htmlroot/cgi-bin/admin/reports_perfdata.pl view on Meta::CPAN
my $Cactivated = (defined $cgi->param('activated')) ? $cgi->param('activated') : 'off';
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
my $htmlTitle = $APPLICATION;
# Init parameters
my ($rv, $dbh, $sth, $sql, $header, $numberRecordsIntoQuery, $nextAction, $formDisabledAll, $formDisabledNoMetricID, $formDisabledPrimaryKey, $submitButton, $uKeySelect, $metric_idSelect);
# User Session and Access Control
my ($sessionID, $iconAdd, $iconDelete, $iconDetails, $iconEdit, $iconQuery, $iconTable, $errorUserAccessControl, undef, undef, undef, undef, undef, undef, undef, undef, undef, undef, undef, $subTitle) = user_session_and_access_control (1, 'admin', $c...
# Serialize the URL Access Parameters into a string
my $urlAccessParameters = "pagedir=$pagedir&pageset=$pageset&debug=$debug&CGISESSID=$sessionID&pageNo=$pageNo&pageOffset=$pageOffset&orderBy=$orderBy&action=$action&uKeyReload=$CuKeyReload&catalogID=$CcatalogID&catalogIDreload=$CcatalogIDreload&uKey=...
# 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>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 {
$action = "listView";
}
}
if ($action eq 'duplicateView' or $action eq 'insertView') {
$htmlTitle = "Insert Report Perfdata";
$submitButton = "Insert";
$nextAction = "insert" if ($rv);
$CcatalogID = $CATALOGID if ($action eq 'insertView');
} elsif ($action eq 'insert') {
$htmlTitle = "Check if Report Perfdata $CuKey, $Cmetric_id from $CcatalogID exist before to insert";
$sql = "select catalogID, uKey, metric_id from $SERVERTABLREPORTSPRFDT WHERE catalogID='$CcatalogID' and uKey='$CuKey' and metric_id='$Cmetric_id'";
($rv, $numberRecordsIntoQuery) = do_action_DBI ($rv, $dbh, $sql, $pagedir, $pageset, $htmlTitle, $subTitle, $sessionID, $debug);
if ( $numberRecordsIntoQuery ) {
$htmlTitle = "Report Perfdata $CuKey, $Cmetric_id from $CcatalogID exist already";
$nextAction = "insertView";
} else {
$htmlTitle = "Report Perfdata $CuKey, $Cmetric_id from $CcatalogID inserted";
my $dummyActivated = ($Cactivated eq 'on') ? 1 : 0;
$sql = 'INSERT INTO ' .$SERVERTABLREPORTSPRFDT. ' SET catalogID="' .$CcatalogID. '", uKey="' .$CuKey. '", metric_id="' .$Cmetric_id. '", times="' .$Ctimes. '", percentiles="' .$Cpercentiles. '", unit="' .$Cunit. '", activated="' .$dummyActiva...
$dbh->do ( $sql ) or $rv = error_trap_DBI(*STDOUT, "Cannot dbh->do: $sql", $debug, $pagedir, $pageset, $htmlTitle, $subTitle, 3600, '', $sessionID);
$nextAction = "listView" if ($rv);
}
} elsif ($action eq 'deleteView') {
$formDisabledPrimaryKey = $formDisabledAll = 'disabled';
$htmlTitle = "Delete Report Perfdata $CuKey, $Cmetric_id from $CcatalogID";
$submitButton = "Delete";
$nextAction = "delete" if ($rv);
} elsif ($action eq 'delete') {
$sql = 'DELETE FROM ' .$SERVERTABLREPORTSPRFDT. ' WHERE catalogID="' .$CcatalogID. '" and uKey="' .$CuKey. '" and metric_id="' .$Cmetric_id. '"';
$dbh->do ( $sql ) or $rv = error_trap_DBI(*STDOUT, "Cannot dbh->do: $sql", $debug, $pagedir, $pageset, $htmlTitle, $subTitle, 3600, '', $sessionID);
$nextAction = "listView" if ($rv);
$htmlTitle = "Report Perfdata $CuKey, $Cmetric_id from $CcatalogID deleted";
} elsif ($action eq 'displayView') {
$formDisabledPrimaryKey = $formDisabledAll = 'disabled';
$htmlTitle = "Display Report Perfdata $CuKey, $Cmetric_id from $CcatalogID";
$nextAction = "listView" if ($rv);
} elsif ($action eq 'editView') {
$formDisabledPrimaryKey = 'disabled';
$htmlTitle = "Edit Report Perfdata $CuKey, $Cmetric_id from $CcatalogID";
$submitButton = "Edit";
$nextAction = "edit" if ($rv);
} elsif ($action eq 'edit') {
$htmlTitle = "Report Perfdata $CuKey, $Cmetric_id from $CcatalogID updated";
my $dummyActivated = ($Cactivated eq 'on') ? 1 : 0;
$sql = 'UPDATE ' .$SERVERTABLREPORTSPRFDT. ' SET catalogID="' .$CcatalogID. '", uKey="' .$CuKey. '", metric_id="' .$Cmetric_id. '", times="' .$Ctimes. '", percentiles="' .$Cpercentiles. '", unit="' .$Cunit. '", activated="' .$dummyActivated. '"...
$dbh->do ( $sql ) or $rv = error_trap_DBI(*STDOUT, "Cannot dbh->do: $sql", $debug, $pagedir, $pageset, $htmlTitle, $subTitle, 3600, '', $sessionID);
$nextAction = "listView" if ($rv);
} elsif ($action eq 'listView') {
$htmlTitle = "All reports perfdata listed";
if ( $CcatalogIDreload ) {
$pageNo = 1;
$pageOffset = 0;
}
$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;
if ( $rv ) {
($CcatalogID, $CuKey, $Cmetric_id, $Ctimes, $Cpercentiles, $Cunit, $Cactivated) = $sth->fetchrow_array() or $rv = error_trap_DBI(*STDOUT, "Cannot $sth->fetchrow_array: $sql", $debug, $pagedir, $pageset, $htmlTitle, $subTitle, 3600, '', $sessi...
$CcatalogID = $CATALOGID if ($action eq 'duplicateView');
applications/htmlroot/cgi-bin/admin/reports_perfdata.pl view on Meta::CPAN
$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';
}
}
$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 ) {
# HTML - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
if ($action eq 'duplicateView' or $action eq 'editView' or $action eq 'insertView') {
print_header (*STDOUT, $pagedir, $pageset, $htmlTitle, $subTitle, 3600, "", 'F', '', $sessionID);
print <<HTML;
<script language="JavaScript1.2" type="text/javascript">
function submitForm() {
if ( document.reports_perfdata.uKey.value == null || document.reports_perfdata.uKey.value == 'none' ) {
document.reports_perfdata.uKey.focus();
alert('Please create/select a Application!');
return false;
}
document.reports_perfdata.uKeyReload.value = 1;
document.reports_perfdata.submit();
return true;
}
function validateForm() {
HTML
if ($action eq 'duplicateView' or $action eq 'insertView') {
print <<HTML;
if ( document.reports_perfdata.uKey.options[document.reports_perfdata.uKey.selectedIndex].value == 'none' ) {
document.reports_perfdata.uKey.focus();
alert('Please create/select one of the applications!');
return false;
}
if ( document.reports_perfdata.metric_id.options[document.reports_perfdata.metric_id.selectedIndex].value == 'none' ) {
document.reports_perfdata.metric_id.focus();
alert('Please create/select one of the metrics!');
return false;
}
HTML
}
print <<HTML;
// times n[,n] and n >= 0
var objectRegularExpressionTimesValue = /\^([0-9]+)(,([0-9]+))*\$/;
if ( ! ( document.reports_perfdata.times.value == null || document.reports_perfdata.times.value == '' ) ) {
if ( ! objectRegularExpressionTimesValue.test(document.reports_perfdata.times.value) ) {
document.reports_perfdata.times.focus();
alert('Please re-enter times: Bad times format!');
return false;
}
}
// percentiles n[,n] and 0 < n < 100
var objectRegularExpressionPercentilesValue = /\^([1-9]|[1-9][0-9])(,([1-9]|[1-9][0-9]))*\$/;
if ( ! ( document.reports_perfdata.percentiles.value == null || document.reports_perfdata.percentiles.value == '' ) ) {
if ( ! objectRegularExpressionPercentilesValue.test(document.reports_perfdata.percentiles.value) ) {
document.reports_perfdata.percentiles.focus();
alert('Please re-enter percentiles: Bad percentile format!');
return false;
}
}
return true;
}
</script>
<form action="$ENV{SCRIPT_NAME}" method="post" name="reports_perfdata" onSubmit="return validateForm();">
HTML
} elsif ($action eq 'listView') {
print_header (*STDOUT, $pagedir, $pageset, $htmlTitle, $subTitle, 3600, "", 'F', '', $sessionID);
print <<HTML;
<script language="JavaScript1.2" type="text/javascript">
function submitForm() {
document.reports_perfdata.catalogIDreload.value = 1;
document.reports_perfdata.submit();
return true;
}
</script>
<form action="$ENV{SCRIPT_NAME}" method="post" name="reports_perfdata">
HTML
} elsif ($action eq 'deleteView') {
print_header (*STDOUT, $pagedir, $pageset, $htmlTitle, $subTitle, 3600, '', 'F', '', $sessionID);
print "<form action=\"" . $ENV{SCRIPT_NAME} . "\" method=\"post\" name=\"reports\">\n";
$pageNo = 1; $pageOffset = 0;
} else {
print_header (*STDOUT, $pagedir, $pageset, $htmlTitle, $subTitle, 3600, '', 'F', '', $sessionID);
}
if ($action eq 'deleteView' or $action eq 'duplicateView' or $action eq 'editView' or $action eq 'insertView' or $action eq 'listView') {
applications/htmlroot/cgi-bin/admin/reports_perfdata.pl view on Meta::CPAN
}
print <<HTML;
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr align="center"><td>
<table border="0" cellspacing="0" cellpadding="0"><tr>
HTML
if ( $iconAdd ) {
print <<HTML;
<td class="StatusItem"><a href="$urlWithAccessParameters&action=insertView&orderBy=$orderBy">[Insert report perfdata]</a></td>
<td class="StatusItem"> </td>
HTML
}
print <<HTML;
<td class="StatusItem"><a href="$urlWithAccessParameters&action=listView&orderBy=$orderBy">[List all reports perfdata]</a></td>
</tr></table>
</td></tr>
HTML
unless ( $PERFPARSEENABLED ) {
print " <tr><td align=\"center\"><br>'Performance Data' not enabled</td></tr>";
} elsif ($action eq 'deleteView' or $action eq 'displayView' or $action eq 'duplicateView' or $action eq 'editView' or $action eq 'insertView') {
my $unitSelect = create_combobox_from_keys_and_values_pairs ('s=>s|ms=>ms', 'K', 0, $Cunit, 'unit', '', '', $formDisabledAll, '', $debug);
my $activatedChecked = ($Cactivated eq 'on') ? ' checked' : '';
applications/htmlroot/cgi-bin/admin/reports_perfdata.pl view on Meta::CPAN
</td></tr>
<tr><td><b>Activated: </b></td><td>
<input type="checkbox" name="activated" $activatedChecked $formDisabledAll>
</td></tr>
HTML
print " <tr><td> </td><td><br>Please enter all required information before committing the required information. Required fields are marked in bold.</td></tr>\n" if ($action eq 'duplicateView' or $action eq 'editView' or $action eq '...
print " <tr align=\"left\"><td align=\"right\"><br><input type=\"submit\" value=\"$submitButton\"></td><td><br><input type=\"reset\" value=\"Reset\"></td></tr>\n" if ($action ne 'displayView');
print " </table>\n";
} elsif ($action eq 'delete' or $action eq 'edit' or $action eq 'insert') {
print " <tr><td align=\"center\"><br><br><h1>Report Perfdata: $htmlTitle</h1></td></tr>";
print " <tr><td align=\"center\">$matchingReportsPerfdata</td></tr>" if (defined $matchingReportsPerfdata and $matchingReportsPerfdata ne '');
} else {
print " <tr><td><br><table align=\"center\" border=0 cellpadding=1 cellspacing=1 bgcolor='#333344'><tr><td align=\"left\"><b>Catalog ID: </b></td><td>$catalogIDSelect</td></tr></table></td></tr>";
print " <tr><td align=\"center\"><br>$matchingReportsPerfdata</td></tr>";
}
print " </table>\n";
if ($action eq 'deleteView' or $action eq 'duplicateView' or $action eq 'editView' or $action eq 'insertView' or $action eq 'listView') {
print "</form>\n";
} else {
print "<br>\n";
}
}
applications/htmlroot/cgi-bin/admin/resultsdirs.pl view on Meta::CPAN
my $urlAccessParameters = "pagedir=$pagedir&pageset=$pageset&debug=$debug&CGISESSID=$sessionID&pageNo=$pageNo&pageOffset=$pageOffset&orderBy=$orderBy&action=$action&catalogID=$CcatalogID&catalogIDreload=$CcatalogIDreload&resultsdir=$Cresultsdir&group...
# 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 ...
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/resultsdirs.pl view on Meta::CPAN
$sth->execute() or $rv = error_trap_DBI(*STDOUT, "Cannot sth->execute: $sql", $debug, $pagedir, $pageset, $htmlTitle, $subTitle, 3600, '', $sessionID) if $rv;
if ( $rv ) {
($CcatalogID, $Cresultsdir, $CgroupName, $Cactivated) = $sth->fetchrow_array() or $rv = error_trap_DBI(*STDOUT, "Cannot $sth->fetchrow_array: $sql", $debug, $pagedir, $pageset, $htmlTitle, $subTitle, 3600, '', $sessionID) if ($sth->rows);
$CcatalogID = $CATALOGID if ($action eq 'duplicateView');
$Cactivated = ($Cactivated == 1) ? 'on' : 'off';
$sth->finish() or $rv = error_trap_DBI(*STDOUT, "Cannot sth->finish: $sql", $debug, $pagedir, $pageset, $htmlTitle, $subTitle, 3600, '', $sessionID);
}
}
$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 ) {
# HTML - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
if ($action eq 'duplicateView' or $action eq 'editView' or $action eq 'insertView') {
print_header (*STDOUT, $pagedir, $pageset, $htmlTitle, $subTitle, 3600, '', 'F', '', $sessionID);
print <<HTML;
<script language="JavaScript1.2" type="text/javascript">
applications/htmlroot/cgi-bin/admin/timeperiods.pl view on Meta::CPAN
my $urlAccessParameters = "pagedir=$pagedir&pageset=$pageset&debug=$debug&CGISESSID=$sessionID&pageNo=$pageNo&pageOffset=$pageOffset&orderBy=$orderBy&action=$action&catalogID=$CcatalogID&catalogIDreload=$CcatalogIDreload&timeperiodID=$CtimeperiodID&t...
# 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, $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/timeperiods.pl view on Meta::CPAN
if ($action eq 'duplicateView') {
$CcatalogID = $CATALOGID;
$CtimeperiodID = 'new';
}
$Cactivated = ($Cactivated == 1) ? 'on' : 'off';
$sth->finish() or $rv = error_trap_DBI(*STDOUT, "Cannot sth->finish: $sql", $debug, $pagedir, $pageset, $htmlTitle, $subTitle, 3600, '', $sessionID);
}
}
$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 ) {
# HTML - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
if ($action eq 'duplicateView' or $action eq 'editView' or $action eq 'insertView') {
print_header (*STDOUT, $pagedir, $pageset, $htmlTitle, $subTitle, 3600, '', 'F', '', $sessionID);
print <<HTML;
<script language="JavaScript1.2" type="text/javascript">