I am completely clueless about this topic and never done it before.
How to get started with monitoring health of application on server(JBoss/Tomcat) as a programmer's perspective?
I have read about using some third party tools but I am still not clear about this. Do I have to write JMX Beans? So that any third party tool can plug-in to application server and get the stats.
Do I have to profile my application or something like that?
Please provide tutorials/blog links which can help me understand it more.
http://docs.oracle.com/javase/6/docs/technotes/guides/management/agent.html See aslo link of PeterMmm above.
Related
I am implementing OpenTok/Vonage into our android app in order to enable video conferencing. I'm looking for advice on getting started. For example recommendations on the kind of server I should deploy for the implementation. I notice that a limited functionality server can be deployed at Heroki, but what about something full functionality? Any examples of setup of one of those? Where do I deploy it? Can it operate on AWS or Azure? What spec should I use for the server? How do I implement and install the server? Again all things that aren't touched upon in the Vonage documentation. It's almost as if you should someone intuit it like arcana.
OpenTok Developer Advocate here.
There's a lot to unpack in that question(s). May I suggest asking in the Vonage Community Slack?
Quick answer on the Server SDKs: you can run all of the OpenTok Server SDK code with full functionality in any cloud, including Heroku/AWS/Azure/Google/etc.
As for specs of servers, that is something that is specific to your use cases, bandwidth, expected load, etc. There's not a good way to provide details there with the information you provided.
I am using a embedded ActiveMQ in my application, the queue works excellent,
Now we want a way to be able to monitor this ActiveMQ, due to its embedded nature we cannot use the default web console provided by ActiveMQ.
I have had a look here http://activemq.apache.org/how-can-i-monitor-activemq.html , the provided options haven't helped much in my cause due to following reasons
Using JConsole is not a nice option because it uses up much of server resources and causes JVM to be slow.
StatisticsPlugin is a nice approach but doesn't provide a UI view, and gets reset on every server restart (This is what we will use if nothing else is found).
Have also had a look at similar question on SO ActiveMQ: how to programmatically monitor embedded broker , this is not what I want
Recently have heard about a tool called Hawtio , but this also seems to be useful when ActiveMq is running as standalone instance, (Please Correct If I am wrong on this, Any pointers will be definitely helpful)
So the help that I need is
Is Hawtio really useful for embedded instance ?
Are there any other tools availablle to achieve this goal?
Any help really appreciated.
I have used hawtio, its very useful tools for monitoring ActiveMQ. It used JMX internally which takes you java process running and monitor it.
I have been playing around with JMX for the last few days and although I don't mind JConsole or the standard JMX web admin tool, it would be nice to create my own web app that somehow queried the registered JMX MBeans and presented a nice, rich-UI-style "dashboard" with charts and graphs; things that the JMX console or JConsole simply do not have.
Is this possible? I've heard of something called a JMX "agent" but not sure if that has anything to do with how JMX can be queried and managed by a dashboard-style app. Thanks in advance!
Jolokia is an agent based approach to JMX which translates JMX native calls to JSON-over-HTTP. It comes with a Javascript library which is perfectly suited for used within the browser. For a sample usage within a web page look at the demo of the Jolokia-Cubism Integration or even better have a look at the blog post from Tomasz Nurkiewicz which gives a very nice example of using Jolokia along with the Highcharts graphing library.
Said all this, there is even more: Ají, Jolokia's fancy sister, has been started as project which will provide an JMX console bundled along with Jolokia clients. I'm still sorting things outs (well, it moves slowly ...), but I think that over the summer more will be there. One can already play around with it and we still look for volunteers (hint ;-) ....
What you are looking to do has probably already been built unless you really want to do it yourself. Have you looked at VisualVM before? I really like it http://visualvm.java.net/mbeans_tab.html/
To write your own application that manages MBeans remotely I think you could start with this tutorial. Seems to be a good starting point.
http://docs.oracle.com/javase/tutorial/jmx/remote/custom.html
One of the comments here is that VisualVM is a profiler. VisualVM isn't a profiler, it's a platform built on top of the NetBeans platform. The platform supports connecting to a VM in flight a number ways including using a JMXConnector to the MBeanPlatformServer, Serviceability Agent (SA), Attach on demand and so on.
VisualVM does contain 2 different profilers but there is also an MBean plugin that allows you to view and manipulate MBeans that have been registered with the MBeansPlatformServer.
A number of the view in VisualVM scrape data from the MXBeans found in the java.lang.management package that are registered with the MBeansPlatformServer. Many of these MXBeans are wrappers over the SA, a component of HotSpot that maintains a set of performance counters. For example, counters can give you some information about JIT compiler activity, GC activity and even host platform CPU utilization and so on.
You can easily build your own plugins to view or manipulate MBeans. The tutorial mentioned in a posting here is one source of information as to how to get it done. I have written a demonstration VisualVM plugin that looks at data from the MemoryPool MXBeans. That plugin has been augmented by others to do a number of other things. All the code can be found at java.net in the project MemoryPoolView. It covers reading data. However executing functionality is really just executing a method against the JMXConnector with the parameters required by the MBean you are interacting with. IOWs, it's a fairly trivial extension of the plugin.
HawtIO Is about the best plug-and-play, works out of the box solution for getting JMX stuff on a web page. You can put multiple mbeans on the same page and see them all at once, it works in a browser, you don't have to write a bunch of front-end code yourself, and it can be done without opening up weird ports that your IT department will get nervous about. The data visualization options that work with the simple drag and drop interface are pretty minimal, but there is documentation for writing more advanced plugins.
The backend uses Jolokia to put an HTTP REST interface on JMX, which is probably going to be true for any solution you might look at.
we are implementing webservices with Spring & Apache CXF which run on Tomcat 7, the original idea was to write some kind of monitoring solution that checks if the webservices are available and running ok.
But i guess that instead of writing the monitoring software ourselves there should be some tooling that already exists which could help us monitoring the webservices.
Which tooling could help us monitor the webservice availablity? Or what is the best approach to achieve this? Our support staff should be informed if a webservice goes down, and they should be able to act on data that the montoring tools provide.
In the past, I've added an additional API endpoint that simply returns a 200 error code. Hook this URL up to something like pingdom.com and you're good to go.
If you develop your own solution, a good approach would be to develop an external scheduled class that checks weather your services are alive every X minutes. If not, it will send the email you want. This will work even if your tomcat dies.
You can also check the JMX technology:
"The JMX technology provides the tools for building distributed, Web-based, modular and dynamic solutions for managing and monitoring devices, applications, and service-driven networks."
We're using Windows 2008 and we are thinking of switching application servers from Adobe ColdFusion 9 to Railo 3.1. This would mean using a new Java servlet container, so instead of Adobe JRun 4, we're looking at Apache Tomcat.
Adobe have a helpful perfmon plugin for CF9. We can gather most stats with that. The problem is, as far as I understand, there is no perfmon plugin for Tomcat.
I wanted to know if there are any kind of free profiling tools we can use to get metrics and performance data on Tomcat, for example requests/sec, memory usage etc.
I don't mind if they are just written to logs so long as we can read them in some format. Also, it doesn't have to be a stand-alone product.
Any and all help appreciated!
Just curious - which application server are you using now? Which one uses perfmon now?
Because you've got to run Tomcat on an operating system - Windows, Linux, etc. You seem to imply that perfmon is useless to you now. I don't believe that's the case.
If you need to embellish info from perfmon, you can certainly buy something. But the cheapest solution for you would be filters that would intercept every incoming request and outgoing response to calculate request counts, response time, etc. You'd write these classes once and declare them in your web.xml. They could write to logs using log4j.
Or maybe Hyperic's solution is what you have in mind. It used to be open source, but Spring bought them a few years back. Then VMWare bought Spring. It's all part of a grander solution.
LambdaProbe will give you monitoring for sessions, memory used, web app sessions and servlets, connections etc.
Take a look at the demo site http://demo.lambdaprobe.org/ for more.
Site login: demo/demo