diff options
Diffstat (limited to '')
-rw-r--r-- | src/go/plugin/go.d/modules/snmp/integrations/snmp_devices.md (renamed from src/go/collectors/go.d.plugin/modules/snmp/integrations/snmp_devices.md) | 226 |
1 files changed, 159 insertions, 67 deletions
diff --git a/src/go/collectors/go.d.plugin/modules/snmp/integrations/snmp_devices.md b/src/go/plugin/go.d/modules/snmp/integrations/snmp_devices.md index cc15a6960..a2431b006 100644 --- a/src/go/collectors/go.d.plugin/modules/snmp/integrations/snmp_devices.md +++ b/src/go/plugin/go.d/modules/snmp/integrations/snmp_devices.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/snmp/README.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/snmp/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/snmp/README.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/snmp/metadata.yaml" sidebar_label: "SNMP devices" learn_status: "Published" learn_rel_path: "Collecting Metrics/Generic Collecting Metrics" @@ -21,22 +21,22 @@ Module: snmp ## Overview -This collector monitors any SNMP devices and uses the [gosnmp](https://github.com/gosnmp/gosnmp) package. +This SNMP collector discovers and gathers statistics for network interfaces on SNMP-enabled devices: -It supports: +- Traffic +- Packets (unicast, multicast, broadcast) +- Errors +- Discards +- Administrative and operational status -- all SNMP versions: SNMPv1, SNMPv2c and SNMPv3. -- any number of SNMP devices. -- each SNMP device can be used to collect data for any number of charts. -- each chart may have any number of dimensions. -- each SNMP device may have a different update frequency. -- each SNMP device will accept one or more batches to report values (you can set `max_request_size` per SNMP server, to control the size of batches). +Additionally, it collects overall device uptime. -Keep in mind that many SNMP switches and routers are very slow. They may not be able to report values per second. -`go.d.plugin` reports the time it took for the SNMP device to respond when executed in the debug mode. +It is compatible with all SNMP versions (v1, v2c, and v3) and uses the [gosnmp](https://github.com/gosnmp/gosnmp) package. -Also, if many SNMP clients are used on the same SNMP device at the same time, values may be skipped. -This is a problem of the SNMP device, not this collector. In this case, consider reducing the frequency of data collection (increasing `update_every`). +**For advanced users**: + +- You can manually specify custom OIDs (Object Identifiers) to retrieve specific data points beyond the default metrics. +- However, defining custom charts with dimensions for these OIDs requires manual configuration. @@ -58,39 +58,75 @@ The default configuration for this integration does not impose any limits on dat #### Performance Impact -The default configuration for this integration is not expected to impose a significant performance impact on the system. +**Device limitations**: Many SNMP switches and routers have limited processing power. They might not be able to report data as frequently as desired. You can monitor response times using go.d.plugin in debug mode to identify potential bottlenecks. + +**Concurrent access**: If multiple collectors or tools access the same SNMP device simultaneously, data points might be skipped. This is a limitation of the device itself, not this collector. To mitigate this, consider increasing the collection interval (update_every) to reduce the frequency of requests. + ## Metrics +Metrics grouped by *scope*. + +The scope defines the instance that the metric belongs to. An instance is uniquely identified by a set of labels. + The metrics that will be collected are defined in the configuration file. +### Per snmp device -## Alerts +These metrics refer to the SNMP device. -There are no alerts configured by default for this integration. +Labels: +| Label | Description | +|:-----------|:----------------| +| sysName | SNMP device's system name (OID: [1.3.6.1.2.1.1.5](https://oidref.com/1.3.6.1.2.1.1.5)). | -## Setup +Metrics: -### Prerequisites +| Metric | Dimensions | Unit | +|:------|:----------|:----| +| snmp.device_uptime | uptime | seconds | -#### Find OIDs +### Per network interface -Use `snmpwalk`, like this: +Network interfaces of the SNMP device being monitored. These metrics refer to each interface. -```sh -snmpwalk -t 20 -O fn -v 2c -c public 192.0.2.1 -``` +Labels: + +| Label | Description | +|:-----------|:----------------| +| sysName | SNMP device's system name (OID: [1.3.6.1.2.1.1.5](https://oidref.com/1.3.6.1.2.1.1.5)). | +| ifDescr | Network interface description (OID: [1.3.6.1.2.1.2.2.1.2](https://cric.grenoble.cnrs.fr/Administrateurs/Outils/MIBS/?oid=1.3.6.1.2.1.2.2.1.2)). | +| ifName | Network interface name (OID: [1.3.6.1.2.1.2.2.1.2](https://cric.grenoble.cnrs.fr/Administrateurs/Outils/MIBS/?oid=1.3.6.1.2.1.31.1.1.1.1)). | +| ifType | Network interface type (OID: [1.3.6.1.2.1.2.2.1.2](https://cric.grenoble.cnrs.fr/Administrateurs/Outils/MIBS/?oid=1.3.6.1.2.1.2.2.1.3)). | + +Metrics: -- `-t 20` is the timeout in seconds. -- `-O fn` will display full OIDs in numeric format. -- `-v 2c` is the SNMP version. -- `-c public` is the SNMP community. -- `192.0.2.1` is the SNMP device. +| Metric | Dimensions | Unit | +|:------|:----------|:----| +| snmp.device_net_interface_traffic | received, sent | kilobits/s | +| snmp.device_net_interface_unicast | received, sent | packets/s | +| snmp.device_net_interface_multicast | received, sent | packets/s | +| snmp.device_net_interface_broadcast | received, sent | packets/s | +| snmp.device_net_interface_errors | inbound, outbound | errors/s | +| snmp.device_net_interface_discards | inbound, outbound | discards/s | +| snmp.device_net_interface_admin_status | up, down, testing | status | +| snmp.device_net_interface_oper_status | up, down, testing, unknown, dormant, not_present, lower_layer_down | status | +## Alerts + +There are no alerts configured by default for this integration. + + +## Setup + +### Prerequisites + +No action required. + ### Configuration #### File @@ -114,15 +150,18 @@ The following options can be defined globally: update_every, autodetection_retry | Name | Description | Default | Required | |:----|:-----------|:-------|:--------:| -| update_every | Data collection frequency. | 1 | no | +| update_every | Data collection frequency. | 10 | no | | autodetection_retry | Recheck interval in seconds. Zero means no recheck will be scheduled. | 0 | no | -| hostname | Target ipv4 address. | 127.0.0.1 | yes | +| hostname | Target ipv4 address. | | yes | | community | SNMPv1/2 community string. | public | no | | options.version | SNMP version. Available versions: 1, 2, 3. | 2 | no | | options.port | Target port. | 161 | no | | options.retries | Retries to attempt. | 1 | no | -| options.timeout | SNMP request/response timeout. | 10 | no | -| options.max_request_size | Maximum number of OIDs allowed in one one SNMP request. | 60 | no | +| options.timeout | SNMP request/response timeout. | 5 | no | +| options.max_repetitions | Controls how many SNMP variables to retrieve in a single GETBULK request. | 25 | no | +| options.max_request_size | Maximum number of OIDs allowed in a single GET request. | 60 | no | +| network_interface_filter.by_name | Filter interfaces by their names using [simple patterns](/src/libnetdata/simple_pattern/README.md#simple-patterns). | | no | +| network_interface_filter.by_type | Filter interfaces by their types using [simple patterns](/src/libnetdata/simple_pattern/README.md#simple-patterns). | | no | | user.name | SNMPv3 user name. | | no | | user.name | Security level of SNMPv3 messages. | | no | | user.auth_proto | Security level of SNMPv3 messages. | | no | @@ -198,10 +237,58 @@ In this example: - the SNMP version is `2`. - the SNMP community is `public`. - we will update the values every 10 seconds. -- we define 2 charts `bandwidth_port1` and `bandwidth_port2`, each having 2 dimensions: `in` and `out`. -> **SNMPv1**: just set `options.version` to 1. -> **Note**: the algorithm chosen is `incremental`, because the collected values show the total number of bytes transferred, which we need to transform into kbps. To chart gauges (e.g. temperature), use `absolute` instead. + +<details open><summary>Config</summary> + +```yaml +jobs: + - name: switch + update_every: 10 + hostname: 192.0.2.1 + community: public + options: + version: 2 + +``` +</details> + +##### SNMPv3 + +To use SNMPv3: + +- use `user` instead of `community`. +- set `options.version` to 3. + + +<details open><summary>Config</summary> + +```yaml +jobs: + - name: switch + update_every: 10 + hostname: 192.0.2.1 + options: + version: 3 + user: + name: username + level: authPriv + auth_proto: sha256 + auth_key: auth_protocol_passphrase + priv_proto: aes256 + priv_key: priv_protocol_passphrase + +``` +</details> + +##### Custom OIDs + +In this example: + +- the SNMP device is `192.0.2.1`. +- the SNMP version is `2`. +- the SNMP community is `public`. +- we will update the values every 10 seconds. <details open><summary>Config</summary> @@ -249,37 +336,7 @@ jobs: ``` </details> -##### SNMPv3 - -To use SNMPv3: - -- use `user` instead of `community`. -- set `options.version` to 3. - -The rest of the configuration is the same as in the SNMPv1/2 example. - - -<details open><summary>Config</summary> - -```yaml -jobs: - - name: switch - update_every: 10 - hostname: 192.0.2.1 - options: - version: 3 - user: - name: username - level: authPriv - auth_proto: sha256 - auth_key: auth_protocol_passphrase - priv_proto: aes256 - priv_key: priv_protocol_passphrase - -``` -</details> - -##### Multiply range +##### Custom OIDs with multiply range If you need to define many charts using incremental OIDs, you can use the `charts.multiply_range` option. @@ -379,6 +436,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `snmp` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -401,4 +460,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m snmp ``` +### Getting Logs + +If you're encountering problems with the `snmp` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep snmp +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep snmp /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep snmp +``` + |