Simple Network Management Protocol (SNMP) is a type of an application layer protocol which governs the exchange of management information between network devices. Now in webLogic server SNMP agents can be configured to collect data from the webLogic server management system and communicate the results over the SNMP protocol. In this example we will see “How to Configure SNMP Agent in WebLogic Server?”
This could be a very useful tool for the administrators to keep a watch of what exactly is going on with the servers and take an actions accordingly. As weblogic server supports SNMP protocol like SNMPv1, SNMPv2 and SNMPv3 from weblogic server version 10 MP-3 we can do lot of things with it.
.
Some Advantages of Weblogic SNMP Agents
- Send notifications when any servers starts or has been shuts down.
- Monitor any specific log messages or error message and send notifications when weblogic server generates them.
- You can even use JMX monitors to poll weblogic server MBeans periodically and send notifications when the MBean attributes change in what ever way you want.
- And lot more can be done with it.
Steps to Configure SNMP agent
1. Start your WebLogic Server and Login to the Admin Console.
2. Create a SNMP agent from the following console path
Domain Structure -> expand “Diagnostics” -> “SNMP”
3. Once you target the SNMP agent on the running server then you will get the following output on the prompt which makes sure that our configuration is taken properly.
4. Now we will configure an Attribute changes on our SNMP agent to keep an eye on the changes done at an applications deployment order.
5. After configuring Attribute changes now we will configure Trap destinations on our SNMP agent to send the notifications.
6. Now open a new command prompt/shell and run the following command after running setDomainEnv.cmd / setDomainEnv.sh
java weblogic.diagnostics.snmp.cmdline.Manager SnmpTrapMonitor -p 165
Where -p is having the post given to the Trap Destination
7. SNMP side configuration has been completed, now its time to test if everything is working fine as it should be. So from the Deployment page go the application which you have chosen in the step 4 and from the configuration tab change the deployment order as shown below.
Console Path:
Deployment –> (YOUR APPLICATION) –> Configuration tab –> change Deployment Order
8. You can now notice that if you change the deployment order parameter you get the following output, which would indicate the the order has been change as shown in the below snap-shot.
You can monitor lot more by using the same steps and also configure log filtering, monitor particular string and many more things. Hence this way you can get alerts and keep knowing what is going on in your production environment.
Regards,
Ravish Mody
November 26th, 2010 on 2:36 am
you guys are really fantastic, you provide so much useful info in your posts.
Yet all these screenshots are difficult to enjoy, lot of clicking back and forth.
For tutorials like this, wouldn’t it be easier to make a movie, using a tool like CamStudio or BB FlashBack ?
thanks!
November 26th, 2010 on 9:53 am
Hi Vernetto,
Thank you for your appreciation and for your suggestion too.
We would make sure that we will implement your suggestion in couple of months after planning on it, so stay tuned 😉
Regards,
Ravish Mody
November 28th, 2010 on 8:33 pm
Hello Ravish,
How SNMP is different from JMX . Like we are using JMX to monitors all the weblogic counters?
Thanks
Sumit
November 29th, 2010 on 9:39 pm
Hi Sumit,
SNMP – Simple Network Management Protocol
JMX – Java Management Extensions
As the name suggests that SNMP is a protocol which is been used by almost all the servers and network devices, however JMX would need Java to use it.
Both of them can be used for monitoring purpose, but using JMX we can even be used to configure resources like domain configuration MBean can be used to create a domain and like wise.
Regards,
Ravish Mody
December 16th, 2010 on 2:56 pm
Ravish
We are running application on WL version 9.2MP3. I have configured the SNMP agent and trap. How will i test it.
What is the equivalent for
“java weblogic.diagnostics.snmp.cmdline.Manager SnmpTrapMonitor -p 165” in solaris
Thanks
Sumit
December 16th, 2010 on 3:44 pm
Hi Sumit,
The above command would work fine in Solaris too.
Regards,
Ravish Mody
December 16th, 2010 on 11:02 pm
Hi Ravish
I have folled the document, it is really informative. But, am not getting any thing on thing on console, am missing any thing.
D:wls103wlserver_10.3serverbin>java weblogic.diagnostics.snmp.cmdline.Manager SnmpTrapMonitor -p 165
Listening on port:165
December 17th, 2010 on 12:01 am
Hi Jeets,
Can you explain what exactly you are not getting. Are you getting an error or which step is not working?
Regards,
Ravish Mody
December 17th, 2010 on 12:04 am
Am not seeing any thing on console, even if I make deployment changes. Am not getting any error.
I could not see the changes in console(deployment changes), as shown in your ppts.
December 17th, 2010 on 12:32 am
Hi Jeets,
That changes would not been shown on the console but would see in the prompt which you have opened check step-6 and step-8. So once you have done with step-6 and then if you change the deployment order after that you will be notified on the prompt as shown in step-8.
Regards,
Ravish Mody
December 17th, 2010 on 12:41 am
Yeah that is what am unable to see on my prompt. By mistake i wrote it as console, its actually the prompt.
Sorry for the confusion.
December 17th, 2010 on 6:33 pm
Hi Jeets,
If you are not able to get the any output on the prompt then it means you have missed out something during the configuration, hence would suggest you to just have a look properly and check if something has missed out.
Regards,
Ravish Mody
December 17th, 2010 on 2:40 pm
Ravish,
I am getting the following error.
Exception in thread “main” java.lang.NoClassDefFoundError: weblogic/diagnostics/snmp/cmdline/Manager
It looks like WL9.2MP3 does not have this utility.
Do i am missing something??
Thanks
Sumit
December 18th, 2010 on 10:14 am
Hi Sumit,
Above Post was intended for WLS10.3 Audience. If you want to use WLS9.2 MP3 SNMP features then you can use the command lines utilites as described in the below link: http://download.oracle.com/docs/cd/E13222_01/wls/docs91/admin_ref/snmpcli.html#1293233
From WebLogic 10 Onwards you can find the Class “weblogic.diagnostics.snmp.cmdline.Manager” inside the following location:
Found: weblogic.diagnostics.snmp.cmdline
Library Name: weblogic.jar
Library Path: WLS10.0wlserver_10.0serverlibweblogic.jar
.
.
Keep Posting 🙂
Thanks
Jay SenSharma
December 22nd, 2010 on 10:39 pm
Hello Ravish
Can I enable and disable SNMP while all the managed servers are running?
Do I need to restart to get the changes reflected?
Please suggest.
Thanks
December 22nd, 2010 on 10:58 pm
Hi Jeets,
Usually it is not required to restart the server when you enable or disable SNMP while the managed servers are running.
However few many alerts and String/Log Monitors which may require that the server must be restarted in order to get the changes reflected.
Also there is no such list is maintained by the Oracle which tells us exactly which SNMP Agent Configuration requires restart.
Hope that answers your question.
Regards,
Ravish Mody
December 23rd, 2010 on 1:46 am
Yes Ravish,
You answerd my question thank you so much
August 25th, 2011 on 10:16 am
Need Help;
Followed below steps to configure SNMP Traps.
1) Create SNMP Agent (Target servers : Admin & Clustered MGD servers)
2) Create Logfilters (Target servers : Admin & Clustered MGD servers)
3) Configure Trap Destination.
When JVM’s are getting restarted; SNMP Logfilter is failing to start for Clustered Managed Servers but no issues for Admin Server & there are no messages in Admin log for Logfilter targetted to it.
Admin Server Output:
MGD Server output:
Aug 25, 2011 12:28:24 AM EDT>
August 25th, 2011 on 10:21 am
Sorry for the confusion; please find below log output.
Admin output:
The SNMP Agent has been started on port 9,161.
The SNMP trap version is 1
MGD Server Output:
Failed to add NotificationListener to logBroadcaster for SNMPLogFilter STUCKThreadLogFilter
Thank you,
Krish..
September 28th, 2011 on 8:06 pm
Hi Jay, I’m newbie to your site and to WL. Hope you can help me. We have upgraded WL 10.3 to 10.3.3(11g) with no issues. We have done a fresh installation of 11g and 10.3 remains on the same machine but the services are stopped. All is working fine except SNMP monitoring on 11g. We have configured 4 SNMP Agents for each managed servers using snmp port 1610, 1612,1614, 1616. We have IBM Netcool monitoring system similar to HP openview which monitors the managed servers. Since upgrading to 11g the Netcool is unable to communicate with SNMP ports (1610, 1612,1614, 1616) and ports are not responding to any queries from Netcool server. To verify if 10.3 works with Netcool, we stopped 11g and started 10.3. Surprisingly, 10.3 started working with Netcool. We are unable to find why 11g is not able to respond to SNMP request when 10.3 on the same machine is working. All the config and port numbers on 11g are same as 10.3. Thanks in advance.
September 29th, 2011 on 3:17 pm
Hi, one of our engineer was able to fix the SNMP monitoring issue. In the 11g Managed Server config the Listen Address was blank. The Listen Address should be the HostName/IP of the machine the managed server is installed. Once we configured the Host Name the Netcool monitoring started working. But still wondering why 10.3 was working with Netcool when the Listen Address was blank.
September 29th, 2011 on 4:51 pm
HI Harish,
By default the listen address is Empty means WLS Server will listen to “localhost” (127.0.0.1) And will not be accessible from remote machines or remote applications. So If you want to access WebLogic from a remote Machine or remote utility like NetCool then the WLS need to be running on a certain HostName or IP Address.
.
.
Keep Posting 🙂
Thanks
Jay SenSharma
October 26th, 2012 on 11:18 pm
Hi,
My environment does only consists of multiple Admin servers and i am trying to monitor them through SNMP. Weblogic version is 10.3.5. I have configured SNMP agents and started them without default port as its not allowing me to configure on default port.
My question is i am not able to get the MIB values through the snmpwalk command.
I have followed the steps written in this thread but when i execute it i see no class found error.
#java snmpwalk localhost .1.3.6.1.4.1.140.625.360.1.60
Exception in thread “main” java.lang.NoClassDefFoundError: snmpwalk
Caused by: java.lang.ClassNotFoundException: snmpwalk
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
Could not find the main class: snmpwalk. Program will exit.
when i tried to use the other command it just says DONE.
$ java weblogic.diagnostics.snmp.cmdline.Manager SnmpWalk .1.3.6.1.4.1.140.625.105
DONE
I need the MIB value to configure in my script to extract the state of the system. Any help on this ?
Thanks.
Venki
May 12th, 2013 on 6:04 pm
Hi,
Your step 9 (Giving Attribute Changes Name) doesn’t seem to work on my WebLogic 12c installation. I’m not seeing “AppDeployment” MBean available for selection. Is there some setting for it to show up in the drop down?
Thanks,
PJ
May 14th, 2013 on 6:09 pm
Thanks Rene for your response.
I should have been more specific – I was referring to the screenshot with the caption “Giving Attribute Changes Name”. In there, I’m setting the Name as “AppDeployAttributeChange” but unfortunately, for me, I don’t see “AppDeployment” as an available selection choice for the MBean Type.
Also, on a different note, do you happen to have an example/tutorial/pointer of how to create an custom mxbean in an application/ear in order to gather performance statistics which can be then viewed on the “Monitoring dashboard”?
Thanks,
PJ
September 25th, 2015 on 4:18 pm
This is an excellent article. Thank you very much. Can you explain a brief summary of how to forward these traps to third-party SNMP monitoring software? I’m trying to set this up in SolarWinds ipMonitor software, and I’m having a very difficult time. I’d also like to use snmpget to pull data from individual OID’s, but I can’t figure out how to make it work. We use Weblogic 10.3.5. Any advice is appreciated!
-Seth