Wednesday, September 30, 2009

RHQ plugins - platform services

There was recently a question on the Jopr devel mailinglist, that Ian Springer answered - I've taken his answers to write this post, as this is of general interest to plugin writers.

Bruno asks:
I have written a plugin which defines a single service like so:
<plugin ...>
<service
name="Interdomain Service"
...
supportsManualAdd="true">
</service>
</plugin>

But during auto-discovery, the resource discovery component does not get called. It only gets called, if I define the Interdomain Service to be a server. What am I missing here?

Lets first have a look at the resource hierarchy within RHQ:
PSS-hierarchy.png


So for <server>s that are standalone within a <plugin> tag, it is obvious that the parent is the <platform>, while <service> can have both other ResourceCategory as parent.

This means that you have to define the service's parent type(s), so RHQ knows where to stick it in the type hierarchy once it's discovered. There are a few ways to do this, depending on your needs.

If it's a platform service (i.e. a service whose parent is the platform
itself), you'd do something like:

<service name="Interdomain Service" ...>
<runs-inside>
<parent-resource-type name="Windows" plugin="Platforms"/>
<parent-resource-type name="Linux" plugin="Platforms"/>
<parent-resource-type name="Solaris" plugin="Platforms"/>
<parent-resource-type name="HP-UX" plugin="Platforms"/>
<parent-resource-type name="AIX" plugin="Platforms"/>
<parent-resource-type name="FreeBSD" plugin="Platforms"/>
<parent-resource-type name="Mac OS X" plugin="Platforms"/>
<parent-resource-type name="Java" plugin="Platforms"/> <!-- any OS that RHQ doesn't have native (i.e. SIGAR) support for -->
</runs-inside>
...
</service>


(If your service will only run on certain OS'es, you could remove the
unsupported platform types from the list of parent types).

Or you could do something similar to say it can be the child of multiple
server or service types, e.g.:

<service name="Interdomain Service" ...>       
<runs-inside>
<parent-resource-type name="JMX Server" plugin="JMX"/>
<parent-resource-type name="JBossAS Server" plugin="JBossAS"/>
<parent-resource-type name="JBossAS Server" plugin="JBossAS5"/>
</runs-inside>
...
</service>


Finally, if you want it to be a child of a single server or service type
defined in the same plugin, just nest it inside the parent server or
service element, e.g.:

<server name="CoolServer">
<service name="Interdomain Service" ...>
...
</service>
...
</server>



The reason it works if you change it to a server, rather
than a service, is because, when parsing the plugin descriptor, if RHQ
encounters a server element at the top level with no runs-inside types
defined, it assumes the server is a platform server (a server who has
all the platform types as its parents). So:

<server name="Interdomain Service" ...>
...
</server>


is essentially equivalent to:

<server name="Interdomain Service" ...>
<runs-inside>
<parent-resource-type name="Windows" plugin="Platforms"/>
<parent-resource-type name="Linux" plugin="Platforms"/>
...
<parent-resource-type name="Mac OS X" plugin="Platforms"/>
<parent-resource-type name="Java" plugin="Platforms"/> <!-- any OS that RHQ doesn't have native (i.e. SIGAR) support for -->
</runs-inside>
...
</server>


Most of the time when writing a plugin you will probably start with a server at the top level of your plugin, so it will just work.

1000 km :-)

Last weekend I crossed the 1000km mark since I started running last year (see here). I took me quite some time since the 800km mark at Stuttgart-Lauf. This had to a big extend to do with the fact that I was not really able to go out much while kids were on vacation from Kindergarden and also needed some rest after Üetliberg. But since start of september I am back on track :-)

So what are my next goals? I don't really know yet. Running Stuttgart-Lauf faster than this year probably. And just improving my overall fitness to be able to run at same pace with a lot lower heart rate.

Thursday, September 24, 2009

RHQ / Jopr agent waiting at startup

I have written in the past about RHQ and Jopr "agent waiting at startup. That actually was before high availability has been released, so it is a little outdated.

With high availability (HA) you will see one new type of issues: ip address forward and backward mappings do not match.

Basically you need to make sure that the IP address of your computer can be reverse mapped to the computer name and that this name mapps back to the same ip address.
And this needs to be true along all your hosts.

Suppose you have an IP address of 172.31.7.7, then the results of name resolution should look like the following:


$ dig -x 172.31.7.7
[...]
;; ANSWER SECTION:
7.7.31.172.in-addr.arpa. 86400 IN PTR snert
$
$ dig snert
[...]
;; ANSWER SECTION:
snert 74030 IN A 172.31.7.7


If you had agent-server communication working before and it stopped all of a sudden, go to the Jopr server UI, to the Administration -> High Availability -> Server section and check if the name shown there matches what you expect - same for the agents.


If this all works, and the agent is still hanging, have a look at the older post to rule out other possibilities for misconfiguration.

New api for manual discovery on RHQ and Jopr

The other day I was writing about manual discovery/addition of resources. Now that Jopr 2.3 (and its JBoss ON counterpart is out), we have updated the API for manual discovery to provide its own interface so that you don't need to fiddle around with finding the passed configuration.

The new API lives in the ManualAddFacet, which has one method
DiscoveredResourceDetails discoverResource(Configuration pluginConfiguration, ResourceDiscoveryContext<T> context)
throws InvalidPluginConfigurationException;
that you need to implement. This Facet is implemented in addition to the ResourceDiscoveryComponent within the discovery component. Ips has already converted all existing plugins to the new api, so you can have a look at many examples there, so I'll only show a short one here, which is an excerpt from the Twitter plugin:


public class TwitterDiscovery
implements ResourceDiscoveryComponent,ManualAddFacet {
 
// Auto-discovery not supported, so return an empty set
public Set discoverResources
(ResourceDiscoveryContext discoveryContext)
throws Exception {
 
// We don't support auto-discovery.
return Collections.emptySet();
}
 
// perform the manual add
public DiscoveredResourceDetails discoverResource(
Configuration pluginConfig,
ResourceDiscoveryContext discoveryContext)
throws InvalidPluginConfigurationException {
 
DiscoveredResourceDetails detail =
new DiscoveredResourceDetails(
discoveryContext.getResourceType(), //ResourceType
url + "_"+ user, // ResourceKey
url + " feed for " +user, // ResourceName
null, // Version
"One " + url + " user", // Description
pluginConfig, // Passed plugin config
null ); // Process scans
return detail;
}
}

I have also updated the plugin skeleton generator code in svn to support this new API and have uploaded the new version to jopr.org

Saturday, September 19, 2009

Jopr 2.3.1 released



The Jopr team has released version 2.3.1 of Jopr.

The major difference over Jopr 2.3 is a fix in the dbupgrade scripts.

If you are still on 2.2 and want to upgrade, use 2.3.1, as 2.3 will not correctly update your database schema.

You can download the release from SourceForge.

Friday, September 18, 2009

Jopr talking


I have added an experimental alert sender to Jopr that can call administrators on their phone, tell them the alert conditions and can then take input via DTMF tones. This input can be used to disable or re-enable the alert definition or to clean out this alert from the alert history.

This all has been made possible by via the Mobicents server and SIP servlet.

Mobicents logo

A special thanks goes to Jean Deruelle from Mobicents, who wrote the integration part on the Mobicents side.

Podcast episode

I have created an episode of the Jopr podcast that shows the setup and some UI demo (the call on the SIP phone has been faked a little bit, as my screen capture program is always crashing at this point, but the message read is real).

As usual, this podcast episode is available on iTunes.

Show me the code...

The code on the Jopr side lives in http://svn.rhq-project.org/repos/rhq/branches/HEIKO-EXP/. There is also code on the Mobicents side, but we still need to clean up things and write some documentation on how to integrate them.

Ping me if you are interested in this integration.

Monday, September 14, 2009

Snow Leopard - mixed feelings?

So far Snow Leopard is somewhat disappointing for me:

  • DNS - especially when VPN is on sucks, as SL is sometimes blacklisting very valid hosts all of a sudden. This results in e.g. "The computer is not connected to the internet" messages in Safari for sites like www.google.com (see e.g. here)

  • The upgrade broke Aperture - the upgrade process removed a framework needed by Aperture. For me re-installing /Library/Frameworks/Pluginmanager.framework from a TimeMachine backup worked. (see e.g. here)

  • Older Software like Parallels 2.5 no longer works

  • Nambu 1.2 no longer works (and Nambu 2 is still in closed beta)

  • X-Lite 3 has no sound in/out. Dialing works though. And the beta of X-Lite 4 is not even able to show the preferences.



The biggest item for me is currently the DNS one, as this renders the system more or less unusable.


But then there is at least some good thing about it:


  • The internal VPN now works against Cisco concentrators, which is very nice

  • JDK 1.6 is finally available on 32 bit macs like my 3 years old MacBook



I will update this post, when I see more pros and cons.

Friday, September 11, 2009

Jopr podcast iTunes URL has changed

The Jopr podcast is now available on iTunes at the following new place
http://itunes.apple.com/WebObjects/MZStore.woa/wa/viewPodcast?id=331189266.

Please update your feeds or iTunes subscriptions accordingly. Thanks.

Thursday, September 10, 2009

New episode of the Jopr podcast: Manik from Infinispan (updated)

At JBossWorld Chicago I had the pleasure to do a short interview with Manik Surtani, lead of the Infinispan project.

The interview is now available in the Jopr Podcast home page and is also available on iTunes (note, the iTunes url has changed).

Enjoy!

Again: if you like it, please rate it up on iTunes and/or provide Feedback via email to me.

Tuesday, September 08, 2009

What a weekend

I am currentl staying in New Jersey, as the opportunity to give a talk at JBossWorld in Chicago also gave me the opportunity to go to NJ to meet the biger part of theJopr developers.

I arrived friday evening and as the car rental company ran out of cars, I got the last one remaining: a Chrysler Sebring convertible. On Saturday I went running and also drove around a lot with the roof open and music turned on - very nice :-)

Sunday I spent with Jess and family. Jess and I went climbing - my first time, but this was fun. One one side I can't imagine to do it more often, but on the other side I can :)

Today was Labour Day, so no one in America is working (only joking) and I went to New York. Walked around a lot and visited important landmarks like the Brookly bridge and the Apple store on 5th avenue.

Saturday, September 05, 2009

Jopr 2.3 released



Jopr version 2.3 has been released. You can find the binaries http://sourceforge.net/projects/rhq/ on SourceForge.

IMPORTANT UPDATE: 2.3.1 is out with a fix for dbupgrade

Notable changes are:
  • Support for JBoss EAP 5

  • A new command line interface: you can now talk to Jopr from a Linux or Windows command line. This interface uses the Java 6 script support, so that you can create scripts for re-use.

  • Group alerts: it is now possible to fire an alert when any resource in a group runs into an error condition by defining alert templates on the group

  • Experimental support for embedded H2 database and MS SQL Server (same as in 2.2.1)

  • Plugins can now depend one of several others: if you have e.g. a plugin that uses JMX it is now possible to either depend on JBossAS when the resource types are used within the JBossAS or depend directly (and only) on JMX plugin to discover standalone JVM versions of those resources.

  • Support for taking snapshots of resource configurations: it is now possible to gather e.g. all config files from one of your JBossAS servers and have that zipped up and put in a place on the Jopr server

  • Dynagroups have been extended to support searching more levels of ancestry

  • Postgres 8.4 is now officially supported

  • Autodiscovery of JBossAS jnp credentials: Jopr is now looking at the config files to obtain the security credentials for secured JBossAS instances, so that you do not need to type them in by hand in the inventory



And many many more improvements. You can see lists of closed Jiras for
RHQ and Jopr projects.

Matching SVN tags are http://svn.rhq-project.org/repos/rhq/tags/RHQ_1_3_0/ and Jopr_2_3_0.

As so often :) join us on irc.freenode.net #jopr or in the forums or or or :)