Wednesday, December 4, 2013

Announcing RHQ Agent Plugin Plugin

I'm happy to announce the release of RHQ Agent Plugin Plugin!

Plugin Plugin? Yes. Plugin Plugin: a Maven plugin to help you build RHQ Agent plugins.

It provides a handful of very convenient mojos for:
  • Packaging
  • Validation
  • Deployment to a local RHQ Server (dev-container)
  • Uploading to to a remote RHQ Server
  • RHQ CLI script or command execution
  • Standalone Plugin Container setup for integration tests

Dependent agent plugins are supported (many plugins depend on the parent JMX plugin, for example).

The RHQ Agent Plugin Plugin documentation is hosted on Github Pages and the bits are available on JBoss Releases and Maven Central repositories.

Need help to get started?

Thursday, October 10, 2013

Uploading large content for package backed resources or bundles with the RHQ CLI

Until recently, the only way to create a package backed resource, update its backing content or create a bundle version with the RHQ CLI was to fully load the file in memory as a byte array.

Consequently, as soon as you tried to send something of relatively large size, the CLI crashed with OutOfMemoryError. In practice, with the default CLI max heap size (128MB), that would be about 60 MB.

There is now a way to avoid that and send content or bundles of any size. The ContentManager has been extended to allow fragmented content uploads:

As you can imagine, you'll have to request first the creation of new temporary content handle. Then you'll be able to upload fragments sequentially. For ease of use, a utility method has been added to the ScriptUtil object (bound to 'scriptUtil' ):

So here's how you'll create a package backed resource:

The bundles.js sample script has also been updated in order to upload the bundle file in fragments when creating a bundle version:

These changes have been pushed to the master branch and will be released with RHQ 4.10.

That's it!

Tuesday, March 5, 2013

RHQ Net Services plugin enhancements

The RHQ Net Services plugin has just been updated with new features. It now defines three types of services:
  • HTTP service
  • Ping service
  • Port service
You can add any number of these services to a managed platform with the "Import" button:

RHQ netservices import
Import a Net Service on a managed platform
Note that the network connections will be made from the agent monitoring the platform you add the services to. So make sure this agent can connect to your HTTP or IP endpoints (is the remote network reachable? will you hit firewall rules?)

HTTP service

HTTP service monitors availability of an HTTP URL endpoint. By default the endpoint is reported up if a GET request to its URL gives any response. It can be configured to validate response code and response content (with a regular expression).

If you validate the response content, bear in mind that it will be entirely loaded in memory. So for efficiency and reliability don't use this option with large sized responses.

The HTTP service defines a "contentLength" metric. This metric is filled with the HTTP response content length header. When the response does not contain this header, the metric will have a default value of -1. You may want to disable this particular metric in this case.

Ping service

Ping service lets you know if a remote IP is reachable. The internal mechanism involved may vary upon JVM implementation but will typically be an ICMP echo request or a TCP request to port 7 (echo service).

Port service

Port service monitors availability of a remote port for TCP connection. This can be useful to check if a remote service you cannot manage with an RHQ agent is listening to your connections.

Want more?

Would you like to see other type of services in this plugin? Come and tell us in the forum.

Friday, February 8, 2013

Monitoring JBoss AS 7 web connector with RHQ

An RHQ user recently asked on our forums how to monitor "active connections" in a JBoss AS 7 web connector. Here is an how-to guide.

Let's assume that you already started a JBoss AS 7 instance, created a user in the Management Realm for RHQ agent (with add-user script) and imported this instance in RHQ server.

Don't forget to configure the user credentials under the Connection Settings tab.

RHQ AS7 Inventory Connection Settings
AS 7 Connection Settings

By default, the JBoss Web subsystem uses an internal thread pool and does not expose many properties through the management interface. What we need to do is creating a dedicated thread pool in the Threads subsystem and configure it to be the web connector executor.

Create a thread factory

Wouldn't it be nice to give connector threads an eloquent name? A dedicated thread factory will help. Under the Inventory > Child Resources tab of the Threads subsystem page, create a new child of ThreadFactory type:

RHQ AS7 Create Child Thread Factory
Create child of ThreadFactory type

Give this thread factory a name and adjust the Thread Name Pattern as you wish:

RHQ AS7 Thread Factory Wizard
ThreadFactory creation wizard
WARNING: don't leave priority unset. The default value '-1' is not valid and things will break at thread creation time.

Create and configure a thread pool

This is the core part. Under the Inventory > Child Resources tab of the Threads subsystem page, create a new child of ThreadPool type. Choose the unbounded-queue-thread-pool template and don't forget to link with your thread factory:

RHQ AS7 Thread Pool Wizard
ThreadPool creation wizard

Once the thread pool has been created and the new resource discovered by RHQ, enable measurements (only availability check is enabled by default). I chose to keep the default value for total counts and check active threads count every 30 seconds:

RHQ AS7 Thread Pool Schedules
ThreadPool Monitoring Schedules

Configure the web connector

Almost done! Configure the web connector to use the new thread pool as executor:

RHQ AS7 Connector Configuration
Web Connector configuration

This change requires to reload the JBoss AS 7 configuration. You can do this under the Operations tab of the JBoss AS 7 resource page.

Thread pool metrics

That's it! Now you can see your metrics collected:

RHQ AS7 Thread Pool Metrics
Web Connector Executor metrics