Monday, May 20, 2013

Monitoring Oracle tablespace quota with OpenNMS

Going beyond the normal application availability check

One interesting use of the OpenNMS JDBC poller is for extracting data from the Oracle administrative database tables, for example tracking tablespace quota usage to detect quota exhaustion, sudden usage peaks and graph usage over time.

Graph of quota usage for user [redacted] on tablespace DAT.
Notice the cleaning operation running at 3.30 AM
Tablespace quotas is a feature present in the Oracle database that allows the DBA to set a limit on the amount of storage that any given user can consume on a specific tablespace. This allows the DBA to share tablespaces across users yet still be able to policy users into predefined usage boundaries. When a user consumes all its quota it can no longer store data, but it can delete it, thus allowing self-recovery.

Tuesday, March 26, 2013

A not so short guide to ZFS on Linux

Unless you've been living under a rock you should have by now heard many stories about how awesome ZFS is and the many ways it can help with saving your bacon.

The downside is that ZFS is not available (natively) for Linux because the CDDL license under which it is released is incompatible with the GPL. Assuming you are not interested in converting to one of the many Illumos distributions or FreeBSD this guide might serve you as a starting point if you are attracted  by ZFS features but are reluctant to try it out on production systems.

Basically in this post I note down both the tought process and the actual commands for implementing a fileserver for a small office. The fileserver will run as a virtual machine in a large ESXi host and use ZFS as the filesystem for shared data.

Saturday, February 23, 2013

Development is fun again with nodejs

Being a longtime Java developer, back from when servlets where cool and Struts was making MVC popular among web devs, I always try to find new and more productive ways to deliver software within the Java ecosystem.

Recently I turned to Grails and delivered several projects with it. When developing with Grails you can use the power and the expressiveness of Groovy to write compact, elegant, fluent and readable code.
The downside is that Grails is huge:

  1. even the most simple Grails apps will weigh in the 40MB range
  2. compilation, test and building takes a long time (minutes, actually) even in recent versions
  3. it is (fairly) complex, but that I can understand because it does so much
  4. it will consume a huge chunk of you app server memory when deployed
I have been using Grails as the backend for Mappu too, initially just because I wanted to bootstrap the project quickly and Grails is simply perfect for that. But as time passed I started to find Grails too heavy for a simple REST API. I am currently running the demo on the smallest Rackspace server and it's constantly swapping. It's not slow, but it could be better.

Friday, February 01, 2013

3 new features that I wish were in OpenNMS 2.0

As a long time OpenNMS user I've been often impressed with its extensibility and the completeness of its feature set. There is support for lots of data collection techniques: from the old school snmp exec extensions, to the http poller, from the JDBC poller to the XML poller and many others that I probably forgot to mention.

Supporting new probes is therefore just a matter of how, not if , it can be done. And with new monitoring tools popping up every day this is clearly good as it allows OpenNMS to keep up with the competition.
So the present looks bright, but what about the future? With OpenNMS 2.0 not yet on the radar I thought I could put together a list of features I would love to have. What do you think of them?

Sunday, January 20, 2013

Triggering OpenNMS notifications when patterns occur in a log file

A common problem with OpenNMS is how to monitor a log file and trigger alerts when certain conditions are met. Let me clarify with an example: you have this mission critical app that sometimes experiences internal errors. The application keeps running and still responds to requests, but the error will slow down the system and/or delay further processing. Monitoring the process and/or network polling will obviously not be able to detect the issue and the only way is to tail the application log file and look for certain messages.

The problem can usually be solved simply by forwarding the log file to OpenNMS through syslog, but what for logs generated by applications that don't speak syslog or if you don't want to configure syslog forwarding?

Monday, December 31, 2012

The sorry state of ATI drivers in Linux

Subtitle: broken by impress.js

I've been using Linux as the primary OS on all my laptops since a loooong time ago and until recently I always chose computers fitted with nvidia graphics over any other brand because their drivers probably have the best quality and performance.

My last (and current) laptop, an HP ProBook, came with ATI graphics, but since in the last years ATI seemed to have caught up, I decided to give it a try.
For over two yeas the laptop performed extremely well with Ubuntu 10.04 LTS as everything worked right out of the box with no customization whatsoever. Suspend/resume worked, performance was great and boot time pretty good too (for a conventional hard drive at 7200rpm, at least). The problems came with the upgrade to Ubuntu 12.04.

Saturday, December 22, 2012

Merry Christmas!

It's that time of the year again and, since it appears that the Maya spared us, I want to share with you a couple of gists that I came up with recently that could be generally useful. Btw, there are lots of other gists on my gist.github.com profile, check them out.

If you find these script useful star them on github, drop me a comment or just share them. Once again, Merry Christmas everyone!

The first one is for Java people and is a HttpServletRequestWrapper that supports:
  1. injection of the principal: for those cases when you use trust authentication and you are rolling your own SSO solution and/or you need to integrate with an existing SSO solution (I used it with for CAS)
  2. supports reading of the InputStream multiple times. We all know that in a POST the request input stream can only be read once, so this will definitely help you if you need to access the post body or a request parameter in a Filter and make sure the upstream servlets/filters still work