﻿---
title: Nagios_nsca output plugin
description: Plugin version: v3.0.7 (Other versions), Released on: 2021-09-20, Changelog. For questions about the plugin, open a topic in the Discuss forums. For bugs...
url: https://docs-v3-preview.elastic.dev/elastic/logstash-docs-md/tree/main/lsr/plugins-outputs-nagios_nsca
---

# Nagios_nsca output plugin
- Plugin version: v3.0.7 ([Other versions](https://docs-v3-preview.elastic.dev/elastic/logstash-docs-md/tree/main/vpr/output-nagios_nsca-index))
- Released on: 2021-09-20
- [Changelog](https://github.com/logstash-plugins/logstash-output-nagios_nsca/blob/v3.0.7/CHANGELOG.md)


## Getting help

For questions about the plugin, open a topic in the [Discuss](http://discuss.elastic.co) forums. For bugs or feature requests, open an issue in [Github](https://github.com/logstash-plugins/logstash-output-nagios_nsca). For the list of Elastic supported plugins, please consult the [Elastic Support Matrix](https://www.elastic.co/support/matrix#matrix_logstash_plugins).

## Description

The nagios_nsca output is used for sending passive check results to Nagios through the NSCA protocol.
This is useful if your Nagios server is not the same as the source host from where you want to send logs or alerts. If you only have one server, this output is probably overkill # for you, take a look at the *nagios* output instead.
Here is a sample config using the nagios_nsca output:
```
    output {
      nagios_nsca {
        # specify the hostname or ip of your nagios server
        host => "nagios.example.com"
```

```
    # specify the port to connect to
    port => 5667
  }
}
```


## Nagios_nsca Output Configuration Options

This plugin supports the following configuration options plus the [Common options](#plugins-outputs-nagios_nsca-common-options) described later.

| Setting                                                                               | Input type                                                                 | Required |
|---------------------------------------------------------------------------------------|----------------------------------------------------------------------------|----------|
| [`host`](#plugins-outputs-nagios_nsca-host)`host`                                     | [string](/elastic/logstash-docs-md/tree/main/lsr/value-types#string)string | No       |
| [`message_format`](#plugins-outputs-nagios_nsca-message_format)`message_format`       | [string](/elastic/logstash-docs-md/tree/main/lsr/value-types#string)string | No       |
| [`nagios_host`](#plugins-outputs-nagios_nsca-nagios_host)`nagios_host`                | [string](/elastic/logstash-docs-md/tree/main/lsr/value-types#string)string | No       |
| [`nagios_service`](#plugins-outputs-nagios_nsca-nagios_service)`nagios_service`       | [string](/elastic/logstash-docs-md/tree/main/lsr/value-types#string)string | No       |
| [`nagios_status`](#plugins-outputs-nagios_nsca-nagios_status)`nagios_status`          | [string](/elastic/logstash-docs-md/tree/main/lsr/value-types#string)string | Yes      |
| [`port`](#plugins-outputs-nagios_nsca-port)`port`                                     | [number](/elastic/logstash-docs-md/tree/main/lsr/value-types#number)number | No       |
| [`send_nsca_bin`](#plugins-outputs-nagios_nsca-send_nsca_bin)`send_nsca_bin`          | [string](/elastic/logstash-docs-md/tree/main/lsr/value-types#string)string | No       |
| [`send_nsca_config`](#plugins-outputs-nagios_nsca-send_nsca_config)`send_nsca_config` | a valid filesystem path                                                    | No       |

Also see [Common options](#plugins-outputs-nagios_nsca-common-options) for a list of options supported by all output plugins.

### `host`

- Value type is [string](/elastic/logstash-docs-md/tree/main/lsr/value-types#string)
- Default value is `"localhost"`

The nagios host or IP to send logs to. It should have a NSCA daemon running.

### `message_format`

- Value type is [string](/elastic/logstash-docs-md/tree/main/lsr/value-types#string)
- Default value is `"%{@timestamp} %{host}: %{message}"`

The format to use when writing events to nagios. This value supports any string and can include `%{name}` and other dynamic strings.

### `nagios_host`

- Value type is [string](/elastic/logstash-docs-md/tree/main/lsr/value-types#string)
- Default value is `"%{host}"`

The nagios *host* you want to submit a passive check result to. This parameter accepts interpolation, e.g. you can use `@source_host` or other logstash internal variables.

### `nagios_service`

- Value type is [string](/elastic/logstash-docs-md/tree/main/lsr/value-types#string)
- Default value is `"LOGSTASH"`

The nagios *service* you want to submit a passive check result to. This parameter accepts interpolation, e.g. you can use `@source_host` or other logstash internal variables.

### `nagios_status`

- This is a required setting.
- Value type is [string](/elastic/logstash-docs-md/tree/main/lsr/value-types#string)
- There is no default value for this setting.

The status to send to nagios. Should be 0 = OK, 1 = WARNING, 2 = CRITICAL, 3 = UNKNOWN

### `port`

- Value type is [number](/elastic/logstash-docs-md/tree/main/lsr/value-types#number)
- Default value is `5667`

The port where the NSCA daemon on the nagios host listens.

### `send_nsca_bin`

- Value type is [string](/elastic/logstash-docs-md/tree/main/lsr/value-types#string)
- Default value is `"/usr/sbin/send_nsca"`

The path to the *send_nsca* binary on the local host.

### `send_nsca_config`

- Value type is [path](/elastic/logstash-docs-md/tree/main/lsr/value-types#path)
- There is no default value for this setting.

The path to the send_nsca config file on the local host. Leave blank if you don’t want to provide a config file.

## Common options

These configuration options are supported by all output plugins:

| Setting                                                                      | Input type                                                                    | Required |
|------------------------------------------------------------------------------|-------------------------------------------------------------------------------|----------|
| [`codec`](#plugins-outputs-nagios_nsca-codec)`codec`                         | [codec](/elastic/logstash-docs-md/tree/main/lsr/value-types#codec)codec       | No       |
| [`enable_metric`](#plugins-outputs-nagios_nsca-enable_metric)`enable_metric` | [boolean](/elastic/logstash-docs-md/tree/main/lsr/value-types#boolean)boolean | No       |
| [`id`](#plugins-outputs-nagios_nsca-id)`id`                                  | [string](/elastic/logstash-docs-md/tree/main/lsr/value-types#string)string    | No       |


### `codec`

- Value type is [codec](/elastic/logstash-docs-md/tree/main/lsr/value-types#codec)
- Default value is `"plain"`

The codec used for output data. Output codecs are a convenient method for encoding your data before it leaves the output without needing a separate filter in your Logstash pipeline.

### `enable_metric`

- Value type is [boolean](/elastic/logstash-docs-md/tree/main/lsr/value-types#boolean)
- Default value is `true`

Disable or enable metric logging for this specific plugin instance. By default we record all the metrics we can, but you can disable metrics collection for a specific plugin.

### `id`

- Value type is [string](/elastic/logstash-docs-md/tree/main/lsr/value-types#string)
- There is no default value for this setting.

Add a unique `ID` to the plugin configuration. If no ID is specified, Logstash will generate one. It is strongly recommended to set this ID in your configuration. This is particularly useful when you have two or more plugins of the same type. For example, if you have 2 nagios_nsca outputs. Adding a named ID in this case will help in monitoring Logstash when using the monitoring APIs.
```
output {
  nagios_nsca {
    id => "my_plugin_id"
  }
}
```