Tuesday, December 7, 2010

Get the server "STATUS" when server is offline..!! -- PART - I

Hello All,

While I was away for some of the photography and some techno-graphy, I did some of the nice moves on the Photography side and Technology side..

You can catch my photography on my http://magical-shots.blogspot.com and here for Technology I work on..!!

These days I was working some of the SNMP features, many of you may know that we need SNMP to monitor the WebLogic Servers in various aspects as to monitor the WebLogic Server MBeans

Here we setup SNMP Traps for UNKNOWN Status of the server.

This scope is divided into 2 scopes of SNMP Functions
1. Domain Scoped SNMP Agent
2. Server Scoped SNMP Agent

In this Part we will work on Domain Scoped SNMP Agent.

In WebLogic Server Version 8.1 This feature of UNKNOWN Server Traps Generation was possible, but when new portal versions (9.2, 10.x and 11g) are introduced this feature faded to appear, and in new versions server doesn't generate any traps for UNKNOWN status of the server.

We believe that, whenever server enters into UNKNOWN Status, it will not be able to send any messages to Admin Server about its status as the status of the server will not be known to the Admin Server, and after all Kill -9 and a abrupt power failure of the server or many other circumstances result into pushing server into UNKNOWN Status.

For this feature, we have to apply the patch developed by Oracle (Patch ID : UE4C)

And then follow the following Steps to Setup a SNMP Traps for UNKNOWN Status of the Server.

I am using WebLogic Server Version 10.3.0.0

Step 1. Go to Servers, Check the status as Shutdown after starting the Admin Server





Step 2. Click on Diagnostics --> SNMP









Step 3. You can see a pre-existing domain scoped SNMP Agent in disabled state. Click on that and Enable the SNMP Agent by Click on the Check Box.



















Step 4. Save the Configuration.
























Step 5 . Configure the String Monitors.

Please Note : Don't Target any of the Servers.
















Step 6. Save the configuration.

Step 7. Create Trap Destination as in below Configurations.






















 Step 8. Save and Activate the Changes.

Step 9. Start the SNMP Trap Monitor as in below command after setting the WebLogic Environment.

"${JAVA_HOME}/bin/java" weblogic.diagnostics.snmp.cmdline.Manager SnmpTrapMonitor -p 1121
Step 10. Now try to start one of the Managed Servers and watch the traps from the server.

Here are SNMP traps for various states for WebLogic Servers you will see..

For Successful Server startup :

--- Snmp Trap Received ---
    Version        : v1
    Source         : UdpEntity:10.177.57.149:1101
    Community      : public
    Enterprise     : enterprises.140.625
    TrapOID        : enterprises.140.625.0.65
    RawTrapOID     : 1.3.6.1.4.1.140.625.0.65
    Trap Objects   : {
   { enterprises.140.625.100.5=Tue Dec 07 20:20:00 GMT+05:30 2010 }
   { enterprises.140.625.100.10=Managed-1 }
}
    Raw VarBinds   : {
   { enterprises.140.625.100.5=Tue Dec 07 20:20:00 GMT+05:30 2010 }
   { enterprises.140.625.100.10=Managed-1 }
}

For Successfull Server Shutdown :
--- Snmp Trap Received ---
    Version        : v1
    Source         : UdpEntity:10.177.57.149:1101
    Community      : public
    Enterprise     : enterprises.140.625
    TrapOID        : enterprises.140.625.0.70
    RawTrapOID     : 1.3.6.1.4.1.140.625.0.70
    Trap Objects   : {
   { enterprises.140.625.100.5=Tue Dec 07 20:18:33 GMT+05:30 2010 }
   { enterprises.140.625.100.10=Managed-1 }
}
    Raw VarBinds   : {
   { enterprises.140.625.100.5=Tue Dec 07 20:18:33 GMT+05:30 2010 }
   { enterprises.140.625.100.10=Managed-1 }
}
For Server Kill or Power Failure kind of instances..!! - Implemeneted Kill -30 on the WebLogic Java process as it assumes to be power failure.

--- Snmp Trap Received ---
    Version        : v1
    Source         : UdpEntity:10.177.57.149:1101
    Community      : public
    Enterprise     : enterprises.140.625
    TrapOID        : enterprises.140.625.0.75
    RawTrapOID     : 1.3.6.1.4.1.140.625.0.75
    Trap Objects   : {
   { enterprises.140.625.100.5=Tue Dec 07 20:22:40 GMT+05:30 2010 }
   { enterprises.140.625.100.10=AdminServer }
   { enterprises.140.625.100.55=jmx.monitor.string.matches }
   { enterprises.140.625.100.60=UNKNOWN }
   { enterprises.140.625.100.65=UNKNOWN }
   { enterprises.140.625.100.70=com.bea:Name=Managed-1,Type=ServerLifeCycleRuntime }
   { enterprises.140.625.100.75=ServerLifeCycleRuntime }
   { enterprises.140.625.100.80=State }
}
    Raw VarBinds   : {
   { enterprises.140.625.100.5=Tue Dec 07 20:22:40 GMT+05:30 2010 }
   { enterprises.140.625.100.10=AdminServer }
   { enterprises.140.625.100.55=jmx.monitor.string.matches }
   { enterprises.140.625.100.60=UNKNOWN }
   { enterprises.140.625.100.65=UNKNOWN }
   { enterprises.140.625.100.70=com.bea:Name=Managed-1,Type=ServerLifeCycleRuntime }
   { enterprises.140.625.100.75=ServerLifeCycleRuntime }
   { enterprises.140.625.100.80=State }
}

Please let me know if you are facing any difficulty in setting SNMP.

Thanks,

Your comments are much helpful.

Shailesh Dyade





5 comments:

Shailesh Dyade said...

Please Note : Admin Server should be be online to receive SNMP traps for remaining servers.

Jay said...

Wow...
Best use of SNMP Agent.
Thanks for Sharing

Jay SenSharma

Shailesh Dyade said...

Thanks Jay..!!

shashi bhushan r said...

Hi,

I have setup the env on wls 10.3.0 and also applied the patch which is showing on the monitor tab.

But when I kill I am not getting the trap.. Is there neway i can share my config.xml

/SR

shashi bhushan r said...

Hi again,
Patch applied info in the server logs.



Also all other trap are working fine. including heapfreesize trap. its just that UNKNOWN is not working.