Creating node/host defintions for OpenNMS requisitions


I’m here to get some information and if it’s worth to try Foreman for my requirements.
Since Foreman has this datacenter plugin I was thinking about to use Foreman as documentation tool.
But it would be really cool to feed our monitoring with definitions which could be (hopefully) provided by Foreman.

We are using OpenNMS and a node definition looks like this:

   <node foreign-id="HOSTNAME" node-label="NODE-LABEL">
      <interface ip-addr="IPADDRESS" snmp-primary="P">
         <monitored-service service-name="SNMP"/>
         <monitored-service service-name="ICMP"/>
         <monitored-service service-name="SSH"/>
      <category name="CATEGORY1"/>
      <category name="CATERORY2"/>
      <asset name="address1" value="STREET"/>
      <asset name="zip" value="ZIP"/>

The really important part is, to assign services on IP interfaces. Also different assets and categories are required which should be mapped on a node.

Since you are more experienced using Foreman, I would like to get some feedback if this logic can be handled by Foreman.

Thanks in advance!

Hey, I am not aware of any OpenNMS integration so Foreman cannot do anything like this out of box. However you will find all the information in Foreman database (hostnames, NICs) and using the datacenter plugin you can provide more info and fetch that of course.

You can write our own plugin or develop an 3rd party app accessing the data via our API (the datacenter plugin does provide API as well). If you aim to export this XML on a daily basis, you can write a Rake task as well, that would be probably the easiest way of doing this.

@lzap Thanks for your feedback.

For ONMS I need a logic to assign a service like ICMP, HTTP, SNMP etc on an IP interface. Reading this information from the Foremans database would be very easy. But if Foreman isn’t designed to model that, it’s gonna be complicated.

It’s very cool, that others can provide plugins for Foreman. But I’m not a developer, so I can’t do it.

There’s a foreman probing plugin which uses nmap to detect open ports. Then it saves it as host facts. Not sure if that would fit your needs.

After working more with Foreman, I think I could query the DB to get at least most of the required information.
So can you give me some help finding the required information in the database?

I need things like:

hostname, primary ip address, hostgroup assignments, host and global parameters

Yeah… it’s basically the node information :slight_smile: