Search code examples
monitoringopennms

Restrict service detection in OpenNMS based on "hostname"


I am able to restrict a service detection based on the ipaddress , but suppose if I want to use another parameter like hostname or node_label for service detection , then how do I configure that?

I need to know exact snippet config for hostname in default-foreign-source.xml P.S : I am using the Discovery demon i.e auto-discovery of nodes

Any help would be appreciated.


Solution

  • The OpenNMS model is as follows:

    node --> interface --> service

    So OpenNMS has no way of associating a node label with a service. There is a BusinessServiceMonitor in development that will help deal with more complicated models, but it isn't in release code at the moment.

    This is why you aren't able to associate as you want.

    You might get around this by labeling (ifAlias) interfaces with tags and matching categories to tags to exclude the service.

    Also, you should never edit provisioning XML configuration files directly. OpenNMS utilizes caching for those configs for performance purposes and you can break your system (unlikely but possible).

    I would also get away from using discovery. It limits the ability for you to separate groups of nodes out as distinct requisitions, which give you the ability to apply different sets of provisioning policies (filters, ability to monitor or not monitor services or data collections) to different groups of nodes. Discovery operates only against the default foreign source policy so you lose that kind of flexibility.