Uploaded image for project: 'CFEngine Community'
  1. CFEngine Community
  2. CFE-1186

RFC: findportsmatching() function

    XMLWordPrintable

    Details

    • Type: Task
    • Status: Done
    • Priority: (None)
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.9.0
    • Component/s: Built-in functions
    • Labels:
      None

      Description

      Proposing new function @findportsmatching@

      Parameters (all regexes): @socket_type@ (tcp/tcp6/udp/udp6/unknown), @socket_state@ (listening/not-listening), @local_address@, @local_port@, @remote_address@, @remote_port@

      Returns: a data container, an array of elements like @

      { type: "tcp", local_address: "1.2.3.4", local_port: "80", etc }

      @

      Internally, this function would simplify the cf-monitord code and factor out the port scan for common usage. It would also offer the opportunity to speed up greatly on platforms with @/proc/net@ or @ss@ installed without touching the cf-monitord operation, and after testing we can let the cf-monitord code use the new scanners as well (since the data container is a superset of all the lists, they can be easily regenerated from it).

      A first attempt in this direction is in @tzz/core.git feature/redmine4168-sys.ports_listening-and-sys.memory_total@ after work done for #4168

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                jiraadmin Old User (Inactive)
              • Votes:
                0 Vote for this issue
                Watchers:
                6 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Summary Panel