Uploaded image for project: 'OpenNMS'
  1. OpenNMS
  2. NMS-13118

unable to add node/interface meta-data through requisition ui

    XMLWordPrintable

    Details

    • Sprint:
      Horizon 2021 - Feb 3 - Feb 17

      Description

      meta-data is added anymore in new version 27.0.4. In v27.0.3 there was only a issue with db only sync but now the function is completely broken.

      No matter which sync option in requisition ui used - meta-data for node or interface is no longer added.

      Meta-data for service is added.
      Currently one solution for node meta-data is a requisition policy (see example 2).

      Installed a new fresh OpenNMS and add a node in a requisition:

      Example:

      Add meta-data directly in requisition does not work (neither for interface) - but it works for service

      <model-import xmlns="http://xmlns.opennms.org/xsd/config/model-import" date-stamp="2021-02-03T09:31:58.570+01:00" foreign-source="meta-test" last-import="2021-02-03T09:40:38.398+01:00">
         <node foreign-id="1612340597434" node-label="localhost">
            <interface ip-addr="127.0.0.1" status="1" snmp-primary="P">
               <monitored-service service-name="ICMP">
                  <meta-data context="requisition" key="servicetestkey" value="servicetestvalue"/>
               </monitored-service>
               <meta-data context="requisition" key="iftestkey" value="iftestvalue"/>
            </interface>
            <meta-data context="requisition" key="testkey" value="testvalue"/>
         </node>
      </model-import>
      

      Synced Requisition.
      Values in database - only meta-data in ifservices_metadata is added:

      opennms=# select nodeid,nodelabel,foreignsource from node;
       nodeid | nodelabel | foreignsource
      --------+-----------+---------------
            1 | localhost | meta-test
      (1 row)
      
      opennms=# select * from node_metadata;
       id | context | key | value
      ----+---------+-----+-------
      (0 rows)
      
      opennms=# select * from ifservices_metadata;
       id |   context   |      key       |      value
      ----+-------------+----------------+------------------
        5 | requisition | servicetestkey | servicetestvalue
      (1 row)
      
      opennms=# select * from ipinterface_metadata;
       id | context | key | value
      ----+---------+-----+-------
      (0 rows)
      
      

      Example 2
      Using a requisition policy to add node meta-data works as expected:

            <policy name="Meta-data-policy" class="org.opennms.netmgt.provision.persist.policies.NodeMetadataSettingPolicy">
               <parameter key="metadataValue" value="Meta-data-policy-Value"/>
               <parameter key="metadataKey" value="Meta-data-policy-Key"/>
               <parameter key="sysObjectId" value=".1.3.6.1.4.1.8072.3.2.10"/>
               <parameter key="matchBehavior" value="ALL_PARAMETERS"/>
            </policy>
      
      opennms=# select * from node_metadata;
       id |   context   |         key          |         value
      ----+-------------+----------------------+------------------------
        1 | requisition | Meta-data-policy-Key | Meta-data-policy-Value
      (1 row)
      

       

        Attachments

        1. NMS-13118.gif
          6.83 MB
          Ronny Trommer

          Issue Links

            Activity

              People

              Assignee:
              cpape Christian Pape
              Reporter:
              mlaercher Martin Laercher
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Git Integration