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

cf-monitord is not reporting correctly on open ports

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Done
    • Priority: High
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.6.5
    • Component/s: cf-monitord
    • Labels:
      None
    • Platform:
      RHEL or CentOS, Debian, Ubuntu, Solaris, AIX, HP-UX, Linux
    • Steps to reproduce:
      Manual steps provided

      Description

      cf-monitord is not reporting correctly on open ports that have been closed unless you restart cf-monitord. This
      is due to the Item linked lists MON_TCP4, MON_TCP6, MON_UDP4 and MON_UDP6 not being re-initialized for each
      invocation of MonNetworkGatherData() defined in cf-monitord/mon_network.c (ie. each invocation of netstat).

      Setting the priority to high as this also affects open ports reporting for Enterprise.

      1. date
        Fri Jan 16 16:24:29 CET 2015
      1. egrep 'tcp.*port_addr.*25' env_data
        tcp4_port_addr[25]=127.0.0.1
      1. service postfix status
        master (pid 7924) is running...
      1. netstat -an | grep LISTEN | grep 127.0.0.1:25
        tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN
      1. ls -li env_data
        398032 rw------. 1 root root 6411 Jan 16 16:23 env_data
      1. service postfix stop
        Shutting down postfix: [ OK ]
      1. netstat -an | grep LISTEN | grep 127.0.0.1:25
        #
      1. date
        Fri Jan 16 16:29:03 CET 2015
      1. ls -li env_data
        398059 rw------. 1 root root 6257 Jan 16 16:28 env_data
      1. egrep 'tcp.*port_addr.*25' env_data
        tcp4_port_addr[25]=127.0.0.1

      I got this to work using the attached patch

        Attachments

          Activity

            People

            • Assignee:
              a10053 Marcin Pasinski
              Reporter:
              a10007 Jon Henrik Bjørnstad (Inactive)
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Summary Panel

                  Time Tracking

                  Estimated:
                  Original Estimate - 5 hours
                  5h
                  Remaining:
                  Not Specified
                  Logged:
                  Time Not Required
                  Not Specified