One of my favorite new features in OpenNMS is the HTTP data collector. In addition to SNMP, JMX and NSClient, we now can mine data from web pages. In many cases it can be easier to just write to a text file in the web root of a local web server than it is to instrument the data via SNMP or some other method.
I decided to put this to the test.
I am a weather geek. In the summer in North Carolina the usual afternoon thunderstorms can be very spotty, and so while it might rain like mad at the office, the farm (10 miles away) could remain dry, and vice versa. This summer we’ve been experiencing an extreme drought, so tracking rain is even more important. I thought it would be cool to see if it was raining at home from the office.
For several years I’ve had a Davis Vantage Pro weather station. With the associated Weatherlink software it is possible to publish the current weather data on the web, but it wasn’t until I finally got broadband a few months ago that it was feasible to actually use it. This weekend I got around to setting it up and sending the data to a web site every five minutes. The output looks like this:
Now all I had to do was set up OpenNMS to grab it using the HttpCollector. Rather than post all of the steps here, I added it as an example on the wiki.
Now I have nifty reports like:
Note that this won’t work for non-text-based site, like those that use Flash, but for everyone else it should provide an easy way to integrate custom data sources into OpenNMS.