---
title: Ping
description: Datadog, the leading service for cloud-scale monitoring.
breadcrumbs: Docs > Network Monitoring > Network Device Monitoring > Ping
---

# Ping

## Overview{% #overview %}

When configured, the SNMP check can also send ICMP pings to your devices. This can be configured for individual as well as Autodiscovered devices.

## Prerequistes{% #prerequistes %}

- [Agent](https://docs.datadoghq.com/agent.md) version `7.52+`.
- SNMP monitoring configured on [Individual devices](https://docs.datadoghq.com/network_monitoring/devices/snmp_metrics.md?tab=snmpv2#monitoring-individual-devices) or with [Autodiscovery](https://docs.datadoghq.com/network_monitoring/devices/snmp_metrics.md#autodiscovery).

### Setup{% #setup %}

1. Edit the `snmp.d/conf.yaml` file in the `conf.d/` folder at the root of your [Agent's configuration directory](https://docs.datadoghq.com/agent/configuration/agent-configuration-files.md#agent-configuration-directory) for individual devices, or the [`datadog.yaml`](https://docs.datadoghq.com/agent/configuration/agent-configuration-files.md?tab=agentv6v7#agent-main-configuration-file) Agent configuration file for Autodiscovery. See the [sample snmp.d/conf.yaml](https://github.com/DataDog/integrations-core/blob/master/snmp/datadog_checks/snmp/data/conf.yaml.example) for all available configuration options.

1. **Linux Only**: If you're receiving errors when running ping, you may need to configure the integration to send pings using a raw socket. This requires elevated privileges and is done using the Agent's system-probe. See the [linux.use_raw_socket](https://docs.datadoghq.com/network_monitoring/devices/ping.md?tab=userawsocketslinuxonly#setup) `system-probe` configuration below.

{% tab title="Individual" %}
To apply ping settings to all *manually* configured devices, add the ping configuration in the `init_config` section:

```yaml
init_config:
  loader: core
  use_device_id_as_hostname: true
  ping:
    enabled: true            # (default false) enable the ping check
    linux:                   # (optional) Linux specific configuration
      use_raw_socket: true   # (optional, default false) send pings using a raw socket (see step 3 above)
instances:
  - ip_address: '1.2.3.4'
    community_string: 'sample-string'
    tags:
    - 'key1:val1'
    - 'key2:val2'
```

Or, apply the ping configuration *per* instance:

```yaml
init_config:
  loader: core
  use_device_id_as_hostname: true
instances:
  - ip_address: '1.2.3.4'
    community_string: 'sample-string'
    tags:
      - 'key1:val1'
      - 'key2:val2'
    ping:
      enabled: true            # (default false) enable the ping check
      linux:                   # (optional) Linux specific configuration
        use_raw_socket: true   # (optional, default false) send pings using a raw socket 
```

{% /tab %}

{% tab title="Autodiscovery" %}
Configure ping settings in the `network_devices` section under the Autodiscovery parameter to apply them to *all* Autodiscovery subnets.

```yaml
network_devices:
  autodiscovery:
    workers: 100
    discovery_interval: 3600
    loader: core
    use_device_id_as_hostname: true
    configs:
      - network_address: 10.10.0.0/24
        loader: core
        snmp_version: 2
        port: 161
        community_string: '***'
        tags:
        - "key1:val1"
        - "key2:val2"
        ping:
          enabled: true            # (default false) enable the ping check
          linux:                   # (optional) Linux specific configuration
            use_raw_socket: true   # (optional, default false) send pings using a raw socket (see step 3 above)
```

**Note**: For Autodiscovery, Datadog does not ping devices that do not respond to SNMP.
{% /tab %}

{% tab title="Use raw sockets (Linux only)" %}
If you're on Linux and want to use raw sockets for ping, you must also enable ping in the `system-probe` configuration file in addition to the Agent configuration.

Edit `/etc/datadog-agent/system-probe.yaml` to set the enable flag to true.

```yaml
ping:
  enabled: true
```

{% /tab %}

After ping is enabled on your network devices, the **Ping State** column appears in [Network Device Monitoring](https://app.datadoghq.com/devices), displaying the ping status for each device.

{% image
   source="https://docs.dd-static.net/images/network_device_monitoring/snmp/ping_state_status_2.6936896f0dca3f6ee26d9f8e609638a8.png?auto=format&fit=max&w=850 1x, https://docs.dd-static.net/images/network_device_monitoring/snmp/ping_state_status_2.6936896f0dca3f6ee26d9f8e609638a8.png?auto=format&fit=max&w=850&dpr=2 2x"
   alt="The status column in the NDM UI showing the Ping state toggle enabled with the ping state status column highlighted" /%}

The following are the status names in the **Ping State** column and their descriptions:

| Status name | Description                                   |
| ----------- | --------------------------------------------- |
| Unreachable | Device is unreachable through ping.           |
| Unmonitored | Ping has not been configured for this device. |
| Ok          | Device is reachable through ping.             |
| N/A         | The devices do not support ping.              |

### Metrics collected{% #metrics-collected %}

The following metrics are made available after enabling ping:

| Metric name                    | Description                |
| ------------------------------ | -------------------------- |
| networkdevice.ping.avg_rtt     | Average round-trip time    |
| networkdevice.ping.reachable   | Device reachability status |
| networkdevice.ping.packet_loss | Packet loss percentage     |
| networkdevice.ping.unreachable | Device unreachable status  |

## Further Reading{% #further-reading %}

- [Using Profiles with Network Device Monitoring](https://docs.datadoghq.com/network_monitoring/devices/profiles.md)
- [SNMP Monitoring Overview](https://www.datadoghq.com/knowledge-center/network-monitoring/snmp-monitoring/)
