This Week in OpenNMS: Season 1.6, Episode 11 (Giving Provisiond a REST)

Benjamin Reed <[email protected]> Mon, 23 Mar 2009 12:50:24 -0400
Newsgroups gmane.network.opennms.announce
Organization The OpenNMS Group
Message-ID <49C7BDD0.5010100__937.343310988759$1237827400$gmane$org@opennms.org>
Hello again, dear readers.  It is time for yet another This Week in
OpenNMS.  This week I'm going to talk a little about the wonders of REST.

Project Updates
---------------

- Stable: Current Release is 1.6.2

1.6.2 is the current stable release, but it looks like we're going to
want to get a 1.6.3 out soon.

For one thing, a major annoyance to a number of folks has been fixed in
1.6-testing: thresholding on JMX is now working again, thanks to the
eagle eyes of one of our users, Sheng Cheng.  Also, Jeff added the
ability to create non-IP interfaces in the 1.6 importer.  This makes it
possible to collect SNMP data for non-IP interfaces, e.g. access ports
on switches.  A number of other bugs are set to be fixed in 1.6.3 as
well.  There are a few blockers left holding up the release, but we will
hopefully have those hammered out in the coming weeks.

List of fixed/pending bugs for 1.6.3:
  http://bugzilla.opennms.org/buglist.cgi?target_milestone=1.6.3

- Unstable: Current Release is 1.7.0

Trunk continues to undergo heavy development. I've said it before, but
it's still true: we're hoping to get 1.7.1 out soon.  We're waiting to
hit the milestone of complete Capsd-replacement in Provisiond before
tagging 1.7.1.  In the meantime, feel free to try the nightly snapshots
(if it's not on a production system, of course).

That's right, I'm cheating, that's the exact same paragraph from last
week. Shhh!

- Trunk: Provisiond Soldiers On

Provisiond continues to improve.  The focus has moved from large feature
additions to bugfixing, performance, and stability updates.

- Trunk: RANCID Integration

The RANCID integration continues to get refined.

- Trunk: Ackd

Ackd work has continued, and Dave has made a branch to finish it off.
I'm really looking forward to it getting to a point where I can do a
writeup on it here, it promises to be a very useful feature.

Give Provisiond a REST Already!
-------------------------------

One of the first things done in the future OpenNMS 1.8 codebase at
Dev-Jam last year was an infrastructure for providing a RESTful
interface to the data in OpenNMS.  While we still have to RESTful-ize
some of the existing model, we've tried to make a RESTful interface as
part of any new development.  This weekend I wrote a little utility to
interface with the requisition REST API to see how much work it would
be, and the answer is: not much.

- The provision.pl Script

For the most part, I just translated the existing rest calls into
something you can put into the command-line.  The "requisitions" URL
turns into a "list" command, the "requisitions/<foreign-source>" is
accessed through the "requisition" command, etc.

So, an example.  I've started with a fresh install.  Suppose you wanted
to create a requisition, give it three nodes, and set them up with
interfaces and services.  It would go something like this:

  ./provision.pl requisition add TWiO

  # set up the first node
  ./provision.pl node add TWiO foreignid1 "Node Label 1"
  ./provision.pl interface add TWiO foreignid1 192.168.0.1
  ./provision.pl interface set TWiO foreignid1 192.168.0.1 \
    descr "interface 1"
  ./provision.pl service add TWiO foreignid1 192.168.0.1 ICMP
  ./provision.pl service add TWiO foreignid1 192.168.0.1 SNMP
  ./provision.pl interface add TWiO foreignid1 10.0.0.1
  ./provision.pl interface set TWiO foreignid1 10.0.0.1 \
    descr "interface 2"
  ./provision.pl service add TWiO foreignid1 10.0.0.1 ICMP

  # set up the second node
  ./provision.pl node add TWiO foreignid2 "Node Label 2"
  ./provision.pl interface add TWiO foreignid2 192.168.0.2
  ./provision.pl service add TWiO foreignid2 192.168.0.2 ICMP
  ./provision.pl service add TWiO foreignid2 192.168.0.2 HTTP

  #set up the third node
  ./provision.pl node add TWiO foreignid3 "Node Label 3"
  ./provision.pl interface add TWiO foreignid3 192.168.0.3
  ./provision.pl service add TWiO foreignid3 192.168.0.3 ICMP

In the end, you'd get a nice provisioning group, all set up:

  ./provision.pl list
  TWiO (last updated: 2009-03-23T12:17:43.225-04:00)
    * nodes:
      * Node Label 1 (foreign ID: foreignid1)
        * interfaces:
          * 192.168.0.1 (interface 1)
            * services:
              * ICMP
              * SNMP
          * 10.0.0.1 (interface 2)
            * services:
              * ICMP
      * Node Label 2 (foreign ID: foreignid2)
        * interfaces:
          * 192.168.0.2
            * services:
              * ICMP
              * HTTP
      * Node Label 3 (foreign ID: foreignid3)
        * interfaces:
          * 192.168.0.3
            * services:
              * ICMP

Now you can import it with "./provision.pl import TWiO" and voila!
Imported nodes.

Upcoming Events
---------------

(Note: April training has been pushed back to May.)

May 4th-8th, 2009: OpenNMS training will be available through The
OpenNMS Group at the OpenNMS training facility in Pittsboro, NC.

For more information on training, go to:
  http://www.opennms.com/training.html

Ciao
----

Hope you found that useful.  If there's anything you'd like me to talk
about in a future TWiO, please let me know!  See you next week, barring
any fatal injuries, delays, or laziness on my part.  *cough*


-- 
Benjamin Reed
The OpenNMS Group
http://www.opennms.org/

------------------------------------------------------------------------------
Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are
powering Web 2.0 with engaging, cross-platform capabilities. Quickly and
easily build your RIAs with Flex Builder, the Eclipse(TM)based development
software that enables intelligent coding and step-through debugging.
Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com

_______________________________________________
Please read the OpenNMS Mailing List FAQ:
http://www.opennms.org/wiki/index.php?page=MailingListFaq

opennms-announce mailing list

To *unsubscribe* or change your subscription options, see the bottom of this page:
https://lists.sourceforge.net/lists/listinfo/opennms-announce
signature.asc (application/pgp-signature, 249 B)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFJx73QUu+jZtP2Zf4RAqydAJ4zsgJ5W5MQsw78Yc0nBrhW2+6LgACfUsL0
5PSD1tNj6Q06Pr2Q1XO045A=
=2lpI
-----END PGP SIGNATURE-----