Thursday, June 10, 2010

Back from Linuxtag





So I am back from a quick trip to Linuxtag 2010 in Berlin where I was presenting "Systemmanagement with RHQ - also for Linux". My talk featured an overview of RHQ by slides and live demo and a demonstration of the Nagios plugin, Alexander Kiefer has written.

The meeting room wasn't exactly crowded with around 20 people, but I saw them writing down stuff and they were asking questions, so I consider this good anyway.

At Linuxtag I also met Dalibor Topic from OpenJDK, my colleague David Lutterkort (who was presenting about deltacloud) and Hardy Ferentschik who was presenting about Hibernate Search. Unfortunately I was not able to attend any of those, as either I was still on my way to the conference or already back.

While I spent a good part of the day in trains (5h30 in the morning + commuter train within Berlin and 5h in the evening + commuter train), I was also able to walk around Linuxtag and have a glance at the exhibition. Many (larger) Open Source Projects were present (Fedora was missing to my surprise) and Debian even hold their own mini conference.
Also some system integrators and other companies like Google, O'Reilly or Addison-Weseley had a booth.


In the train I started hacking a plugin to monitor Hadoop clusters. It will find the various instances and already connects via JMX to them. The NameNode even has some statistics exposed. I'll put that into RHQ git within the next days.


You can find slides of my talk online - those are rather sparse as I was doing a long demo session showing RHQ, the Nagios integration and how easy it is to put an agent on a new platform and get this platform into inventory (literally took 2mins incl. downloading)

Sorry that there are no photos or even a video - I just did not feel like carrying the appropriate equipment around.

Friday, June 04, 2010

RHQ at Linuxtag






I will present "Systemmanagement mit RHQ - auch für Linux" at Linuxtag
Berlin next wednesday, June 9 at 3pm in room Europa 1.

I will talk about the architecture of RHQ and how it can be used
for Linux monitoring and will especially mention the Nagios integration by Alex Kiefer.

Wednesday schedule for Linuxtag is here (Don't worry, if you still see the CDI talk in this slot. I am sure my talk will soon show up at 3pm in room "Europa 1")

Monday, May 31, 2010

RHQ / Jopr tab sweep

RHQ release 3.0.0.B06 is out and contains support for provisioning of new software.

Alex Kiefer has worked hard and now we have Nagios support in RHQ.

Episode 6 of the Jopr podcast has been released and is talking about the new pluggable alert senders in RHQ.

And finally we've got portuguese translations of the installer messages by Rafael Soares Tuelho.

As always, give us feedback.

Thursday, May 27, 2010

Nagios Plugin for RHQ and Jopr available



As previously written, Nagios support is coming to RHQ.

Well, Alex has done more work and actually it is here now in its first version and is out-of the box able to monitor the standard services that are in a Nagios install:

Screenshot of resource tree and metric

(Screenshot with standard services and metrics)


This picture shows again the setup:
#alttext#


To take the nagios server into inventory, you need to go to a platform and use the Manually Add functionality, where you have to give the connection properties "host, where nagios is on" and "port" (6557 in the image)

But before you can start you have to:

  • install mk_livestatus within Nagios and xinetd.
    Alex has documented this in the Wiki; the mk_livestatus installation is very well described on the livestatus web page.
  • For all services in addition to the standard ones supplied in the plugin descriptor you need to update the plugin-descriptor of the plugin. This is described below.





As we know the second step is somewhat cumbersome, we will in the future work to make the detection of the resource types dynamic, so that you basically need to point the plugin at a Nagios install and the plugin will then "learn" all the types of service (e.g. SSH, Swap , ..).

PLEASE give feedback on the plugin on the rhq-devel mailing list.
Be it because you know more cool metrics to look at or because you want to help with the parser issue mentioned below. Also the source has a TODO file, that lists more ideas for contributions :-)

Source



You can get the source from the RHQ git repository in the nagios branch.
This first version has been tagged as RHQ_NAGIOS_PLUGIN_V1



Adding additional services



The following is an excerpt from the plugin descriptor:

   <service name="Root Partition"  
class="NagiosMonitorComponent"
discovery="NagiosMonitorDiscovery"
description="root partition service">
<metric property="free_space|plugin_output|.*/ ([\d]+).*"
displayName="Free space" measurementType="dynamic"
units="megabytes" displayType="summary"/>
</service>


The first thing you need to provide is the name of the RHQ-resourceType, which is used in <service name="Root Partition"... To obtain those, you can do the following query against mk_livestatus:

$ cat service-query
GET services
Columns: display_name
$ nc localhost 6557 < service-query
Root Partition
SSH
...
$

So in this example services were 'Root Partition' and 'SSH'

The next thing is to provide the metrics. The property="free_space|plugin_output|.*/ ([\d]+).*" attribute is used here. It actually consists of three parts separated by a bar (|) symbol:

  1. Text identifier - currently unused
  2. The column of the livestatus service query output (see below)
  3. A regular expression where the first capturing group is used as return value


Let's have a look at an extended service query (actually in version 1.0 of the plugin, only he plugin_output column is supported, as the parser in the plugin needs some more work (see below):
$ cat service-query
GET services
Columns: display_name plugin_output
$ nc localhost 6557 < service-query
Root Partition;DISK OK - free space: / 3611 MB (48% inode=71%)
...
$


So Root Partition delivered "DISK OK - free space: / 3611 MB (48% inode=71%)" which is then matched by .*/ ([\d]+).* to extract the value of 3611.

The parser issue



mk_livestatus delivers as default data separated by semicolon (;), but some columns like 'perf_data' (not shown above) can also return data that consist of multiple items separated by semicolon, so that the parser counts wrong and delivers bad answers.

Luckily mk_livestatus can do some
output formatting that can help to work around this. Please ping us if you want to help here.


RHQ community build 3.0.0.B06 released



The RHQ team is pleased to announce the immediate availability of community release 3.0.0.B06 of the RHQ systems management and monitoring platform. As before this release includes the Jopr bits.

This release features a lot of bug fixes as you can see on the
Release Notes.

New features include optimized search in Inventory and especially provisioning of software (like JBossAS servers). See below.

You can download the release from SourceForge

Provisioning...

To enable this you need to go to Administration -> System Configuration -> Settings and enable debug mode

#alttext#


This will then show a new menu "Debug" with a "GWT GUI" entry:

#alttext#


Click on "GWT GUI" and you'll get to a GUI written in GWT with a new "Bundle" menu item.

To learn more about this, have a look at the Wiki and especially
this flash demo video by Mazz

Translations for RHQ (we want you!)

Thanks to Rafael Soares, we now have Brazilian-Portuguese installer messages forRHQ

#alttext#

Click for a larger version


Those translated messages currently live in the 'translations' branch in git (which will shadow the master branch).

While we use I18Nlog for I18N output, there is no need to modify the java file, but one can just supply the "classical" .properties files for it.

We want you!

So if you want to help translate messages to your language, contact us and/or just start right away :) Make sure to also to check out the contributions page on our wiki.

Thursday, May 06, 2010

No wonder Mighty Mouse refused to work

I am for a long time user of a Mighty Mouse (actually 2 of them. And as every user of a Mighty Mouse, I have the issues of the mouse ball being stuck and needing some cleanup.

In the past I've turned the mouse around and rolled it over some issue, which helped more or less. But just now I had the urge to finally open it and really clean it. There are many "how-to"s on the web for this.

When the mouse was open, it became very obvious why it did not really work well anymore:

IMG_8664.JPG
(click for a larger version)


opening the white cage an removing the ball (which itself was totally clean) revealed more dirt:

IMG_8666.JPG
(click for a larger version)


Cleaning the little rolls was no issue, but putting them back was somewhat harder, as the thicker black rolls are magnetic and would directly attach to a screwdriver.

After assembling everything, the mouse responds well again, so problem solved for the years to come :)

Tuesday, May 04, 2010

RHQ community build 3.0.0.B05 released



The RHQ development team is happy to announce the availability of the 3.0.0.B05 community build of RHQ. As in previous community releases, this also contains the Jopr bits.

As usual, changes have been recorded on the change log page.

Most notable changes were:

  • Support for obfuscated db passwords

  • A fix for postgres 8.4+ servers to display statistics again
  • Completion of the alert sender plugins. This includes the possibility to finally execute resource operations on any resource as result of an alert
  • Suport for Oracle 11g database



Please use and test this release and report issues or feature requests in Bugzilla. If you want to contribute to the project, please have a look at the Contributions page on the wiki.

You can download the release from SourceForge.

If you want to develop plugins against this version, you can find the respective artifacts in the new JBoss Maven repository at https://repository.jboss.org/nexus/content/repositories/releases/org/rhq/.

Monday, May 03, 2010

Neues Maskottchen für die -T---kom ?

Heute auf dem Heimweg beim Alten Landtag gesehen:

DSC00106.JPG

(click auf's Bild für eine größere Version)


Die Farbe scheint nicht so ganz das Original-Magenta zu sein, aber das gibt dem Konzern ja auch ein ganz neues Image :-)

Friday, April 30, 2010

RHQ/Jopr plugin development and versions

Recently a user showed up on IRC and said he had written a plugin and that deploying it is throwing this error:

2010-04-30 14:26:10,601 WARN [org.rhq.enterprise.server.core.plugin.AgentPluginDeploymentScanner] Failed to scan plugin [...../myPlugin-1.0.jar] found on filesystem. Skipping it.

Cause: java.lang.Exception: No version is defined for plugin jar [..../myPlugin-1.0.jar]. A version must be defined either via the MANIFEST.MF [Implementation-Version] attribute or via the plugin descriptor 'version' attribute.


While the error message is accurate, it is still not obvious, what is going on, as most of the plugins in the RHQ source tree do not explicitly set a version number.

As the message says you need to:

  • either explicitly set a version in the plugin descriptor like

    <plugin name="myPlugin" version="1.2.3" ... >

  • or tell maven to add a Specification-Version: in MANIFEST.MF, which automatically happens when you have the rhq-parent pom as (indirect) parent of your pom, which then contains this:
    <plugin>

    <artifactId>maven-jar-plugin</artifactId>

    <configuration>

    <archive>

    <manifest>

    <addDefaultSpecificationEntries>true</addDefaultSpecificationEntries>



In most cases, following the RHQ-version is easiest, as you don't have to do anything. If you want to do release-cycles outside of RHQ, the explicit version is for sure better.

Monday, April 26, 2010

Nagios support coming to RHQ...

Alexander Kiefer started working on supporting the Nagios monitoring system from within RHQ. The idea here is not to plugin the Nagios plugins directly into RHQ, but to talk from RHQ (better, a RHQ plugin) to the Nagios instance via mk_livestatus for Nagios. And overview of the setup is shown in the next figure.

NagiosSetup.png


The first cut of the implementation is mainly about talking to Nagios via mk_livestatus. Next steps will be

  • Implement the plugin in a way that the user only needs to modify the plugin descriptor to monitor additional Nagios resources
  • Implement dynamic metadata so that the plugin can automatically detect resource types present in Nagios and detect resources of the given types.


Alex has started documenting the Plugin in the RHQ Wiki

Code for this is in the nagios branch in git.

PLEASE try it and give feedback on the rhq-devel mailing list

Monday, April 19, 2010

Muskelkater (German)

Vorgestern bin ich das erste Mal dieses Jahr wieder die 21km gelaufen und merke deutlich, dass ich noch nicht so richtig in der Form für die Strecke bin. Ab Kilometer 14 fiel es mir zunehmend schwerer und die letzten Kilometer waren eine reine Willensleistung, nicht aufzugeben. Aber immerhin war ich mit < 1:58h etwas schneller als beim Stuttgart-Lauf letztes Jahr. Es bestehen also berechtigte Hoffnungen, dass es mit diesem einen Jahresziel hinhaut.

Auf jeden Fall habe ich heute noch einen granatenmäßigen Muskelkater - speziell in den Waden.

Aber noch sind 2 Monate Zeit, um für den diesjährigen Stuttgart-Lauf zu trainieren.

Der vorherige Lauf in Kiew war weniger beschwerlich :-) (aber auch deutlich kürzer).

Wednesday, March 03, 2010

Multiple usage of the maven exec plugin

So I was trying to use the maven exec plugin in my alert-operations sender pom in RHQ to automatically run a java class and generate some documentation.

I've added the maven exec plugin to the pom like this:


<build>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.1</version>
<executions>
<execution>
<!-- Generate tokens.xml file -->
<phase>install</phase>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<executable>java</executable>
...


As soon as I added this and tried to build after a mvn clean, the build failed without an obvious message why. Commenting out this plugin made the build succeed. Digging around showed that we have an other call to this plugin in the root pom. So there was some clash - but which?

I thought "perhaps I need to include the execution from the root pom in mine as well (via copy&paste). I did that and got an error message, that it is not possible to have two executions without an <id> in a pom. So it turned out that both executions had the same implicit id - even while being in different poms, so one was overwriting the other.

Now I have


<execution>
<id>generate-tokens-xml</id>
<!-- Generate tokens.xml file -->
<phase>install</phase>
<goals>


and everything is fine again.

Saturday, February 27, 2010

Glassfish v3 - what's the deal to have Weld and REST?

<UPDATE>

It turns out I did the right thing, but obviously needed a few more mvn clean install cycles (or in other words I have no obvious clue why this consistently failed at the start

</UPDATE>

---------------

So I've been trying to write an app that uses CDI (Weld) and JAX-RS.
As I want separate layers, I coded everything up to have a web.war, an ejb.jar and packaged everything together in an ear-file.

I've coded a bean like this:

@Stateless
@Path("/xx")
@Produces({MediaType.TEXT_PLAIN})
@Named
public class StatusManager {

public String foo() {
...
}
}


Now I can use it in a JSF like

 <h:commandButton value="Submit!" action="#{statusManager.foo}"/>

Works like a charm.

When I try to accces the REST endpoint I get a "resource not found". Ok,
so I add some stuff to web.xml:

    <servlet>
<servlet-name>ServletAdaptor</servlet-name>
<servlet-class>com.sun.jersey.spi.container.servlet.ServletContainer</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>ServletAdaptor</servlet-name>
<url-pattern>/xxx/*</url-pattern>
</servlet-mapping>


Now accessing the JAX-RS endpoint works like a charm, but the above JSF action breaks and the container shows the following in the logs:

com.sun.jersey.api.container.ContainerException: The ResourceConfig instance does not contain any root resource classes.


Does anyone know what is going on and how to use both at a time?

Monday, February 22, 2010

RHQ / Jopr tab sweep

Lot has happened since the last tab sweep ...

Releases

RHQ 3.0.0.B03 has been released. You can find more information on the release notes page and the bits at the download page.

Videos

There are several new videos available:





Talks

I've been talking about RHQ at FOSDEM X - the talk was well received and its recording is finally online (see above).


Misc

Spacewalk 0.8 has been released.

Joe Marques gives a tip about automation in web development




Quote html for MarsEdit



I am using MarsEdit to post my blog entries, which is a nice editor (ok, it could sometimes have a more wysiwig mode, but in total I am happy with it).

One thing that I find often annoying or missing when writing posts is that there is no build in quotation mechanism for '<' in a <pre> block (many of my posts are rather technical and contain XML snippets).

Luckily MarsEdit has AppleScript support, so I wrote this little AppleScript script (actually I copied a good part from the supplied Add Paragraph Tags one):


tell application "MarsEdit"
try
set currentWindow to document 1
on error errorMessage
displayErrorMessage("Can’t add paragraph tags because no post windows are open. This script works on text in the frontmost post window.") of me
return
end try

set currentTextView to selected text in currentWindow
set numChars to number of (characters in currentTextView)
set newBodyText to ""

repeat with i from 1 to numChars

set currentChar to character i in currentTextView

if (currentChar is "<") then
set newBodyText to newBodyText & "&lt;"
else
set newBodyText to newBodyText & currentChar
end if
end repeat

set (selected text in document 1) to newBodyText
end tell


This allows to quote the current selection. Save the script to
~/Library/Application Support/MarsEdit/Scripts/Quote Html.scpt.
It will then be availably in the ApppleScript Menu:

Bildschirmfoto 2010-02-22 um 09.35.54.png


To use it, just select the text and then invoke this Quote Html menu item

Monday, February 08, 2010

Small FOSDEM 2010 round up (with pics and video)

So I've spent last weekend in Brussels, Belgium at FOSDEM, gave a talk, met with some colleagues and had a great time.



Ok, this was a bit tense :)

FOSDEM 2010 was the 10th incarnation of the Free and Open Source Developer's European Meeting. There have been thousands of geeks at the ULB (UNiveristé libre de Brussels) - exact numbers are not known as there has been no official registration. THere have been tweets about being around 2000 devices with IPv4 and close to 2000 devices with IPv& active - this already shows the size of the audience.
Despite this huge number of devices online, the network was great (FOSDEM had a 1GBit link to the internet) - wireless was available in nearly every room at good strength and performance On sunday morning they even encouraged people to use more bandwidth - many much more commercial conferences should talk to the FOSDEM NOC in order to learn how to do this.

I arrived in Brussels on Saturday morning having taken an early train from Stuttgart - after Cologne I met the first two other guys heading to FOSDEM too :)

Later on saturday I gave myself a talk about Systemsmanagement with RHQ. Slides are available here.

After my talk, my colleague Mark Procter gave a presentation about Drools. When my talk was over I felt very much relieved and was more able to attend other talks. I wanted to attend some Postgres related ones, but they were already crowded.

One of the/my highlights was the talk by Andy S. Tanenbaum about Minix 3 - he presented with a good sense of humor, so it was nice to listen. His talk actually made me want to do some low-level stuff hacking again (I used to work on NetBSD in the past). Later on I was sitting in the Free Java track and was thinking that I should perhaps also start hacking on the VM. Lukily for me I did not attend all talks. Otherwise I'd probably end up with programming Drupal in Assembler for one of those little embedded boards I that the OpenEmbedded guys had on display :-)

On Sunday Dave Fetter from Postgres showed on Sunday how to compute Mandelbrot sets and solve the Traveling Salesman Problem in SQL on Postgres - totally crazy! :)

After this I have been in the Free Java dev room and met some colleagues from Red Hat, working in that area - it is always nice to finally be able to put a face behind a name.

Below are a few impressions from Fosdem and Brussels - enjoy (I will fix the image orientation as soon as I know how ... ). More pictures are e.g. on Flickr, here and here.


Below movie is also available as .ogg version (79 MB).












































Thursday, February 04, 2010

RHQ / Jopr tab sweep



Releases

RHQ 3.0.0.b02 has been released

Web articles

We have set up a page that lists third party plugins and also usages of Jopr and RHQ - if you want to be listed here, contact us


Marek Goldmann has written a blog post, where he shows how CirrAS uses RHQ for management of servers in the cloud. This post especially talks about using the RHQ CLI to import and configure resources.

Mazz also refers to this in his latest blog entry. In another post he describes how to install the JD java decompiler, which also understands generics unlike the outdated (but often used) jad.

My (German) article "Polyglotte Bohnen" on JSR 223 usage at the example of JRuby got published at Heise Developer. JSR 223 is in usage in a few places within RHQ: CLI, script2 alert plugin and scriptlang alert sender plugin (and probably others).

Talks

I'm going to FOSDEM, the Free and Open Source Software Developers' European Meeting

I will talk about RHQ at FOSDEM. There will be other people from Red Hat, as well as many other interesting talks.

Wednesday, February 03, 2010

RESTEasy client : authentication

Was just playing with RESTEasy and needed to do authentication against the server.
Came up with this solution:


String userId = "myName";
String password = "verySecret";
 
Credentials credentials = new UsernamePasswordCredentials(userId, password);
HttpClient httpClient = new HttpClient();
httpClient.getState().setCredentials(AuthScope.ANY, credentials);
httpClient.getParams().setAuthenticationPreemptive(true);
 
ClientExecutor clientExecutor = new ApacheHttpClientExecutor(httpClient);
 
try {
URI uri = new URI("http://.....");
ClientRequestFactory fac = new ClientRequestFactory(clientExecutor,uri);
 
ClientRequest request = fac.createRequest("http://.....);

I don't know if there is a better way, as there are a lot of steps to do here. Just thought I should share as documentation is a little sparse here.

Tuesday, February 02, 2010

RHQ 3.0.0.b02 released - includes Jopr

We are proud to announce the release of RHQ 3.0.0.b02. Like the 1.4.0.B01 release, this is a developer preview and not intended for production. As with the previous release, this includes the Jopr bits, which now also live in the combined RHQ source repository.

You may wonder about the jump in the major release number. Well, first of all, the next release will be a big jump forward for the project, so a new major number is appropriate. And then, there is a very practical reason too: as I've already written earlier, the download not only contains the RHQ bits, but also the Jopr bits, which creates some confusion in the install / upgrade process, as the Jopr bits, which in the last Jopr-release were named xy-plugin-2.3.1, in 1.4.0.B01 they were suddenly xy-plugin-1.4.0.b01. The RHQ installer assumes that plugin versions are increasing and thus is considering the Jopr plugins in 1.4.0.B01 as older.
We could have hacked around this, but just increasing the major number solves this issue in a very natural way.

New Features:

  • Some French installer messages contributed by Victor Montaner

  • Alerting

    • Much improved UI for the new alert sender plugins

    • Alert definition UI partly moved from JSF to struts

    • Improved alert senders for microblog and snmp

    • It is now possible to define templates of alert notifications that contain a bundle of senders that can be reused to create notifications for alert definitions. See menu "Administration -> Settings -> Alert Notification Templates"

    • Alert migration: the datamodel for alerts has changed an needs migration. See the README for a how to

    • NOTE: alert senders for Subject, Roles and Operation are not in this release - they will come back soon


  • Raw configuration support: It is now possible to edit the raw text of configuration files and not only the structural view of them. This includes validation and rollback

  • Operations for server side plugins: it is now possible to define operations on server side plugins, that can be triggered through the alert plugin gui (Administration -> System Configuration -> Plugins -> Server Plugins)

  • Cosmetical changes in the left nav tree


Have a look at the full release notes for more details.

Download:

You can download this release from SourceForge at

https://sourceforge.net/projects/rhq/files/rhq/rhq-3.0.0.B02/. There is an agent download as well, but you don't need to download this, as the agent is contained in the server download already.

The source for the community release can be found in the 3.0.0.b02 branch in RHQ git.