wls-basic-measurement.py 67 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081
  1. # This WLST script tests whether the Weblogic Application Server configuration
  2. # being used violates any of the testable restrictions imposed by the
  3. # WebLogic Server Basic License
  4. #
  5. # Support Version: 20
  6. #
  7. # To invoke this script, set the WLS classpath and
  8. # execute java weblogic.WLST wls-basic-measurement.py
  9. # [ verbose ]
  10. # [ output <file> ]
  11. # [ username <name> ]
  12. # [ password <pwd> ]
  13. # [ url <url> ]
  14. #
  15. # Output from the script will be sent to the output file, if specified.
  16. # The script connects to a running Adminstration Server using
  17. # the administrative username, password and url.
  18. # If any of these connection arguments are not specified, the script
  19. # prompts for them. The url typically is specified as t3://host:port.
  20. import sys, socket, os
  21. import java
  22. from java.lang import System
  23. from java.text import DateFormat
  24. from java.util import HashMap
  25. from java.util import HashSet
  26. from java.util import Iterator
  27. import javax.management.ObjectName
  28. import javax.management.Query
  29. import javax.management.QueryExp
  30. import weblogic.management.configuration
  31. from java.io import File
  32. from java.io import FileOutputStream
  33. WLBasic_script_version = "19.1"
  34. outputFile=None
  35. verbose=false
  36. sepString=""
  37. totalErrors = 0
  38. domainObject=None
  39. customerApplicationNameSet=None
  40. oracleApplications = "AqAdapter", "b2bui", "composer", "DbAdapter", "DefaultToDoTaskFlow", "DIP", "discoverer", "DMS Application", "em", "FileAdapter", "FMW Welcome Page Application", "formsapp", "FtpAdapter", "JmsAdapter", "MQSeriesAdapter", "MQSeriesAdapter_Automation12", "newM11demo", "NonJ2EEManagement", "odsm", "OIF", "oracle-bam", "OracleAppsAdapter", "OracleBamAdapter", "OrderApprovalHumanTask", "owc_discussions", "owc_wiki", "portalTools", "reports", "soa-infra", "SocketAdapter", "srdemo_new_ear", "usermessagingdriver-email", "usermessagingdriver-voicexml", "usermessagingdriver-smpp", "usermessagingdriver-xmpp", "usermessagingserver", "webcenter", "webcenter-help", "WebServices_WebLogicFusionOrderDemo_CreditCardAuthorization", "worklistapp", "wsil-wls", "wsm-pm", "wsrp-tools", "Healthcare UI", "usermessagingdriver-extension", "OracleBPMProcessRolesApp", "Healthcare FastPath", "OracleBPMComposerRolesApp", "OracleBPMWorkspace", "SimpleApprovalTaskFlow", "BPMComposer"
  41. oracleApplicationNameSet=None
  42. oracleWLDFs = "Module-FMWDFW", ""
  43. oracleWLDFNameSet=None
  44. customerAppDeploymentObjectNameSet=None
  45. customerApplicationRuntimeObjectNameSet=None
  46. nameToNonVersionedName=None
  47. nameToVersion=None
  48. # Begin locale translation
  49. WLS_BASIC_AUDIT="WLS Basic Feature Usage Measurement"
  50. NOT_IMPLEMENTED="not implemented"
  51. SEE_DOCUMENTATION="See the documentation"
  52. CONNECTION_ERROR="Connection error"
  53. COLON=": "
  54. LICENSE_COMPLIANCE_FAILURE="Feature usage measurement error" + COLON
  55. NAME="name"
  56. TYPE="type"
  57. DOMAIN="Domain"
  58. DOMAIN_INFO="Domain Info"
  59. DOMAIN_NAME="Domain name"
  60. DOMAIN_VERSION="Domain version"
  61. DOMAIN_CLUSTER_CONSTRAINTS="Domain cluster constraints "
  62. ARE_ENABLED="are enabled"
  63. ARE_NOT_ENABLED="are not enabled"
  64. IS_ENABLED="is enabled"
  65. IS_NOT_ENABLED="is not enabled"
  66. DOMAIN_DEPLOY_INTERNAL_APPS_ON_DEMAND="Domain deploy internal apps on-demand "
  67. SERVICE_MIGRATION_INFO="Service Migration Info"
  68. SERVER="Server "
  69. SERVER_INFO="Server Info"
  70. SERVER_NAME="Server name"
  71. AUTOMIGRATION=" is configured to use AutoMigration"
  72. NOT_AUTOMIGRATION=" is not configured to use AutoMigration"
  73. SERVER_MACHINE="Server machine"
  74. SERVER_STATE="has server state"
  75. ADMINISTRATION_PORT="is configured to use AdministrationPort"
  76. STARTUP_MODE="startup mode"
  77. INCORRECT_STARTUP_MODE="has an incorrect startup mode"
  78. INCORRECT_SERVER_STATE="has an incorrect state"
  79. OVERLOAD_PROTECTION_FAILURE_ACTION=" overload protection failure action"
  80. INCORRECT_OVERLOAD_PROTECTION_FAILURE_ACTION=" has an incorrect overload protection failure action"
  81. OVERLOAD_PROTECTION_PANIC_ACTION=" overload protection panic action"
  82. INCORRECT_OVERLOAD_PROTECTION_PANIC_ACTION=" has an incorrect overload protection panic action"
  83. CLUSTER="Cluster "
  84. CLUSTER_INFO="Cluster Info"
  85. CLUSTER_NAME="Cluster name"
  86. CLUSTER_TYPE="cluster type"
  87. INCORRECT_CLUSTER_TYPE="has an incorrect cluster type"
  88. MIGRATION_BASIS="migration basis"
  89. INCORRECT_MIGRATION_BASIS="uses an incorrect " + MIGRATION_BASIS
  90. SINGLETON_SERVICE_INFO="Singleton Service Info"
  91. SINGLETON="Singleton "
  92. SINGLETON_NAME="Singleton name"
  93. CLASS_NAME="class name"
  94. HOSTING_SERVER="hosting server"
  95. USER_PREFERRED_SERVER="user preferred server"
  96. CANDIDATE_SERVER="candidate server"
  97. HAVE_SINGLETONS="The number of singleton servers is not zero"
  98. SINGLETONS_ARE="the singletons are"
  99. MIGRATABLE_TARGET="Migratable Target "
  100. MIGRATION_POLICY="migration policy"
  101. INCORRECT_MIGRATION_POLICY="has an incorrect migration policy"
  102. DIAGNOSTICS_FRAMEWORK_INFO="Diagnostics Framework Info"
  103. GLOBAL_WORK_MANAGER_INFO="Global Work Manager Info"
  104. GLOBAL_WORK_MANAGER_USED="A global Work Manager is configured"
  105. SELF_TUNING="self tuning"
  106. WORK_MANAGER="Work Manager"
  107. APPLICATION="Application"
  108. APPLICATION_NAME="Application name"
  109. WORK_MANAGER_TYPE="Work Manager type"
  110. NUMBER_OF="number of "
  111. WORK_MANAGERS="work managers"
  112. APPLICATION_WORK_MANAGER_INFO="Application Work Manager Info"
  113. APPLICATION_WORK_MANAGER_USED="has an application Work Manager configured"
  114. DEPLOYMENT_INFO="Deployment Info"
  115. USES_VERSION="uses version"
  116. USES_NON_DEFAULT_DEPLOYMENT_ORDER="uses a non-default deployment order"
  117. APPLICATION_FAST_SWAP_INFO="Application FastSwap Info"
  118. USES_FAST_SWAP="uses FastSwap"
  119. JMS_INFO="JMS Info"
  120. USING_OBJECT_NAME="using Object Name"
  121. RESOURCE="Resource"
  122. HAS_UNIT_OF_WORK="has a Unit-of-Work Message Handling Policy that is not the default"
  123. HAS_UNIT_OF_ORDER="has a Unit-of-Order"
  124. SAF_AGENT="Store-and-Forward agent"
  125. SAF_TARGET="Store-and-Forward target"
  126. USED="is being used"
  127. TUXEDO_CONNECTOR_INFO="Tuxedo Connector Info"
  128. TUXEDO_CONNECTOR="Tuxedo Connector"
  129. SNMP_INFO="SNMP Info"
  130. SNMP_AGENT="SNMP agent"
  131. APPLICATION_MODE_INFO="Application Mode Info"
  132. HAS_INTENDED_STATE="has intended state"
  133. MODULE_DEPLOYMENT_INFO="Module Deployment Info"
  134. INCORRECT_STANDALONE_MODULE_DEPLOYMENT="is an improper standalone module type"
  135. HTTP_PUBLISH_SUBSCRIBE_SERVER_INFO="HTTP Publish-Subscribe Info"
  136. HTTP_PUBLISH_SUBSCRIBE_SERVER="HTTP Publish-Subscribe Server"
  137. LIBRARY="library"
  138. LOCAL_SOURCE_PATH="local source path"
  139. REFERENCED_BY="is referenced by"
  140. VERSION="version"
  141. DIAGNOSTICS_FRAMEWORK_SYSTEM_RESOURCE="Diagnostics framework system resource"
  142. USES_DIAGNOSTICS_FRAMEWORK="is configured to use the diagnostic framework"
  143. ACTIVE_GRIDLINK_INFO="Active GridLink DataSource Info"
  144. ACTIVE_GRIDLINK_DATASOURCE="Active GridLink DataSource"
  145. USES_ACTIVE_GRIDLINK_BEHAVIOUR=" is configured with Active GridLink behaviour"
  146. USES_ACTIVE_GRIDLINK_DATASOURCE="Datasource "
  147. USES_ACTIVE_GRIDLINK_JNDI=" exposed as "
  148. CHECKING_FOR_ADMINISTRATION_PORT_ENABLED="Checking for administration port enabled"
  149. CHECKING_FOR_WHOLE_SERVER_MIGRATION="Checking for whole server migration"
  150. CHECKING_SERVER_MODE_AND_OVERLOAD_ACTIONS="Checking server mode and overload actions"
  151. CHECKING_CLUSTER_TYPE_AND_OVERLOAD_ACTIONS="Checking cluster type and overload actions"
  152. CHECKING_FOR_SINGLETON_SERVICES="Checking for singleton services"
  153. CHECKING_FOR_GLOBAL_WORK_MANAGERS="Checking for global Work Managers"
  154. CHECKING_FOR_APPLICATION_WORK_MANAGERS="Checking for application-scoped Work Managers"
  155. CHECKING_APPLICATIONS_FOR_VERSIONING_AND_ORDERING="Checking for application versioning and ordering"
  156. CHECKING_FOR_APPLICATION_FAST_SWAP="Checking whether FastSwap is enabled in an application"
  157. CHECKING_FOR_JMS_UNIT_OF_WORK="Checking for non-default Unit-of-Work Message Handling Policy"
  158. CHECKING_FOR_JMS_UNIT_OF_ORDER="Checking for non-default Message Unit-of-Order"
  159. CHECKING_FOR_JMS_SAF_AGENTS="Checking for Message Store-and-Forward agents"
  160. CHECKING_FOR_TUXEDO_CONNECTORS="Checking for WebLogic Tuxedo Connectors"
  161. CHECKING_FOR_SNMP_AGENTS="Checking for SNMP agents"
  162. CHECKING_FOR_SERVICE_MIGRATION="Checking for service migration"
  163. CHECKING_FOR_APPLICATION_ADMIN_MODE="Checking for application in Administration mode"
  164. CHECKING_FOR_JMS_JDBC_WLDF_MODULES="Checking for deployment of standalone JMS, JDBC, or WLDF modules"
  165. CHECKING_FOR_HTTP_PUBLISH_SUBSCRIBE_USAGE="Checking for HTTP Publish-Subscribe Server usage"
  166. CHECKING_FOR_DIAGNOSTICS_FRAMEWORK_USAGE="Checking for WebLogic Diagnostics Framework usage"
  167. CHECKING_FOR_ACTIVE_GRIDLINK_USAGE="Checking for Active GridLink DataSource usage"
  168. SUMMARY="Summary"
  169. NO_ERRORS="No errors detected"
  170. ERRORS_DETECTED="%(#)i error(s) detected"
  171. LICENSE_WHOLE_SERVER_MIGRATION="Whole server-level migration enables a migratable server instance, and all of its services, to be migrated to a different physical machine. When a migratable server becomes unavailable for any reason - for example, if it hangs, loses network connectivity, or its host machine fails - migration is automatic. Upon failure, a migratable server is automatically restarted on the same machine if possible. If the migratable server cannot be restarted on the machine where it failed, it is migrated to another machine. \nIn the license for WebLogic Server Basic, whole server migration is not permitted."
  172. LICENSE_SERVICE_MIGRATION="In a WebLogic Server cluster, most subsystem services are hosted homogeneously on all server instances in the cluster, enabling transparent failover from one server to another. In contrast, pinned services, such as JMS-related services, the JTA Transaction Recovery Service, and user-defined singleton services are hosted on individual server instances within a cluster - for these services, the WebLogic Server migration framework supports failure recovery with service migration, as opposed to failover. Service-level migration in WebLogic Server is the process of moving the pinned services from one server instance to a different available server instance within the cluster. \nIn the license for WebLogic Server Basic, the configuration and execution of automatic service-level migration is not permitted."
  173. LICENSE_WAN_AND_MAN_STATE_REPLICATION="In addition to providing HTTP session state replication across servers within a cluster, WebLogic server provides the ability to replicate HTTP session state across multiple clusters in a Metropolitan Area Networks (MAN) or in a Wide Area Network (WAN). This improves high-availability and fault tolerance by allowing clusters to be spread across multiple geographic regions, power grids, and internet service providers. \nResources within a MAN are often in physically separate locations, but are geographically close enough that network latency is not an issue. Network communication in a MAN generally has low latency and fast interconnect. Clusters within a MAN can be installed in physically separate locations which improves availability. Resources in a WAN are frequently spread across separate geographical regions. In addition to requiring network traffic to cross long distances, these resources are often separated by multiple routers and other network bottle necks. Network communication in a WAN generally has higher latency and slower interconnect.\nSlower network performance within a WAN makes it difficult to use a synchronous replication mechanism like the one used within a MAN. WebLogic Server provides failover across clusters in WAN by using an asynchronous data replication scheme.\nIn the license for WebLogic Server Basic, the use of either the MAN and WAN state replication type is not permitted."
  174. LICENSE_MANAGED_SERVER_CLONING="WebLogic Server provides the capability of cloning an existing Managed Server instance that is part of a cluster. This capability is typically used when a Managed Server instance is mistakenly deleted by an administrator. \nIn the WebLogic Server Basic license, managed server cloning is not available."
  175. LICENSE_SINGLETON_SERVICE="Within an application, or as a standalone artifact, you can define a singleton service that can be used to perform tasks that you want to be executed on only one member of a cluster at any give time. A singleton service is active on exactly one server in the cluster at a time and processes requests from multiple clients. A singleton service is generally backed by private, persistent data, which it caches in memory. It may also maintain transient state in memory, which is either regenerated or lost in the event of failure. Upon failure, a singleton service must be restarted on the same server or migrated to a new server.\nIn the license for WebLogic Server Basic, the configuration of either a standalone or application-provided singleton service is not permitted."
  176. LICENSE_CLUSTER_CONSTAINTS="The default cluster deployment behavior ensures homogeneous deployment for all clustered server instances that can be reached at the time of deployment. However, if the Administration Server cannot reach one or more clustered servers due to a network outage, those servers do not receive the deployment request until the network connection is restored.\nIt is possible to change WebLogic Server\'s default deployment behavior for clusters by setting the ClusterConstraintsEnabled option when starting the WebLogic Server domain. This option enforces strict deployment for all servers configured in a cluster. A deployment to a cluster succeeds only if all members of the cluster are reachable and all can deploy the specified files.\nIn the license for WebLogic Server Basic, the use of cluster constraints deployment is not permitted."
  177. LICENSE_OVERLOAD_MANAGEMENT="WebLogic Server has features for detecting, avoiding, and recovering from overload conditions. WebLogic Server\'s overload protection features help prevent the negative consequences - degraded application performance and stability - that can result from continuing to accept requests when the system capacity is reached.\nIn the license for WebLogic Server Basic, the configuration of any overload protection scheme at either a cluster or server level is not permitted."
  178. LICENSE_SERVER_MODE="The series of states through which a WebLogic Server instance can transition is called the server life cycle. At any time, a WebLogic Server instance is in a particular operating state. Two states with which WebLogic Server can be started include the following:\n*\tADMIN - WebLogic Server is up and running, but available only for administration operations, allowing you to perform server and application-level administration tasks.\n*\tSTANDBY - WebLogic Server does not process any request; its regular Listen Port is closed. The Administration Port is open and accepts life cycle commands that transition the server instance to either the RUNNING or the SHUTDOWN state. Other Administration requests are not accepted.\nStarting a server instance in standby is a method of keeping it available as a \"hot\" backup, a useful capability in high-availability environments.\nIn the license for WebLogic Server Basic, starting a WebLogic Server instance in either ADMIN or STANDBY state is not permitted."
  179. LICENSE_PRODUCTION_REDEPLOYMENT="Production redeployment strategy involves deploying a new version of an updated application alongside an older version of the same application. WebLogic Server automatically manages client connections so that only new client requests are directed to the new version. Clients already connected to the application during the redeployment continue to use the older version of the application until they complete their work, at which point WebLogic Server automatically retires the older application. This capability is supported by deploying the application in Administration mode, which makes it available only via a configured Administration channel.\nIn the license for WebLogic Server Basic, deploying any application that uses a version identifier is not permitted."
  180. LICENSE_APPLICATION_ADMINISTRATION_MODE="Distributing an application copies deployment files to target servers and places the application in a prepared state. You can then start the application in Administration mode, which restricts access to the application to a configured Administration channel so you can perform final testing without opening the application to external client connections or disrupting connected clients. You can start an application in administration mode with the -adminmode option. After performing final testing, you can either undeploy the application to make further changes, or start the application in Production mode to make it generally available to clients.\nIn the license for WebLogic Server Basic, configuring any application to start in administration mode is not permitted."
  181. LICENSE_DEPLOYMENT_ORDER="You can change the deployment order for a deployed application or stand-alone module by setting the AppDeploymentMBean DeploymentOrder attribute in the Administration Console (or programmatically using the AppDeploymentMBean). The DeploymentOrder attribute controls the load order of deployments relative to one another - modules with lower DeploymentOrder values deploy before those with higher values. By default, each deployment unit is configured with a DeploymentOrder value of 100. Deployments with the same DeploymentOrder value are deployed in alphabetical order using the deployment name. In all cases, applications and stand-alone modules are deployed after the WebLogic Server instance has initialized dependent subsystems.\nIn the license for WebLogic Server Basic, deploying an application or module with a non-default deployment order setting is not permitted."
  182. LICENSE_FAST_SWAP="Java EE 5 introduces the ability to redefine a class at runtime without dropping its ClassLoader or abandoning existing instances. This allows containers to reload altered classes without disturbing running applications, vastly speeding up iterative development cycles and improving the overall development and testing experiences. The usefulness of the Java EE dynamic class redefinition is severely curtailed, however, by the restriction that the shape of the class - its declared fields and methods - cannot change. The purpose of FastSwap is to remove this restriction in WLS, allowing the dynamic redefinition of classes with new shapes to facilitate iterative development.\nWith FastSwap, Java classes are redefined in-place without reloading the ClassLoader, thereby having the decided advantage of fast turnaround times. This means that you do not have to wait for an application to redeploy and then navigate back to wherever you were in the Web page flow. Instead, you can make your changes, auto compile, and then see the effects immediately.\nIn the license for WebLogic Server Basic, deploying an application in which FastSwap is enabled is not permitted."
  183. LICENSE_JMS_JDBC_WLDF_MODULE_DEPLOYMENT="Stand-alone JDBC, JMS, and WLDF application modules can be deployed similar to stand-alone Java EE modules. For a stand-alone JDBC, JMS, or WLDF application module, the target list determines the WebLogic Server domain in which the module is available. JNDI names specified within an application module are bound as global names and available to clients. For example, if you deploy a stand-alone JDBC application module to a single-server target, then applications that require resources defined in the JDBC module can only be deployed to the same server instance. You can target application modules to multiple servers, or to WebLogic Server clusters to make the resources available on additional servers.\nIn the license for WebLogic Server Basic, the stand-alone deployment of WebLogic JDBC, JMS and WLDF modules is not permitted."
  184. LICENSE_JMS_UNIT_OF_ORDER="Message Unit-of-Order is a WebLogic Server value-added feature that enables a stand-alone message producer, or a group of producers acting as one, to group messages into a single unit with respect to the processing order. This single unit is called a Unit-of-Order and requires that all messages from that unit be processed sequentially in the order they were created.\nIn the license for WebLogic Server Basic, changing the default Unit-of-Order for a message producer is not permitted."
  185. LICENSE_JMS_UNIT_OF_WORK="Many applications need an even more restricted notion of a group than provided by the Message Unit-of-Order (UOO) feature. If this is the case for your applications, WebLogic JMS provides the Unit-of-Work (UOW) Message Groups, which allows applications to send JMS messages, identifying some of them as a group and allowing a JMS consumer to process them as such. For example, an JMS producer can designate a set of messages that need to be delivered to a single client without interruption, so that the messages can be processed as a unit. Further, the client will not be blocked waiting for the completion of one unit when there is another unit that is already complete.\nIn the license for WebLogic Server Basic, changing the default value of the UnitOfWorkHandlingPolicy value for a JMS resource is not permitted."
  186. LICENSE_JMS_SAF="The WebLogic Store-and-Forward (SAF) client provides a mechanism whereby standalone clients can reliably send JMS messages to server-side JMS destinations, even when the SAF client cannot reach the JMS destination due to a network connection failure (e.g., a temporary blip or a network failure). While disconnected, messages sent by a SAF client are stored locally on the client and are forwarded to server-side JMS destinations once the client is reconnected.\nIn the license for WebLogic Server Basic, configuring any SAF agents is not permitted."
  187. LICENSE_SNMP_AGENTS="WebLogic Server SNMP agents query the WebLogic Server management system and communicate the results to managers over the SNMP protocol. The WebLogic Server management system exposes management data through a collection of managed beans (MBeans). When a WebLogic Server SNMP agent receives a request from a manager, it determines which MBean corresponds to the OID in the manager\'s request. Then it retrieves the data and wraps it in an SNMP response.\nIn the license for WebLogic Server Basic, all SNMP agents must be disabled."
  188. LICENSE_TUXEDO_CONNECTOR="The Oracle WebLogic Tuxedo Connector provides interoperability between WebLogic Server applications and Tuxedo services. The connector allows WebLogic Server clients to invoke Tuxedo services and Tuxedo clients to invoke WebLogic Server Enterprise Java Beans (EJBs) in response to a service request.\nIn the license for WebLogic Server Basic, use of Oracle WebLogic Tuxedo Connector is not permitted."
  189. LICENSE_HTTP_PUBLISH_SUBSCRIBE_SERVER="An HTTP Publish-Subscribe Server is a mechanism whereby Web clients subscribe to channels and then publish messages to these channels using asynchronous messages over HTTP.\nIn the license for WebLogic Server Basic, use of the WebLogic HTTP Publish-Subscribe Server is not permitted."
  190. LICENSE_WORK_MANAGER="WebLogic Server prioritizes work and allocates threads based on an execution model that takes into account administrator-defined parameters and actual run-time performance and throughput.\nAdministrators can configure a set of scheduling guidelines and associate them with one or more applications, or with particular application components. For example, you can associate one set of scheduling guidelines for one application, and another set of guidelines for other applications. At run time, WebLogic Server uses these guidelines to assign pending work and enqueued requests to execution threads.\nIn the license for WebLogic Server Basic, the creation of either global or application-specific Work Managers to modify the default work model is not permitted."
  191. LICENSE_WLDF="The WebLogic Diagnostic Framework (WLDF) is a monitoring and diagnostic framework that defines and implements a set of services that run within WebLogic Server processes and participate in the standard server life cycle. Using WLDF, you can create, collect, analyze, archive, and access diagnostic data generated by a running server and the applications deployed within its containers. This data provides insight into the run-time performance of servers and applications and enables you to isolate and diagnose faults when they occur.\nIn the license for WebLogic Server Basic, the use of WLDF is not permitted."
  192. LICENSE_ACTIVE_GRIDLINK="A single GridLink data source provides connectivity between WebLogic Server and an Oracle Database service targeted to an Oracle RAC cluster.\nIt uses the Oracle Notification Service (ONS) to adaptively respond to state changes in an Oracle RAC instance.\nIn the license for WebLogic Server Basic, the configuration and usage of GridLink data sources are not permitted."
  193. # End locale translation
  194. URL_SERVER_MIGRATION="http://download.oracle.com/docs/cd/E12839_01/e13709/migration.htm"
  195. URL_SERVICE_MIGRATION="http://download.oracle.com/docs/cd/E12839_01/e13709/service_migration.htm"
  196. URL_SELF_TUNED="http://download.oracle.com/docs/cd/E12839_01/web.1111/e13701/self_tuned.htm#CNFGD114"
  197. URL_DEPLOYMENT_MANAGING="http://download.oracle.com/docs/cd/E12839_01/web.1111/e13702/managing.htm#DEPGD305"
  198. URL_SERVER_LIFE="http://download.oracle.com/docs/cd/E12839_01/web.1111/e13708/server_life.htm"
  199. URL_OVERLOAD="http://download.oracle.com/docs/cd/E12839_01/web.1111/e13701/overload.htm"
  200. URL_FAILOVER="http://download.oracle.com/docs/cd/E12839_01/web.1111/e13709/failover.htm#CLUST224"
  201. URL_REDEPLOY="http://download.oracle.com/docs/cd/E12839_01/web.1111/e13702/redeploy.htm#DEPGD281"
  202. URL_DEPLOYUNITS="http://download.oracle.com/docs/cd/E12839_01/web.1111/e13702/deployunits.htm#DEPGD153"
  203. URL_JMS_UOW="http://download.oracle.com/docs/cd/E12839_01/web.1111/e13727/uow.htm"
  204. URL_JMS_UOO="http://download.oracle.com/docs/cd/E12839_01/web.1111/web.1111/e13727/uoo.htm"
  205. URL_JMS_SAF_ADMIN_CONFIG="http://download.oracle.com/docs/cd/E12839_01/web.1111/e13742/config_jms.htm"
  206. URL_WTC_ADMIN="http://download.oracle.com/docs/cd/E12839_01/web.1111/e13744/toc.htm"
  207. URL_SNMPMAN="http://download.oracle.com/docs/cd/E12839_01/web.1111/e13743/toc.htm"
  208. URL_DEPLOYMENT_UNDERSTANDING="http://download.oracle.com/docs/cd/E12839_01/web.1111/e13702/understanding.htm#DEPGD121"
  209. URL_DEPLOYMENT_DEPLOY="http://download.oracle.com/docs/cd/E12839_01/web.1111/e13702/deploy.htm#DEPGD228"
  210. URL_PUBSUB="http://download.oracle.com/docs/cd/E12839_01/web.1111/e13712/pubsub.htm"
  211. URL_WLDF="http://download.oracle.com/docs/cd/E12839_01/web.1111/e13714/intro.htm#WLDFC108"
  212. URL_ACTIVE_GRIDLINK="http://docs.oracle.com/cd/E17904_01/web.1111/e13737/gridlink_datasources.htm#JDBCA373"
  213. # print to stdout or to an output file
  214. def doPrint(txt):
  215. global outputFile
  216. if outputFile == None:
  217. print txt
  218. else:
  219. print >> outputFile, txt
  220. # format a string containing the separator char the same number of times
  221. # as the number of chars in the msg arg.
  222. def sep(msg="", ch="-"):
  223. global sepString
  224. sepString=""
  225. for c in msg:
  226. sepString=sepString+ch
  227. # print a header, which is a separator line before and after the value arg.
  228. def header(value=""):
  229. sep(value, "=")
  230. doPrint(sepString)
  231. doPrint(value)
  232. doPrint(sepString)
  233. # print the summary, which is the number of errors that were detected
  234. def summary():
  235. header(SUMMARY)
  236. if totalErrors == 0:
  237. doPrint(NO_ERRORS)
  238. else:
  239. doPrint(ERRORS_DETECTED % {"#": totalErrors})
  240. # print the current date & time
  241. def timestamp(date=None):
  242. doPrint(DateFormat.getDateTimeInstance(DateFormat.SHORT, DateFormat.SHORT).format(date))
  243. # print the relevant text from the license and
  244. # print the URL to the documentation.
  245. def licenseDoc(license=None, url=None):
  246. if license != None:
  247. doPrint(license)
  248. if url != None:
  249. doPrint(SEE_DOCUMENTATION + COLON + url)
  250. # print an error using the txt arg,
  251. # increment the total number of errors,
  252. # print the relevant text from the license and the URL to the documentation.
  253. def printError(txt, license=None, url=None):
  254. global totalErrors
  255. doPrint(LICENSE_COMPLIANCE_FAILURE + txt)
  256. totalErrors = totalErrors + 1
  257. licenseDoc(license, url)
  258. # print the (embedded) message from an exception
  259. def printExceptionInfo(ex):
  260. msg = ""
  261. while (ex != None):
  262. if (ex.getMessage() != None):
  263. msg = ex.getMessage()
  264. break
  265. ex = ex.getCause()
  266. doPrint(msg)
  267. # format an application name from an object name into the real name & version
  268. def applicationNameVersion(name):
  269. realName = nameToNonVersionedName.get(name)
  270. version = nameToVersion.get(name)
  271. nameVersion = APPLICATION + " " + realName
  272. if version != None:
  273. nameVersion = nameVersion + " " + VERSION + " " + version
  274. return nameVersion
  275. # get the names and object names of customer apps
  276. def customerApps():
  277. global oracleApplications
  278. global oracleApplicationNameSet
  279. oracleApplicationNameSet = HashSet()
  280. for oracleApplication in oracleApplications:
  281. oracleApplicationNameSet.add(oracleApplication)
  282. global oracleWLDFs
  283. global oracleWLDFNameSet
  284. oracleWLDFNameSet = HashSet()
  285. for oracleWLDF in oracleWLDFs:
  286. oracleWLDFNameSet.add(oracleWLDF)
  287. global customerApplicationNameSet
  288. global customerAppDeploymentObjectNameSet
  289. global customerApplicationRuntimeObjectNameSet
  290. global nameToNonVersionedName
  291. global nameToVersion
  292. customerApplicationNameSet = HashSet()
  293. customerAppDeploymentObjectNameSet = HashSet()
  294. customerApplicationRuntimeObjectNameSet = HashSet()
  295. nameToNonVersionedName = HashMap()
  296. nameToVersion = HashMap()
  297. applicationDeploymentNamePattern = ObjectName("com.bea:Type=AppDeployment,*")
  298. applicationDeployments = mbs.queryNames(applicationDeploymentNamePattern, None)
  299. if (applicationDeployments.size() > 0):
  300. for applicationDeployment in applicationDeployments:
  301. applicationDeploymentName = applicationDeployment.getKeyProperty("Name")
  302. versionIdentifier = mbs.getAttribute(applicationDeployment, "VersionIdentifier")
  303. realName = applicationDeploymentName
  304. if not versionIdentifier == None:
  305. versionIndex = applicationDeploymentName.find(versionIdentifier)
  306. realName = applicationDeploymentName[0:versionIndex-1]
  307. isInternalApp = mbs.getAttribute(applicationDeployment, "InternalApp")
  308. if not isInternalApp:
  309. if not oracleApplicationNameSet.contains(realName):
  310. if not customerApplicationNameSet.contains(realName):
  311. customerApplicationNameSet.add(realName)
  312. if not customerAppDeploymentObjectNameSet.contains(applicationDeployment):
  313. customerAppDeploymentObjectNameSet.add(applicationDeployment)
  314. if not nameToNonVersionedName.containsKey(applicationDeploymentName):
  315. nameToNonVersionedName.put(applicationDeploymentName, realName)
  316. if not nameToVersion.containsKey(applicationDeploymentName):
  317. if not versionIdentifier == None:
  318. nameToVersion.put(applicationDeploymentName, versionIdentifier)
  319. applicationRuntimeNamePattern = ObjectName("com.bea:Type=ApplicationRuntime,*")
  320. applicationRuntimes = mbs.queryNames(applicationRuntimeNamePattern, None)
  321. if (applicationRuntimes.size() > 0):
  322. for applicationRuntime in applicationRuntimes:
  323. applicationRuntimeName = applicationRuntime.getKeyProperty("Name")
  324. realName = applicationRuntimeName
  325. version = mbs.getAttribute(applicationRuntime, "ApplicationVersion")
  326. if not version == None:
  327. versionIndex = applicationRuntimeName.find(version)
  328. realName = applicationRuntimeName[0:versionIndex-1]
  329. if customerApplicationNameSet.contains(realName):
  330. if not customerApplicationRuntimeObjectNameSet.contains(applicationRuntime):
  331. customerApplicationRuntimeObjectNameSet.add(applicationRuntime)
  332. if not nameToNonVersionedName.containsKey(applicationRuntimeName):
  333. nameToNonVersionedName.put(applicationRuntimeName, realName)
  334. if not nameToVersion.containsKey(applicationRuntimeName):
  335. if not version == None:
  336. nameToVersion.put(applicationRuntimeName, version)
  337. # invoke a test & print the number of errors detected
  338. def tryTest(test=None):
  339. if test != None:
  340. curErrors = totalErrors
  341. try:
  342. test()
  343. except WLSTException, ex:
  344. printExceptionInfo(ex)
  345. if totalErrors == curErrors:
  346. doPrint(NO_ERRORS)
  347. else:
  348. doPrint(ERRORS_DETECTED % {"#": totalErrors - curErrors})
  349. # Test for service migration by expecting the value of the
  350. # DomainMBean attribute ClusterConstraintsEnabled to be false.
  351. # Test for potential incorrect server state by expecting the value of the
  352. # DomainMBean attribute AdministrationPortEnabled to be false.
  353. def domainInfo():
  354. header(DOMAIN_INFO)
  355. domainObjectNamePattern = ObjectName("com.bea:Type=Domain,*")
  356. domains=mbs.queryNames(domainObjectNamePattern, None)
  357. if domains.size() > 0:
  358. domain = domains[0]
  359. global domainObject
  360. domainObject = domain
  361. if verbose:
  362. doPrint(DOMAIN_NAME + COLON + domain.getKeyProperty("Name"))
  363. doPrint(DOMAIN_VERSION + COLON + mbs.getAttribute(domain, "DomainVersion"))
  364. if (mbs.getAttribute(domain, "InternalAppsDeployOnDemandEnabled")):
  365. doPrint(DOMAIN_DEPLOY_INTERNAL_APPS_ON_DEMAND + IS_ENABLED)
  366. else:
  367. doPrint(DOMAIN_DEPLOY_INTERNAL_APPS_ON_DEMAND + IS_NOT_ENABLED)
  368. doPrint(CHECKING_FOR_ADMINISTRATION_PORT_ENABLED + COLON)
  369. administrationPortEnabled = mbs.getAttribute(domain, "AdministrationPortEnabled")
  370. if administrationPortEnabled:
  371. printError(DOMAIN + " " + ADMINISTRATION_PORT, LICENSE_SERVER_MODE, URL_SERVER_LIFE)
  372. doPrint(CHECKING_FOR_SERVICE_MIGRATION + COLON)
  373. clusterConstraintsEnabled = mbs.getAttribute(domainObject, "ClusterConstraintsEnabled")
  374. if verbose:
  375. if clusterConstraintsEnabled:
  376. doPrint(DOMAIN_CLUSTER_CONSTRAINTS + ARE_ENABLED)
  377. else:
  378. doPrint(DOMAIN_CLUSTER_CONSTRAINTS + ARE_NOT_ENABLED)
  379. if clusterConstraintsEnabled:
  380. printError(DOMAIN_CLUSTER_CONSTRAINTS + ARE_ENABLED, LICENSE_CLUSTER_CONSTAINTS, URL_SERVICE_MIGRATION)
  381. # Test for whole server migration by expecting the value of each
  382. # ServerMBean attribute AutoMigration to be false.
  383. # Test for server state by expecting the value of each
  384. # ServerMBean attribute AdministrationPortEnabled to be false and by
  385. # expecting the value of each ServerMBean attribute StartupMode to not
  386. # be ADMIN or STANDBY and expecting the value of each ServerRuntimeMBean
  387. # attribute State to not be ADMIN or STANDBY.
  388. # Test for invalid server overload protection schemes by expecting the
  389. # value of the attributes FailureAction and PanicAction to be no-action
  390. # for each ServerMBean attribute OverloadProtection.
  391. def serverInfo():
  392. header(SERVER_INFO)
  393. doPrint(CHECKING_SERVER_MODE_AND_OVERLOAD_ACTIONS + COLON)
  394. noAutoMigrationErrors = 0
  395. noServerModeErrors = 0
  396. noOverloadErrors = 0
  397. serverObjectNamePattern = ObjectName("com.bea:Type=Server,*")
  398. servers=mbs.queryNames(serverObjectNamePattern, None)
  399. if (servers.size() > 0):
  400. for server in servers:
  401. serverName = server.getKeyProperty("Name")
  402. if verbose:
  403. doPrint(SERVER_NAME + COLON + serverName)
  404. autoMigrationEnabled = mbs.getAttribute(server, "AutoMigrationEnabled")
  405. if verbose:
  406. if autoMigrationEnabled:
  407. doPrint(SERVER + serverName + AUTOMIGRATION)
  408. else:
  409. doPrint(SERVER + serverName + NOT_AUTOMIGRATION)
  410. machine = mbs.getAttribute(server, "Machine");
  411. if machine != None:
  412. if verbose:
  413. doPrint(SERVER_MACHINE + COLON + mbs.getAttribute(machine, "Name"))
  414. administrationPortEnabled = mbs.getAttribute(server, "AdministrationPortEnabled")
  415. startupMode = mbs.getAttribute(server, "StartupMode")
  416. if verbose:
  417. doPrint(SERVER + serverName + " " + STARTUP_MODE + COLON + startupMode)
  418. if autoMigrationEnabled:
  419. printError(SERVER + serverName + AUTOMIGRATION)
  420. noAutoMigrationErrors = noAutoMigrationErrors + 1
  421. if administrationPortEnabled:
  422. printError(SERVER + serverName + " " + ADMINISTRATION_PORT)
  423. noServerModeErrors = noServerModeErrors + 1
  424. if (startupMode == "ADMIN") or (startupMode == "STANDBY"):
  425. printError(SERVER + serverName + " " + INCORRECT_STARTUP_MODE + COLON + startupMode)
  426. noServerModeErrors = noServerModeErrors + 1
  427. overloadProtection = mbs.getAttribute(server, "OverloadProtection")
  428. if (overloadProtection != None):
  429. failureAction = mbs.getAttribute(overloadProtection, "FailureAction")
  430. panicAction = mbs.getAttribute(overloadProtection, "PanicAction")
  431. if verbose:
  432. doPrint(SERVER + serverName + OVERLOAD_PROTECTION_FAILURE_ACTION + COLON + failureAction)
  433. doPrint(SERVER + serverName + OVERLOAD_PROTECTION_PANIC_ACTION + COLON + panicAction)
  434. if failureAction != "no-action":
  435. printError(SERVER + serverName + INCORRECT_OVERLOAD_PROTECTION_FAILURE_ACTION + COLON + failureAction)
  436. noOverloadErrors = noOverloadErrors + 1
  437. if panicAction != "no-action":
  438. printError(SERVER + serverName + INCORRECT_OVERLOAD_PROTECTION_PANIC_ACTION + COLON + panicAction)
  439. noOverloadErrors = noOverloadErrors + 1
  440. serverObjectNamePattern = ObjectName("com.bea:Type=ServerRuntime,*")
  441. servers=mbs.queryNames(serverObjectNamePattern, None)
  442. if (servers.size() > 0):
  443. for server in servers:
  444. serverName = server.getKeyProperty("Name")
  445. serverState = mbs.getAttribute(server, "State")
  446. if verbose:
  447. doPrint(SERVER + serverName + " " + SERVER_STATE + COLON + serverState)
  448. if (serverState == "ADMIN") or (serverState == "STANDBY"):
  449. printError(SERVER + serverName + " " + INCORRECT_SERVER_STATE + COLON + serverState)
  450. noServerModeErrors = noServerModeErrors + 1
  451. if noAutoMigrationErrors > 0:
  452. licenseDoc(LICENSE_WHOLE_SERVER_MIGRATION, URL_SERVER_MIGRATION)
  453. if noServerModeErrors > 0:
  454. licenseDoc(LICENSE_SERVER_MODE, URL_SERVER_LIFE)
  455. if noOverloadErrors > 0:
  456. licenseDoc(LICENSE_OVERLOAD_MANAGEMENT, URL_OVERLOAD)
  457. # Test for WAN or MAN replication type by expecting the value of each
  458. # ClusterMBean attribute ClusterType to not be wan or man
  459. # Test for whole server migration by expecting the value of each
  460. # ClusterMBean attribute AutoMigration to be false.
  461. # Test for invalid cluster overload protection schemes by expecting the
  462. # value of the attributes FailureAction and PanicAction to be no-action
  463. # for each ClusterMBean attribute OverloadProtection.
  464. def clusterInfo():
  465. header(CLUSTER_INFO)
  466. doPrint(CHECKING_CLUSTER_TYPE_AND_OVERLOAD_ACTIONS + COLON)
  467. noClusterTypeErrors = 0
  468. noMigrationBasisErrors = 0
  469. noOverloadErrors = 0
  470. clusterObjectNamePattern = ObjectName("com.bea:Type=Cluster,*")
  471. clusters=mbs.queryNames(clusterObjectNamePattern, None)
  472. if (clusters.size() > 0):
  473. for cluster in clusters:
  474. clusterName = cluster.getKeyProperty("Name")
  475. if verbose:
  476. doPrint(CLUSTER_NAME + COLON + clusterName)
  477. clusterType = mbs.getAttribute(cluster, "ClusterType")
  478. if verbose:
  479. doPrint(CLUSTER + clusterName + " " + CLUSTER_TYPE + COLON + clusterType)
  480. if (clusterType == "wan") or (clusterType == "man"):
  481. printError(CLUSTER + clusterName + " " + INCORRECT_CLUSTER_TYPE + COLON + clusterType)
  482. noClusterTypeErrors = noClusterTypeErrors + 1
  483. migrationBasis = mbs.getAttribute(cluster, "MigrationBasis")
  484. if verbose:
  485. doPrint(CLUSTER + clusterName + " " + MIGRATION_BASIS + COLON + migrationBasis)
  486. if migrationBasis == "consensus":
  487. printError(CLUSTER + clusterName + " " + INCORRECT_MIGRATION_BASIS + COLON + migrationBasis)
  488. noMigrationBasisErrors = noMigrationBasisErrors + 1
  489. overloadProtection = mbs.getAttribute(cluster, "OverloadProtection")
  490. if (overloadProtection != None):
  491. failureAction = mbs.getAttribute(overloadProtection, "FailureAction")
  492. panicAction = mbs.getAttribute(overloadProtection, "PanicAction")
  493. if verbose:
  494. doPrint(CLUSTER + clusterName + OVERLOAD_PROTECTION_FAILURE_ACTION + COLON + failureAction)
  495. doPrint(CLUSTER + clusterName + OVERLOAD_PROTECTION_PANIC_ACTION + COLON + panicAction)
  496. if failureAction != "no-action":
  497. printError(CLUSTER + clusterName + INCORRECT_OVERLOAD_PROTECTION_FAILURE_ACTION + COLON + failureAction)
  498. noOverloadErrors = noOverloadErrors + 1
  499. if panicAction != "no-action":
  500. printError(CLUSTER + clusterName + INCORRECT_OVERLOAD_PROTECTION_PANIC_ACTION + COLON + panicAction)
  501. noOverloadErrors = noOverloadErrors + 1
  502. if noClusterTypeErrors > 0:
  503. licenseDoc(LICENSE_WAN_AND_MAN_STATE_REPLICATION, URL_FAILOVER)
  504. if noMigrationBasisErrors > 0:
  505. licenseDoc(LICENSE_WHOLE_SERVER_MIGRATION, URL_SERVER_MIGRATION)
  506. if noOverloadErrors > 0:
  507. licenseDoc(LICENSE_OVERLOAD_MANAGEMENT, URL_OVERLOAD)
  508. # Test for singleton services by expecting the number of the
  509. # SingletonServiceMBeans to be zero.
  510. def singletonServiceInfo():
  511. header(SINGLETON_SERVICE_INFO)
  512. doPrint(CHECKING_FOR_SINGLETON_SERVICES + COLON)
  513. singletonNames = ""
  514. singletonObjectNamePattern = ObjectName("com.bea:Type=SingletonService,*")
  515. singletons=mbs.queryNames(singletonObjectNamePattern, None)
  516. if (singletons.size() > 0):
  517. for singleton in singletons:
  518. singletonName = singleton.getKeyProperty("Name")
  519. singletonNames = singletonNames + singletonName + " "
  520. if verbose:
  521. doPrint(SINGLETON_NAME + COLON + singletonName)
  522. doPrint(SINGLETON + singletonName + " class name: " + mbs.getAttribute(singleton, "ClassName"))
  523. cluster = mbs.getAttribute(singleton, "Cluster")
  524. if (cluster != None):
  525. if verbose:
  526. doPrint(SINGLETON + singletonName + " " + CLUSTER_NAME + COLON + cluster.getKeyProperty("Name"))
  527. hostingServer = mbs.getAttribute(singleton, "HostingServer")
  528. if (hostingServer != None):
  529. if verbose:
  530. doPrint(SINGLETON + singletonName + " " + HOSTING_SERVER + COLON + cluster.getKeyProperty("Name"))
  531. userPreferredServer = mbs.getAttribute(singleton, "UserPreferredServer")
  532. if (userPreferredServer != None):
  533. if verbose:
  534. doPrint(SINGLETON + singletonName + " " + USER_PREFERRED_SERVER + COLON + cluster.getKeyProperty("Name"))
  535. allCandidateServers = mbs.getAttribute(singleton, "AllCandidateServers")
  536. if (len(allCandidateServers) > 0):
  537. for candidateServer in allCandidateServers:
  538. candidateServerName = candidateServer.getKeyProperty("Name")
  539. if verbose:
  540. doPrint(SINGLETON + singletonName + " " + CANDIDATE_SERVER+ COLON + candidateServerName)
  541. if singletons.size() > 0:
  542. printError(HAVE_SINGLETONS + COLON + SINGLETONS_ARE + " " + singletonNames, LICENSE_SINGLETON_SERVICE)
  543. # Test for service migration by expecting the value of the MigrationPolicy
  544. # attribute to be manual for each MigratableTargetMBean
  545. def serviceMigrationInfo():
  546. header(SERVICE_MIGRATION_INFO)
  547. doPrint(CHECKING_FOR_SERVICE_MIGRATION + COLON)
  548. noMigratableTargetErrors = 0
  549. migratableTargetNamePattern = ObjectName("com.bea:Type=MigratableTarget,*")
  550. targets=mbs.queryNames(migratableTargetNamePattern, None)
  551. if (targets.size() > 0):
  552. for target in targets:
  553. targetName = target.getKeyProperty("Name")
  554. if verbose:
  555. doPrint(MIGRATABLE_TARGET + COLON + targetName)
  556. migrationPolicy = mbs.getAttribute(target, "MigrationPolicy")
  557. if verbose:
  558. doPrint(MIGRATABLE_TARGET + targetName + " " + MIGRATION_POLICY + COLON + migrationPolicy)
  559. if migrationPolicy != "manual":
  560. printError(MIGRATABLE_TARGET + targetName + " " + INCORRECT_MIGRATION_POLICY + COLON + migrationPolicy)
  561. noMigratableTargetErrors = noMigratableTargetErrors + 1
  562. if noMigratableTargetErrors > 0:
  563. licenseDoc(LICENSE_SERVICE_MIGRATION, URL_SERVICE_MIGRATION)
  564. # Test for non-default global work managers by expecting the size of the
  565. # attribute WorkManagers to be zero for the DomainMBean attribute SelfTuning.
  566. def globalWorkManagerInfo():
  567. header(GLOBAL_WORK_MANAGER_INFO)
  568. global domainObject
  569. selfTuning = mbs.getAttribute(domainObject, "SelfTuning")
  570. if (selfTuning != None):
  571. selfTuningName = selfTuning.getKeyProperty("Name")
  572. workManagers = mbs.getAttribute(selfTuning, "WorkManagers")
  573. doPrint(CHECKING_FOR_GLOBAL_WORK_MANAGERS + COLON)
  574. if len(workManagers) > 0:
  575. workManagersUsed = ""
  576. for workManager in workManagers:
  577. workManagerName = workManager.getKeyProperty("Name")
  578. if not (workManagerName.startswith("wm/")) and (workManagerName.endswith("WorkManager")):
  579. workManagersUsed = workManagersUsed + workManagerName + " "
  580. if workManagersUsed != "":
  581. printError(DOMAIN + " " + SELF_TUNING + " " + NAME + " " + selfTuningName + COLON + GLOBAL_WORK_MANAGER_USED)
  582. doPrint(WORK_MANAGERS + COLON + workManagersUsed)
  583. licenseDoc(LICENSE_WORK_MANAGER, URL_SELF_TUNED)
  584. # Test for non-default application work managers by expecting the values
  585. # of each ApplicationRuntimeMBean attribute WorkManagerRuntimes to be default
  586. # or consoleWorkManager
  587. def applicationWorkManagerInfo():
  588. global customerApplicationRuntimeObjectNameSet
  589. header(APPLICATION_WORK_MANAGER_INFO)
  590. doPrint(CHECKING_FOR_APPLICATION_WORK_MANAGERS + COLON)
  591. noWorkManagerErrors = 0
  592. if (customerApplicationRuntimeObjectNameSet.size() > 0):
  593. for applicationRuntime in customerApplicationRuntimeObjectNameSet:
  594. applicationRuntimeName = applicationRuntime.getKeyProperty("Name")
  595. workManagerRuntimes = mbs.getAttribute(applicationRuntime, "WorkManagerRuntimes")
  596. if (len(workManagerRuntimes) > 0):
  597. for workManagerRuntime in workManagerRuntimes:
  598. workManagerRuntimeName = mbs.getAttribute(workManagerRuntime, "Name")
  599. workManagerRuntimeType = mbs.getAttribute(workManagerRuntime, "Type")
  600. if (workManagerRuntimeName != "default") and (workManagerRuntimeName != "consoleWorkManager"):
  601. if verbose:
  602. doPrint(APPLICATION_NAME + COLON + applicationRuntimeName)
  603. doPrint(WORK_MANAGER + COLON + workManagerRuntimeName)
  604. doPrint(WORK_MANAGER_TYPE + COLON + workManagerRuntimeType)
  605. if (workManagerRuntimeName != "default") and (workManagerRuntimeName != "consoleWorkManager"):
  606. printError(applicationNameVersion(applicationRuntimeName) + " " + APPLICATION_WORK_MANAGER_USED + COLON + workManagerRuntimeName)
  607. noWorkManagerErrors = noWorkManagerErrors + 1
  608. if noWorkManagerErrors > 0:
  609. licenseDoc(LICENSE_WORK_MANAGER, URL_SELF_TUNED)
  610. # Test for application versioning by expecting the value of the
  611. # AppDeploymentMBean attribute VersionIdentifier to be empty.
  612. # Test for application deployment order by expecting the value of the
  613. # AppDeploymentMBean attribute DeploymentOrder to be 100.
  614. # Test only applications with the attribute ModuleType == ear
  615. def deploymentInfo():
  616. global customerAppDeploymentObjectNameSet
  617. header(DEPLOYMENT_INFO)
  618. doPrint(CHECKING_APPLICATIONS_FOR_VERSIONING_AND_ORDERING + COLON)
  619. noVersionIdentifierErrors = 0
  620. noDeploymentOrderErrors = 0
  621. queryExp = Query.eq(Query.attr("ModuleType"), Query.value("ear"))
  622. if customerAppDeploymentObjectNameSet.size() > 0:
  623. for applicationDeployment in customerAppDeploymentObjectNameSet:
  624. moduleType = mbs.getAttribute(applicationDeployment, "ModuleType")
  625. if moduleType == "ear":
  626. applicationDeploymentName = applicationDeployment.getKeyProperty("Name")
  627. versionIdentifier = mbs.getAttribute(applicationDeployment, "VersionIdentifier")
  628. if (versionIdentifier != None) and (versionIdentifier != "V2.0"):
  629. printError(applicationNameVersion(applicationDeploymentName) + " " + USES_VERSION + " " + versionIdentifier)
  630. noVersionIdentifierErrors = noVersionIdentifierErrors + 1
  631. deploymentOrder = mbs.getAttribute(applicationDeployment, "DeploymentOrder")
  632. if deploymentOrder != 100:
  633. printError(applicationNameVersion(applicationDeploymentName) + " " + USES_NON_DEFAULT_DEPLOYMENT_ORDER + COLON + str(deploymentOrder))
  634. noDeploymentOrderErrors = noDeploymentOrderErrors + 1
  635. if noVersionIdentifierErrors > 0:
  636. licenseDoc(LICENSE_PRODUCTION_REDEPLOYMENT, URL_REDEPLOY)
  637. if noDeploymentOrderErrors > 0:
  638. licenseDoc(LICENSE_DEPLOYMENT_ORDER, URL_DEPLOYMENT_MANAGING)
  639. # Test for application fast swap by expecting the value of the
  640. # ApplicationRuntimeMBean attribute ClassRedefinitionRuntime to be empty.
  641. def applicationFastSwapInfo():
  642. global customerApplicationRuntimeObjectNameSet
  643. header(APPLICATION_FAST_SWAP_INFO)
  644. doPrint(CHECKING_FOR_APPLICATION_FAST_SWAP + COLON)
  645. noFastSwapErrors = 0
  646. if (customerApplicationRuntimeObjectNameSet.size() > 0):
  647. for applicationRuntime in customerApplicationRuntimeObjectNameSet:
  648. applicationRuntimeName = applicationRuntime.getKeyProperty("Name")
  649. classRedefinitionRuntime = mbs.getAttribute(applicationRuntime, "ClassRedefinitionRuntime")
  650. if classRedefinitionRuntime != None:
  651. printError(applicationNameVersion(applicationRuntimeName) + " " + USES_FAST_SWAP)
  652. noFastSwapErrors = noFastSwapErrors + 1
  653. if noFastSwapErrors > 0:
  654. licenseDoc(LICENSE_FAST_SWAP, URL_DEPLOYUNITS)
  655. # Test for non-default JMS unit of work by expecting the values of the
  656. # attribute UnitOfWorkHandlingPolicy to be PassThrough.
  657. # Test for non-default JMS unit of order by expecting the values of the
  658. # attribute DefaultUnitOfOrder to be empty.
  659. # Test for SAF agents by expecting the size of the
  660. # DomainMBean attribute SAFAgents to be zero.
  661. def jmsInfo():
  662. header(JMS_INFO)
  663. doPrint(CHECKING_FOR_JMS_UNIT_OF_WORK + COLON)
  664. queryExp = Query.not(Query.eq(Query.attr("UnitOfWorkHandlingPolicy"), Query.value("PassThrough")))
  665. namePattern = ObjectName("*:*")
  666. unitsOfWork = mbs.queryNames(namePattern, queryExp)
  667. if unitsOfWork.size() > 0:
  668. for unitOfWork in unitsOfWork:
  669. workHandlingPolicy = mbs.getAttribute(unitOfWork, "UnitOfWorkHandlingPolicy")
  670. if unitOfWork != None:
  671. printError(RESOURCE + " " + USING_OBJECT_NAME + " " + unitOfWork.toString() + " " + HAS_UNIT_OF_WORK + COLON + workHandlingPolicy)
  672. licenseDoc(LICENSE_JMS_UNIT_OF_WORK, URL_JMS_UOW)
  673. doPrint(CHECKING_FOR_JMS_UNIT_OF_ORDER + COLON)
  674. queryExp = Query.not(Query.eq(Query.attr("DefaultUnitOfOrder"), Query.value("None")))
  675. unitsOfOrder = mbs.queryNames(namePattern, queryExp)
  676. if unitsOfOrder.size() > 0:
  677. for unitOfOrder in unitsOfOrder:
  678. defaultUnitOfOrder = mbs.getAttribute(unitOfOrder, "DefaultUnitOfOrder")
  679. if unitOfOrder != None:
  680. printError(RESOURCE + " " + USING_OBJECT_NAME + " " + unitOfOrder.toString() + " " + HAS_UNIT_OF_ORDER + COLON + defaultUnitOfOrder)
  681. licenseDoc(LICENSE_JMS_UNIT_OF_ORDER, URL_JMS_UOO)
  682. doPrint(CHECKING_FOR_JMS_SAF_AGENTS + COLON)
  683. SAFAgents = mbs.getAttribute(domainObject, "SAFAgents")
  684. if len(SAFAgents) > 0:
  685. for SAFAgent in SAFAgents:
  686. agentName = mbs.getAttribute(SAFAgent, "Name")
  687. agentType = mbs.getAttribute(SAFAgent, "Type")
  688. agentTargets = mbs.getAttribute(SAFAgent, "Targets")
  689. if verbose:
  690. doPrint(SAF_AGENT + " " + NAME + COLON + agentName)
  691. doPrint(SAF_AGENT + " " + TYPE + COLON + agentType)
  692. if len(agentTargets) > 0:
  693. for agentTarget in agentTargets:
  694. targetName = agentTarget.getKeyProperty("Name")
  695. doPrint(SAF_TARGET + COLON + targetName)
  696. if SAFAgent != None:
  697. printError(SAF_AGENT + " " + agentName + " " + USED)
  698. licenseDoc(LICENSE_JMS_SAF, URL_JMS_SAF_ADMIN_CONFIG)
  699. # Test for the existence of a tuxedo connector by expecting the number of the
  700. # WTCServerMBeans to be zero.
  701. def tuxedoConnectorInfo():
  702. header(TUXEDO_CONNECTOR_INFO)
  703. doPrint(CHECKING_FOR_TUXEDO_CONNECTORS + COLON)
  704. noTuxedoConnectorErrors = 0
  705. tuxedoConnectorObjectNamePattern = ObjectName("com.bea:Type=WTCServer,*")
  706. tuxedoConnectors=mbs.queryNames(tuxedoConnectorObjectNamePattern, None)
  707. if (tuxedoConnectors.size() > 0):
  708. for tuxedoConnector in tuxedoConnectors:
  709. tuxedoConnectorName = tuxedoConnector.getKeyProperty("Name")
  710. printError(TUXEDO_CONNECTOR + " " + tuxedoConnectorName + " " + USED)
  711. licenseDoc(LICENSE_TUXEDO_CONNECTOR, URL_WTC_ADMIN)
  712. # Test for usage of an SNMP agent by expecting the value of the
  713. # attribute Enabled to be false for any DomainMBean attribute SNMPAgent.
  714. def snmpInfo():
  715. header(SNMP_INFO)
  716. doPrint(CHECKING_FOR_SNMP_AGENTS + COLON)
  717. snmpAgent = mbs.getAttribute(domainObject, "SNMPAgent")
  718. if snmpAgent != None:
  719. name = snmpAgent.getKeyProperty("Name")
  720. isEnabled = mbs.getAttribute(snmpAgent, "Enabled")
  721. if isEnabled:
  722. printError(SNMP_AGENT + " " + name + " " + IS_ENABLED, LICENSE_SNMP_AGENTS, URL_SNMPMAN)
  723. # Test for application admin mode by expecting the values of each
  724. # AppRuntimeStateRuntimeMBean getIntendedState method for each value of the
  725. # AppRuntimeStateRuntimeMBean attribute ApplicationIds to not be STATE_ADMIN.
  726. def applicationModeInfo():
  727. header(APPLICATION_MODE_INFO)
  728. doPrint(CHECKING_FOR_APPLICATION_ADMIN_MODE + COLON)
  729. noApplicationStateErrors = 0
  730. domainRuntime()
  731. applicationRuntimeNamePattern = ObjectName("com.bea:Type=AppRuntimeStateRuntime,*")
  732. applicationRuntimes = mbs.queryNames(applicationRuntimeNamePattern, None)
  733. if applicationRuntimes.size() > 0:
  734. for applicationRuntime in applicationRuntimes:
  735. applicationRuntimeName = applicationRuntime.getKeyProperty("Name")
  736. if customerAppDeploymentObjectNameSet.size() > 0:
  737. for applicationDeployment in customerAppDeploymentObjectNameSet:
  738. applicationDeploymentName = applicationDeployment.getKeyProperty("Name")
  739. objs = jarray.array([applicationDeploymentName],java.lang.Object)
  740. strs = jarray.array(["java.lang.String"],java.lang.String)
  741. intendedState = mbs.invoke(applicationRuntime, "getIntendedState",objs,strs)
  742. if intendedState == "STATE_ADMIN":
  743. printError(applicationNameVersion(applicationDeploymentName) + " " + HAS_INTENDED_STATE + COLON + intendedState)
  744. noApplicationStateErrors = noApplicationStateErrors + 1
  745. serverRuntime()
  746. if noApplicationStateErrors > 0:
  747. licenseDoc(LICENSE_APPLICATION_ADMINISTRATION_MODE, URL_DEPLOYMENT_UNDERSTANDING)
  748. # Test for standalone deployment of a JMS, JDBC or WLDF module by expecting
  749. # the module types of non-internal standalone modules to not be
  750. # jms, jdbc or wldf.
  751. def moduleDeploymentInfo():
  752. header(MODULE_DEPLOYMENT_INFO)
  753. doPrint(CHECKING_FOR_JMS_JDBC_WLDF_MODULES + COLON)
  754. curErrors = totalErrors
  755. for wrongModuleType in ["jms", "jdbc", "wldf"]:
  756. applicationDeploymentNamePattern = ObjectName("com.bea:Type=AppDeployment,*")
  757. queryExp = Query.eq(Query.attr("ModuleType"), Query.value(wrongModuleType))
  758. applicationDeployments = mbs.queryNames(applicationDeploymentNamePattern, queryExp)
  759. if (applicationDeployments.size() > 0):
  760. for applicationDeployment in applicationDeployments:
  761. applicationDeploymentName = applicationDeployment.getKeyProperty("Name")
  762. printError(applicationNameVersion(applicationDeploymentName) + " " + INCORRECT_STANDALONE_MODULE_DEPLOYMENT + COLON + wrongModuleType)
  763. if totalErrors > curErrors:
  764. licenseDoc(LICENSE_JMS_JDBC_WLDF_MODULE_DEPLOYMENT, URL_DEPLOYMENT_DEPLOY)
  765. # Test for HTTP publish/subscriber usage by expecting the number of
  766. # LibraryMBeans with Name=pubsub to be zero.
  767. def httpPublishSubscribeServerInfo():
  768. header(HTTP_PUBLISH_SUBSCRIBE_SERVER_INFO)
  769. doPrint(CHECKING_FOR_HTTP_PUBLISH_SUBSCRIBE_USAGE + COLON)
  770. noPubSubErrors = 0
  771. libraryNamePattern = ObjectName("com.bea:Type=Library,*")
  772. queryExp = Query.eq(Query.attr("Name"), Query.value("pubsub"))
  773. pubSubLibs = mbs.queryNames(libraryNamePattern, queryExp)
  774. if pubSubLibs.size() > 0:
  775. for pubSubLib in pubSubLibs:
  776. name = pubSubLib.getKeyProperty("Name")
  777. localSourcePath = mbs.getAttribute(pubSubLib, "LocalSourcePath")
  778. if verbose:
  779. doPrint(LIBRARY + " " + NAME + COLON + name)
  780. doPrint(LOCAL_SOURCE_PATH + COLON + localSourcePath)
  781. if pubSubLibs > 0:
  782. printError(HTTP_PUBLISH_SUBSCRIBE_SERVER + " " + name + " " + USED)
  783. noPubSubErrors = noPubSubErrors + 1
  784. if verbose:
  785. libraryNamePattern = ObjectName("com.bea:Type=LibraryRuntime,*")
  786. pubSubRuntimes = mbs.queryNames(libraryNamePattern, queryExp)
  787. if pubSubRuntimes.size() > 0:
  788. for pubSubRuntime in pubSubRuntimes:
  789. name = pubSubRuntime.getKeyProperty("Name")
  790. referenced = mbs.getAttribute(pubSubRuntime, "Referenced")
  791. if referenced:
  792. referencingNames = mbs.getAttribute(pubSubRuntime, "ReferencingNames")
  793. for referencingName in referencingNames:
  794. doPrint(LIBRARY + " " + NAME + REFERENCED_BY + COLON + referencingName)
  795. if noPubSubErrors > 0:
  796. licenseDoc(LICENSE_HTTP_PUBLISH_SUBSCRIBE_SERVER, URL_PUBSUB)
  797. # Test for diagnostics framework usage by expecting the size of
  798. # the DomainMBean attribute WLDFSystemResources to be zero.
  799. def diagnosticsFrameworkInfo():
  800. header(DIAGNOSTICS_FRAMEWORK_INFO)
  801. doPrint(CHECKING_FOR_DIAGNOSTICS_FRAMEWORK_USAGE + COLON)
  802. noWldfErrors = 0
  803. WLDFSystemResources = mbs.getAttribute(domainObject, "WLDFSystemResources")
  804. if len(WLDFSystemResources) > 0:
  805. for WLDFSystemResource in WLDFSystemResources:
  806. name = WLDFSystemResource.getKeyProperty("Name")
  807. if not oracleWLDFNameSet.contains(name):
  808. printError(DIAGNOSTICS_FRAMEWORK_SYSTEM_RESOURCE + " " + USED + COLON + name)
  809. noWldfErrors = noWldfErrors + 1
  810. if noWldfErrors > 0:
  811. licenseDoc(LICENSE_WLDF, URL_WLDF)
  812. # Test for Active GridLink use
  813. # Check for ActiveGridLink=true, FanEnabled, ONS Nodes or ONS Wallet file config elements
  814. def activeGridLinkInfo():
  815. noActiveGridLinkErrors = 0
  816. header(ACTIVE_GRIDLINK_INFO)
  817. doPrint(CHECKING_FOR_ACTIVE_GRIDLINK_USAGE + COLON)
  818. # Examine the Oracle JDBC Parameter Beans for Active GridLink usage
  819. jdbcParamObjectNamePattern = ObjectName("com.bea:Type=weblogic.j2ee.descriptor.wl.JDBCOracleParamsBean,*")
  820. jdbcParams= mbs.queryNames(jdbcParamObjectNamePattern, None)
  821. for jdbcParam in jdbcParams:
  822. if mbs.getAttribute(jdbcParam, "FanEnabled") == true or mbs.getAttribute(jdbcParam, "OnsNodeList") != None or mbs.getAttribute(jdbcParam, "OnsWalletFile") != None or hasActiveGridlinkAttribute(jdbcParam):
  823. noActiveGridLinkErrors +=1
  824. dataSourceName = jdbcParam.getKeyProperty('Name')
  825. # Lookup the related DataSource Bean to get JNDI name
  826. jdbcDataSourceNamePattern = ObjectName("com.bea:Type=weblogic.j2ee.descriptor.wl.JDBCDataSourceParamsBean,Name=" + dataSourceName + ",*")
  827. jdbcDataSources= mbs.queryNames(jdbcDataSourceNamePattern, None)
  828. jndiName = ""
  829. for jdbcDataSource in jdbcDataSources:
  830. jndiNames = mbs.getAttribute(jdbcDataSource,"JNDINames")
  831. for i in jndiNames:
  832. if jndiName != "":
  833. jndiName = " " + jndiName
  834. jndiName = jndiName + i
  835. printError(USES_ACTIVE_GRIDLINK_DATASOURCE + '"' + dataSourceName + '"' + USES_ACTIVE_GRIDLINK_JNDI + '"' + jndiName + '"' + USES_ACTIVE_GRIDLINK_BEHAVIOUR)
  836. if noActiveGridLinkErrors > 0:
  837. licenseDoc(LICENSE_ACTIVE_GRIDLINK, URL_ACTIVE_GRIDLINK)
  838. # Determines if MBean has an "ActiveGridlink" attribute and returns value
  839. # Returns false otherwise
  840. # From WebLogic Server 12.1.2 onwards
  841. def hasActiveGridlinkAttribute(jdbcParam):
  842. info = mbs.getMBeanInfo(jdbcParam)
  843. attributes = info.getAttributes()
  844. for a in attributes:
  845. if a.getName() == "ActiveGridlink":
  846. return mbs.getAttribute(jdbcParam, "ActiveGridlink")
  847. return false
  848. # if all connection info is passed as args, use them
  849. # otherwise, connect manually
  850. username = None
  851. password = None
  852. url = None
  853. out = None
  854. argNo = 1
  855. while len(sys.argv) > argNo:
  856. if sys.argv[argNo] == "username":
  857. username = sys.argv[argNo + 1]
  858. argNo = argNo + 2
  859. elif sys.argv[argNo] == "password":
  860. password = sys.argv[argNo + 1]
  861. argNo = argNo + 2
  862. elif sys.argv[argNo] == "url":
  863. url = sys.argv[argNo + 1]
  864. argNo = argNo + 2
  865. elif sys.argv[argNo] == "verbose":
  866. verbose = true
  867. argNo = argNo + 1
  868. elif sys.argv[argNo] == "output":
  869. out = sys.argv[argNo + 1]
  870. argNo = argNo + 2
  871. else:
  872. argNo = argNo + 1
  873. def getWLBasic_Info():
  874. global totalErrors
  875. totalErrors = 0
  876. header(WLS_BASIC_AUDIT)
  877. timestamp(System.currentTimeMillis())
  878. hideDumpStack("true")
  879. WLST_return = ''
  880. WLSBasic_ERRORS = File(os.environ["CT_TMP"] + os.sep + 'logs' + os.sep + 'WLS_errors.log')
  881. fosWLSBasicerr = FileOutputStream(WLSBasic_ERRORS,true)
  882. WLSBasic_WARNINGS = File(os.environ["CT_TMP"] + os.sep + 'logs' + os.sep + 'WLS_warnings.log')
  883. fosWLSBasicwarn = FileOutputStream(WLSBasic_WARNINGS,true)
  884. WLSBasic_COLLECTED = File(os.environ["CT_TMP"] + os.sep + 'logs' + os.sep + 'WLS_collected.log')
  885. fosWLSBasiccol = FileOutputStream(WLSBasic_COLLECTED,true)
  886. targetMachine = sys.argv[1]
  887. while 1:
  888. print
  889. print 'Please enter administrative credentials for the WebLogic domain.'
  890. print
  891. try:
  892. connect()
  893. break
  894. except WLSTException, ex:
  895. WLST_return = str(ex)
  896. if WLST_return.find('authenticated') >= 0:
  897. print '\n\nWLS: CT-03003: ERROR: WLBasic script failed to authenticate user. Invalid userID or password.'
  898. quitWLST = raw_input('Please press enter to try to connect again with new credentials or q to quit:')
  899. if quitWLST.strip() == 'q':
  900. Failed_output = File(os.environ["CT_TMP"] + os.sep + 'WLSBasic' + os.sep + targetMachine + '_OracleWLS_WL_Basic.txt')
  901. fosFailedOut = FileOutputStream(Failed_output)
  902. theInterpreter.setOut(fosWLSBasicerr)
  903. print 'WLS: CT-03003: ERROR: WLBasic script failed to authenticate user. Invalid userID or password.'
  904. theInterpreter.setOut(fosFailedOut)
  905. print 'WLS: CT-03003: ERROR: WLBasic script failed to authenticate user. Invalid userID or password.'
  906. print
  907. print 'End of getWLS_WL_Basic'
  908. fosNUPerr.close()
  909. fosNUPwarn.close()
  910. fosNUPcol.close()
  911. fosFailedOut.close()
  912. return
  913. elif WLST_return.find('performing') >= 0:
  914. print 'WLS: CT-03004: ERROR: WLBasic script failed to connect to URL. Please check the URL and port and try again.'
  915. quitWLST = raw_input('Please press enter to try to connect again with new credentials or q to quit:')
  916. if quitWLST.strip() == 'q':
  917. Failed_output = File(os.environ["CT_TMP"] + os.sep + 'WLSBasic' + os.sep + targetMachine + '_OracleWLS_WL_Basic.txt')
  918. fosFailedOut = FileOutputStream(Failed_output)
  919. theInterpreter.setOut(fosWLSBasicerr)
  920. print 'WLS: CT-03004: ERROR: WLBasic script failed to connect to URL. Please check the URL and port and try again.'
  921. theInterpreter.setOut(fosFailedOut)
  922. print 'WLS: CT-03004: ERROR: WLBasic script failed to connect to URL. Please check the URL and port and try again.'
  923. print
  924. print 'End of getWLS_WL_Basic'
  925. fosNUPerr.close()
  926. fosNUPwarn.close()
  927. fosNUPcol.close()
  928. fosFailedOut.close()
  929. return
  930. ## We need to only get WL_Basic from WebLogic 10.3 and later
  931. ver=cmo.getConfigurationVersion()
  932. verElements = ver.split('.')
  933. if eval(verElements[0]) < 10 :
  934. print 'Failed to connect. WL_Basic measurement not supported on WebLogic Version' + ver
  935. theInterpreter.setOut(fosWLSBasicerr)
  936. print 'WLS: CT-03005: ERROR: WLBasic script failed to connect to URL, this version of WebLogic is not supported by the WLST WLBasic script.'
  937. print
  938. print 'End of getWLS_WL_Basic'
  939. fosNUPerr.close()
  940. fosNUPwarn.close()
  941. fosNUPcol.close()
  942. fosFailedOut.close()
  943. return
  944. else:
  945. print "WebLogic Version " + ver
  946. targetMachine = sys.argv[1]
  947. fBaseName = targetMachine + '_' + domainName + '_OracleWLS_WL_Basic.txt'
  948. theInterpreter.setOut(prev)
  949. print 'Checking WL Basic for the domain, ' + domainName + '.'
  950. WL_Basic_output = File(os.environ["CT_TMP"] + os.sep + 'WLSBasic' + os.sep + fBaseName)
  951. print 'Saving output to ' + str(WL_Basic_output)
  952. fosWLBasicOut = FileOutputStream(WL_Basic_output)
  953. theInterpreter.setOut(fosWLBasicOut)
  954. print
  955. print 'Target Machine: ' + targetMachine
  956. print 'Domain Name: ' + domainName
  957. print 'MW_HOME: ' + os.environ["MW_HOME"]
  958. print
  959. try:
  960. customerApps()
  961. except WLSTException, ex:
  962. return str(ex)
  963. try:
  964. tryTest(domainInfo)
  965. tryTest(clusterInfo)
  966. tryTest(serverInfo)
  967. tryTest(singletonServiceInfo)
  968. tryTest(serviceMigrationInfo)
  969. tryTest(globalWorkManagerInfo)
  970. tryTest(applicationWorkManagerInfo)
  971. tryTest(deploymentInfo)
  972. tryTest(applicationFastSwapInfo)
  973. tryTest(jmsInfo)
  974. tryTest(tuxedoConnectorInfo)
  975. tryTest(snmpInfo)
  976. tryTest(applicationModeInfo)
  977. tryTest(moduleDeploymentInfo)
  978. tryTest(httpPublishSubscribeServerInfo)
  979. tryTest(diagnosticsFrameworkInfo)
  980. tryTest(activeGridLinkInfo)
  981. except WLSTException, ex:
  982. return str(ex)
  983. summary()
  984. disconnect()
  985. theInterpreter.setOut(fosWLSBasiccol)
  986. print 'WLS: CT-03201: COLLECTED: WLBasic measurement running on ' + targetMachine + ' Domain ' + domainName
  987. theInterpreter.setOut(fosWLBasicOut)
  988. print
  989. print 'End of wls-basic-measurement'
  990. fosWLBasicOut.close()
  991. fosWLSBasicerr.close()
  992. fosWLSBasicwarn.close()
  993. fosWLSBasiccol.close()
  994. theInterpreter.setOut(prev)
  995. return 1
  996. prev = theInterpreter.getOut()
  997. getWLBasic_Info()
  998. while 1:
  999. print '\n\nWould you like to connect to another domain?'
  1000. quitDomains = raw_input('Please press enter to connect to a new domain or q to quit:')
  1001. if quitDomains.strip() == 'q':
  1002. break
  1003. else :
  1004. getWLBasic_Info()
  1005. theInterpreter.setOut(prev)
  1006. print
  1007. print 'End of getWLS_Basic'
  1008. exit()