NRDP (Nagios Remote Data Processor) API

PHP-based HTTP collector that accepts passive check results and external commands. Two commands are supported: `submitcheck` (host/service check results) and `submitcmd` (Nagios external command). Payloads can be sent as XML (`XMLDATA`) or JSON (`JSONDATA`) in a POST form. Authenticated by a token configured in `config.inc.php` with optional per-command deny mappings.

NRDP (Nagios Remote Data Processor) API is one of 5 APIs that Nagios publishes on the APIs.io network, described by a machine-readable OpenAPI specification.

This API exposes 2 JSON Schema definitions.

Tagged areas include Monitoring, Passive Check, REST, and NRDP. The published artifact set on APIs.io includes an OpenAPI specification and 2 JSON Schemas.

OpenAPI Specification

nrdp-openapi.yml Raw ↑
openapi: 3.0.3
info:
  title: NRDP (Nagios Remote Data Processor) API
  description: |
    NRDP is a PHP-based passive result collector for Nagios. It accepts host and
    service check results and external commands over HTTP POST in either XML or
    JSON form, then injects them into Nagios Core via the external command
    pipe. Authentication uses a token configured in `config.inc.php`.
  version: '2.0.x'
  contact:
    name: Nagios Enterprises
    url: https://github.com/NagiosEnterprises/nrdp

servers:
  - url: https://{nrdpHost}/nrdp
    description: Self-hosted NRDP collector.
    variables:
      nrdpHost:
        default: nagios.example.com

security:
  - TokenForm: []

tags:
  - name: Submission
    description: Submit passive check results and external commands.

paths:
  /:
    post:
      tags: [Submission]
      summary: Submit NRDP Payload
      description: |
        Submit a `checkresults` payload (`cmd=submitcheck`) or a Nagios external
        command (`cmd=submitcmd`). The body can be `application/x-www-form-urlencoded`
        with an XML/JSON `XMLDATA`/`JSONDATA` field.
      operationId: submitNrdp
      requestBody:
        required: true
        content:
          application/x-www-form-urlencoded:
            schema:
              type: object
              required: [token, cmd]
              properties:
                token: { type: string, description: NRDP authentication token. }
                cmd:
                  type: string
                  enum: [submitcheck, submitcmd]
                XMLDATA:
                  type: string
                  description: |
                    XML payload, root `<checkresults>` containing one or more
                    `<checkresult type="host|service">` elements with
                    `<hostname>`, `<servicename>`, `<state>`, `<output>` children.
                JSONDATA:
                  type: string
                  description: |
                    JSON string equivalent of XMLDATA — e.g.
                    `{"checkresults":[{"checkresult":{"type":"service",...}}]}`.
                command:
                  type: string
                  description: External command string when `cmd=submitcmd`.
      responses:
        '200':
          description: Submission result.
          content:
            application/json:
              schema: { $ref: '#/components/schemas/NrdpResponse' }

components:
  securitySchemes:
    TokenForm:
      type: apiKey
      in: query
      name: token
  schemas:
    NrdpResponse:
      type: object
      properties:
        status: { type: integer, description: 0 on success, non-zero on error. }
        message: { type: string }
        meta:
          type: object
          properties:
            output: { type: string }