6 Replies Latest reply: Feb 16, 2011 2:45 PM by paone RSS

    Weblogic Helath Check

    user507243
      Is there is any way to do health check alert on weblogic console server.
      I mean if any server goes down then I should get an email stating server is down.
      Any Idea guys.....
        • 1. Re: Weblogic Helath Check
          Jay SenSharma MiddlewareMagic
          Hi,

          You can use the weblogic.Admin utility to check the State of the Server and Accordingly u can use *"mailx"* utility of Unix to send an E-Mail Update at a regular interval.

          Example:
          Step1). Run the ". ./setWLSEnv.sh" or set the classpath manually....

          Step2). Run the following Command:
          java weblogic.Admin -url t3://localhost:7001 -username weblogic -password weblogic1 GET -pretty -type ServerRuntime


          OUTPUT:
          ---------------------------
          MBeanName: "Test_Domain:Name=AdminServer,Type=ServerRuntime,Location=AdminServer"
          ActivationTime: 1276750730667
          AdminServer: true
          AdminServerHost: 10.19.7.126
          AdminServerListenPort: 7001
          AdminServerListenPortSecure: false
          AdministrationPort: 9002
          AdministrationPortEnabled: false
          AdministrationURL: t3://10.19.7.126:7001
          ApplicationRuntimes: bea_wls9_async_response,mejb,WseeJmsModule,WseeJaxwsJmsModule,bea_wls_internal
          CachingDisabled: true
          ClusterRuntime:
          ConnectorServiceRuntime: ConnectorService
          CurrentDirectory: C:\BEA103~1\user_projects\domains\Test_Domain\.
          CurrentMachine:
          DefaultExecuteQueueRuntime:
          DefaultURL: t3://10.19.7.126:7001
          EntityCacheCumulativeRuntime:
          EntityCacheCurrentStateRuntime:
          EntityCacheHistoricalRuntime:
          ExecuteQueueRuntimes: weblogic.socket.Muxer
          HealthState: Component:ServerRuntime,State:HEALTH_OK,MBean:AdminServer,ReasonCode:[]
          JDBCServiceRuntime: AdminServer
          JMSRuntime: AdminServer.jms
          JTARuntime: JTARuntime
          JVMRuntime: AdminServer
          JoltRuntime:
          LibraryRuntimes: bea_wls_async_response
          ListenAddress: JAYKUMARS02.corp.amdocs.com/10.19.7.126
          ListenPort: 7001
          ListenPortEnabled: true
          LogBroadcasterRuntime: TheLogBroadcaster
          MANReplicationRuntime:
          Name: AdminServer
          OpenSocketsCurrentCount: 1
          Parent:
          PathServiceRuntime:
          Registered: true
          RestartsTotalCount: 0
          SAFRuntime: AdminServer.saf
          SSLListenAddress:
          SSLListenPort: 7002
          SSLListenPortEnabled: false
          ServerChannelRuntimes: Default[snmp][1],Default[snmp],Default[ldap][1],Default[http],Default[iiop],Default[http][1],Default[ldap],Default[t3][1],Default[t3],Default[iiop][1]
          ServerSecurityRuntime: AdminServer
          SingleSignOnServicesRuntime: AdminServer
          SocketsOpenedTotalCount: 1
          <b><font color=maroon>State: RUNNING</font></b><BR>
          StateVal: 2
          TimerRuntime: TimerRuntime
          Type: ServerRuntime
          WANReplicationRuntime:
          WLECConnectionServiceRuntime:
          WTCRuntime: WTCService
          WebServerRuntimes: AdminServer_AdminServer
          WeblogicVersion: WebLogic Server 10.3.3.0 Fri Apr 9 00:05:28 PDT 2010 1321401



          Step3). if above command works fine then Just Change the URL " -url t3://localhost:7001" to some other Servers URL to get it's State...information...

          Unsing Shell Script u can achieve it inside a For Loop to check the state of all the Servers...

          <font color=red>
          NOTE: Suppose if any Server is DOWN then u will get the following Message :

          Failed to connect to t3://localhost:7001: Destination unreachable; nested exception is:
          java.net.ConnectException: Connection refused: connect; No available router to destination

          Catch this exceptional case in your Shell Script and Immediately trigger a Mail to the Administrator using "mailx" utility.
          </font>


          You need to run that Shell Script as a Cron Job at a regular Interval of around 3 minutes or 5-Minutes or 10 Minutes ....baced on your requirement.
          .
          .
          Thanks
          Jay SenSharma
          http://weblogic-wonders.com/weblogic (WebLogic Wonders Are Here)
          • 2. Re: Weblogic Helath Check
            Jay SenSharma MiddlewareMagic
            Hi,

            Please refer to : http://weblogic-wonders.com/weblogic/2010/06/30/sending-email-alert-on-server-shutdown-using-wlst/
            • 3. Re: Weblogic Helath Check
              785468
              Hi jay,
              Im using java weblogic.Admin to get Health Status of servers.......when i run it in local weblogic 10.3 servers it working fine.........but when i run it in Production environment it gives me the message "NO Mbeans found" please help me to resolve this
              • 5. Re: Weblogic Helath Check
                Jay SenSharma MiddlewareMagic
                Hi,

                Please refer to the following post : http://weblogic-wonders.com/weblogic/2010/08/29/all-weblogic-server-healthstate-checking-using-jmx/ to check your Server's Health is in which State...out of below 5 states

                HEALTH_OK;
                HEALTH_WARN;
                HEALTH_CRITICAL;
                HEALTH_FAILED;
                HEALTH_OVERLOADED;

                .
                .
                Thanks
                Jay SenSharma
                • 6. Re: Weblogic Helath Check
                  paone
                  Probably my friend Jay links not functioning...

                  Anyway you can also ref the following links to get HealthState of you Threadpool on WebLogic 10.x and also on WebLogic 9.x versions.

                  http://wlstbyexamples.blogspot.com/2009/06/self-tuned-thread-pool-count.html

                  HTH
                  Pavan