What is this Hawtio anyway?
Whenever a cool open source project is brought to my attention, I usually subscribe to the mailing lists so that I can get a better feel of the projects progress, direction etc. Sooner or later there is always an email with the topic “[Discuss] – Webconsole for our cool project“.
Such emails quite often end up in a long discussion about what’s the best web framework to use, what should be the target platform and how the console could be integrated with upstream/downstream projects.
The number of consoles grows so big, that users have to hire a personal assistance just to keep track of the URLs of each web console. Well, maybe that’s an overstatement but you get the idea. And if we also take into consideration that some projects are bound to a specific runtime, while others are not then we have a perfect webconsole storm.
Hawtio solves this problem, by providing a lightweight HTML5 modular web console with tons of plugins. Hawtio can run everywhere as its not bound to a specific runtime, and its modular, which means that its pretty easy to write and hook your own plugins.
Writing plugins for Hawtio
Hawtio is a full client framework. Whenever it requires communication with the backend it can use rest. To make things easier it also use Jolokia that exposes JMX with JSON over HTTP. This makes it pretty easy to hook frameworks even if they don’t already provide a rest interface, but expose things over JMX.
The Jclouds plugin
Apache Jclouds doesn’t have yet a rest interface, nor it has JMX support. Well actually it has pluggable JMX support as of 1.6.1-incubating release. All you need to do is to create a Apache Jclouds Context using the ManagementLifecycle module:
Note: Users that are using the jclouds-karaf project, will get that for free (no need to do anything at all).
|The main Jclouds plugin Page|
From there the user is able to browse all installed Apache Jclouds providers, apis and services. If for example, you have created a compute service context with the MangementLifecycle module, you’ll be able to see in it under the “Compute Service” tab:
|List of Compute Services – Amazon AWS & A Stub service.|
By selecting one of the available services, a details bar appears, which helps you navigate to all service specific tabs. For a compute service its:
A detailed list of all running nodes, with the ability to reboot, destroy, suspend & resume a node.
A list of images, with an operating system filter.
|A blobstore browser|
|Visual representation of a route that polls EC2 for running instances and sends email notifications|
An other cool plugin that can be used along with the jclouds plugin is the “Logs plugin”, The log plugin let’s you search, browse and filter your logs and even see the source that is associated with the log entries:
|Searching the logs for jclouds related errors|
|The code that generated the log entry|
This is only a first draft of the jclouds plugin and there are more cool things to be added, like executing scripts, downloading blobs and also have a better way of creating new services (the last is already supported but could be really improved).