firehol/netdata

View on GitHub
src/go/plugin/go.d/modules/portcheck/config_schema.json

Summary

Maintainability
Test Coverage
{
  "jsonSchema": {
    "$schema": "http://json-schema.org/draft-07/schema#",
    "title": "Portcheck collector configuration.",
    "description": "Collector for monitoring TCP service availability and response time.",
    "type": "object",
    "properties": {
      "update_every": {
        "title": "Update every",
        "description": "Data collection interval, measured in seconds.",
        "type": "integer",
        "minimum": 1,
        "default": 5
      },
      "timeout": {
        "title": "Timeout",
        "description": "Timeout for establishing a connection, including domain name resolution, in seconds.",
        "type": "number",
        "minimum": 0.5,
        "default": 2
      },
      "host": {
        "title": "Network host",
        "description": "The IP address or domain name of the network host.",
        "type": "string",
        "default": "127.0.0.1"
      },
      "ports": {
        "title": "TCP ports",
        "description": "A list of ports to monitor for TCP service availability and response time.",
        "type": [
          "array",
          "null"
        ],
        "items": {
          "title": "Port",
          "type": "integer",
          "minimum": 1
        },
        "uniqueItems": true
      },
      "udp_ports": {
        "title": "UDP ports",
        "description": "A list of ports to monitor for UDP service availability.",
        "type": [
          "array",
          "null"
        ],
        "items": {
          "title": "Port",
          "type": "integer",
          "minimum": 1
        },
        "uniqueItems": true
      }
    },
    "required": [
      "host"
    ],
    "additionalProperties": false,
    "patternProperties": {
      "^name$": {}
    }
  },
  "uiSchema": {
    "ui:flavour": "tabs",
    "ui:options": {
      "tabs": [
        {
          "title": "Base",
          "fields": [
            "update_every",
            "timeout",
            "host"
          ]
        },
        {
          "title": "Checks",
          "fields": [
            "ports",
            "udp_ports"
          ]
        }
      ]
    },
    "uiOptions": {
      "fullPage": true
    },
    "timeout": {
      "ui:help": "Accepts decimals for precise control (e.g., type 1.5 for 1.5 seconds)."
    },
    "host": {
      "ui:placeholder": "127.0.0.1"
    },
    "ports": {
      "ui:listFlavour": "list"
    },
    "udp_ports": {
      "ui:help": "The collector sends 0-byte UDP packets to each port on the target system. If an ICMP Destination Unreachable message is received, the port is considered closed. Otherwise, it is assumed to be open or filtered (if no response is received within the timeout). This approach is similar to the behavior of the `close`/`open/filtered` states reported by `nmap`. However, note that the `open/filtered` state is a best-effort determination, as the collector does not actually exchange data with the application on the target system.",
      "ui:listFlavour": "list"
    }
  }
}