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

HTTPDetector does not work with Go programs (http request is invalid)

    XMLWordPrintable

Details

    • Bug
    • Status: Resolved (View Workflow)
    • Blocker
    • Resolution: Fixed
    • 1.13.4
    • 14.0.0
    • Data Collection - HTTP
    • Security Level: Default (Default Security Scheme)
    • None

    Description

      When OpenNMS attempts to detect HTTP based services, it is placing an extra space character in the HTTP request that cause some languages (Go) to think that the request is malformed.

      The HTTP specification actually only calls for 1 space: http://www.w3.org/Protocols/HTTP/1.0/spec.html#Request-Line

      here is the code that makes the request in opennms-provision/opennms-detector-lineoriented/src/main/java/org/opennms/netmgt/provision/detector/simple/HttpDetector.java

          protected String httpCommand(final String command) {
      
              return String.format("%s %s  HTTP/1.0\r\n\r\n", command, getUrl());
          }
      

      You will notice there are two spaces between the %s and HTTP - if this were one space then the request would be well-formed.

      Attachments

        Activity

          People

            mvr Markus von Rüden
            szinck Shaun Zinck (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: