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

Determine Local IPAddress on Minion/OpenNMS system

    XMLWordPrintable

Details

    • Story
    • Status: Resolved (View Workflow)
    • Minor
    • Resolution: Fixed
    • None
    • 30.0.0
    • None
    • Security Level: Default (Default Security Scheme)
    • 3
    • Horizon 22 - Mar 2 - 16
      • IP address can be determined for IPv4 or IPv6 connections
      • IP addresses can be specified by properties

    Description

      In order to fetch device config, ssh script need to configure Monitoring system (OpenNMS/Minion) IPAddress.

      For this determination, we used following snippet.

      try(final DatagramSocket socket = new DatagramSocket()) {
          socket.connect(InetAddressUtils.UNPINGABLE_ADDRESS, 10002);
          String ipAddress = socket.getLocalAddress().getHostAddress();
          if (ipAddress.equals("0.0.0.0")) {
              return InetAddress.getLocalHost().getHostAddress();
          }
          return ipAddress;
      }
      

       

      This works fine on linux/Mac development systems.

      Need to ensure if this works with Docker and any other systems that users can deploy Minion/OpenNMS

       

      May need to configure this IP on Minion ?

      Attachments

        Activity

          People

            cpape Christian Pape
            cgorantla Chandra Gorantla
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: