#!perl -w ######################################################################## # Script Name: variables.pl # ######################################################################## # This module contains Global Variables for use with DRM Perl Scripts. # ######################################################################## ################## # System Type. # ################## $SYSTEM_TYPE = "SAP"; ################# # System Status # ################# $STATUS = "TEST"; #$STATUS = "PROD"; if ($STATUS eq "TEST") { ####################### # Test Systems Paging # ####################### $PAGERNOTIFY = ""; $TELALERT_PAGE = ""; $BASIS_PAGE = ""; ############################## # Number of Backups to keep. # ############################## $KEEP = 3; ################################ # Tables to Exclude from Reorg # ################################ # APQD --> /CWLD/EVT_CUR excluded since dynamic tables. @EXCLUDE = ('APQD', 'APQI', 'VBLOG', 'VBHDR', 'VBMOD', 'VBDATA', 'YXR_EVENTS', '/CWLD/EVT_CUR'); } else { ########## # Paging # ########## $PAGERNOTIFY = ""; $TELALERT_PAGE = ""; $BASIS_PAGE = ""; ############################## # Number of Backups to keep. # ############################## $KEEP = 7; ################################ # Tables to Exclude from Reorg # ################################ # APQD --> /CWLD/EVT_CUR excluded since dynamic tables. @EXCLUDE = ('APQD', 'APQI', 'VBLOG', 'VBHDR', 'VBMOD', 'VBDATA', 'YXR_EVENTS', '/CWLD/EVT_CUR'); } ##################### # All Systems Email # ##################### $EMAILNOTIFY = ""; $TELALERT_EMAIL = ""; $BASIS_EMAIL = ""; ########################################### # Filesystem % Utilized Paging Threshold. # ########################################### $FSTHRESH = 95; ########################################### # Tablespace % Utilized Paging Threshold. # ########################################### $TBLSPCTHRESH = 90; ##################################### # Backup Threshold for log_archive. # ##################################### $ARCHTHRESH = 60; ############################################################ # List of client specific tables that need runstats daily. # ############################################################ @TABLES = ('EKPO', 'VEPO', 'VBUP', 'VBUK', 'VAPMA', 'LIPS', 'LIKP', 'LTAP', 'LTAK', 'EIPO', 'VTTK', 'VTTS', 'VTTP', 'EIKP', 'ZSD_VEPO_LTAP', 'ZPXLE_PERF_DATES', 'ZLE_BDL_HDR', 'ZLE_BDL_ITM', 'VEKP', 'VBAK', 'VBAP', 'LIPSDG', 'ZLE_PACK_WITH', 'MAKT', 'MARC', 'MARA', 'MATERIALID', 'EKES', 'EKET', 'HUSSTAT', 'VLPMA', 'MARM', 'VBFA', 'HUSTOBJ', 'VEVW', 'MARD', 'EINA', 'STXL', 'STXH', 'VBEP', 'MLGN'); ############################################ # Tables that should not receive runstats. # ############################################ @NOSTATS = ('APQD', 'APQI', 'VBMOD', 'VBHDR', 'VBDATA', 'VBLOG'); ########################################### # Tables that should have specific stats. # ########################################### @CWLDSTATS = ('YXR_EVENTS', '/CWLD/EVT_CUR'); ######################### # List of Current DBA's # ######################### $DBALIST = ""; ############################### # File to keep Last Runtimes. # ############################### $RUNFILE = "/db2/$DB2DBDFT/Messages/runtime.txt"; ######################################### # Filesystems to check for Utilization. # ######################################### @FILESYSTEMS = ("/db2/db2as", "/db2/$DB2INSTANCE", "/db2/$DB2DBDFT", "/db2/$DB2DBDFT/db2dump", "/db2/$DB2DBDFT/sapdatat", "/db2/$DB2DBDFT/sapdatat2", "/db2/$DB2DBDFT/sapdata1", "/db2/$DB2DBDFT/sapdata2", "/db2/$DB2DBDFT/sapdata3", "/db2/$DB2DBDFT/sapdata4", "/db2/$DB2DBDFT/sapdata5", "/db2/$DB2DBDFT/sapdata6"); ######################################### # Filesystems to check for Utilization. # ######################################### @LOGFS = ("/db2/$DB2DBDFT/log_dir", "/db2/$DB2DBDFT/log_archive"); ################################## # Database Active Log Directory. # ################################## $LOGDIR = "/db2/$DB2DBDFT/log_dir/"; ############################################################## # Log Utilization Threshold at which Application is forced . # ############################################################## $HIGHLOGTHRESH = 93; ######################################################### # Log Utilization Threshold at which Basis is notified. # ######################################################### $LOGTHRESH = 88; ############################################################################ # The following module will automatically create a peregrine ticket ############################################################################ sub create_ticket() { $peregrinefile = "/db2/$DB2DBDFT/Messages/peregrine.txt"; $PEREGRINENOTIFY = ""; ($SC_brief_description, $update_action)=@_; #################################################3 # Tickets are only created if paging is turned on ################################################## if ($STATUS eq "PROD") { ################################# # Add host variables for backups ################################# $space_holder = ' - '; chomp($peregrine_hostname = `hostname`); $SC_brief_description = join $space_holder,$peregrine_hostname,$SC_brief_description; if ($SC_brief_description =~ /ackup/) { chomp($peregrine_TSM_node = `db2 get db cfg for $DB2DBDFT | grep TSM_NODENAME`); $update_action = join $space_holder,$SC_brief_description,$update_action,$peregrine_TSM_node; } else { $update_action = join $space_holder,$SC_brief_description,$update_action; } if ($SC_brief_description =~ /Perform disk space and disk request processes/) { $SC_cat_subcomponent = "OTHER"; } else { $SC_cat_subcomponent = "SOX"; } ############################## # Define Peregreine variables ############################## $SC_event = ""; $SC_type = ""; $SC_category = "SOFTWARE"; $SC_subcategory = "DATABASE MANAGEMENT"; $SC_product_type = "DB2 DISTRIBUTED DATABASE - SAP"; $SC_problem_type = "SUPPORT"; $SC_assignment = "DISTRIBUTED DATABASE"; $SC_assignee_name = ""; $SC_severity_code = "5"; $SC_site_category = "WORKGROUP"; $SC_cause_code = "SOFTWARE"; $SC_contact_name = ""; $SC_ticket_owner = "AUTOMATED - DRM DISTRIBUTED GROUP"; $SC_user_priority = "3"; $SC_cat_alternate_last = "NULL"; $SC_cat_alternate_first = "NULL"; $SC_alternate_phone = "NULL"; $SC_cat_alternate_company = "NULL"; $SC_cat_confidential = "GREEN"; $SC_different_from_contact = "false"; ############## # Format file ############## open OUT_TICKET, ">$peregrinefile"; print OUT_TICKET "SC_event:$SC_event \n"; print OUT_TICKET "SC_type:$SC_type \n"; print OUT_TICKET "SC_category:$SC_category \n"; print OUT_TICKET "SC_subcategory:$SC_subcategory \n"; print OUT_TICKET "SC_product.type:$SC_product_type \n"; print OUT_TICKET "SC_problem.type:$SC_problem_type \n"; print OUT_TICKET "SC_assignment:$SC_assignment \n"; print OUT_TICKET "SC_severity.code:$SC_severity_code \n"; print OUT_TICKET "SC_site.category:$SC_site_category \n"; print OUT_TICKET "SC_cause.code:$SC_cause_code \n"; print OUT_TICKET "update.action:$update_action \n"; print OUT_TICKET "SC_contact.name:$ SC_contact_name \n"; print OUT_TICKET "SC_ticket.owner:$SC_ticket_owner \n"; print OUT_TICKET "SC_brief.description:$SC_brief_description \n"; print OUT_TICKET "SC_cat.subcomponent:$SC_cat_subcomponent \n"; print OUT_TICKET "SC_assignee.name:$SC_assignee_name \n"; print OUT_TICKET "SC_user_priority:$SC_user_priority \n"; print OUT_TICKET "SC_cat.alternate_last:$SC_cat_alternate_last \n"; print OUT_TICKET "SC_cat.alternate_first:$SC_cat_alternate_first \n"; print OUT_TICKET "SC_alternate.phone:$SC_alternate_phone \n"; print OUT_TICKET "SC_cat_alternate.company:$SC_cat_alternate_company \n"; print OUT_TICKET "SC_cat.confidential:$SC_cat_confidential \n"; print OUT_TICKET "SC_different.from.contact:$SC_different_from_contact \n"; close OUT_TICKET; ############# # Email File ############# open IN_ticket, $peregrinefile; read IN_ticket, $msg_ticket, 10000; close IN_ticket; if ($SC_brief_description eq "" && $update_action eq "") { `printf "$msg_ticket" | mail -s "FAILED Automated ticket FAILED $SC_brief_description $update_action" $EMAILNOTIFY`; print "Ticket was not sent to peregrine server: $SC_brief_description and $update_action are inputs.\n"; } else { `printf "$msg_ticket" | mail -s "Automated ticket from DRM Distributed Team" $PEREGRINENOTIFY`; print "\nTicket sent to $PEREGRINENOTIFY for creation.\n"; } } }